aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordongAxis <dongaxis1944@outlook.com>2022-01-26 23:22:09 +0800
committerdongAxis <dongaxis1944@outlook.com>2022-01-26 23:26:31 +0800
commitdf597bf000b5c566e0f9218a53927daf9bc60f6d (patch)
treeb6f550e343b5abe1bef60615874d9543f601f1a5
parent63daea8b35cdb48d6061dc8ad72e5445b808dbce (diff)
downloadllvm-df597bf000b5c566e0f9218a53927daf9bc60f6d.zip
llvm-df597bf000b5c566e0f9218a53927daf9bc60f6d.tar.gz
llvm-df597bf000b5c566e0f9218a53927daf9bc60f6d.tar.bz2
[NFC][ORC][AArch64] use isInt<N> to replace fitsRangeSignedInt on aarch64
Summary: This is the first path to support more relocation types on aarch64. The patch just uses the isInt<N> to replace fitsRangeSignedInt. Test Plan: check-all Differential Revision: https://reviews.llvm.org/D118231
-rw-r--r--llvm/lib/ExecutionEngine/JITLink/ELF_aarch64.cpp7
1 files changed, 2 insertions, 5 deletions
diff --git a/llvm/lib/ExecutionEngine/JITLink/ELF_aarch64.cpp b/llvm/lib/ExecutionEngine/JITLink/ELF_aarch64.cpp
index a228c2c..dd3eb97 100644
--- a/llvm/lib/ExecutionEngine/JITLink/ELF_aarch64.cpp
+++ b/llvm/lib/ExecutionEngine/JITLink/ELF_aarch64.cpp
@@ -16,6 +16,7 @@
#include "llvm/BinaryFormat/ELF.h"
#include "llvm/ExecutionEngine/JITLink/aarch64.h"
#include "llvm/Object/ELFObjectFile.h"
+#include "llvm/Support/MathExtras.h"
#define DEBUG_TYPE "jitlink"
@@ -51,7 +52,7 @@ private:
if (static_cast<uint64_t>(Value) & 0x3)
return make_error<JITLinkError>("Call target is not 32-bit aligned");
- if (!fitsRangeSignedInt<27>(Value))
+ if (!isInt<28>(Value))
return makeTargetOutOfRangeError(G, B, E);
uint32_t RawInstr = *(little32_t *)FixupPtr;
@@ -65,10 +66,6 @@ private:
}
return Error::success();
}
-
- template <uint8_t Bits> static bool fitsRangeSignedInt(int64_t Value) {
- return Value >= -(1ll << Bits) && Value < (1ll << Bits);
- }
};
template <typename ELFT>