From a9d50568625e4f2e021d6229f8c1c721a3d82d51 Mon Sep 17 00:00:00 2001 From: Kazu Hirata Date: Tue, 10 Oct 2023 21:54:15 -0700 Subject: [PATCH] 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. --- .../lldb-server/tests/MessageObjects.cpp | 6 +- llvm/include/llvm/BinaryFormat/MsgPack.h | 2 +- .../llvm/DebugInfo/MSF/MappedBlockStream.h | 8 +-- .../llvm/ExecutionEngine/JITLink/JITLink.h | 8 +-- .../llvm/ExecutionEngine/JITLink/ppc64.h | 16 ++--- .../llvm/ExecutionEngine/Orc/ExecutionUtils.h | 2 +- .../llvm/ExecutionEngine/Orc/MachOBuilder.h | 2 +- .../llvm/ExecutionEngine/RuntimeDyldChecker.h | 6 +- llvm/include/llvm/MC/MCAsmBackend.h | 5 +- llvm/include/llvm/Object/ELFTypes.h | 4 +- llvm/include/llvm/Object/StackMapParser.h | 3 +- .../ProfileData/Coverage/CoverageMapping.h | 62 +++++++++---------- .../Coverage/CoverageMappingReader.h | 2 +- .../llvm/ProfileData/InstrProfData.inc | 8 +-- .../llvm/ProfileData/InstrProfReader.h | 12 ++-- .../llvm/ProfileData/InstrProfWriter.h | 2 +- .../include/llvm/Support/ELFAttributeParser.h | 2 +- llvm/include/llvm/Support/HashBuilder.h | 10 +-- llvm/include/llvm/Support/VersionTuple.h | 2 +- llvm/include/llvm/Support/YAMLTraits.h | 6 +- .../DWARFLinkerCompileUnit.h | 4 +- .../DWARFLinkerParallel/DWARFLinkerImpl.cpp | 2 +- llvm/lib/DWARFLinkerParallel/OutputSections.h | 16 +++-- .../JITLink/COFFLinkGraphBuilder.cpp | 2 +- .../JITLink/COFFLinkGraphBuilder.h | 2 +- .../JITLink/ELFLinkGraphBuilder.h | 2 +- .../ExecutionEngine/JITLink/ELF_aarch32.cpp | 2 +- .../lib/ExecutionEngine/JITLink/ELF_ppc64.cpp | 16 ++--- .../JITLink/MachOLinkGraphBuilder.cpp | 2 +- .../JITLink/MachOLinkGraphBuilder.h | 2 +- llvm/lib/ExecutionEngine/JITLink/aarch32.cpp | 2 +- llvm/lib/ExecutionEngine/Orc/COFFPlatform.cpp | 2 +- .../Orc/Debugging/PerfSupportPlugin.cpp | 2 +- .../ExecutionEngine/Orc/ELFNixPlatform.cpp | 2 +- .../ExecutionEngine/Orc/ExecutionUtils.cpp | 2 +- .../lib/ExecutionEngine/Orc/MachOPlatform.cpp | 2 +- .../RuntimeDyld/RuntimeDyldChecker.cpp | 4 +- .../RuntimeDyld/RuntimeDyldCheckerImpl.h | 14 +++-- llvm/lib/MC/MCAsmBackend.cpp | 2 +- llvm/lib/MC/MCAssembler.cpp | 2 +- llvm/lib/MC/MCDwarf.cpp | 2 +- llvm/lib/ObjectYAML/ELFEmitter.cpp | 2 +- .../Coverage/CoverageMappingReader.cpp | 14 ++--- llvm/lib/ProfileData/InstrProf.cpp | 11 ++-- llvm/lib/ProfileData/InstrProfWriter.cpp | 5 +- llvm/lib/Support/ELFAttributeParser.cpp | 2 +- .../Target/ARM/MCTargetDesc/ARMAsmBackend.cpp | 2 +- .../Target/ARM/MCTargetDesc/ARMAsmBackend.h | 2 +- .../ARM/MCTargetDesc/ARMAsmBackendELF.h | 2 +- .../Target/BPF/MCTargetDesc/BPFAsmBackend.cpp | 2 +- .../PowerPC/MCTargetDesc/PPCMCCodeEmitter.cpp | 2 +- .../SPIRV/MCTargetDesc/SPIRVAsmBackend.cpp | 2 +- .../Instrumentation/GCOVProfiling.cpp | 2 +- llvm/tools/llvm-gsymutil/llvm-gsymutil.cpp | 2 +- llvm/tools/llvm-objdump/llvm-objdump.cpp | 2 +- llvm/tools/llvm-readobj/ELFDumper.cpp | 4 +- llvm/unittests/DebugInfo/GSYM/GSYMTest.cpp | 15 +++-- 57 files changed, 158 insertions(+), 167 deletions(-) diff --git a/lldb/unittests/tools/lldb-server/tests/MessageObjects.cpp b/lldb/unittests/tools/lldb-server/tests/MessageObjects.cpp index 2c6b9a2299dd7..7ccc9210daad0 100644 --- a/lldb/unittests/tools/lldb-server/tests/MessageObjects.cpp +++ b/lldb/unittests/tools/lldb-server/tests/MessageObjects.cpp @@ -53,7 +53,7 @@ Expected ProcessInfo::create(StringRef response) { lldb::pid_t ProcessInfo::GetPid() const { return m_pid; } -support::endianness ProcessInfo::GetEndian() const { return m_endian; } +llvm::endianness ProcessInfo::GetEndian() const { return m_endian; } //====== ThreadInfo ============================================================ ThreadInfo::ThreadInfo(StringRef name, StringRef reason, RegisterMap registers, @@ -237,7 +237,7 @@ StopReply::create(StringRef Response, llvm::endianness Endian, Expected StopReplyStop::parseRegisters( const StringMap> &Elements, - support::endianness Endian, ArrayRef RegInfos) { + llvm::endianness Endian, ArrayRef RegInfos) { RegisterMap Result; for (const auto &E : Elements) { @@ -263,7 +263,7 @@ Expected StopReplyStop::parseRegisters( } Expected> -StopReplyStop::create(StringRef Response, support::endianness Endian, +StopReplyStop::create(StringRef Response, llvm::endianness Endian, ArrayRef RegInfos) { unsigned int Signal; StringRef SignalStr = Response.take_front(2); diff --git a/llvm/include/llvm/BinaryFormat/MsgPack.h b/llvm/include/llvm/BinaryFormat/MsgPack.h index 9fda14b21c711..7fe6442e33737 100644 --- a/llvm/include/llvm/BinaryFormat/MsgPack.h +++ b/llvm/include/llvm/BinaryFormat/MsgPack.h @@ -21,7 +21,7 @@ namespace llvm { namespace msgpack { /// The endianness of all multi-byte encoded values in MessagePack. -constexpr support::endianness Endianness = support::big; +constexpr llvm::endianness Endianness = support::big; /// The first byte identifiers of MessagePack object formats. namespace FirstByte { diff --git a/llvm/include/llvm/DebugInfo/MSF/MappedBlockStream.h b/llvm/include/llvm/DebugInfo/MSF/MappedBlockStream.h index b5f0596fceed3..39593b759bb5e 100644 --- a/llvm/include/llvm/DebugInfo/MSF/MappedBlockStream.h +++ b/llvm/include/llvm/DebugInfo/MSF/MappedBlockStream.h @@ -54,9 +54,7 @@ class MappedBlockStream : public BinaryStream { createDirectoryStream(const MSFLayout &Layout, BinaryStreamRef MsfData, BumpPtrAllocator &Allocator); - support::endianness getEndian() const override { - return support::little; - } + llvm::endianness getEndian() const override { return support::little; } Error readBytes(uint64_t Offset, uint64_t Size, ArrayRef &Buffer) override; @@ -121,9 +119,7 @@ class WritableMappedBlockStream : public WritableBinaryStream { createFpmStream(const MSFLayout &Layout, WritableBinaryStreamRef MsfData, BumpPtrAllocator &Allocator, bool AltFpm = false); - support::endianness getEndian() const override { - return support::little; - } + llvm::endianness getEndian() const override { return support::little; } Error readBytes(uint64_t Offset, uint64_t Size, ArrayRef &Buffer) override; diff --git a/llvm/include/llvm/ExecutionEngine/JITLink/JITLink.h b/llvm/include/llvm/ExecutionEngine/JITLink/JITLink.h index 4fcb4656a2df0..fb758f7a66cf5 100644 --- a/llvm/include/llvm/ExecutionEngine/JITLink/JITLink.h +++ b/llvm/include/llvm/ExecutionEngine/JITLink/JITLink.h @@ -995,14 +995,14 @@ class LinkGraph { using GetEdgeKindNameFunction = const char *(*)(Edge::Kind); LinkGraph(std::string Name, const Triple &TT, SubtargetFeatures Features, - unsigned PointerSize, support::endianness Endianness, + unsigned PointerSize, llvm::endianness Endianness, GetEdgeKindNameFunction GetEdgeKindName) : Name(std::move(Name)), TT(TT), Features(std::move(Features)), PointerSize(PointerSize), Endianness(Endianness), GetEdgeKindName(std::move(GetEdgeKindName)) {} LinkGraph(std::string Name, const Triple &TT, unsigned PointerSize, - support::endianness Endianness, + llvm::endianness Endianness, GetEdgeKindNameFunction GetEdgeKindName) : LinkGraph(std::move(Name), TT, SubtargetFeatures(), PointerSize, Endianness, GetEdgeKindName) {} @@ -1026,7 +1026,7 @@ class LinkGraph { unsigned getPointerSize() const { return PointerSize; } /// Returns the endianness of content in this graph. - support::endianness getEndianness() const { return Endianness; } + llvm::endianness getEndianness() const { return Endianness; } const char *getEdgeKindName(Edge::Kind K) const { return GetEdgeKindName(K); } @@ -1530,7 +1530,7 @@ class LinkGraph { Triple TT; SubtargetFeatures Features; unsigned PointerSize; - support::endianness Endianness; + llvm::endianness Endianness; GetEdgeKindNameFunction GetEdgeKindName = nullptr; DenseMap> Sections; ExternalSymbolMap ExternalSymbols; diff --git a/llvm/include/llvm/ExecutionEngine/JITLink/ppc64.h b/llvm/include/llvm/ExecutionEngine/JITLink/ppc64.h index e2677893cf7f5..e55edf3082533 100644 --- a/llvm/include/llvm/ExecutionEngine/JITLink/ppc64.h +++ b/llvm/include/llvm/ExecutionEngine/JITLink/ppc64.h @@ -88,7 +88,7 @@ struct PLTCallStubInfo { SmallVector Relocs; }; -template +template inline PLTCallStubInfo pickStub(PLTCallStubKind StubKind) { constexpr bool isLE = Endianness == llvm::endianness::little; switch (StubKind) { @@ -139,7 +139,7 @@ inline Symbol &createAnonymousPointer(LinkGraph &G, Section &PointerSection, return G.addAnonymousSymbol(B, 0, G.getPointerSize(), false, false); } -template +template inline Symbol &createAnonymousPointerJumpStub(LinkGraph &G, Section &StubSection, Symbol &PointerSymbol, @@ -152,7 +152,7 @@ inline Symbol &createAnonymousPointerJumpStub(LinkGraph &G, return G.addAnonymousSymbol(B, 0, StubInfo.Content.size(), true, false); } -template +template class TOCTableManager : public TableManager> { public: // FIXME: `llvm-jitlink -check` relies this name to be $__GOT. @@ -190,7 +190,7 @@ class TOCTableManager : public TableManager> { Section *TOCSection = nullptr; }; -template +template class PLTTableManager : public TableManager> { public: PLTTableManager(TOCTableManager &TOC) : TOC(TOC) {} @@ -271,21 +271,21 @@ inline static uint16_t highesta(uint64_t x) { return (x + 0x8000) >> 48; } // the most significant 32 bits belong to the prefix word. The prefix word is at // low address for both big/little endian. Byte order in each word still follows // its endian. -template +template inline static uint64_t readPrefixedInstruction(const char *Loc) { constexpr bool isLE = Endianness == llvm::endianness::little; uint64_t Inst = support::endian::read64(Loc); return isLE ? (Inst << 32) | (Inst >> 32) : Inst; } -template +template inline static void writePrefixedInstruction(char *Loc, uint64_t Inst) { constexpr bool isLE = Endianness == llvm::endianness::little; Inst = isLE ? (Inst << 32) | (Inst >> 32) : Inst; support::endian::write64(Loc, Inst); } -template +template inline Error relocateHalf16(char *FixupPtr, int64_t Value, Edge::Kind K) { switch (K) { case Delta16: @@ -343,7 +343,7 @@ inline Error relocateHalf16(char *FixupPtr, int64_t Value, Edge::Kind K) { } /// Apply fixup expression for edge to block content. -template +template inline Error applyFixup(LinkGraph &G, Block &B, const Edge &E, const Symbol *TOCSymbol) { char *BlockWorkingMem = B.getAlreadyMutableContent().data(); diff --git a/llvm/include/llvm/ExecutionEngine/Orc/ExecutionUtils.h b/llvm/include/llvm/ExecutionEngine/Orc/ExecutionUtils.h index 2f13560061c4f..a6f097da1f3a1 100644 --- a/llvm/include/llvm/ExecutionEngine/Orc/ExecutionUtils.h +++ b/llvm/include/llvm/ExecutionEngine/Orc/ExecutionUtils.h @@ -343,7 +343,7 @@ class DLLImportDefinitionGenerator : public DefinitionGenerator { : ES(ES), L(L) {} static Expected getTargetPointerSize(const Triple &TT); - static Expected getTargetEndianness(const Triple &TT); + static Expected getTargetEndianness(const Triple &TT); Expected> createStubsGraph(const SymbolMap &Resolved); diff --git a/llvm/include/llvm/ExecutionEngine/Orc/MachOBuilder.h b/llvm/include/llvm/ExecutionEngine/Orc/MachOBuilder.h index 8cbd9ed2448f5..fba688309ec19 100644 --- a/llvm/include/llvm/ExecutionEngine/Orc/MachOBuilder.h +++ b/llvm/include/llvm/ExecutionEngine/Orc/MachOBuilder.h @@ -507,7 +507,7 @@ struct MachO64LE { using NList = MachO::nlist_64; using Relocation = MachO::relocation_info; - static constexpr support::endianness Endianness = support::little; + static constexpr llvm::endianness Endianness = support::little; static constexpr uint32_t Magic = MachO::MH_MAGIC_64; static constexpr MachO::LoadCommandType SegmentCmd = MachO::LC_SEGMENT_64; static constexpr MachO::LoadCommandType SymTabCmd = MachO::LC_SYMTAB; diff --git a/llvm/include/llvm/ExecutionEngine/RuntimeDyldChecker.h b/llvm/include/llvm/ExecutionEngine/RuntimeDyldChecker.h index 85df587bff50c..faca037a56c49 100644 --- a/llvm/include/llvm/ExecutionEngine/RuntimeDyldChecker.h +++ b/llvm/include/llvm/ExecutionEngine/RuntimeDyldChecker.h @@ -163,9 +163,9 @@ class RuntimeDyldChecker { GetSymbolInfoFunction GetSymbolInfo, GetSectionInfoFunction GetSectionInfo, GetStubInfoFunction GetStubInfo, - GetGOTInfoFunction GetGOTInfo, - support::endianness Endianness, Triple TT, StringRef CPU, - SubtargetFeatures TF, raw_ostream &ErrStream); + GetGOTInfoFunction GetGOTInfo, llvm::endianness Endianness, + Triple TT, StringRef CPU, SubtargetFeatures TF, + raw_ostream &ErrStream); ~RuntimeDyldChecker(); /// Check a single expression against the attached RuntimeDyld diff --git a/llvm/include/llvm/MC/MCAsmBackend.h b/llvm/include/llvm/MC/MCAsmBackend.h index 5e08fb41679ba..b5c30aa756c2b 100644 --- a/llvm/include/llvm/MC/MCAsmBackend.h +++ b/llvm/include/llvm/MC/MCAsmBackend.h @@ -41,15 +41,14 @@ class raw_ostream; /// Generic interface to target specific assembler backends. class MCAsmBackend { protected: // Can only create subclasses. - MCAsmBackend(support::endianness Endian, - unsigned RelaxFixupKind = MaxFixupKind); + MCAsmBackend(llvm::endianness Endian, unsigned RelaxFixupKind = MaxFixupKind); public: MCAsmBackend(const MCAsmBackend &) = delete; MCAsmBackend &operator=(const MCAsmBackend &) = delete; virtual ~MCAsmBackend(); - const support::endianness Endian; + const llvm::endianness Endian; /// Fixup kind used for linker relaxation. Currently only used by RISC-V. const unsigned RelaxFixupKind; diff --git a/llvm/include/llvm/Object/ELFTypes.h b/llvm/include/llvm/Object/ELFTypes.h index 6295341e15183..f7a1d02e534c5 100644 --- a/llvm/include/llvm/Object/ELFTypes.h +++ b/llvm/include/llvm/Object/ELFTypes.h @@ -740,7 +740,7 @@ template struct Elf_CGProfile_Impl { template struct Elf_Mips_RegInfo; -template +template struct Elf_Mips_RegInfo> { LLVM_ELF_IMPORT_TYPES(TargetEndianness, false) Elf_Word ri_gprmask; // bit-mask of used general registers @@ -748,7 +748,7 @@ struct Elf_Mips_RegInfo> { Elf_Addr ri_gp_value; // gp register value }; -template +template struct Elf_Mips_RegInfo> { LLVM_ELF_IMPORT_TYPES(TargetEndianness, true) Elf_Word ri_gprmask; // bit-mask of used general registers diff --git a/llvm/include/llvm/Object/StackMapParser.h b/llvm/include/llvm/Object/StackMapParser.h index 3560675af564c..37d0377cf93bc 100644 --- a/llvm/include/llvm/Object/StackMapParser.h +++ b/llvm/include/llvm/Object/StackMapParser.h @@ -21,8 +21,7 @@ namespace llvm { /// A parser for the latest stackmap format. At the moment, latest=V3. -template -class StackMapParser { +template class StackMapParser { public: template class AccessorIterator { diff --git a/llvm/include/llvm/ProfileData/Coverage/CoverageMapping.h b/llvm/include/llvm/ProfileData/Coverage/CoverageMapping.h index b2fdbc1936ef2..948203eea8636 100644 --- a/llvm/include/llvm/ProfileData/Coverage/CoverageMapping.h +++ b/llvm/include/llvm/ProfileData/Coverage/CoverageMapping.h @@ -790,26 +790,26 @@ getLineCoverageStats(const coverage::CoverageData &CD) { namespace accessors { /// Return the structural hash associated with the function. -template +template uint64_t getFuncHash(const FuncRecordTy *Record) { return support::endian::byte_swap(Record->FuncHash); } /// Return the coverage map data size for the function. -template +template uint64_t getDataSize(const FuncRecordTy *Record) { return support::endian::byte_swap(Record->DataSize); } /// Return the function lookup key. The value is considered opaque. -template +template uint64_t getFuncNameRef(const FuncRecordTy *Record) { return support::endian::byte_swap(Record->NameRef); } /// Return the PGO name of the function. Used for formats in which the name is /// a hash. -template +template Error getFuncNameViaRef(const FuncRecordTy *Record, InstrProfSymtab &ProfileNames, StringRef &FuncName) { uint64_t NameRef = getFuncNameRef(Record); @@ -820,7 +820,7 @@ Error getFuncNameViaRef(const FuncRecordTy *Record, /// Read coverage mapping out-of-line, from \p MappingBuf. This is used when the /// coverage mapping is attached to the file header, instead of to the function /// record. -template +template StringRef getCoverageMappingOutOfLine(const FuncRecordTy *Record, const char *MappingBuf) { return {MappingBuf, size_t(getDataSize(Record))}; @@ -828,7 +828,7 @@ StringRef getCoverageMappingOutOfLine(const FuncRecordTy *Record, /// Advance to the next out-of-line coverage mapping and its associated /// function record. -template +template std::pair advanceByOneOutOfLine(const FuncRecordTy *Record, const char *MappingBuf) { return {MappingBuf + getDataSize(Record), Record + 1}; @@ -847,21 +847,21 @@ struct CovMapFunctionRecordV1 { #undef COVMAP_V1 CovMapFunctionRecordV1() = delete; - template uint64_t getFuncHash() const { + template uint64_t getFuncHash() const { return accessors::getFuncHash(this); } - template uint64_t getDataSize() const { + template uint64_t getDataSize() const { return accessors::getDataSize(this); } /// Return function lookup key. The value is consider opaque. - template IntPtrT getFuncNameRef() const { + template IntPtrT getFuncNameRef() const { return support::endian::byte_swap(NamePtr); } /// Return the PGO name of the function. - template + template Error getFuncName(InstrProfSymtab &ProfileNames, StringRef &FuncName) const { IntPtrT NameRef = getFuncNameRef(); uint32_t NameS = support::endian::byte_swap(NameSize); @@ -872,17 +872,17 @@ struct CovMapFunctionRecordV1 { return Error::success(); } - template + template std::pair advanceByOne(const char *MappingBuf) const { return accessors::advanceByOneOutOfLine(this, MappingBuf); } - template uint64_t getFilenamesRef() const { + template uint64_t getFilenamesRef() const { llvm_unreachable("V1 function format does not contain a filenames ref"); } - template + template StringRef getCoverageMapping(const char *MappingBuf) const { return accessors::getCoverageMappingOutOfLine(this, MappingBuf); @@ -898,35 +898,35 @@ struct CovMapFunctionRecordV2 { #undef COVMAP_V2 CovMapFunctionRecordV2() = delete; - template uint64_t getFuncHash() const { + template uint64_t getFuncHash() const { return accessors::getFuncHash(this); } - template uint64_t getDataSize() const { + template uint64_t getDataSize() const { return accessors::getDataSize(this); } - template uint64_t getFuncNameRef() const { + template uint64_t getFuncNameRef() const { return accessors::getFuncNameRef(this); } - template + template Error getFuncName(InstrProfSymtab &ProfileNames, StringRef &FuncName) const { return accessors::getFuncNameViaRef(this, ProfileNames, FuncName); } - template + template std::pair advanceByOne(const char *MappingBuf) const { return accessors::advanceByOneOutOfLine(this, MappingBuf); } - template uint64_t getFilenamesRef() const { + template uint64_t getFilenamesRef() const { llvm_unreachable("V2 function format does not contain a filenames ref"); } - template + template StringRef getCoverageMapping(const char *MappingBuf) const { return accessors::getCoverageMappingOutOfLine(this, MappingBuf); @@ -942,39 +942,39 @@ struct CovMapFunctionRecordV3 { #undef COVMAP_V3 CovMapFunctionRecordV3() = delete; - template uint64_t getFuncHash() const { + template uint64_t getFuncHash() const { return accessors::getFuncHash(this); } - template uint64_t getDataSize() const { + template uint64_t getDataSize() const { return accessors::getDataSize(this); } - template uint64_t getFuncNameRef() const { + template uint64_t getFuncNameRef() const { return accessors::getFuncNameRef(this); } - template + template Error getFuncName(InstrProfSymtab &ProfileNames, StringRef &FuncName) const { return accessors::getFuncNameViaRef(this, ProfileNames, FuncName); } /// Get the filename set reference. - template uint64_t getFilenamesRef() const { + template uint64_t getFilenamesRef() const { return support::endian::byte_swap(FilenamesRef); } /// Read the inline coverage mapping. Ignore the buffer parameter, it is for /// out-of-line coverage mapping data only. - template + template StringRef getCoverageMapping(const char *) const { return StringRef(&CoverageMapping, getDataSize()); } // Advance to the next inline coverage mapping and its associated function // record. Ignore the out-of-line coverage mapping buffer. - template + template std::pair advanceByOne(const char *) const { assert(isAddrAligned(Align(8), this) && "Function record not aligned"); @@ -992,19 +992,19 @@ struct CovMapFunctionRecordV3 { struct CovMapHeader { #define COVMAP_HEADER(Type, LLVMType, Name, Init) Type Name; #include "llvm/ProfileData/InstrProfData.inc" - template uint32_t getNRecords() const { + template uint32_t getNRecords() const { return support::endian::byte_swap(NRecords); } - template uint32_t getFilenamesSize() const { + template uint32_t getFilenamesSize() const { return support::endian::byte_swap(FilenamesSize); } - template uint32_t getCoverageSize() const { + template uint32_t getCoverageSize() const { return support::endian::byte_swap(CoverageSize); } - template uint32_t getVersion() const { + template uint32_t getVersion() const { return support::endian::byte_swap(Version); } }; diff --git a/llvm/include/llvm/ProfileData/Coverage/CoverageMappingReader.h b/llvm/include/llvm/ProfileData/Coverage/CoverageMappingReader.h index 326c1b0d33384..346ca4ad2eb31 100644 --- a/llvm/include/llvm/ProfileData/Coverage/CoverageMappingReader.h +++ b/llvm/include/llvm/ProfileData/Coverage/CoverageMappingReader.h @@ -213,7 +213,7 @@ class BinaryCoverageReader : public CoverageMappingReader { FuncRecordsStorage &&FuncRecords, InstrProfSymtab &&ProfileNames, uint8_t BytesInAddress, - support::endianness Endian, + llvm::endianness Endian, StringRef CompilationDir = ""); Error readNextRecord(CoverageMappingRecord &Record) override; diff --git a/llvm/include/llvm/ProfileData/InstrProfData.inc b/llvm/include/llvm/ProfileData/InstrProfData.inc index 8ba7e186d4fb1..13be2753e514e 100644 --- a/llvm/include/llvm/ProfileData/InstrProfData.inc +++ b/llvm/include/llvm/ProfileData/InstrProfData.inc @@ -340,7 +340,7 @@ typedef struct ValueProfRecord { * Do byte swap for this instance. \c Old is the original order before * the swap, and \c New is the New byte order. */ - void swapBytes(support::endianness Old, support::endianness New); + void swapBytes(llvm::endianness Old, llvm::endianness New); #endif } ValueProfRecord; @@ -395,15 +395,15 @@ typedef struct ValueProfData { static Expected> getValueProfData(const unsigned char *SrcBuffer, const unsigned char *const SrcBufferEnd, - support::endianness SrcDataEndianness); + llvm::endianness SrcDataEndianness); /*! * Swap byte order from \c Endianness order to host byte order. */ - void swapBytesToHost(support::endianness Endianness); + void swapBytesToHost(llvm::endianness Endianness); /*! * Swap byte order from host byte order to \c Endianness order. */ - void swapBytesFromHost(support::endianness Endianness); + void swapBytesFromHost(llvm::endianness Endianness); /*! * Return the total size of \c ValueProfileData. */ diff --git a/llvm/include/llvm/ProfileData/InstrProfReader.h b/llvm/include/llvm/ProfileData/InstrProfReader.h index acbc9e21fcc76..5b71c984b5d5c 100644 --- a/llvm/include/llvm/ProfileData/InstrProfReader.h +++ b/llvm/include/llvm/ProfileData/InstrProfReader.h @@ -412,7 +412,7 @@ class RawInstrProfReader : public InstrProfReader { return ShouldSwapBytes ? llvm::byteswap(Int) : Int; } - support::endianness getDataEndianness() const { + llvm::endianness getDataEndianness() const { if (!ShouldSwapBytes) return llvm::endianness::native; if (llvm::endianness::native == llvm::endianness::little) @@ -477,7 +477,7 @@ class InstrProfLookupTrait { // Endianness of the input value profile data. // It should be LE by default, but can be changed // for testing purpose. - support::endianness ValueProfDataEndianness = support::little; + llvm::endianness ValueProfDataEndianness = support::little; public: InstrProfLookupTrait(IndexedInstrProf::HashT HashType, unsigned FormatVersion) @@ -514,7 +514,7 @@ class InstrProfLookupTrait { data_type ReadData(StringRef K, const unsigned char *D, offset_type N); // Used for testing purpose only. - void setValueProfDataEndianness(support::endianness Endianness) { + void setValueProfDataEndianness(llvm::endianness Endianness) { ValueProfDataEndianness = Endianness; } }; @@ -531,7 +531,7 @@ struct InstrProfReaderIndexBase { ArrayRef &Data) = 0; virtual void advanceToNextKey() = 0; virtual bool atEnd() const = 0; - virtual void setValueProfDataEndianness(support::endianness Endianness) = 0; + virtual void setValueProfDataEndianness(llvm::endianness Endianness) = 0; virtual uint64_t getVersion() const = 0; virtual bool isIRLevelProfile() const = 0; virtual bool hasCSIRLevelProfile() const = 0; @@ -580,7 +580,7 @@ class InstrProfReaderIndex : public InstrProfReaderIndexBase { return RecordIterator == HashTable->data_end(); } - void setValueProfDataEndianness(support::endianness Endianness) override { + void setValueProfDataEndianness(llvm::endianness Endianness) override { HashTable->getInfoObj().setValueProfDataEndianness(Endianness); } @@ -753,7 +753,7 @@ class IndexedInstrProfReader : public InstrProfReader { std::unique_ptr RemappingBuffer = nullptr); // Used for testing purpose only. - void setValueProfDataEndianness(support::endianness Endianness) { + void setValueProfDataEndianness(llvm::endianness Endianness) { Index->setValueProfDataEndianness(Endianness); } diff --git a/llvm/include/llvm/ProfileData/InstrProfWriter.h b/llvm/include/llvm/ProfileData/InstrProfWriter.h index e50705ee053ee..311c84a2d52bc 100644 --- a/llvm/include/llvm/ProfileData/InstrProfWriter.h +++ b/llvm/include/llvm/ProfileData/InstrProfWriter.h @@ -170,7 +170,7 @@ class InstrProfWriter { InstrProfKind getProfileKind() const { return ProfileKind; } // Internal interface for testing purpose only. - void setValueProfDataEndianness(support::endianness Endianness); + void setValueProfDataEndianness(llvm::endianness Endianness); void setOutputSparse(bool Sparse); // Compute the overlap b/w this object and Other. Program level result is // stored in Overlap and function level result is stored in FuncLevelOverlap. diff --git a/llvm/include/llvm/Support/ELFAttributeParser.h b/llvm/include/llvm/Support/ELFAttributeParser.h index 75ed82b3f6839..ceb84540d6f6e 100644 --- a/llvm/include/llvm/Support/ELFAttributeParser.h +++ b/llvm/include/llvm/Support/ELFAttributeParser.h @@ -58,7 +58,7 @@ class ELFAttributeParser { ELFAttributeParser(TagNameMap tagNameMap, StringRef vendor) : vendor(vendor), sw(nullptr), tagToStringMap(tagNameMap) {} - Error parse(ArrayRef section, support::endianness endian); + Error parse(ArrayRef section, llvm::endianness endian); std::optional getAttributeValue(unsigned tag) const { auto I = attributes.find(tag); diff --git a/llvm/include/llvm/Support/HashBuilder.h b/llvm/include/llvm/Support/HashBuilder.h index e09e4f2f61d30..097110874400d 100644 --- a/llvm/include/llvm/Support/HashBuilder.h +++ b/llvm/include/llvm/Support/HashBuilder.h @@ -135,7 +135,7 @@ template class HashBuilderBase { /// computation (for example when computing `add((int)123)`). /// Specifiying a non-`native` `Endianness` template parameter allows to compute /// stable hash across platforms with different endianness. -template +template class HashBuilder : public HashBuilderBase { public: explicit HashBuilder(HasherT &Hasher) : HashBuilderBase(Hasher) {} @@ -213,7 +213,7 @@ class HashBuilder : public HashBuilderBase { /// providing a `addHash` templated function. /// /// ``` - /// template + /// template /// void addHash(HashBuilder &HBuilder, /// const UserDefinedStruct &Value); /// ``` @@ -225,7 +225,7 @@ class HashBuilder : public HashBuilderBase { /// int i; /// }; /// - /// template + /// template /// void addHash(HashBuilder &HBuilder, /// const SimpleStruct &Value) { /// HBuilder.add(Value.c); @@ -245,7 +245,7 @@ class HashBuilder : public HashBuilderBase { /// /// // If possible, we want to hash both `I` and `C` in a single /// // `update` call for performance concerns. - /// template + /// template /// friend void addHash(HashBuilder &HBuilder, /// const StructWithFastHash &Value) { /// if (Endianness == llvm::endianness::native) { @@ -275,7 +275,7 @@ class HashBuilder : public HashBuilderBase { /// for (size_t I = 0; I != Size; ++I) /// Elements[I] = I; /// } - /// template + /// template /// friend void addHash(HashBuilder &HBuilder, /// const CustomContainer &Value) { /// if (Endianness == llvm::endianness::native) { diff --git a/llvm/include/llvm/Support/VersionTuple.h b/llvm/include/llvm/Support/VersionTuple.h index 4d58424657b06..e56efeae603d2 100644 --- a/llvm/include/llvm/Support/VersionTuple.h +++ b/llvm/include/llvm/Support/VersionTuple.h @@ -22,7 +22,7 @@ #include namespace llvm { -template class HashBuilder; +template class HashBuilder; class raw_ostream; class StringRef; diff --git a/llvm/include/llvm/Support/YAMLTraits.h b/llvm/include/llvm/Support/YAMLTraits.h index b351ec629cbe5..45bb303409844 100644 --- a/llvm/include/llvm/Support/YAMLTraits.h +++ b/llvm/include/llvm/Support/YAMLTraits.h @@ -1277,7 +1277,7 @@ struct ScalarTraits { // For endian types, we use existing scalar Traits class for the underlying // type. This way endian aware types are supported whenever the traits are // defined for the underlying type. -template +template struct ScalarTraits, std::enable_if_t::value>> { @@ -1301,7 +1301,7 @@ struct ScalarTraits +template struct ScalarEnumerationTraits< support::detail::packed_endian_specific_integral, @@ -1317,7 +1317,7 @@ struct ScalarEnumerationTraits< } }; -template +template struct ScalarBitSetTraits< support::detail::packed_endian_specific_integral, diff --git a/llvm/lib/DWARFLinkerParallel/DWARFLinkerCompileUnit.h b/llvm/lib/DWARFLinkerParallel/DWARFLinkerCompileUnit.h index 3f9ae4ba5d1b9..54666f684f3a3 100644 --- a/llvm/lib/DWARFLinkerParallel/DWARFLinkerCompileUnit.h +++ b/llvm/lib/DWARFLinkerParallel/DWARFLinkerCompileUnit.h @@ -55,7 +55,7 @@ class CompileUnit : public DwarfUnit { CompileUnit(LinkingGlobalData &GlobalData, unsigned ID, StringRef ClangModuleName, DWARFFile &File, OffsetToUnitTy UnitFromOffset, dwarf::FormParams Format, - support::endianness Endianess) + llvm::endianness Endianess) : DwarfUnit(GlobalData, ID, ClangModuleName), File(File), getUnitFromOffset(UnitFromOffset), Stage(Stage::CreatedNotLoaded) { UnitName = File.FileName; @@ -65,7 +65,7 @@ class CompileUnit : public DwarfUnit { CompileUnit(LinkingGlobalData &GlobalData, DWARFUnit &OrigUnit, unsigned ID, StringRef ClangModuleName, DWARFFile &File, OffsetToUnitTy UnitFromOffset, dwarf::FormParams Format, - support::endianness Endianess) + llvm::endianness Endianess) : DwarfUnit(GlobalData, ID, ClangModuleName), File(File), OrigUnit(&OrigUnit), getUnitFromOffset(UnitFromOffset), Stage(Stage::CreatedNotLoaded) { diff --git a/llvm/lib/DWARFLinkerParallel/DWARFLinkerImpl.cpp b/llvm/lib/DWARFLinkerParallel/DWARFLinkerImpl.cpp index b03786b37e505..78f553a125445 100644 --- a/llvm/lib/DWARFLinkerParallel/DWARFLinkerImpl.cpp +++ b/llvm/lib/DWARFLinkerParallel/DWARFLinkerImpl.cpp @@ -64,7 +64,7 @@ Error DWARFLinkerImpl::link() { dwarf::FormParams GlobalFormat = {GlobalData.getOptions().TargetDWARFVersion, 0, dwarf::DwarfFormat::DWARF32}; - support::endianness GlobalEndianness = llvm::endianness::native; + llvm::endianness GlobalEndianness = llvm::endianness::native; if (TheDwarfEmitter) { GlobalEndianness = TheDwarfEmitter->getTargetTriple().isLittleEndian() diff --git a/llvm/lib/DWARFLinkerParallel/OutputSections.h b/llvm/lib/DWARFLinkerParallel/OutputSections.h index c8881297a755d..b101ac61935c5 100644 --- a/llvm/lib/DWARFLinkerParallel/OutputSections.h +++ b/llvm/lib/DWARFLinkerParallel/OutputSections.h @@ -139,7 +139,7 @@ struct SectionDescriptor { friend OutputSections; SectionDescriptor(DebugSectionKind SectionKind, LinkingGlobalData &GlobalData, - dwarf::FormParams Format, support::endianness Endianess) + dwarf::FormParams Format, llvm::endianness Endianess) : OS(Contents), GlobalData(GlobalData), SectionKind(SectionKind), Format(Format), Endianess(Endianess) { ListDebugStrPatch.setAllocator(&GlobalData.getAllocator()); @@ -247,7 +247,7 @@ struct SectionDescriptor { const StringLiteral &getName() const { return getSectionName(SectionKind); } /// Returns endianess used by section. - support::endianness getEndianess() const { return Endianess; } + llvm::endianness getEndianess() const { return Endianess; } /// Returns FormParams used by section. dwarf::FormParams getFormParams() const { return Format; } @@ -266,8 +266,7 @@ struct SectionDescriptor { void applySLEB128(uint64_t PatchOffset, uint64_t Val); /// Sets output format. - void setOutputFormat(dwarf::FormParams Format, - support::endianness Endianess) { + void setOutputFormat(dwarf::FormParams Format, llvm::endianness Endianess) { this->Format = Format; this->Endianess = Endianess; } @@ -288,7 +287,7 @@ struct SectionDescriptor { /// Output format. dwarf::FormParams Format = {4, 4, dwarf::DWARF32}; - support::endianness Endianess = llvm::endianness::little; + llvm::endianness Endianess = llvm::endianness::little; }; /// This class keeps contents and offsets to the debug sections. Any objects @@ -299,8 +298,7 @@ class OutputSections { OutputSections(LinkingGlobalData &GlobalData) : GlobalData(GlobalData) {} /// Sets output format for all keeping sections. - void setOutputFormat(dwarf::FormParams Format, - support::endianness Endianness) { + void setOutputFormat(dwarf::FormParams Format, llvm::endianness Endianness) { this->Format = Format; this->Endianness = Endianness; } @@ -400,7 +398,7 @@ class OutputSections { StringEntryToDwarfStringPoolEntryMap &DebugLineStrStrings); /// Endiannes for the sections. - support::endianness getEndianness() const { return Endianness; } + llvm::endianness getEndianness() const { return Endianness; } /// Return DWARF version. uint16_t getVersion() const { return Format.Version; } @@ -432,7 +430,7 @@ class OutputSections { dwarf::FormParams Format = {4, 4, dwarf::DWARF32}; /// Endiannes for sections. - support::endianness Endianness = llvm::endianness::native; + llvm::endianness Endianness = llvm::endianness::native; /// All keeping sections. using SectionsSetTy = std::map; diff --git a/llvm/lib/ExecutionEngine/JITLink/COFFLinkGraphBuilder.cpp b/llvm/lib/ExecutionEngine/JITLink/COFFLinkGraphBuilder.cpp index 060b3d672340c..0496847a0c26c 100644 --- a/llvm/lib/ExecutionEngine/JITLink/COFFLinkGraphBuilder.cpp +++ b/llvm/lib/ExecutionEngine/JITLink/COFFLinkGraphBuilder.cpp @@ -43,7 +43,7 @@ COFFLinkGraphBuilder::getPointerSize(const object::COFFObjectFile &Obj) { return Obj.getBytesInAddress(); } -support::endianness +llvm::endianness COFFLinkGraphBuilder::getEndianness(const object::COFFObjectFile &Obj) { return Obj.isLittleEndian() ? support::little : support::big; } diff --git a/llvm/lib/ExecutionEngine/JITLink/COFFLinkGraphBuilder.h b/llvm/lib/ExecutionEngine/JITLink/COFFLinkGraphBuilder.h index e64823759540a..3adaa447d9cb8 100644 --- a/llvm/lib/ExecutionEngine/JITLink/COFFLinkGraphBuilder.h +++ b/llvm/lib/ExecutionEngine/JITLink/COFFLinkGraphBuilder.h @@ -162,7 +162,7 @@ class COFFLinkGraphBuilder { const object::coff_section *Section); static bool isComdatSection(const object::coff_section *Section); static unsigned getPointerSize(const object::COFFObjectFile &Obj); - static support::endianness getEndianness(const object::COFFObjectFile &Obj); + static llvm::endianness getEndianness(const object::COFFObjectFile &Obj); static StringRef getDLLImportStubPrefix() { return "__imp_"; } static StringRef getDirectiveSectionName() { return ".drectve"; } StringRef getCOFFSectionName(COFFSectionIndex SectionIndex, diff --git a/llvm/lib/ExecutionEngine/JITLink/ELFLinkGraphBuilder.h b/llvm/lib/ExecutionEngine/JITLink/ELFLinkGraphBuilder.h index 1f545adcdf0e6..56d1efa4bdef7 100644 --- a/llvm/lib/ExecutionEngine/JITLink/ELFLinkGraphBuilder.h +++ b/llvm/lib/ExecutionEngine/JITLink/ELFLinkGraphBuilder.h @@ -193,7 +193,7 @@ ELFLinkGraphBuilder::ELFLinkGraphBuilder( StringRef FileName, LinkGraph::GetEdgeKindNameFunction GetEdgeKindName) : ELFLinkGraphBuilderBase(std::make_unique( FileName.str(), Triple(std::move(TT)), std::move(Features), - ELFT::Is64Bits ? 8 : 4, support::endianness(ELFT::TargetEndianness), + ELFT::Is64Bits ? 8 : 4, llvm::endianness(ELFT::TargetEndianness), std::move(GetEdgeKindName))), Obj(Obj) { LLVM_DEBUG( diff --git a/llvm/lib/ExecutionEngine/JITLink/ELF_aarch32.cpp b/llvm/lib/ExecutionEngine/JITLink/ELF_aarch32.cpp index 4d2dc6846297d..525ece4eea9c0 100644 --- a/llvm/lib/ExecutionEngine/JITLink/ELF_aarch32.cpp +++ b/llvm/lib/ExecutionEngine/JITLink/ELF_aarch32.cpp @@ -114,7 +114,7 @@ class ELFJITLinker_aarch32 : public JITLinker { } }; -template +template class ELFLinkGraphBuilder_aarch32 : public ELFLinkGraphBuilder> { private: diff --git a/llvm/lib/ExecutionEngine/JITLink/ELF_ppc64.cpp b/llvm/lib/ExecutionEngine/JITLink/ELF_ppc64.cpp index e14e1e18e43fd..8ede046e1636e 100644 --- a/llvm/lib/ExecutionEngine/JITLink/ELF_ppc64.cpp +++ b/llvm/lib/ExecutionEngine/JITLink/ELF_ppc64.cpp @@ -33,7 +33,7 @@ constexpr StringRef TOCSymbolAliasIdent = "__TOC__"; constexpr uint64_t ELFTOCBaseOffset = 0x8000; constexpr StringRef ELFTLSInfoSectionName = "$__TLSINFO"; -template +template class TLSInfoTableManager_ELF_ppc64 : public TableManager> { public: @@ -96,7 +96,7 @@ const uint8_t TLSInfoTableManager_ELF_ppc64< 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /*data address*/ }; -template +template Symbol &createELFGOTHeader(LinkGraph &G, ppc64::TOCTableManager &TOC) { Symbol *TOCSymbol = nullptr; @@ -122,7 +122,7 @@ Symbol &createELFGOTHeader(LinkGraph &G, } // Register preexisting GOT entries with TOC table manager. -template +template inline void registerExistingGOTEntries(LinkGraph &G, ppc64::TOCTableManager &TOC) { @@ -140,7 +140,7 @@ registerExistingGOTEntries(LinkGraph &G, } } -template +template Error buildTables_ELF_ppc64(LinkGraph &G) { LLVM_DEBUG(dbgs() << "Visiting edges in graph:\n"); ppc64::TOCTableManager TOC; @@ -189,7 +189,7 @@ Error buildTables_ELF_ppc64(LinkGraph &G) { namespace llvm::jitlink { -template +template class ELFLinkGraphBuilder_ppc64 : public ELFLinkGraphBuilder> { private: @@ -381,7 +381,7 @@ class ELFLinkGraphBuilder_ppc64 FileName, ppc64::getEdgeKindName) {} }; -template +template class ELFJITLinker_ppc64 : public JITLinker> { using JITLinkerBase = JITLinker>; friend JITLinkerBase; @@ -443,7 +443,7 @@ class ELFJITLinker_ppc64 : public JITLinker> { } }; -template +template Expected> createLinkGraphFromELFObject_ppc64(MemoryBufferRef ObjectBuffer) { LLVM_DEBUG({ @@ -467,7 +467,7 @@ createLinkGraphFromELFObject_ppc64(MemoryBufferRef ObjectBuffer) { .buildGraph(); } -template +template void link_ELF_ppc64(std::unique_ptr G, std::unique_ptr Ctx) { PassConfiguration Config; diff --git a/llvm/lib/ExecutionEngine/JITLink/MachOLinkGraphBuilder.cpp b/llvm/lib/ExecutionEngine/JITLink/MachOLinkGraphBuilder.cpp index 0927f2ff4e338..8afedd016f9a1 100644 --- a/llvm/lib/ExecutionEngine/JITLink/MachOLinkGraphBuilder.cpp +++ b/llvm/lib/ExecutionEngine/JITLink/MachOLinkGraphBuilder.cpp @@ -106,7 +106,7 @@ MachOLinkGraphBuilder::getPointerSize(const object::MachOObjectFile &Obj) { return Obj.is64Bit() ? 8 : 4; } -support::endianness +llvm::endianness MachOLinkGraphBuilder::getEndianness(const object::MachOObjectFile &Obj) { return Obj.isLittleEndian() ? support::little : support::big; } diff --git a/llvm/lib/ExecutionEngine/JITLink/MachOLinkGraphBuilder.h b/llvm/lib/ExecutionEngine/JITLink/MachOLinkGraphBuilder.h index 2805c2960b9bd..a4ae0ac1ecfc0 100644 --- a/llvm/lib/ExecutionEngine/JITLink/MachOLinkGraphBuilder.h +++ b/llvm/lib/ExecutionEngine/JITLink/MachOLinkGraphBuilder.h @@ -181,7 +181,7 @@ class MachOLinkGraphBuilder { private: static unsigned getPointerSize(const object::MachOObjectFile &Obj); - static support::endianness getEndianness(const object::MachOObjectFile &Obj); + static llvm::endianness getEndianness(const object::MachOObjectFile &Obj); void setCanonicalSymbol(NormalizedSection &NSec, Symbol &Sym) { auto *&CanonicalSymEntry = NSec.CanonicalSymbols[Sym.getAddress()]; diff --git a/llvm/lib/ExecutionEngine/JITLink/aarch32.cpp b/llvm/lib/ExecutionEngine/JITLink/aarch32.cpp index 124955236cf96..10409b9bdb2aa 100644 --- a/llvm/lib/ExecutionEngine/JITLink/aarch32.cpp +++ b/llvm/lib/ExecutionEngine/JITLink/aarch32.cpp @@ -305,7 +305,7 @@ void writeImmediate(WritableArmRelocation &R, uint32_t Imm) { } Expected readAddendData(LinkGraph &G, Block &B, const Edge &E) { - support::endianness Endian = G.getEndianness(); + llvm::endianness Endian = G.getEndianness(); Edge::Kind Kind = E.getKind(); const char *BlockWorkingMem = B.getContent().data(); diff --git a/llvm/lib/ExecutionEngine/Orc/COFFPlatform.cpp b/llvm/lib/ExecutionEngine/Orc/COFFPlatform.cpp index 3a67a315eab42..c8f5a99099eae 100644 --- a/llvm/lib/ExecutionEngine/Orc/COFFPlatform.cpp +++ b/llvm/lib/ExecutionEngine/Orc/COFFPlatform.cpp @@ -54,7 +54,7 @@ class COFFHeaderMaterializationUnit : public MaterializationUnit { void materialize(std::unique_ptr R) override { unsigned PointerSize; - support::endianness Endianness; + llvm::endianness Endianness; const auto &TT = CP.getExecutionSession().getTargetTriple(); switch (TT.getArch()) { diff --git a/llvm/lib/ExecutionEngine/Orc/Debugging/PerfSupportPlugin.cpp b/llvm/lib/ExecutionEngine/Orc/Debugging/PerfSupportPlugin.cpp index 1c5b9c6078b75..fffecfc978144 100644 --- a/llvm/lib/ExecutionEngine/Orc/Debugging/PerfSupportPlugin.cpp +++ b/llvm/lib/ExecutionEngine/Orc/Debugging/PerfSupportPlugin.cpp @@ -29,7 +29,7 @@ namespace { // to the start of the .eh_frame section. Absolute injects a 64-bit absolute // address space offset 4 bytes from the start instead of 4 bytes Expected createX64EHFrameHeader(Section &EHFrame, - support::endianness endianness, + llvm::endianness endianness, bool absolute) { uint8_t Version = 1; uint8_t EhFramePtrEnc = 0; diff --git a/llvm/lib/ExecutionEngine/Orc/ELFNixPlatform.cpp b/llvm/lib/ExecutionEngine/Orc/ELFNixPlatform.cpp index 6fa8e5b11d179..2b6c4b9e7f431 100644 --- a/llvm/lib/ExecutionEngine/Orc/ELFNixPlatform.cpp +++ b/llvm/lib/ExecutionEngine/Orc/ELFNixPlatform.cpp @@ -40,7 +40,7 @@ class DSOHandleMaterializationUnit : public MaterializationUnit { void materialize(std::unique_ptr R) override { unsigned PointerSize; - support::endianness Endianness; + llvm::endianness Endianness; jitlink::Edge::Kind EdgeKind; const auto &TT = ENP.getExecutionSession().getTargetTriple(); diff --git a/llvm/lib/ExecutionEngine/Orc/ExecutionUtils.cpp b/llvm/lib/ExecutionEngine/Orc/ExecutionUtils.cpp index 9bbb8660a6c35..eb8e6825fad45 100644 --- a/llvm/lib/ExecutionEngine/Orc/ExecutionUtils.cpp +++ b/llvm/lib/ExecutionEngine/Orc/ExecutionUtils.cpp @@ -538,7 +538,7 @@ DLLImportDefinitionGenerator::getTargetPointerSize(const Triple &TT) { } } -Expected +Expected DLLImportDefinitionGenerator::getTargetEndianness(const Triple &TT) { switch (TT.getArch()) { case Triple::x86_64: diff --git a/llvm/lib/ExecutionEngine/Orc/MachOPlatform.cpp b/llvm/lib/ExecutionEngine/Orc/MachOPlatform.cpp index 30376f4631a80..abc0bbbcaad2a 100644 --- a/llvm/lib/ExecutionEngine/Orc/MachOPlatform.cpp +++ b/llvm/lib/ExecutionEngine/Orc/MachOPlatform.cpp @@ -64,7 +64,7 @@ namespace { std::unique_ptr createPlatformGraph(MachOPlatform &MOP, std::string Name) { unsigned PointerSize; - support::endianness Endianness; + llvm::endianness Endianness; const auto &TT = MOP.getExecutionSession().getTargetTriple(); switch (TT.getArch()) { diff --git a/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldChecker.cpp b/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldChecker.cpp index e99f637bb4b2c..68497305f06b7 100644 --- a/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldChecker.cpp +++ b/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldChecker.cpp @@ -806,7 +806,7 @@ class RuntimeDyldCheckerExprEval { RuntimeDyldCheckerImpl::RuntimeDyldCheckerImpl( IsSymbolValidFunction IsSymbolValid, GetSymbolInfoFunction GetSymbolInfo, GetSectionInfoFunction GetSectionInfo, GetStubInfoFunction GetStubInfo, - GetGOTInfoFunction GetGOTInfo, support::endianness Endianness, Triple TT, + GetGOTInfoFunction GetGOTInfo, llvm::endianness Endianness, Triple TT, StringRef CPU, SubtargetFeatures TF, raw_ostream &ErrStream) : IsSymbolValid(std::move(IsSymbolValid)), GetSymbolInfo(std::move(GetSymbolInfo)), @@ -1016,7 +1016,7 @@ std::pair RuntimeDyldCheckerImpl::getStubOrGOTAddrFor( RuntimeDyldChecker::RuntimeDyldChecker( IsSymbolValidFunction IsSymbolValid, GetSymbolInfoFunction GetSymbolInfo, GetSectionInfoFunction GetSectionInfo, GetStubInfoFunction GetStubInfo, - GetGOTInfoFunction GetGOTInfo, support::endianness Endianness, Triple TT, + GetGOTInfoFunction GetGOTInfo, llvm::endianness Endianness, Triple TT, StringRef CPU, SubtargetFeatures TF, raw_ostream &ErrStream) : Impl(::std::make_unique( std::move(IsSymbolValid), std::move(GetSymbolInfo), diff --git a/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldCheckerImpl.h b/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldCheckerImpl.h index d2a969b0f2119..9f44a9389f473 100644 --- a/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldCheckerImpl.h +++ b/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldCheckerImpl.h @@ -28,11 +28,13 @@ class RuntimeDyldCheckerImpl { using GetGOTInfoFunction = RuntimeDyldChecker::GetGOTInfoFunction; public: - RuntimeDyldCheckerImpl( - IsSymbolValidFunction IsSymbolValid, GetSymbolInfoFunction GetSymbolInfo, - GetSectionInfoFunction GetSectionInfo, GetStubInfoFunction GetStubInfo, - GetGOTInfoFunction GetGOTInfo, support::endianness Endianness, Triple TT, - StringRef CPU, SubtargetFeatures TF, llvm::raw_ostream &ErrStream); + RuntimeDyldCheckerImpl(IsSymbolValidFunction IsSymbolValid, + GetSymbolInfoFunction GetSymbolInfo, + GetSectionInfoFunction GetSectionInfo, + GetStubInfoFunction GetStubInfo, + GetGOTInfoFunction GetGOTInfo, + llvm::endianness Endianness, Triple TT, StringRef CPU, + SubtargetFeatures TF, llvm::raw_ostream &ErrStream); bool check(StringRef CheckExpr) const; bool checkAllRulesInBuffer(StringRef RulePrefix, MemoryBuffer *MemBuf) const; @@ -71,7 +73,7 @@ class RuntimeDyldCheckerImpl { GetSectionInfoFunction GetSectionInfo; GetStubInfoFunction GetStubInfo; GetGOTInfoFunction GetGOTInfo; - support::endianness Endianness; + llvm::endianness Endianness; Triple TT; std::string CPU; SubtargetFeatures TF; diff --git a/llvm/lib/MC/MCAsmBackend.cpp b/llvm/lib/MC/MCAsmBackend.cpp index 4ad0e7a809307..0e6fee8643df5 100644 --- a/llvm/lib/MC/MCAsmBackend.cpp +++ b/llvm/lib/MC/MCAsmBackend.cpp @@ -23,7 +23,7 @@ using namespace llvm; -MCAsmBackend::MCAsmBackend(support::endianness Endian, unsigned RelaxFixupKind) +MCAsmBackend::MCAsmBackend(llvm::endianness Endian, unsigned RelaxFixupKind) : Endian(Endian), RelaxFixupKind(RelaxFixupKind) {} MCAsmBackend::~MCAsmBackend() = default; diff --git a/llvm/lib/MC/MCAssembler.cpp b/llvm/lib/MC/MCAssembler.cpp index 1cc408e11447e..c71f0250a31d7 100644 --- a/llvm/lib/MC/MCAssembler.cpp +++ b/llvm/lib/MC/MCAssembler.cpp @@ -521,7 +521,7 @@ static void writeFragment(raw_ostream &OS, const MCAssembler &Asm, // FIXME: Embed in fragments instead? uint64_t FragmentSize = Asm.computeFragmentSize(Layout, F); - support::endianness Endian = Asm.getBackend().Endian; + llvm::endianness Endian = Asm.getBackend().Endian; if (const MCEncodedFragment *EF = dyn_cast(&F)) Asm.writeFragmentPadding(OS, *EF, FragmentSize); diff --git a/llvm/lib/MC/MCDwarf.cpp b/llvm/lib/MC/MCDwarf.cpp index 55632f2fe76a6..189fe2b238425 100644 --- a/llvm/lib/MC/MCDwarf.cpp +++ b/llvm/lib/MC/MCDwarf.cpp @@ -1940,7 +1940,7 @@ void MCDwarfFrameEmitter::encodeAdvanceLoc(MCContext &Context, if (AddrDelta == 0) return; - support::endianness E = + llvm::endianness E = Context.getAsmInfo()->isLittleEndian() ? support::little : support::big; if (isUIntN(6, AddrDelta)) { diff --git a/llvm/lib/ObjectYAML/ELFEmitter.cpp b/llvm/lib/ObjectYAML/ELFEmitter.cpp index a64ab62ef22b6..40f81f867efa4 100644 --- a/llvm/lib/ObjectYAML/ELFEmitter.cpp +++ b/llvm/lib/ObjectYAML/ELFEmitter.cpp @@ -122,7 +122,7 @@ class ContiguousBlobAccumulator { return encodeULEB128(Val, OS); } - template void write(T Val, support::endianness E) { + template void write(T Val, llvm::endianness E) { if (checkLimit(sizeof(T))) support::endian::write(OS, Val, E); } diff --git a/llvm/lib/ProfileData/Coverage/CoverageMappingReader.cpp b/llvm/lib/ProfileData/Coverage/CoverageMappingReader.cpp index dbba5bc8171d8..857498256ec54 100644 --- a/llvm/lib/ProfileData/Coverage/CoverageMappingReader.cpp +++ b/llvm/lib/ProfileData/Coverage/CoverageMappingReader.cpp @@ -535,7 +535,7 @@ struct CovMapFuncRecordReader { const char *OutOfLineMappingBuf, const char *OutOfLineMappingBufEnd) = 0; - template + template static Expected> get(CovMapVersion Version, InstrProfSymtab &P, std::vector &R, StringRef D, @@ -543,7 +543,7 @@ struct CovMapFuncRecordReader { }; // A class for reading coverage mapping function records for a module. -template +template class VersionedCovMapFuncRecordReader : public CovMapFuncRecordReader { using FuncRecordType = typename CovMapTraits::CovMapFuncRecordType; @@ -767,7 +767,7 @@ class VersionedCovMapFuncRecordReader : public CovMapFuncRecordReader { } // end anonymous namespace -template +template Expected> CovMapFuncRecordReader::get( CovMapVersion Version, InstrProfSymtab &P, std::vector &R, StringRef D, @@ -805,7 +805,7 @@ Expected> CovMapFuncRecordReader::get( llvm_unreachable("Unsupported version"); } -template +template static Error readCoverageMappingData( InstrProfSymtab &ProfileNames, StringRef CovMap, StringRef FuncRecords, std::vector &Records, @@ -852,7 +852,7 @@ Expected> BinaryCoverageReader::createCoverageReaderFromBuffer( StringRef Coverage, FuncRecordsStorage &&FuncRecords, InstrProfSymtab &&ProfileNames, uint8_t BytesInAddress, - support::endianness Endian, StringRef CompilationDir) { + llvm::endianness Endian, StringRef CompilationDir) { std::unique_ptr Reader( new BinaryCoverageReader(std::move(FuncRecords))); Reader->ProfileNames = std::move(ProfileNames); @@ -887,7 +887,7 @@ BinaryCoverageReader::createCoverageReaderFromBuffer( static Expected> loadTestingFormat(StringRef Data, StringRef CompilationDir) { uint8_t BytesInAddress = 8; - support::endianness Endian = llvm::endianness::little; + llvm::endianness Endian = llvm::endianness::little; // Read the magic and version. Data = Data.substr(sizeof(TestingFormatMagic)); @@ -1044,7 +1044,7 @@ loadBinaryFormat(std::unique_ptr Bin, StringRef Arch, // The coverage uses native pointer sizes for the object it's written in. uint8_t BytesInAddress = OF->getBytesInAddress(); - support::endianness Endian = + llvm::endianness Endian = OF->isLittleEndian() ? llvm::endianness::little : llvm::endianness::big; // Look for the sections that we are interested in. diff --git a/llvm/lib/ProfileData/InstrProf.cpp b/llvm/lib/ProfileData/InstrProf.cpp index 1375713cb3f80..237caaaeca5a2 100644 --- a/llvm/lib/ProfileData/InstrProf.cpp +++ b/llvm/lib/ProfileData/InstrProf.cpp @@ -982,8 +982,7 @@ void ValueProfRecord::deserializeTo(InstrProfRecord &Record, // For writing/serializing, Old is the host endianness, and New is // byte order intended on disk. For Reading/deserialization, Old // is the on-disk source endianness, and New is the host endianness. -void ValueProfRecord::swapBytes(support::endianness Old, - support::endianness New) { +void ValueProfRecord::swapBytes(llvm::endianness Old, llvm::endianness New) { using namespace support; if (Old == New) @@ -1020,7 +1019,7 @@ void ValueProfData::deserializeTo(InstrProfRecord &Record, } template -static T swapToHostOrder(const unsigned char *&D, support::endianness Orig) { +static T swapToHostOrder(const unsigned char *&D, llvm::endianness Orig) { using namespace support; if (Orig == little) @@ -1060,7 +1059,7 @@ Error ValueProfData::checkIntegrity() { Expected> ValueProfData::getValueProfData(const unsigned char *D, const unsigned char *const BufferEnd, - support::endianness Endianness) { + llvm::endianness Endianness) { using namespace support; if (D + sizeof(ValueProfData) > BufferEnd) @@ -1083,7 +1082,7 @@ ValueProfData::getValueProfData(const unsigned char *D, return std::move(VPD); } -void ValueProfData::swapBytesToHost(support::endianness Endianness) { +void ValueProfData::swapBytesToHost(llvm::endianness Endianness) { using namespace support; if (Endianness == llvm::endianness::native) @@ -1099,7 +1098,7 @@ void ValueProfData::swapBytesToHost(support::endianness Endianness) { } } -void ValueProfData::swapBytesFromHost(support::endianness Endianness) { +void ValueProfData::swapBytesFromHost(llvm::endianness Endianness) { using namespace support; if (Endianness == llvm::endianness::native) diff --git a/llvm/lib/ProfileData/InstrProfWriter.cpp b/llvm/lib/ProfileData/InstrProfWriter.cpp index 2fd09713c9b05..efcc245130561 100644 --- a/llvm/lib/ProfileData/InstrProfWriter.cpp +++ b/llvm/lib/ProfileData/InstrProfWriter.cpp @@ -106,7 +106,7 @@ class InstrProfRecordWriterTrait { using hash_value_type = uint64_t; using offset_type = uint64_t; - support::endianness ValueProfDataEndianness = support::little; + llvm::endianness ValueProfDataEndianness = support::little; InstrProfSummaryBuilder *SummaryBuilder; InstrProfSummaryBuilder *CSSummaryBuilder; @@ -182,8 +182,7 @@ InstrProfWriter::InstrProfWriter(bool Sparse, InstrProfWriter::~InstrProfWriter() { delete InfoObj; } // Internal interface for testing purpose only. -void InstrProfWriter::setValueProfDataEndianness( - support::endianness Endianness) { +void InstrProfWriter::setValueProfDataEndianness(llvm::endianness Endianness) { InfoObj->ValueProfDataEndianness = Endianness; } diff --git a/llvm/lib/Support/ELFAttributeParser.cpp b/llvm/lib/Support/ELFAttributeParser.cpp index 2e90b70dc83f9..3deaab877b385 100644 --- a/llvm/lib/Support/ELFAttributeParser.cpp +++ b/llvm/lib/Support/ELFAttributeParser.cpp @@ -189,7 +189,7 @@ Error ELFAttributeParser::parseSubsection(uint32_t length) { } Error ELFAttributeParser::parse(ArrayRef section, - support::endianness endian) { + llvm::endianness endian) { unsigned sectionNumber = 0; de = DataExtractor(section, endian == support::little, 0); diff --git a/llvm/lib/Target/ARM/MCTargetDesc/ARMAsmBackend.cpp b/llvm/lib/Target/ARM/MCTargetDesc/ARMAsmBackend.cpp index 7016918046203..34ff0732c9fd0 100644 --- a/llvm/lib/Target/ARM/MCTargetDesc/ARMAsmBackend.cpp +++ b/llvm/lib/Target/ARM/MCTargetDesc/ARMAsmBackend.cpp @@ -1326,7 +1326,7 @@ static MCAsmBackend *createARMAsmBackend(const Target &T, const MCSubtargetInfo &STI, const MCRegisterInfo &MRI, const MCTargetOptions &Options, - support::endianness Endian) { + llvm::endianness Endian) { const Triple &TheTriple = STI.getTargetTriple(); switch (TheTriple.getObjectFormat()) { default: diff --git a/llvm/lib/Target/ARM/MCTargetDesc/ARMAsmBackend.h b/llvm/lib/Target/ARM/MCTargetDesc/ARMAsmBackend.h index 64c78d3528955..40d111b797067 100644 --- a/llvm/lib/Target/ARM/MCTargetDesc/ARMAsmBackend.h +++ b/llvm/lib/Target/ARM/MCTargetDesc/ARMAsmBackend.h @@ -20,7 +20,7 @@ namespace llvm { class ARMAsmBackend : public MCAsmBackend { bool isThumbMode; // Currently emitting Thumb code. public: - ARMAsmBackend(const Target &T, bool isThumb, support::endianness Endian) + ARMAsmBackend(const Target &T, bool isThumb, llvm::endianness Endian) : MCAsmBackend(Endian), isThumbMode(isThumb) {} unsigned getNumFixupKinds() const override { diff --git a/llvm/lib/Target/ARM/MCTargetDesc/ARMAsmBackendELF.h b/llvm/lib/Target/ARM/MCTargetDesc/ARMAsmBackendELF.h index 37afdf439e9a0..abbe73e336f50 100644 --- a/llvm/lib/Target/ARM/MCTargetDesc/ARMAsmBackendELF.h +++ b/llvm/lib/Target/ARM/MCTargetDesc/ARMAsmBackendELF.h @@ -20,7 +20,7 @@ class ARMAsmBackendELF : public ARMAsmBackend { public: uint8_t OSABI; ARMAsmBackendELF(const Target &T, bool isThumb, uint8_t OSABI, - support::endianness Endian) + llvm::endianness Endian) : ARMAsmBackend(T, isThumb, Endian), OSABI(OSABI) {} std::unique_ptr diff --git a/llvm/lib/Target/BPF/MCTargetDesc/BPFAsmBackend.cpp b/llvm/lib/Target/BPF/MCTargetDesc/BPFAsmBackend.cpp index f2445d3695e06..9172a52e18e4c 100644 --- a/llvm/lib/Target/BPF/MCTargetDesc/BPFAsmBackend.cpp +++ b/llvm/lib/Target/BPF/MCTargetDesc/BPFAsmBackend.cpp @@ -25,7 +25,7 @@ namespace { class BPFAsmBackend : public MCAsmBackend { public: - BPFAsmBackend(support::endianness Endian) : MCAsmBackend(Endian) {} + BPFAsmBackend(llvm::endianness Endian) : MCAsmBackend(Endian) {} ~BPFAsmBackend() override = default; void applyFixup(const MCAssembler &Asm, const MCFixup &Fixup, diff --git a/llvm/lib/Target/PowerPC/MCTargetDesc/PPCMCCodeEmitter.cpp b/llvm/lib/Target/PowerPC/MCTargetDesc/PPCMCCodeEmitter.cpp index 70f1c9676d6cd..e06b4cdd4e4d5 100644 --- a/llvm/lib/Target/PowerPC/MCTargetDesc/PPCMCCodeEmitter.cpp +++ b/llvm/lib/Target/PowerPC/MCTargetDesc/PPCMCCodeEmitter.cpp @@ -508,7 +508,7 @@ void PPCMCCodeEmitter::encodeInstruction(const MCInst &MI, // Output the constant in big/little endian byte order. unsigned Size = getInstSizeInBytes(MI); - support::endianness E = IsLittleEndian ? support::little : support::big; + llvm::endianness E = IsLittleEndian ? support::little : support::big; switch (Size) { case 0: break; diff --git a/llvm/lib/Target/SPIRV/MCTargetDesc/SPIRVAsmBackend.cpp b/llvm/lib/Target/SPIRV/MCTargetDesc/SPIRVAsmBackend.cpp index 4156a00264115..016f3c4bf9220 100644 --- a/llvm/lib/Target/SPIRV/MCTargetDesc/SPIRVAsmBackend.cpp +++ b/llvm/lib/Target/SPIRV/MCTargetDesc/SPIRVAsmBackend.cpp @@ -18,7 +18,7 @@ namespace { class SPIRVAsmBackend : public MCAsmBackend { public: - SPIRVAsmBackend(support::endianness Endian) : MCAsmBackend(Endian) {} + SPIRVAsmBackend(llvm::endianness Endian) : MCAsmBackend(Endian) {} void applyFixup(const MCAssembler &Asm, const MCFixup &Fixup, const MCValue &Target, MutableArrayRef Data, diff --git a/llvm/lib/Transforms/Instrumentation/GCOVProfiling.cpp b/llvm/lib/Transforms/Instrumentation/GCOVProfiling.cpp index 0dd1ae15d2473..5d66895d0e207 100644 --- a/llvm/lib/Transforms/Instrumentation/GCOVProfiling.cpp +++ b/llvm/lib/Transforms/Instrumentation/GCOVProfiling.cpp @@ -148,7 +148,7 @@ class GCOVProfiler { std::string mangleName(const DICompileUnit *CU, GCovFileType FileType); GCOVOptions Options; - support::endianness Endian; + llvm::endianness Endian; raw_ostream *os; // Checksum, produced by hash of EdgeDestinations diff --git a/llvm/tools/llvm-gsymutil/llvm-gsymutil.cpp b/llvm/tools/llvm-gsymutil/llvm-gsymutil.cpp index dc351c60e8d41..c2de9edf07fe3 100644 --- a/llvm/tools/llvm-gsymutil/llvm-gsymutil.cpp +++ b/llvm/tools/llvm-gsymutil/llvm-gsymutil.cpp @@ -370,7 +370,7 @@ static llvm::Error handleObjectFile(ObjectFile &Obj, return Err; // Save the GSYM file to disk. - support::endianness Endian = + llvm::endianness Endian = Obj.makeTriple().isLittleEndian() ? support::little : support::big; std::optional OptSegmentSize; diff --git a/llvm/tools/llvm-objdump/llvm-objdump.cpp b/llvm/tools/llvm-objdump/llvm-objdump.cpp index d3edc85e46a5a..ac0bded350743 100644 --- a/llvm/tools/llvm-objdump/llvm-objdump.cpp +++ b/llvm/tools/llvm-objdump/llvm-objdump.cpp @@ -1167,7 +1167,7 @@ static uint64_t dumpARMELFData(uint64_t SectionAddr, uint64_t Index, ArrayRef Bytes, ArrayRef MappingSymbols, const MCSubtargetInfo &STI, raw_ostream &OS) { - support::endianness Endian = + llvm::endianness Endian = Obj.isLittleEndian() ? support::little : support::big; size_t Start = OS.tell(); OS << format("%8" PRIx64 ": ", SectionAddr + Index); diff --git a/llvm/tools/llvm-readobj/ELFDumper.cpp b/llvm/tools/llvm-readobj/ELFDumper.cpp index eda3982113f9b..93b645cdfc1a8 100644 --- a/llvm/tools/llvm-readobj/ELFDumper.cpp +++ b/llvm/tools/llvm-readobj/ELFDumper.cpp @@ -363,7 +363,7 @@ template class ELFDumper : public ObjDumper { } void printAttributes(unsigned, std::unique_ptr, - support::endianness); + llvm::endianness); void printMipsReginfo(); void printMipsOptions(); @@ -2885,7 +2885,7 @@ template void ELFDumper::printArchSpecificInfo() { template void ELFDumper::printAttributes( unsigned AttrShType, std::unique_ptr AttrParser, - support::endianness Endianness) { + llvm::endianness Endianness) { assert((AttrShType != ELF::SHT_NULL) && AttrParser && "Incomplete ELF attribute implementation"); DictScope BA(W, "BuildAttributes"); diff --git a/llvm/unittests/DebugInfo/GSYM/GSYMTest.cpp b/llvm/unittests/DebugInfo/GSYM/GSYMTest.cpp index 3f40ff56d7829..b35fa2739e356 100644 --- a/llvm/unittests/DebugInfo/GSYM/GSYMTest.cpp +++ b/llvm/unittests/DebugInfo/GSYM/GSYMTest.cpp @@ -842,7 +842,7 @@ TEST(GSYMTest, TestLineTableEncodeErrors) { static void TestHeaderEncodeError(const Header &H, std::string ExpectedErrorMsg) { - const support::endianness ByteOrder = llvm::support::little; + const llvm::endianness ByteOrder = llvm::support::little; SmallString<512> Str; raw_svector_ostream OutStrm(Str); FileWriter FW(OutStrm, ByteOrder); @@ -852,7 +852,7 @@ static void TestHeaderEncodeError(const Header &H, static void TestHeaderDecodeError(StringRef Bytes, std::string ExpectedErrorMsg) { - const support::endianness ByteOrder = llvm::support::little; + const llvm::endianness ByteOrder = llvm::support::little; uint8_t AddressSize = 4; DataExtractor Data(Bytes, ByteOrder == llvm::support::little, AddressSize); llvm::Expected
Decoded = Header::decode(Data); @@ -919,7 +919,7 @@ TEST(GSYMTest, TestHeaderDecodeErrors) { } static void TestHeaderEncodeDecode(const Header &H, - support::endianness ByteOrder) { + llvm::endianness ByteOrder) { uint8_t AddressSize = 4; SmallString<512> Str; raw_svector_ostream OutStrm(Str); @@ -932,7 +932,6 @@ static void TestHeaderEncodeDecode(const Header &H, // Make sure decoding succeeded. ASSERT_TRUE((bool)Decoded); EXPECT_EQ(H, Decoded.get()); - } TEST(GSYMTest, TestHeaderEncodeDecode) { Header H; @@ -1014,10 +1013,10 @@ static void Compare(const GsymCreator &GC, const GsymReader &GR) { }); } -static void TestEncodeDecode(const GsymCreator &GC, - support::endianness ByteOrder, uint16_t Version, - uint8_t AddrOffSize, uint64_t BaseAddress, - uint32_t NumAddresses, ArrayRef UUID) { +static void TestEncodeDecode(const GsymCreator &GC, llvm::endianness ByteOrder, + uint16_t Version, uint8_t AddrOffSize, + uint64_t BaseAddress, uint32_t NumAddresses, + ArrayRef UUID) { SmallString<512> Str; raw_svector_ostream OutStrm(Str); FileWriter FW(OutStrm, ByteOrder);