[llvm-exegesis] Fix unused variable 'VAddressSpaceCeiling' warning (NFC)
authorJie Fu <jiefu@tencent.com>
Tue, 27 Jun 2023 01:14:07 +0000 (09:14 +0800)
committerJie Fu <jiefu@tencent.com>
Tue, 27 Jun 2023 01:14:07 +0000 (09:14 +0800)
/Users/jiefu/llvm-project/llvm/tools/llvm-exegesis/lib/X86/Target.cpp:52:33: error: unused variable 'VAddressSpaceCeiling' [-Werror,-Wunused-const-variable]
static constexpr const intptr_t VAddressSpaceCeiling = 0x0000800000000000;
                                ^
1 error generated.

llvm/tools/llvm-exegesis/lib/X86/Target.cpp

index 9be178b..e690089 100644 (file)
 namespace llvm {
 namespace exegesis {
 
-#ifdef __arm__
-static constexpr const intptr_t VAddressSpaceCeiling = 0xC0000000;
-#else
-static constexpr const intptr_t VAddressSpaceCeiling = 0x0000800000000000;
-#endif
-
 // If a positive value is specified, we are going to use the LBR in
 // latency-mode.
 //
@@ -987,6 +981,12 @@ std::vector<MCInst> ExegesisX86Target::setRegTo(const MCSubtargetInfo &STI,
 
 #ifdef __linux__
 
+#ifdef __arm__
+static constexpr const intptr_t VAddressSpaceCeiling = 0xC0000000;
+#else
+static constexpr const intptr_t VAddressSpaceCeiling = 0x0000800000000000;
+#endif
+
 void generateSyscall(long SyscallNumber, std::vector<MCInst> &GeneratedCode) {
   GeneratedCode.push_back(
       loadImmediate(X86::RAX, 64, APInt(64, SyscallNumber)));