Skip to content

Commit e970652

Browse files
[JITLink][AArch32] Reflow code structure after llvm::endianness refactor (NFC)
1 parent 2170252 commit e970652

File tree

3 files changed

+14
-20
lines changed

3 files changed

+14
-20
lines changed

llvm/lib/ExecutionEngine/JITLink/aarch32.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -388,7 +388,7 @@ void writeImmediate(WritableArmRelocation &R, uint32_t Imm) {
388388

389389
Expected<int64_t> readAddendData(LinkGraph &G, Block &B, Edge::OffsetT Offset,
390390
Edge::Kind Kind) {
391-
llvm::endianness Endian = G.getEndianness();
391+
endianness Endian = G.getEndianness();
392392
const char *BlockWorkingMem = B.getContent().data();
393393
const char *FixupPtr = BlockWorkingMem + Offset;
394394

@@ -467,10 +467,10 @@ Error applyFixupData(LinkGraph &G, Block &B, const Edge &E) {
467467
auto Write32 = [FixupPtr, Endian = G.getEndianness()](int64_t Value) {
468468
assert(isInt<32>(Value) && "Must be in signed 32-bit range");
469469
uint32_t Imm = static_cast<int32_t>(Value);
470-
if (LLVM_LIKELY(Endian == llvm::endianness::little))
471-
endian::write32<llvm::endianness::little>(FixupPtr, Imm);
470+
if (LLVM_LIKELY(Endian == endianness::little))
471+
endian::write32<endianness::little>(FixupPtr, Imm);
472472
else
473-
endian::write32<llvm::endianness::big>(FixupPtr, Imm);
473+
endian::write32<endianness::big>(FixupPtr, Imm);
474474
};
475475

476476
Edge::Kind Kind = E.getKind();

llvm/unittests/ExecutionEngine/JITLink/AArch32ErrorTests.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ using namespace llvm::support::endian;
1919

2020
constexpr unsigned PointerSize = 4;
2121
auto G = std::make_unique<LinkGraph>("foo", Triple("armv7-linux-gnueabi"),
22-
PointerSize, llvm::endianness::little,
22+
PointerSize, endianness::little,
2323
getGenericEdgeKindName);
2424
auto &Sec =
2525
G->createSection("__data", orc::MemProt::Read | orc::MemProt::Write);

llvm/unittests/ExecutionEngine/JITLink/AArch32Tests.cpp

Lines changed: 9 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -133,11 +133,9 @@ TEST(AArch32_Relocations, Thumb_Call_J1J2) {
133133
constexpr HalfWords ImmMask = FixupInfo<Thumb_Call>::ImmMask;
134134

135135
static std::array<HalfWords, 3> MemPresets{
136-
makeHalfWords<llvm::endianness::little>(
137-
{0xff, 0xf7, 0xfe, 0xef}), // common
138-
makeHalfWords<llvm::endianness::little>(
139-
{0x00, 0x00, 0x00, 0x00}), // zeros
140-
makeHalfWords<llvm::endianness::little>({0xff, 0xff, 0xff, 0xff}), // ones
136+
makeHalfWords<endianness::little>({0xff, 0xf7, 0xfe, 0xef}), // common
137+
makeHalfWords<endianness::little>({0x00, 0x00, 0x00, 0x00}), // zeros
138+
makeHalfWords<endianness::little>({0xff, 0xff, 0xff, 0xff}), // ones
141139
};
142140

143141
auto EncodeDecode = [ImmMask](int64_t In, MutableHalfWords &Mem) {
@@ -171,11 +169,9 @@ TEST(AArch32_Relocations, Thumb_Call_Bare) {
171169
constexpr HalfWords ImmMask = FixupInfo<Thumb_Call>::ImmMask;
172170

173171
static std::array<HalfWords, 3> MemPresets{
174-
makeHalfWords<llvm::endianness::little>(
175-
{0xff, 0xf7, 0xfe, 0xef}), // common
176-
makeHalfWords<llvm::endianness::little>(
177-
{0x00, 0x00, 0x00, 0x00}), // zeros
178-
makeHalfWords<llvm::endianness::little>({0xff, 0xff, 0xff, 0xff}), // ones
172+
makeHalfWords<endianness::little>({0xff, 0xf7, 0xfe, 0xef}), // common
173+
makeHalfWords<endianness::little>({0x00, 0x00, 0x00, 0x00}), // zeros
174+
makeHalfWords<endianness::little>({0xff, 0xff, 0xff, 0xff}), // ones
179175
};
180176

181177
auto EncodeDecode = [ImmMask](int64_t In, MutableHalfWords &Mem) {
@@ -244,11 +240,9 @@ TEST(AArch32_Relocations, Thumb_MovtAbs) {
244240

245241
static std::array<uint8_t, 3> Registers{0, 5, 12};
246242
static std::array<HalfWords, 3> MemPresets{
247-
makeHalfWords<llvm::endianness::little>(
248-
{0xff, 0xf7, 0xfe, 0xef}), // common
249-
makeHalfWords<llvm::endianness::little>(
250-
{0x00, 0x00, 0x00, 0x00}), // zeros
251-
makeHalfWords<llvm::endianness::little>({0xff, 0xff, 0xff, 0xff}), // ones
243+
makeHalfWords<endianness::little>({0xff, 0xf7, 0xfe, 0xef}), // common
244+
makeHalfWords<endianness::little>({0x00, 0x00, 0x00, 0x00}), // zeros
245+
makeHalfWords<endianness::little>({0xff, 0xff, 0xff, 0xff}), // ones
252246
};
253247

254248
auto EncodeDecode = [ImmMask](uint32_t In, MutableHalfWords &Mem) {

0 commit comments

Comments
 (0)