Skip to content

Commit a9d5056

Browse files
Use llvm::endianness (NFC)
Now that llvm::support::endianness has been renamed to llvm::endianness, we can use the shorter form. This patch replaces support::endianness with llvm::endianness.
1 parent d95a6c9 commit a9d5056

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

57 files changed

+158
-167
lines changed

lldb/unittests/tools/lldb-server/tests/MessageObjects.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ Expected<ProcessInfo> ProcessInfo::create(StringRef response) {
5353

5454
lldb::pid_t ProcessInfo::GetPid() const { return m_pid; }
5555

56-
support::endianness ProcessInfo::GetEndian() const { return m_endian; }
56+
llvm::endianness ProcessInfo::GetEndian() const { return m_endian; }
5757

5858
//====== ThreadInfo ============================================================
5959
ThreadInfo::ThreadInfo(StringRef name, StringRef reason, RegisterMap registers,
@@ -237,7 +237,7 @@ StopReply::create(StringRef Response, llvm::endianness Endian,
237237

238238
Expected<RegisterMap> StopReplyStop::parseRegisters(
239239
const StringMap<SmallVector<StringRef, 2>> &Elements,
240-
support::endianness Endian, ArrayRef<lldb_private::RegisterInfo> RegInfos) {
240+
llvm::endianness Endian, ArrayRef<lldb_private::RegisterInfo> RegInfos) {
241241

242242
RegisterMap Result;
243243
for (const auto &E : Elements) {
@@ -263,7 +263,7 @@ Expected<RegisterMap> StopReplyStop::parseRegisters(
263263
}
264264

265265
Expected<std::unique_ptr<StopReplyStop>>
266-
StopReplyStop::create(StringRef Response, support::endianness Endian,
266+
StopReplyStop::create(StringRef Response, llvm::endianness Endian,
267267
ArrayRef<RegisterInfo> RegInfos) {
268268
unsigned int Signal;
269269
StringRef SignalStr = Response.take_front(2);

llvm/include/llvm/BinaryFormat/MsgPack.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ namespace llvm {
2121
namespace msgpack {
2222

2323
/// The endianness of all multi-byte encoded values in MessagePack.
24-
constexpr support::endianness Endianness = support::big;
24+
constexpr llvm::endianness Endianness = support::big;
2525

2626
/// The first byte identifiers of MessagePack object formats.
2727
namespace FirstByte {

llvm/include/llvm/DebugInfo/MSF/MappedBlockStream.h

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,7 @@ class MappedBlockStream : public BinaryStream {
5454
createDirectoryStream(const MSFLayout &Layout, BinaryStreamRef MsfData,
5555
BumpPtrAllocator &Allocator);
5656

57-
support::endianness getEndian() const override {
58-
return support::little;
59-
}
57+
llvm::endianness getEndian() const override { return support::little; }
6058

6159
Error readBytes(uint64_t Offset, uint64_t Size,
6260
ArrayRef<uint8_t> &Buffer) override;
@@ -121,9 +119,7 @@ class WritableMappedBlockStream : public WritableBinaryStream {
121119
createFpmStream(const MSFLayout &Layout, WritableBinaryStreamRef MsfData,
122120
BumpPtrAllocator &Allocator, bool AltFpm = false);
123121

124-
support::endianness getEndian() const override {
125-
return support::little;
126-
}
122+
llvm::endianness getEndian() const override { return support::little; }
127123

128124
Error readBytes(uint64_t Offset, uint64_t Size,
129125
ArrayRef<uint8_t> &Buffer) override;

llvm/include/llvm/ExecutionEngine/JITLink/JITLink.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -995,14 +995,14 @@ class LinkGraph {
995995
using GetEdgeKindNameFunction = const char *(*)(Edge::Kind);
996996

997997
LinkGraph(std::string Name, const Triple &TT, SubtargetFeatures Features,
998-
unsigned PointerSize, support::endianness Endianness,
998+
unsigned PointerSize, llvm::endianness Endianness,
999999
GetEdgeKindNameFunction GetEdgeKindName)
10001000
: Name(std::move(Name)), TT(TT), Features(std::move(Features)),
10011001
PointerSize(PointerSize), Endianness(Endianness),
10021002
GetEdgeKindName(std::move(GetEdgeKindName)) {}
10031003

10041004
LinkGraph(std::string Name, const Triple &TT, unsigned PointerSize,
1005-
support::endianness Endianness,
1005+
llvm::endianness Endianness,
10061006
GetEdgeKindNameFunction GetEdgeKindName)
10071007
: LinkGraph(std::move(Name), TT, SubtargetFeatures(), PointerSize,
10081008
Endianness, GetEdgeKindName) {}
@@ -1026,7 +1026,7 @@ class LinkGraph {
10261026
unsigned getPointerSize() const { return PointerSize; }
10271027

10281028
/// Returns the endianness of content in this graph.
1029-
support::endianness getEndianness() const { return Endianness; }
1029+
llvm::endianness getEndianness() const { return Endianness; }
10301030

10311031
const char *getEdgeKindName(Edge::Kind K) const { return GetEdgeKindName(K); }
10321032

@@ -1530,7 +1530,7 @@ class LinkGraph {
15301530
Triple TT;
15311531
SubtargetFeatures Features;
15321532
unsigned PointerSize;
1533-
support::endianness Endianness;
1533+
llvm::endianness Endianness;
15341534
GetEdgeKindNameFunction GetEdgeKindName = nullptr;
15351535
DenseMap<StringRef, std::unique_ptr<Section>> Sections;
15361536
ExternalSymbolMap ExternalSymbols;

llvm/include/llvm/ExecutionEngine/JITLink/ppc64.h

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ struct PLTCallStubInfo {
8888
SmallVector<PLTCallStubReloc, 2> Relocs;
8989
};
9090

91-
template <support::endianness Endianness>
91+
template <llvm::endianness Endianness>
9292
inline PLTCallStubInfo pickStub(PLTCallStubKind StubKind) {
9393
constexpr bool isLE = Endianness == llvm::endianness::little;
9494
switch (StubKind) {
@@ -139,7 +139,7 @@ inline Symbol &createAnonymousPointer(LinkGraph &G, Section &PointerSection,
139139
return G.addAnonymousSymbol(B, 0, G.getPointerSize(), false, false);
140140
}
141141

142-
template <support::endianness Endianness>
142+
template <llvm::endianness Endianness>
143143
inline Symbol &createAnonymousPointerJumpStub(LinkGraph &G,
144144
Section &StubSection,
145145
Symbol &PointerSymbol,
@@ -152,7 +152,7 @@ inline Symbol &createAnonymousPointerJumpStub(LinkGraph &G,
152152
return G.addAnonymousSymbol(B, 0, StubInfo.Content.size(), true, false);
153153
}
154154

155-
template <support::endianness Endianness>
155+
template <llvm::endianness Endianness>
156156
class TOCTableManager : public TableManager<TOCTableManager<Endianness>> {
157157
public:
158158
// FIXME: `llvm-jitlink -check` relies this name to be $__GOT.
@@ -190,7 +190,7 @@ class TOCTableManager : public TableManager<TOCTableManager<Endianness>> {
190190
Section *TOCSection = nullptr;
191191
};
192192

193-
template <support::endianness Endianness>
193+
template <llvm::endianness Endianness>
194194
class PLTTableManager : public TableManager<PLTTableManager<Endianness>> {
195195
public:
196196
PLTTableManager(TOCTableManager<Endianness> &TOC) : TOC(TOC) {}
@@ -271,21 +271,21 @@ inline static uint16_t highesta(uint64_t x) { return (x + 0x8000) >> 48; }
271271
// the most significant 32 bits belong to the prefix word. The prefix word is at
272272
// low address for both big/little endian. Byte order in each word still follows
273273
// its endian.
274-
template <support::endianness Endianness>
274+
template <llvm::endianness Endianness>
275275
inline static uint64_t readPrefixedInstruction(const char *Loc) {
276276
constexpr bool isLE = Endianness == llvm::endianness::little;
277277
uint64_t Inst = support::endian::read64<Endianness>(Loc);
278278
return isLE ? (Inst << 32) | (Inst >> 32) : Inst;
279279
}
280280

281-
template <support::endianness Endianness>
281+
template <llvm::endianness Endianness>
282282
inline static void writePrefixedInstruction(char *Loc, uint64_t Inst) {
283283
constexpr bool isLE = Endianness == llvm::endianness::little;
284284
Inst = isLE ? (Inst << 32) | (Inst >> 32) : Inst;
285285
support::endian::write64<Endianness>(Loc, Inst);
286286
}
287287

288-
template <support::endianness Endianness>
288+
template <llvm::endianness Endianness>
289289
inline Error relocateHalf16(char *FixupPtr, int64_t Value, Edge::Kind K) {
290290
switch (K) {
291291
case Delta16:
@@ -343,7 +343,7 @@ inline Error relocateHalf16(char *FixupPtr, int64_t Value, Edge::Kind K) {
343343
}
344344

345345
/// Apply fixup expression for edge to block content.
346-
template <support::endianness Endianness>
346+
template <llvm::endianness Endianness>
347347
inline Error applyFixup(LinkGraph &G, Block &B, const Edge &E,
348348
const Symbol *TOCSymbol) {
349349
char *BlockWorkingMem = B.getAlreadyMutableContent().data();

llvm/include/llvm/ExecutionEngine/Orc/ExecutionUtils.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -343,7 +343,7 @@ class DLLImportDefinitionGenerator : public DefinitionGenerator {
343343
: ES(ES), L(L) {}
344344

345345
static Expected<unsigned> getTargetPointerSize(const Triple &TT);
346-
static Expected<support::endianness> getTargetEndianness(const Triple &TT);
346+
static Expected<llvm::endianness> getTargetEndianness(const Triple &TT);
347347
Expected<std::unique_ptr<jitlink::LinkGraph>>
348348
createStubsGraph(const SymbolMap &Resolved);
349349

llvm/include/llvm/ExecutionEngine/Orc/MachOBuilder.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -507,7 +507,7 @@ struct MachO64LE {
507507
using NList = MachO::nlist_64;
508508
using Relocation = MachO::relocation_info;
509509

510-
static constexpr support::endianness Endianness = support::little;
510+
static constexpr llvm::endianness Endianness = support::little;
511511
static constexpr uint32_t Magic = MachO::MH_MAGIC_64;
512512
static constexpr MachO::LoadCommandType SegmentCmd = MachO::LC_SEGMENT_64;
513513
static constexpr MachO::LoadCommandType SymTabCmd = MachO::LC_SYMTAB;

llvm/include/llvm/ExecutionEngine/RuntimeDyldChecker.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -163,9 +163,9 @@ class RuntimeDyldChecker {
163163
GetSymbolInfoFunction GetSymbolInfo,
164164
GetSectionInfoFunction GetSectionInfo,
165165
GetStubInfoFunction GetStubInfo,
166-
GetGOTInfoFunction GetGOTInfo,
167-
support::endianness Endianness, Triple TT, StringRef CPU,
168-
SubtargetFeatures TF, raw_ostream &ErrStream);
166+
GetGOTInfoFunction GetGOTInfo, llvm::endianness Endianness,
167+
Triple TT, StringRef CPU, SubtargetFeatures TF,
168+
raw_ostream &ErrStream);
169169
~RuntimeDyldChecker();
170170

171171
/// Check a single expression against the attached RuntimeDyld

llvm/include/llvm/MC/MCAsmBackend.h

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,15 +41,14 @@ class raw_ostream;
4141
/// Generic interface to target specific assembler backends.
4242
class MCAsmBackend {
4343
protected: // Can only create subclasses.
44-
MCAsmBackend(support::endianness Endian,
45-
unsigned RelaxFixupKind = MaxFixupKind);
44+
MCAsmBackend(llvm::endianness Endian, unsigned RelaxFixupKind = MaxFixupKind);
4645

4746
public:
4847
MCAsmBackend(const MCAsmBackend &) = delete;
4948
MCAsmBackend &operator=(const MCAsmBackend &) = delete;
5049
virtual ~MCAsmBackend();
5150

52-
const support::endianness Endian;
51+
const llvm::endianness Endian;
5352

5453
/// Fixup kind used for linker relaxation. Currently only used by RISC-V.
5554
const unsigned RelaxFixupKind;

llvm/include/llvm/Object/ELFTypes.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -740,15 +740,15 @@ template <class ELFT> struct Elf_CGProfile_Impl {
740740
template <class ELFT>
741741
struct Elf_Mips_RegInfo;
742742

743-
template <support::endianness TargetEndianness>
743+
template <llvm::endianness TargetEndianness>
744744
struct Elf_Mips_RegInfo<ELFType<TargetEndianness, false>> {
745745
LLVM_ELF_IMPORT_TYPES(TargetEndianness, false)
746746
Elf_Word ri_gprmask; // bit-mask of used general registers
747747
Elf_Word ri_cprmask[4]; // bit-mask of used co-processor registers
748748
Elf_Addr ri_gp_value; // gp register value
749749
};
750750

751-
template <support::endianness TargetEndianness>
751+
template <llvm::endianness TargetEndianness>
752752
struct Elf_Mips_RegInfo<ELFType<TargetEndianness, true>> {
753753
LLVM_ELF_IMPORT_TYPES(TargetEndianness, true)
754754
Elf_Word ri_gprmask; // bit-mask of used general registers

0 commit comments

Comments
 (0)