ART: Detach libart-disassembler from libart
Some more intrusive changes than I would have liked, as long as
ART logging is different from libbase logging.
Fix up some includes.
Bug: 15436106
Bug: 31338270
Test: m test-art-host
Change-Id: I9fbe4b85b2d74e079a4981f3aec9af63b163a461
diff --git a/runtime/arch/instruction_set.h b/runtime/arch/instruction_set.h
index 917acc9..4a8bea4 100644
--- a/runtime/arch/instruction_set.h
+++ b/runtime/arch/instruction_set.h
@@ -21,7 +21,7 @@
#include <string>
#include "base/enums.h"
-#include "base/logging.h" // Logging is required for FATAL in the helper functions.
+#include "base/macros.h"
namespace art {
@@ -75,7 +75,6 @@
// X86 instruction alignment. This is the recommended alignment for maximum performance.
static constexpr size_t kX86Alignment = 16;
-
const char* GetInstructionSetString(InstructionSet isa);
// Note: Returns kNone when the string cannot be parsed to a known value.
@@ -83,6 +82,9 @@
InstructionSet GetInstructionSetFromELF(uint16_t e_machine, uint32_t e_flags);
+// Fatal logging out of line to keep the header clean of logging.h.
+NO_RETURN void InstructionSetAbort(InstructionSet isa);
+
static inline PointerSize GetInstructionSetPointerSize(InstructionSet isa) {
switch (isa) {
case kArm:
@@ -99,12 +101,8 @@
return kMipsPointerSize;
case kMips64:
return kMips64PointerSize;
- case kNone:
- LOG(FATAL) << "ISA kNone does not have pointer size.";
- UNREACHABLE();
default:
- LOG(FATAL) << "Unknown ISA " << isa;
- UNREACHABLE();
+ InstructionSetAbort(isa);
}
}
@@ -139,12 +137,8 @@
case kMips64:
return true;
- case kNone:
- LOG(FATAL) << "ISA kNone does not have bit width.";
- UNREACHABLE();
default:
- LOG(FATAL) << "Unknown ISA " << isa;
- UNREACHABLE();
+ InstructionSetAbort(isa);
}
}
@@ -168,12 +162,9 @@
return 4;
case kMips64:
return 8;
- case kNone:
- LOG(FATAL) << "ISA kNone does not have spills.";
- UNREACHABLE();
+
default:
- LOG(FATAL) << "Unknown ISA " << isa;
- UNREACHABLE();
+ InstructionSetAbort(isa);
}
}
@@ -193,12 +184,9 @@
return 4;
case kMips64:
return 8;
- case kNone:
- LOG(FATAL) << "ISA kNone does not have spills.";
- UNREACHABLE();
+
default:
- LOG(FATAL) << "Unknown ISA " << isa;
- UNREACHABLE();
+ InstructionSetAbort(isa);
}
}