[llvm] e970652 - [JITLink][AArch32] Reflow code structure after llvm::endianness refactor (NFC)
Stefan Gränitz via llvm-commits
llvm-commits at lists.llvm.org
Sat Nov 25 03:42:41 PST 2023
Author: Stefan Gränitz
Date: 2023-11-25T12:37:29+01:00
New Revision: e970652776bd07dbe42be557bf98722749230653
URL: https://github.com/llvm/llvm-project/commit/e970652776bd07dbe42be557bf98722749230653
DIFF: https://github.com/llvm/llvm-project/commit/e970652776bd07dbe42be557bf98722749230653.diff
LOG: [JITLink][AArch32] Reflow code structure after llvm::endianness refactor (NFC)
Added:
Modified:
llvm/lib/ExecutionEngine/JITLink/aarch32.cpp
llvm/unittests/ExecutionEngine/JITLink/AArch32ErrorTests.cpp
llvm/unittests/ExecutionEngine/JITLink/AArch32Tests.cpp
Removed:
################################################################################
diff --git a/llvm/lib/ExecutionEngine/JITLink/aarch32.cpp b/llvm/lib/ExecutionEngine/JITLink/aarch32.cpp
index b727ad39831351f..671ee1a8125252a 100644
--- a/llvm/lib/ExecutionEngine/JITLink/aarch32.cpp
+++ b/llvm/lib/ExecutionEngine/JITLink/aarch32.cpp
@@ -388,7 +388,7 @@ void writeImmediate(WritableArmRelocation &R, uint32_t Imm) {
Expected<int64_t> readAddendData(LinkGraph &G, Block &B, Edge::OffsetT Offset,
Edge::Kind Kind) {
- llvm::endianness Endian = G.getEndianness();
+ endianness Endian = G.getEndianness();
const char *BlockWorkingMem = B.getContent().data();
const char *FixupPtr = BlockWorkingMem + Offset;
@@ -467,10 +467,10 @@ Error applyFixupData(LinkGraph &G, Block &B, const Edge &E) {
auto Write32 = [FixupPtr, Endian = G.getEndianness()](int64_t Value) {
assert(isInt<32>(Value) && "Must be in signed 32-bit range");
uint32_t Imm = static_cast<int32_t>(Value);
- if (LLVM_LIKELY(Endian == llvm::endianness::little))
- endian::write32<llvm::endianness::little>(FixupPtr, Imm);
+ if (LLVM_LIKELY(Endian == endianness::little))
+ endian::write32<endianness::little>(FixupPtr, Imm);
else
- endian::write32<llvm::endianness::big>(FixupPtr, Imm);
+ endian::write32<endianness::big>(FixupPtr, Imm);
};
Edge::Kind Kind = E.getKind();
diff --git a/llvm/unittests/ExecutionEngine/JITLink/AArch32ErrorTests.cpp b/llvm/unittests/ExecutionEngine/JITLink/AArch32ErrorTests.cpp
index 532948d6ae85bae..9c4aeaf7ffa26ae 100644
--- a/llvm/unittests/ExecutionEngine/JITLink/AArch32ErrorTests.cpp
+++ b/llvm/unittests/ExecutionEngine/JITLink/AArch32ErrorTests.cpp
@@ -19,7 +19,7 @@ using namespace llvm::support::endian;
constexpr unsigned PointerSize = 4;
auto G = std::make_unique<LinkGraph>("foo", Triple("armv7-linux-gnueabi"),
- PointerSize, llvm::endianness::little,
+ PointerSize, endianness::little,
getGenericEdgeKindName);
auto &Sec =
G->createSection("__data", orc::MemProt::Read | orc::MemProt::Write);
diff --git a/llvm/unittests/ExecutionEngine/JITLink/AArch32Tests.cpp b/llvm/unittests/ExecutionEngine/JITLink/AArch32Tests.cpp
index 5f44e4d93036259..26c773b8dc3a715 100644
--- a/llvm/unittests/ExecutionEngine/JITLink/AArch32Tests.cpp
+++ b/llvm/unittests/ExecutionEngine/JITLink/AArch32Tests.cpp
@@ -133,11 +133,9 @@ TEST(AArch32_Relocations, Thumb_Call_J1J2) {
constexpr HalfWords ImmMask = FixupInfo<Thumb_Call>::ImmMask;
static std::array<HalfWords, 3> MemPresets{
- makeHalfWords<llvm::endianness::little>(
- {0xff, 0xf7, 0xfe, 0xef}), // common
- makeHalfWords<llvm::endianness::little>(
- {0x00, 0x00, 0x00, 0x00}), // zeros
- makeHalfWords<llvm::endianness::little>({0xff, 0xff, 0xff, 0xff}), // ones
+ makeHalfWords<endianness::little>({0xff, 0xf7, 0xfe, 0xef}), // common
+ makeHalfWords<endianness::little>({0x00, 0x00, 0x00, 0x00}), // zeros
+ makeHalfWords<endianness::little>({0xff, 0xff, 0xff, 0xff}), // ones
};
auto EncodeDecode = [ImmMask](int64_t In, MutableHalfWords &Mem) {
@@ -171,11 +169,9 @@ TEST(AArch32_Relocations, Thumb_Call_Bare) {
constexpr HalfWords ImmMask = FixupInfo<Thumb_Call>::ImmMask;
static std::array<HalfWords, 3> MemPresets{
- makeHalfWords<llvm::endianness::little>(
- {0xff, 0xf7, 0xfe, 0xef}), // common
- makeHalfWords<llvm::endianness::little>(
- {0x00, 0x00, 0x00, 0x00}), // zeros
- makeHalfWords<llvm::endianness::little>({0xff, 0xff, 0xff, 0xff}), // ones
+ makeHalfWords<endianness::little>({0xff, 0xf7, 0xfe, 0xef}), // common
+ makeHalfWords<endianness::little>({0x00, 0x00, 0x00, 0x00}), // zeros
+ makeHalfWords<endianness::little>({0xff, 0xff, 0xff, 0xff}), // ones
};
auto EncodeDecode = [ImmMask](int64_t In, MutableHalfWords &Mem) {
@@ -244,11 +240,9 @@ TEST(AArch32_Relocations, Thumb_MovtAbs) {
static std::array<uint8_t, 3> Registers{0, 5, 12};
static std::array<HalfWords, 3> MemPresets{
- makeHalfWords<llvm::endianness::little>(
- {0xff, 0xf7, 0xfe, 0xef}), // common
- makeHalfWords<llvm::endianness::little>(
- {0x00, 0x00, 0x00, 0x00}), // zeros
- makeHalfWords<llvm::endianness::little>({0xff, 0xff, 0xff, 0xff}), // ones
+ makeHalfWords<endianness::little>({0xff, 0xf7, 0xfe, 0xef}), // common
+ makeHalfWords<endianness::little>({0x00, 0x00, 0x00, 0x00}), // zeros
+ makeHalfWords<endianness::little>({0xff, 0xff, 0xff, 0xff}), // ones
};
auto EncodeDecode = [ImmMask](uint32_t In, MutableHalfWords &Mem) {
More information about the llvm-commits
mailing list