diff --git a/llvm/tools/llvm-jitlink/llvm-jitlink.cpp b/llvm/tools/llvm-jitlink/llvm-jitlink.cpp index b2a133860197d..769ed17ac4cbd 100644 --- a/llvm/tools/llvm-jitlink/llvm-jitlink.cpp +++ b/llvm/tools/llvm-jitlink/llvm-jitlink.cpp @@ -1294,10 +1294,11 @@ class MemoryMatcher { }; static StringRef detectStubKind(const Session::MemoryRegionInfo &Stub) { - constexpr uint32_t Armv7MovWTle = 0xe300c000; - constexpr uint32_t Armv7BxR12le = 0xe12fff1c; - constexpr uint32_t Thumbv7MovWTle = 0x0c00f240; - constexpr uint16_t Thumbv7BxR12le = 0x4760; + using namespace support::endian; + auto Armv7MovWTle = byte_swap(0xe300c000); + auto Armv7BxR12le = byte_swap(0xe12fff1c); + auto Thumbv7MovWTle = byte_swap(0x0c00f240); + auto Thumbv7BxR12le = byte_swap(0x4760); MemoryMatcher M(Stub.getContent()); if (M.matchMask(Thumbv7MovWTle)) {