ART: Make InstructionSet an enum class and add kLast.
Adding InstructionSet::kLast shall make it easier to encode
the InstructionSet in fewer bits using BitField<>. However,
introducing `kLast` into the `art` namespace is not a good
idea, so we change the InstructionSet to an enum class.
This also uncovered a case of InstructionSet::kNone being
erroneously used instead of vixl32::Condition::None(), so
it's good to remove `kNone` from the `art` namespace.
Test: m test-art-host-gtest
Test: testrunner.py --host --optimizing
Change-Id: I6fa6168dfba4ed6da86d021a69c80224f09997a6
diff --git a/disassembler/disassembler.cc b/disassembler/disassembler.cc
index 5af51c1..2ed41c8 100644
--- a/disassembler/disassembler.cc
+++ b/disassembler/disassembler.cc
@@ -36,17 +36,17 @@
}
Disassembler* Disassembler::Create(InstructionSet instruction_set, DisassemblerOptions* options) {
- if (instruction_set == kArm || instruction_set == kThumb2) {
+ if (instruction_set == InstructionSet::kArm || instruction_set == InstructionSet::kThumb2) {
return new arm::DisassemblerArm(options);
- } else if (instruction_set == kArm64) {
+ } else if (instruction_set == InstructionSet::kArm64) {
return new arm64::DisassemblerArm64(options);
- } else if (instruction_set == kMips) {
+ } else if (instruction_set == InstructionSet::kMips) {
return new mips::DisassemblerMips(options, /* is_o32_abi */ true);
- } else if (instruction_set == kMips64) {
+ } else if (instruction_set == InstructionSet::kMips64) {
return new mips::DisassemblerMips(options, /* is_o32_abi */ false);
- } else if (instruction_set == kX86) {
+ } else if (instruction_set == InstructionSet::kX86) {
return new x86::DisassemblerX86(options, false);
- } else if (instruction_set == kX86_64) {
+ } else if (instruction_set == InstructionSet::kX86_64) {
return new x86::DisassemblerX86(options, true);
} else {
UNIMPLEMENTED(FATAL) << static_cast<uint32_t>(instruction_set);