[clang] d7b18d5 - Use llvm::endianness{,::little,::native} (NFC)
Kazu Hirata via cfe-commits
cfe-commits at lists.llvm.org
Mon Oct 9 00:54:59 PDT 2023
Author: Kazu Hirata
Date: 2023-10-09T00:54:47-07:00
New Revision: d7b18d5083648c26b94adc2651edb87848138728
URL: https://github.com/llvm/llvm-project/commit/d7b18d5083648c26b94adc2651edb87848138728
DIFF: https://github.com/llvm/llvm-project/commit/d7b18d5083648c26b94adc2651edb87848138728.diff
LOG: Use llvm::endianness{,::little,::native} (NFC)
Now that llvm::support::endianness has been renamed to
llvm::endianness, we can use the shorter form. This patch replaces
llvm::support::endianness with llvm::endianness.
Added:
Modified:
clang/include/clang/Basic/ObjCRuntime.h
clang/include/clang/Basic/Sanitizers.h
clang/include/clang/Lex/HeaderSearchOptions.h
clang/lib/Frontend/CompilerInvocation.cpp
clang/lib/Tooling/DependencyScanning/ModuleDepCollector.cpp
lld/ELF/Config.h
lldb/unittests/tools/lldb-server/tests/MessageObjects.cpp
lldb/unittests/tools/lldb-server/tests/MessageObjects.h
llvm/include/llvm/DebugInfo/GSYM/FileWriter.h
llvm/include/llvm/DebugInfo/GSYM/GsymCreator.h
llvm/include/llvm/DebugInfo/GSYM/GsymReader.h
llvm/include/llvm/Support/BinaryByteStream.h
llvm/include/llvm/Support/BinaryItemStream.h
llvm/include/llvm/Support/BinaryStream.h
llvm/include/llvm/Support/BinaryStreamReader.h
llvm/include/llvm/Support/BinaryStreamRef.h
llvm/include/llvm/Support/BinaryStreamWriter.h
llvm/include/llvm/Support/VersionTuple.h
llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp
llvm/lib/DebugInfo/GSYM/GsymCreator.cpp
llvm/lib/ProfileData/InstrProfReader.cpp
llvm/lib/Support/BinaryStreamRef.cpp
llvm/lib/Support/BinaryStreamWriter.cpp
llvm/lib/Target/ARM/Disassembler/ARMDisassembler.cpp
llvm/lib/Transforms/Instrumentation/MemProfiler.cpp
llvm/tools/llvm-objdump/llvm-objdump.cpp
llvm/unittests/ADT/HashingTest.cpp
llvm/unittests/DebugInfo/GSYM/GSYMTest.cpp
llvm/unittests/Support/HashBuilderTest.cpp
Removed:
################################################################################
diff --git a/clang/include/clang/Basic/ObjCRuntime.h b/clang/include/clang/Basic/ObjCRuntime.h
index d783154c3f9f135..500b2462f007736 100644
--- a/clang/include/clang/Basic/ObjCRuntime.h
+++ b/clang/include/clang/Basic/ObjCRuntime.h
@@ -482,7 +482,7 @@ class ObjCRuntime {
return llvm::hash_combine(OCR.getKind(), OCR.getVersion());
}
- template <typename HasherT, llvm::support::endianness Endianness>
+ template <typename HasherT, llvm::endianness Endianness>
friend void addHash(llvm::HashBuilder<HasherT, Endianness> &HBuilder,
const ObjCRuntime &OCR) {
HBuilder.add(OCR.getKind(), OCR.getVersion());
diff --git a/clang/include/clang/Basic/Sanitizers.h b/clang/include/clang/Basic/Sanitizers.h
index 090a3a7fa907625..8fdaf2e4ba8ab18 100644
--- a/clang/include/clang/Basic/Sanitizers.h
+++ b/clang/include/clang/Basic/Sanitizers.h
@@ -77,7 +77,7 @@ class SanitizerMask {
llvm::hash_code hash_value() const;
- template <typename HasherT, llvm::support::endianness Endianness>
+ template <typename HasherT, llvm::endianness Endianness>
friend void addHash(llvm::HashBuilder<HasherT, Endianness> &HBuilder,
const SanitizerMask &SM) {
HBuilder.addRange(&SM.maskLoToHigh[0], &SM.maskLoToHigh[kNumElem]);
diff --git a/clang/include/clang/Lex/HeaderSearchOptions.h b/clang/include/clang/Lex/HeaderSearchOptions.h
index 206bc69d7b2cdcb..c7d95006bb779ad 100644
--- a/clang/include/clang/Lex/HeaderSearchOptions.h
+++ b/clang/include/clang/Lex/HeaderSearchOptions.h
@@ -267,7 +267,7 @@ inline llvm::hash_code hash_value(const HeaderSearchOptions::Entry &E) {
return llvm::hash_combine(E.Path, E.Group, E.IsFramework, E.IgnoreSysRoot);
}
-template <typename HasherT, llvm::support::endianness Endianness>
+template <typename HasherT, llvm::endianness Endianness>
inline void addHash(llvm::HashBuilder<HasherT, Endianness> &HBuilder,
const HeaderSearchOptions::Entry &E) {
HBuilder.add(E.Path, E.Group, E.IsFramework, E.IgnoreSysRoot);
@@ -278,7 +278,7 @@ hash_value(const HeaderSearchOptions::SystemHeaderPrefix &SHP) {
return llvm::hash_combine(SHP.Prefix, SHP.IsSystemHeader);
}
-template <typename HasherT, llvm::support::endianness Endianness>
+template <typename HasherT, llvm::endianness Endianness>
inline void addHash(llvm::HashBuilder<HasherT, Endianness> &HBuilder,
const HeaderSearchOptions::SystemHeaderPrefix &SHP) {
HBuilder.add(SHP.Prefix, SHP.IsSystemHeader);
diff --git a/clang/lib/Frontend/CompilerInvocation.cpp b/clang/lib/Frontend/CompilerInvocation.cpp
index f2fe9046a6c1fe2..bb442495f58359c 100644
--- a/clang/lib/Frontend/CompilerInvocation.cpp
+++ b/clang/lib/Frontend/CompilerInvocation.cpp
@@ -4630,7 +4630,7 @@ bool CompilerInvocation::CreateFromArgs(CompilerInvocation &Invocation,
std::string CompilerInvocation::getModuleHash() const {
// FIXME: Consider using SHA1 instead of MD5.
- llvm::HashBuilder<llvm::MD5, llvm::support::endianness::native> HBuilder;
+ llvm::HashBuilder<llvm::MD5, llvm::endianness::native> HBuilder;
// Note: For QoI reasons, the things we use as a hash here should all be
// dumped via the -module-info flag.
diff --git a/clang/lib/Tooling/DependencyScanning/ModuleDepCollector.cpp b/clang/lib/Tooling/DependencyScanning/ModuleDepCollector.cpp
index 5e028c4431fe90f..40115b7b5ae25b3 100644
--- a/clang/lib/Tooling/DependencyScanning/ModuleDepCollector.cpp
+++ b/clang/lib/Tooling/DependencyScanning/ModuleDepCollector.cpp
@@ -295,8 +295,7 @@ void ModuleDepCollector::applyDiscoveredDependencies(CompilerInvocation &CI) {
static std::string getModuleContextHash(const ModuleDeps &MD,
const CowCompilerInvocation &CI,
bool EagerLoadModules) {
- llvm::HashBuilder<llvm::TruncatedBLAKE3<16>,
- llvm::support::endianness::native>
+ llvm::HashBuilder<llvm::TruncatedBLAKE3<16>, llvm::endianness::native>
HashBuilder;
SmallString<32> Scratch;
diff --git a/lld/ELF/Config.h b/lld/ELF/Config.h
index 6a094c4c0ad8241..56229334f9a44ae 100644
--- a/lld/ELF/Config.h
+++ b/lld/ELF/Config.h
@@ -366,7 +366,7 @@ struct Config {
bool isLE;
// endianness::little if isLE is true. endianness::big otherwise.
- llvm::support::endianness endianness;
+ llvm::endianness endianness;
// True if the target is the little-endian MIPS64.
//
diff --git a/lldb/unittests/tools/lldb-server/tests/MessageObjects.cpp b/lldb/unittests/tools/lldb-server/tests/MessageObjects.cpp
index f131bd98c2e84ce..2c6b9a2299dd7d0 100644
--- a/lldb/unittests/tools/lldb-server/tests/MessageObjects.cpp
+++ b/lldb/unittests/tools/lldb-server/tests/MessageObjects.cpp
@@ -201,7 +201,7 @@ Expected<RegisterInfo> RegisterInfoParser::create(StringRef Response) {
Expected<RegisterValue> parseRegisterValue(const RegisterInfo &Info,
StringRef HexValue,
- llvm::support::endianness Endian,
+ llvm::endianness Endian,
bool ZeroPad) {
SmallString<128> Storage;
if (ZeroPad && HexValue.size() < Info.byte_size * 2) {
@@ -224,7 +224,7 @@ Expected<RegisterValue> parseRegisterValue(const RegisterInfo &Info,
//====== StopReply =============================================================
Expected<std::unique_ptr<StopReply>>
-StopReply::create(StringRef Response, llvm::support::endianness Endian,
+StopReply::create(StringRef Response, llvm::endianness Endian,
ArrayRef<RegisterInfo> RegInfos) {
if (Response.size() < 3)
return make_parsing_error("StopReply: Invalid packet");
diff --git a/lldb/unittests/tools/lldb-server/tests/MessageObjects.h b/lldb/unittests/tools/lldb-server/tests/MessageObjects.h
index ff3f76ae3f04e6f..0e0a3b2a9272663 100644
--- a/lldb/unittests/tools/lldb-server/tests/MessageObjects.h
+++ b/lldb/unittests/tools/lldb-server/tests/MessageObjects.h
@@ -31,7 +31,7 @@ class ProcessInfo : public Parser<ProcessInfo> {
public:
static llvm::Expected<ProcessInfo> create(llvm::StringRef response);
lldb::pid_t GetPid() const;
- llvm::support::endianness GetEndian() const;
+ llvm::endianness GetEndian() const;
private:
ProcessInfo() = default;
@@ -43,7 +43,7 @@ class ProcessInfo : public Parser<ProcessInfo> {
uint32_t m_effective_gid;
std::string m_triple;
llvm::SmallString<16> m_ostype;
- llvm::support::endianness m_endian;
+ llvm::endianness m_endian;
unsigned int m_ptrsize;
};
@@ -85,7 +85,7 @@ struct RegisterInfoParser : public Parser<lldb_private::RegisterInfo> {
llvm::Expected<lldb_private::RegisterValue>
parseRegisterValue(const lldb_private::RegisterInfo &Info,
- llvm::StringRef HexValue, llvm::support::endianness Endian,
+ llvm::StringRef HexValue, llvm::endianness Endian,
bool ZeroPad = false);
class StopReply : public Parser<std::unique_ptr<StopReply>> {
@@ -94,7 +94,7 @@ class StopReply : public Parser<std::unique_ptr<StopReply>> {
virtual ~StopReply() = default;
static llvm::Expected<std::unique_ptr<StopReply>>
- create(llvm::StringRef Response, llvm::support::endianness Endian,
+ create(llvm::StringRef Response, llvm::endianness Endian,
llvm::ArrayRef<lldb_private::RegisterInfo> RegInfos);
// for llvm::cast<>
@@ -114,7 +114,7 @@ class StopReplyStop : public StopReply {
Reason(Reason) {}
static llvm::Expected<std::unique_ptr<StopReplyStop>>
- create(llvm::StringRef Response, llvm::support::endianness Endian,
+ create(llvm::StringRef Response, llvm::endianness Endian,
llvm::ArrayRef<lldb_private::RegisterInfo> RegInfos);
const RegisterMap &getThreadPcs() const { return ThreadPcs; }
@@ -131,7 +131,7 @@ class StopReplyStop : public StopReply {
private:
static llvm::Expected<RegisterMap> parseRegisters(
const llvm::StringMap<llvm::SmallVector<llvm::StringRef, 2>> &Elements,
- llvm::support::endianness Endian,
+ llvm::endianness Endian,
llvm::ArrayRef<lldb_private::RegisterInfo> RegInfos);
uint8_t Signal;
diff --git a/llvm/include/llvm/DebugInfo/GSYM/FileWriter.h b/llvm/include/llvm/DebugInfo/GSYM/FileWriter.h
index 74811240e0b5e4f..b6bfcb115d8a2ed 100644
--- a/llvm/include/llvm/DebugInfo/GSYM/FileWriter.h
+++ b/llvm/include/llvm/DebugInfo/GSYM/FileWriter.h
@@ -28,9 +28,10 @@ namespace gsym {
/// offsets and sizes.
class FileWriter {
llvm::raw_pwrite_stream &OS;
- llvm::support::endianness ByteOrder;
+ llvm::endianness ByteOrder;
+
public:
- FileWriter(llvm::raw_pwrite_stream &S, llvm::support::endianness B)
+ FileWriter(llvm::raw_pwrite_stream &S, llvm::endianness B)
: OS(S), ByteOrder(B) {}
~FileWriter();
/// Write a single uint8_t value into the stream at the current file
@@ -113,7 +114,7 @@ class FileWriter {
return OS;
}
- llvm::support::endianness getByteOrder() const { return ByteOrder; }
+ llvm::endianness getByteOrder() const { return ByteOrder; }
private:
FileWriter(const FileWriter &rhs) = delete;
diff --git a/llvm/include/llvm/DebugInfo/GSYM/GsymCreator.h b/llvm/include/llvm/DebugInfo/GSYM/GsymCreator.h
index fd9204dba80ef32..bb52f3f2cd56bc0 100644
--- a/llvm/include/llvm/DebugInfo/GSYM/GsymCreator.h
+++ b/llvm/include/llvm/DebugInfo/GSYM/GsymCreator.h
@@ -278,8 +278,7 @@ class GsymCreator {
/// \param Path The path prefix to use when saving the GSYM files.
/// \param ByteOrder The endianness to use when saving the file.
/// \param SegmentSize The size in bytes to segment the GSYM file into.
- llvm::Error saveSegments(StringRef Path,
- llvm::support::endianness ByteOrder,
+ llvm::Error saveSegments(StringRef Path, llvm::endianness ByteOrder,
uint64_t SegmentSize) const;
/// Let this creator know that this is a segment of another GsymCreator.
@@ -308,7 +307,7 @@ class GsymCreator {
/// a single GSYM file that contains all function
/// information will be created.
/// \returns An error object that indicates success or failure of the save.
- llvm::Error save(StringRef Path, llvm::support::endianness ByteOrder,
+ llvm::Error save(StringRef Path, llvm::endianness ByteOrder,
std::optional<uint64_t> SegmentSize = std::nullopt) const;
/// Encode a GSYM into the file writer stream at the current position.
diff --git a/llvm/include/llvm/DebugInfo/GSYM/GsymReader.h b/llvm/include/llvm/DebugInfo/GSYM/GsymReader.h
index 5c0ab87dca3035c..cd4fdfa0e9e37d9 100644
--- a/llvm/include/llvm/DebugInfo/GSYM/GsymReader.h
+++ b/llvm/include/llvm/DebugInfo/GSYM/GsymReader.h
@@ -47,7 +47,7 @@ class GsymReader {
std::unique_ptr<MemoryBuffer> MemBuffer;
StringRef GsymBytes;
- llvm::support::endianness Endian;
+ llvm::endianness Endian;
const Header *Hdr = nullptr;
ArrayRef<uint8_t> AddrOffsets;
ArrayRef<uint32_t> AddrInfoOffsets;
diff --git a/llvm/include/llvm/Support/BinaryByteStream.h b/llvm/include/llvm/Support/BinaryByteStream.h
index 474a8df3ab38170..d313994fd5b43e8 100644
--- a/llvm/include/llvm/Support/BinaryByteStream.h
+++ b/llvm/include/llvm/Support/BinaryByteStream.h
@@ -30,12 +30,12 @@ namespace llvm {
class BinaryByteStream : public BinaryStream {
public:
BinaryByteStream() = default;
- BinaryByteStream(ArrayRef<uint8_t> Data, llvm::support::endianness Endian)
+ BinaryByteStream(ArrayRef<uint8_t> Data, llvm::endianness Endian)
: Endian(Endian), Data(Data) {}
- BinaryByteStream(StringRef Data, llvm::support::endianness Endian)
+ BinaryByteStream(StringRef Data, llvm::endianness Endian)
: Endian(Endian), Data(Data.bytes_begin(), Data.bytes_end()) {}
- llvm::support::endianness getEndian() const override { return Endian; }
+ llvm::endianness getEndian() const override { return Endian; }
Error readBytes(uint64_t Offset, uint64_t Size,
ArrayRef<uint8_t> &Buffer) override {
@@ -63,7 +63,7 @@ class BinaryByteStream : public BinaryStream {
}
protected:
- llvm::support::endianness Endian;
+ llvm::endianness Endian;
ArrayRef<uint8_t> Data;
};
@@ -74,7 +74,7 @@ class BinaryByteStream : public BinaryStream {
class MemoryBufferByteStream : public BinaryByteStream {
public:
MemoryBufferByteStream(std::unique_ptr<MemoryBuffer> Buffer,
- llvm::support::endianness Endian)
+ llvm::endianness Endian)
: BinaryByteStream(Buffer->getBuffer(), Endian),
MemBuffer(std::move(Buffer)) {}
@@ -89,10 +89,10 @@ class MutableBinaryByteStream : public WritableBinaryStream {
public:
MutableBinaryByteStream() = default;
MutableBinaryByteStream(MutableArrayRef<uint8_t> Data,
- llvm::support::endianness Endian)
+ llvm::endianness Endian)
: Data(Data), ImmutableStream(Data, Endian) {}
- llvm::support::endianness getEndian() const override {
+ llvm::endianness getEndian() const override {
return ImmutableStream.getEndian();
}
@@ -133,16 +133,15 @@ class MutableBinaryByteStream : public WritableBinaryStream {
/// causing the underlying data to grow. This class owns the underlying data.
class AppendingBinaryByteStream : public WritableBinaryStream {
std::vector<uint8_t> Data;
- llvm::support::endianness Endian = llvm::support::little;
+ llvm::endianness Endian = llvm::support::little;
public:
AppendingBinaryByteStream() = default;
- AppendingBinaryByteStream(llvm::support::endianness Endian)
- : Endian(Endian) {}
+ AppendingBinaryByteStream(llvm::endianness Endian) : Endian(Endian) {}
void clear() { Data.clear(); }
- llvm::support::endianness getEndian() const override { return Endian; }
+ llvm::endianness getEndian() const override { return Endian; }
Error readBytes(uint64_t Offset, uint64_t Size,
ArrayRef<uint8_t> &Buffer) override {
@@ -204,7 +203,7 @@ class FileBufferByteStream : public WritableBinaryStream {
class StreamImpl : public MutableBinaryByteStream {
public:
StreamImpl(std::unique_ptr<FileOutputBuffer> Buffer,
- llvm::support::endianness Endian)
+ llvm::endianness Endian)
: MutableBinaryByteStream(
MutableArrayRef<uint8_t>(Buffer->getBufferStart(),
Buffer->getBufferEnd()),
@@ -230,12 +229,10 @@ class FileBufferByteStream : public WritableBinaryStream {
public:
FileBufferByteStream(std::unique_ptr<FileOutputBuffer> Buffer,
- llvm::support::endianness Endian)
+ llvm::endianness Endian)
: Impl(std::move(Buffer), Endian) {}
- llvm::support::endianness getEndian() const override {
- return Impl.getEndian();
- }
+ llvm::endianness getEndian() const override { return Impl.getEndian(); }
Error readBytes(uint64_t Offset, uint64_t Size,
ArrayRef<uint8_t> &Buffer) override {
diff --git a/llvm/include/llvm/Support/BinaryItemStream.h b/llvm/include/llvm/Support/BinaryItemStream.h
index eb512bf4721a8d3..472ef004744c5ce 100644
--- a/llvm/include/llvm/Support/BinaryItemStream.h
+++ b/llvm/include/llvm/Support/BinaryItemStream.h
@@ -33,10 +33,9 @@ template <typename T> struct BinaryItemTraits {
template <typename T, typename Traits = BinaryItemTraits<T>>
class BinaryItemStream : public BinaryStream {
public:
- explicit BinaryItemStream(llvm::support::endianness Endian)
- : Endian(Endian) {}
+ explicit BinaryItemStream(llvm::endianness Endian) : Endian(Endian) {}
- llvm::support::endianness getEndian() const override { return Endian; }
+ llvm::endianness getEndian() const override { return Endian; }
Error readBytes(uint64_t Offset, uint64_t Size,
ArrayRef<uint8_t> &Buffer) override {
@@ -94,7 +93,7 @@ class BinaryItemStream : public BinaryStream {
return Idx;
}
- llvm::support::endianness Endian;
+ llvm::endianness Endian;
ArrayRef<T> Items;
// Sorted vector of offsets to accelerate lookup.
diff --git a/llvm/include/llvm/Support/BinaryStream.h b/llvm/include/llvm/Support/BinaryStream.h
index e87129d8c201f37..4a683f7253f0f84 100644
--- a/llvm/include/llvm/Support/BinaryStream.h
+++ b/llvm/include/llvm/Support/BinaryStream.h
@@ -36,7 +36,7 @@ class BinaryStream {
public:
virtual ~BinaryStream() = default;
- virtual llvm::support::endianness getEndian() const = 0;
+ virtual llvm::endianness getEndian() const = 0;
/// Given an offset into the stream and a number of bytes, attempt to
/// read the bytes and set the output ArrayRef to point to data owned by the
diff --git a/llvm/include/llvm/Support/BinaryStreamReader.h b/llvm/include/llvm/Support/BinaryStreamReader.h
index 6a608d7167e5ac2..ca99388c5d03afe 100644
--- a/llvm/include/llvm/Support/BinaryStreamReader.h
+++ b/llvm/include/llvm/Support/BinaryStreamReader.h
@@ -31,9 +31,8 @@ class BinaryStreamReader {
BinaryStreamReader() = default;
explicit BinaryStreamReader(BinaryStreamRef Ref);
explicit BinaryStreamReader(BinaryStream &Stream);
- explicit BinaryStreamReader(ArrayRef<uint8_t> Data,
- llvm::support::endianness Endian);
- explicit BinaryStreamReader(StringRef Data, llvm::support::endianness Endian);
+ explicit BinaryStreamReader(ArrayRef<uint8_t> Data, llvm::endianness Endian);
+ explicit BinaryStreamReader(StringRef Data, llvm::endianness Endian);
BinaryStreamReader(const BinaryStreamReader &Other) = default;
diff --git a/llvm/include/llvm/Support/BinaryStreamRef.h b/llvm/include/llvm/Support/BinaryStreamRef.h
index 0cea224527ac50f..fdc46f5fd56057d 100644
--- a/llvm/include/llvm/Support/BinaryStreamRef.h
+++ b/llvm/include/llvm/Support/BinaryStreamRef.h
@@ -43,9 +43,7 @@ template <class RefType, class StreamType> class BinaryStreamRefBase {
BinaryStreamRefBase(BinaryStreamRefBase &&Other) = default;
public:
- llvm::support::endianness getEndian() const {
- return BorrowedImpl->getEndian();
- }
+ llvm::endianness getEndian() const { return BorrowedImpl->getEndian(); }
uint64_t getLength() const {
if (Length)
@@ -165,9 +163,8 @@ class BinaryStreamRef
BinaryStreamRef(BinaryStream &Stream);
BinaryStreamRef(BinaryStream &Stream, uint64_t Offset,
std::optional<uint64_t> Length);
- explicit BinaryStreamRef(ArrayRef<uint8_t> Data,
- llvm::support::endianness Endian);
- explicit BinaryStreamRef(StringRef Data, llvm::support::endianness Endian);
+ explicit BinaryStreamRef(ArrayRef<uint8_t> Data, llvm::endianness Endian);
+ explicit BinaryStreamRef(StringRef Data, llvm::endianness Endian);
BinaryStreamRef(const BinaryStreamRef &Other) = default;
BinaryStreamRef &operator=(const BinaryStreamRef &Other) = default;
@@ -240,7 +237,7 @@ class WritableBinaryStreamRef
WritableBinaryStreamRef(WritableBinaryStream &Stream, uint64_t Offset,
std::optional<uint64_t> Length);
explicit WritableBinaryStreamRef(MutableArrayRef<uint8_t> Data,
- llvm::support::endianness Endian);
+ llvm::endianness Endian);
WritableBinaryStreamRef(const WritableBinaryStreamRef &Other) = default;
WritableBinaryStreamRef &
operator=(const WritableBinaryStreamRef &Other) = default;
diff --git a/llvm/include/llvm/Support/BinaryStreamWriter.h b/llvm/include/llvm/Support/BinaryStreamWriter.h
index 5a56c9fcc46bd94..bc1d7949841d6f4 100644
--- a/llvm/include/llvm/Support/BinaryStreamWriter.h
+++ b/llvm/include/llvm/Support/BinaryStreamWriter.h
@@ -33,7 +33,7 @@ class BinaryStreamWriter {
explicit BinaryStreamWriter(WritableBinaryStreamRef Ref);
explicit BinaryStreamWriter(WritableBinaryStream &Stream);
explicit BinaryStreamWriter(MutableArrayRef<uint8_t> Data,
- llvm::support::endianness Endian);
+ llvm::endianness Endian);
BinaryStreamWriter(const BinaryStreamWriter &Other) = default;
diff --git a/llvm/include/llvm/Support/VersionTuple.h b/llvm/include/llvm/Support/VersionTuple.h
index b85500e20d1bdd3..4d58424657b0672 100644
--- a/llvm/include/llvm/Support/VersionTuple.h
+++ b/llvm/include/llvm/Support/VersionTuple.h
@@ -173,7 +173,7 @@ class VersionTuple {
return hash_combine(VT.Major, VT.Minor, VT.Subminor, VT.Build);
}
- template <typename HasherT, llvm::support::endianness Endianness>
+ template <typename HasherT, llvm::endianness Endianness>
friend void addHash(HashBuilder<HasherT, Endianness> &HBuilder,
const VersionTuple &VT) {
HBuilder.add(VT.Major, VT.Minor, VT.Subminor, VT.Build);
diff --git a/llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp b/llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp
index 4ff056042c6f95e..a41d0357bf343bf 100644
--- a/llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp
+++ b/llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp
@@ -3353,7 +3353,7 @@ void CodeViewDebug::emitConstantSymbolRecord(const DIType *DTy, APSInt &Value,
// Encoded integers shouldn't need more than 10 bytes.
uint8_t Data[10];
- BinaryStreamWriter Writer(Data, llvm::support::endianness::little);
+ BinaryStreamWriter Writer(Data, llvm::endianness::little);
CodeViewRecordIO IO(Writer);
cantFail(IO.mapEncodedInteger(Value));
StringRef SRef((char *)Data, Writer.getOffset());
diff --git a/llvm/lib/DebugInfo/GSYM/GsymCreator.cpp b/llvm/lib/DebugInfo/GSYM/GsymCreator.cpp
index 6006b86aa3858f2..ee7b0efba5ea472 100644
--- a/llvm/lib/DebugInfo/GSYM/GsymCreator.cpp
+++ b/llvm/lib/DebugInfo/GSYM/GsymCreator.cpp
@@ -61,9 +61,7 @@ uint32_t GsymCreator::copyFile(const GsymCreator &SrcGC, uint32_t FileIdx) {
return insertFileEntry(DstFE);
}
-
-llvm::Error GsymCreator::save(StringRef Path,
- llvm::support::endianness ByteOrder,
+llvm::Error GsymCreator::save(StringRef Path, llvm::endianness ByteOrder,
std::optional<uint64_t> SegmentSize) const {
if (SegmentSize)
return saveSegments(Path, ByteOrder, *SegmentSize);
@@ -478,7 +476,7 @@ uint64_t GsymCreator::copyFunctionInfo(const GsymCreator &SrcGC, size_t FuncIdx)
}
llvm::Error GsymCreator::saveSegments(StringRef Path,
- llvm::support::endianness ByteOrder,
+ llvm::endianness ByteOrder,
uint64_t SegmentSize) const {
if (SegmentSize == 0)
return createStringError(std::errc::invalid_argument,
diff --git a/llvm/lib/ProfileData/InstrProfReader.cpp b/llvm/lib/ProfileData/InstrProfReader.cpp
index 125184d4020840d..f3fd7fee4f45f40 100644
--- a/llvm/lib/ProfileData/InstrProfReader.cpp
+++ b/llvm/lib/ProfileData/InstrProfReader.cpp
@@ -92,7 +92,7 @@ readBinaryIdsInternal(const MemoryBuffer &DataBuffer,
const uint64_t BinaryIdsSize,
const uint8_t *BinaryIdsStart,
std::vector<llvm::object::BuildID> &BinaryIds,
- const llvm::support::endianness Endian) {
+ const llvm::endianness Endian) {
using namespace support;
if (BinaryIdsSize == 0)
@@ -145,7 +145,7 @@ static Error printBinaryIdsInternal(raw_ostream &OS,
const MemoryBuffer &DataBuffer,
uint64_t BinaryIdsSize,
const uint8_t *BinaryIdsStart,
- llvm::support::endianness Endian) {
+ llvm::endianness Endian) {
if (BinaryIdsSize == 0)
return Error::success();
diff --git a/llvm/lib/Support/BinaryStreamRef.cpp b/llvm/lib/Support/BinaryStreamRef.cpp
index 0ef00af4fcb7d5a..acb1dff889f5cf9 100644
--- a/llvm/lib/Support/BinaryStreamRef.cpp
+++ b/llvm/lib/Support/BinaryStreamRef.cpp
@@ -18,9 +18,7 @@ class ArrayRefImpl : public BinaryStream {
public:
ArrayRefImpl(ArrayRef<uint8_t> Data, endianness Endian) : BBS(Data, Endian) {}
- llvm::support::endianness getEndian() const override {
- return BBS.getEndian();
- }
+ llvm::endianness getEndian() const override { return BBS.getEndian(); }
Error readBytes(uint64_t Offset, uint64_t Size,
ArrayRef<uint8_t> &Buffer) override {
return BBS.readBytes(Offset, Size, Buffer);
@@ -41,9 +39,7 @@ class MutableArrayRefImpl : public WritableBinaryStream {
: BBS(Data, Endian) {}
// Inherited via WritableBinaryStream
- llvm::support::endianness getEndian() const override {
- return BBS.getEndian();
- }
+ llvm::endianness getEndian() const override { return BBS.getEndian(); }
Error readBytes(uint64_t Offset, uint64_t Size,
ArrayRef<uint8_t> &Buffer) override {
return BBS.readBytes(Offset, Size, Buffer);
diff --git a/llvm/lib/Support/BinaryStreamWriter.cpp b/llvm/lib/Support/BinaryStreamWriter.cpp
index 3d87a30a86a172e..dff08fee3fefaa3 100644
--- a/llvm/lib/Support/BinaryStreamWriter.cpp
+++ b/llvm/lib/Support/BinaryStreamWriter.cpp
@@ -22,7 +22,7 @@ BinaryStreamWriter::BinaryStreamWriter(WritableBinaryStream &Stream)
: Stream(Stream) {}
BinaryStreamWriter::BinaryStreamWriter(MutableArrayRef<uint8_t> Data,
- llvm::support::endianness Endian)
+ llvm::endianness Endian)
: Stream(Data, Endian) {}
Error BinaryStreamWriter::writeBytes(ArrayRef<uint8_t> Buffer) {
diff --git a/llvm/lib/Target/ARM/Disassembler/ARMDisassembler.cpp b/llvm/lib/Target/ARM/Disassembler/ARMDisassembler.cpp
index def54f95409d659..4063a647bec3833 100644
--- a/llvm/lib/Target/ARM/Disassembler/ARMDisassembler.cpp
+++ b/llvm/lib/Target/ARM/Disassembler/ARMDisassembler.cpp
@@ -166,7 +166,7 @@ class ARMDisassembler : public MCDisassembler {
DecodeStatus AddThumbPredicate(MCInst&) const;
void UpdateThumbVFPPredicate(DecodeStatus &, MCInst&) const;
- llvm::support::endianness InstructionEndianness;
+ llvm::endianness InstructionEndianness;
};
} // end anonymous namespace
diff --git a/llvm/lib/Transforms/Instrumentation/MemProfiler.cpp b/llvm/lib/Transforms/Instrumentation/MemProfiler.cpp
index 453dd00488b8ffe..8cd06f878897b38 100644
--- a/llvm/lib/Transforms/Instrumentation/MemProfiler.cpp
+++ b/llvm/lib/Transforms/Instrumentation/MemProfiler.cpp
@@ -628,7 +628,7 @@ static void addCallsiteMetadata(Instruction &I,
static uint64_t computeStackId(GlobalValue::GUID Function, uint32_t LineOffset,
uint32_t Column) {
- llvm::HashBuilder<llvm::TruncatedBLAKE3<8>, llvm::support::endianness::little>
+ llvm::HashBuilder<llvm::TruncatedBLAKE3<8>, llvm::endianness::little>
HashBuilder;
HashBuilder.add(Function, LineOffset, Column);
llvm::BLAKE3Result<8> Hash = HashBuilder.final();
diff --git a/llvm/tools/llvm-objdump/llvm-objdump.cpp b/llvm/tools/llvm-objdump/llvm-objdump.cpp
index fcfce7764e012d0..d3edc85e46a5a6f 100644
--- a/llvm/tools/llvm-objdump/llvm-objdump.cpp
+++ b/llvm/tools/llvm-objdump/llvm-objdump.cpp
@@ -783,12 +783,12 @@ class ARMPrettyPrinter : public PrettyPrinter {
OS << "\t<unknown>";
}
- void setInstructionEndianness(llvm::support::endianness Endianness) {
+ void setInstructionEndianness(llvm::endianness Endianness) {
InstructionEndianness = Endianness;
}
private:
- llvm::support::endianness InstructionEndianness = llvm::support::little;
+ llvm::endianness InstructionEndianness = llvm::support::little;
};
ARMPrettyPrinter ARMPrettyPrinterInst;
diff --git a/llvm/unittests/ADT/HashingTest.cpp b/llvm/unittests/ADT/HashingTest.cpp
index d175f8afee34a45..ab13ee833ce5569 100644
--- a/llvm/unittests/ADT/HashingTest.cpp
+++ b/llvm/unittests/ADT/HashingTest.cpp
@@ -424,7 +424,7 @@ TEST(HashingTest, HashCombineArgs18) {
struct StructWithHashBuilderSupport {
char C;
int I;
- template <typename HasherT, llvm::support::endianness Endianness>
+ template <typename HasherT, llvm::endianness Endianness>
friend void addHash(llvm::HashBuilder<HasherT, Endianness> &HBuilder,
const StructWithHashBuilderSupport &Value) {
HBuilder.add(Value.C, Value.I);
@@ -439,7 +439,7 @@ TEST(HashingTest, HashWithHashBuilder) {
struct StructWithHashBuilderAndHashValueSupport {
char C;
int I;
- template <typename HasherT, llvm::support::endianness Endianness>
+ template <typename HasherT, llvm::endianness Endianness>
friend void addHash(llvm::HashBuilder<HasherT, Endianness> &HBuilder,
const StructWithHashBuilderAndHashValueSupport &Value) {}
friend hash_code
diff --git a/llvm/unittests/DebugInfo/GSYM/GSYMTest.cpp b/llvm/unittests/DebugInfo/GSYM/GSYMTest.cpp
index 481a83fa535e848..3f40ff56d782986 100644
--- a/llvm/unittests/DebugInfo/GSYM/GSYMTest.cpp
+++ b/llvm/unittests/DebugInfo/GSYM/GSYMTest.cpp
@@ -176,7 +176,7 @@ TEST(GSYMTest, TestFunctionInfo) {
EXPECT_LT(FIWithLines, FIWithLinesWithHigherAddress);
}
-static void TestFunctionInfoDecodeError(llvm::support::endianness ByteOrder,
+static void TestFunctionInfoDecodeError(llvm::endianness ByteOrder,
StringRef Bytes,
const uint64_t BaseAddr,
std::string ExpectedErrorMsg) {
@@ -192,7 +192,7 @@ static void TestFunctionInfoDecodeError(llvm::support::endianness ByteOrder,
TEST(GSYMTest, TestFunctionInfoDecodeErrors) {
// Test decoding FunctionInfo objects that ensure we report an appropriate
// error message.
- const llvm::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);
@@ -220,9 +220,9 @@ TEST(GSYMTest, TestFunctionInfoDecodeErrors) {
"0x00000008: unsupported InfoType 4");
}
-static void TestFunctionInfoEncodeError(llvm::support::endianness ByteOrder,
- const FunctionInfo &FI,
- std::string ExpectedErrorMsg) {
+static void TestFunctionInfoEncodeError(llvm::endianness ByteOrder,
+ const FunctionInfo &FI,
+ std::string ExpectedErrorMsg) {
SmallString<512> Str;
raw_svector_ostream OutStrm(Str);
FileWriter FW(OutStrm, ByteOrder);
@@ -255,7 +255,7 @@ TEST(GSYMTest, TestFunctionInfoEncodeErrors) {
"attempted to encode invalid InlineInfo object");
}
-static void TestFunctionInfoEncodeDecode(llvm::support::endianness ByteOrder,
+static void TestFunctionInfoEncodeDecode(llvm::endianness ByteOrder,
const FunctionInfo &FI) {
// Test encoding and decoding FunctionInfo objects.
SmallString<512> Str;
@@ -332,7 +332,7 @@ TEST(GSYMTest, TestFunctionInfoEncoding) {
TestFunctionInfoEncodeDecode(llvm::support::big, FIBoth);
}
-static void TestInlineInfoEncodeDecode(llvm::support::endianness ByteOrder,
+static void TestInlineInfoEncodeDecode(llvm::endianness ByteOrder,
const InlineInfo &Inline) {
// Test encoding and decoding InlineInfo objects
SmallString<512> Str;
@@ -351,7 +351,7 @@ static void TestInlineInfoEncodeDecode(llvm::support::endianness ByteOrder,
EXPECT_EQ(Inline, Decoded.get());
}
-static void TestInlineInfoDecodeError(llvm::support::endianness ByteOrder,
+static void TestInlineInfoDecodeError(llvm::endianness ByteOrder,
StringRef Bytes, const uint64_t BaseAddr,
std::string ExpectedErrorMsg) {
uint8_t AddressSize = 4;
@@ -363,7 +363,7 @@ static void TestInlineInfoDecodeError(llvm::support::endianness ByteOrder,
checkError(ExpectedErrorMsg, Decoded.takeError());
}
-static void TestInlineInfoEncodeError(llvm::support::endianness ByteOrder,
+static void TestInlineInfoEncodeError(llvm::endianness ByteOrder,
const InlineInfo &Inline,
std::string ExpectedErrorMsg) {
SmallString<512> Str;
@@ -509,7 +509,7 @@ TEST(GSYMTest, TestInlineInfoEncodeErrors) {
TEST(GSYMTest, TestInlineInfoDecodeErrors) {
// Test decoding InlineInfo objects that ensure we report an appropriate
// error message.
- const llvm::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);
@@ -571,7 +571,7 @@ TEST(GSYMTest, TestStringTable) {
EXPECT_EQ(StrTab.getString(13), "");
}
-static void TestFileWriterHelper(llvm::support::endianness ByteOrder) {
+static void TestFileWriterHelper(llvm::endianness ByteOrder) {
SmallString<512> Str;
raw_svector_ostream OutStrm(Str);
FileWriter FW(OutStrm, ByteOrder);
@@ -686,7 +686,7 @@ TEST(GSYMTest, TestAddressRangesEncodeDecode) {
TestAddressRangeEncodeDecodeHelper(Ranges, BaseAddr);
}
-static void TestLineTableHelper(llvm::support::endianness ByteOrder,
+static void TestLineTableHelper(llvm::endianness ByteOrder,
const LineTable <) {
SmallString<512> Str;
raw_svector_ostream OutStrm(Str);
@@ -762,7 +762,7 @@ TEST(GSYMTest, TestLineTable) {
ASSERT_FALSE(LT2 < LT2);
}
-static void TestLineTableDecodeError(llvm::support::endianness ByteOrder,
+static void TestLineTableDecodeError(llvm::endianness ByteOrder,
StringRef Bytes, const uint64_t BaseAddr,
std::string ExpectedErrorMsg) {
uint8_t AddressSize = 4;
@@ -777,7 +777,7 @@ static void TestLineTableDecodeError(llvm::support::endianness ByteOrder,
TEST(GSYMTest, TestLineTableDecodeErrors) {
// Test decoding InlineInfo objects that ensure we report an appropriate
// error message.
- const llvm::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);
@@ -813,7 +813,7 @@ TEST(GSYMTest, TestLineTableDecodeErrors) {
TEST(GSYMTest, TestLineTableEncodeErrors) {
const uint64_t BaseAddr = 0x1000;
const uint32_t FileIdx = 1;
- const llvm::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);
@@ -897,7 +897,7 @@ TEST(GSYMTest, TestHeaderEncodeErrors) {
}
TEST(GSYMTest, TestHeaderDecodeErrors) {
- const llvm::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);
@@ -941,7 +941,7 @@ TEST(GSYMTest, TestHeaderEncodeDecode) {
TestHeaderEncodeDecode(H, llvm::support::big);
}
-static void TestGsymCreatorEncodeError(llvm::support::endianness ByteOrder,
+static void TestGsymCreatorEncodeError(llvm::endianness ByteOrder,
const GsymCreator &GC,
std::string ExpectedErrorMsg) {
SmallString<512> Str;
diff --git a/llvm/unittests/Support/HashBuilderTest.cpp b/llvm/unittests/Support/HashBuilderTest.cpp
index 7738897be4e00ab..461b7c3b25d89a0 100644
--- a/llvm/unittests/Support/HashBuilderTest.cpp
+++ b/llvm/unittests/Support/HashBuilderTest.cpp
@@ -21,10 +21,10 @@
// gtest utilities and macros rely on using a single type. So wrap both the
// hasher type and endianness.
-template <typename _HasherT, llvm::support::endianness _Endianness>
+template <typename _HasherT, llvm::endianness _Endianness>
struct HasherTAndEndianness {
using HasherT = _HasherT;
- static constexpr llvm::support::endianness Endianness = _Endianness;
+ static constexpr llvm::endianness Endianness = _Endianness;
};
using HasherTAndEndiannessToTest =
::testing::Types<HasherTAndEndianness<llvm::MD5, llvm::support::big>,
@@ -124,7 +124,7 @@ struct SimpleStruct {
int I;
};
-template <typename HasherT, llvm::support::endianness Endianness>
+template <typename HasherT, llvm::endianness Endianness>
void addHash(llvm::HashBuilder<HasherT, Endianness> &HBuilder,
const SimpleStruct &Value) {
HBuilder.add(Value.C);
@@ -138,7 +138,7 @@ struct StructWithoutCopyOrMove {
StructWithoutCopyOrMove(const StructWithoutCopyOrMove &) = delete;
StructWithoutCopyOrMove &operator=(const StructWithoutCopyOrMove &) = delete;
- template <typename HasherT, llvm::support::endianness Endianness>
+ template <typename HasherT, llvm::endianness Endianness>
friend void addHash(llvm::HashBuilder<HasherT, Endianness> &HBuilder,
const StructWithoutCopyOrMove &Value) {
HBuilder.add(Value.I);
@@ -153,7 +153,7 @@ struct /* __attribute__((packed)) */ StructWithFastHash {
// If possible, we want to hash both `I` and `C` in a single `update`
// call for performance concerns.
- template <typename HasherT, llvm::support::endianness Endianness>
+ template <typename HasherT, llvm::endianness Endianness>
friend void addHash(llvm::HashBuilder<HasherT, Endianness> &HBuilder,
const StructWithFastHash &Value) {
if (Endianness == llvm::endianness::native) {
@@ -177,7 +177,7 @@ struct CustomContainer {
for (size_t I = 0; I != Size; ++I)
Elements[I] = I;
}
- template <typename HasherT, llvm::support::endianness Endianness>
+ template <typename HasherT, llvm::endianness Endianness>
friend void addHash(llvm::HashBuilder<HasherT, Endianness> &HBuilder,
const CustomContainer &Value) {
if (Endianness == llvm::endianness::native) {
@@ -325,13 +325,11 @@ TEST(CustomHasher, CustomHasher) {
};
{
- llvm::HashBuilder<SumHash, llvm::support::endianness::little> HBuilder(0,
- 1);
+ llvm::HashBuilder<SumHash, llvm::endianness::little> HBuilder(0, 1);
EXPECT_EQ(HBuilder.add(0x02, 0x03, 0x400).getHasher().Hash, 0xa);
}
{
- llvm::HashBuilder<SumHash, llvm::support::endianness::little> HBuilder(2,
- 3);
+ llvm::HashBuilder<SumHash, llvm::endianness::little> HBuilder(2, 3);
EXPECT_EQ(HBuilder.add("ab", 'c').getHasher().Hash,
static_cast<uint8_t>(/*seeds*/ 2 + 3 + /*range size*/ 2 +
/*characters*/ 'a' + 'b' + 'c'));
More information about the cfe-commits
mailing list