Skip to content

Commit 6b31b02

Browse files
[Support] Deprecate system_endianness (#68279)
system_endianness() just returns llvm::endianness::native, a compile-time constant equivalent to std::native in C++20. This patch deprecates system_endianness() while replacing all invocations of system_endianness() with llvm::endianness::native. While we are at it, this patch replaces llvm::support::endianness::{big,little} with llvm::endianness::{big,little} in those statements that happen to call system_endianness(). It does not go out of its way to replace other occurrences of llvm::support::endianness::{big,little}.
1 parent b9383a8 commit 6b31b02

File tree

15 files changed

+49
-59
lines changed

15 files changed

+49
-59
lines changed

clang/include/clang/Serialization/ModuleFileExtension.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ class ModuleFileExtension
8686
/// The default implementation of this function simply does nothing, so the
8787
/// presence/absence of this extension does not distinguish module files.
8888
using ExtensionHashBuilder =
89-
llvm::HashBuilder<llvm::MD5, llvm::support::endian::system_endianness()>;
89+
llvm::HashBuilder<llvm::MD5, llvm::endianness::native>;
9090
virtual void hashExtension(ExtensionHashBuilder &HBuilder) const;
9191

9292
/// Create a new module file extension writer, which will be

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ template <typename MachOTraits> class MachOBuilder {
8686
using StringTable = std::vector<StringTableEntry>;
8787

8888
static bool swapStruct() {
89-
return MachOTraits::Endianness != support::endian::system_endianness();
89+
return MachOTraits::Endianness != llvm::endianness::native;
9090
}
9191

9292
public:

llvm/include/llvm/Support/Endian.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,9 @@ struct PickAlignment {
5353

5454
namespace endian {
5555

56-
constexpr endianness system_endianness() {
57-
return sys::IsBigEndianHost ? big : little;
58-
}
56+
LLVM_DEPRECATED("Use llvm::endianness::native instead",
57+
"llvm::endianness::native")
58+
constexpr endianness system_endianness() { return llvm::endianness::native; }
5959

6060
template <typename value_type>
6161
[[nodiscard]] inline value_type byte_swap(value_type value, endianness endian) {

llvm/include/llvm/Support/HashBuilder.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ class HashBuilder : public HashBuilderBase<HasherT> {
170170
// `update` to guarantee the fast path.
171171
add(Value.size());
172172
if (hashbuilder_detail::IsHashableData<T>::value &&
173-
Endianness == support::endian::system_endianness()) {
173+
Endianness == llvm::endianness::native) {
174174
this->update(ArrayRef(reinterpret_cast<const uint8_t *>(Value.begin()),
175175
Value.size() * sizeof(T)));
176176
} else {
@@ -248,7 +248,7 @@ class HashBuilder : public HashBuilderBase<HasherT> {
248248
/// template <typename HasherT, support::endianness Endianness>
249249
/// friend void addHash(HashBuilder<HasherT, Endianness> &HBuilder,
250250
/// const StructWithFastHash &Value) {
251-
/// if (Endianness == support::endian::system_endianness()) {
251+
/// if (Endianness == llvm::endianness::native) {
252252
/// HBuilder.update(ArrayRef(
253253
/// reinterpret_cast<const uint8_t *>(&Value), sizeof(Value)));
254254
/// } else {
@@ -278,7 +278,7 @@ class HashBuilder : public HashBuilderBase<HasherT> {
278278
/// template <typename HasherT, support::endianness Endianness>
279279
/// friend void addHash(HashBuilder<HasherT, Endianness> &HBuilder,
280280
/// const CustomContainer &Value) {
281-
/// if (Endianness == support::endian::system_endianness()) {
281+
/// if (Endianness == llvm::endianness::native) {
282282
/// HBuilder.update(ArrayRef(
283283
/// reinterpret_cast<const uint8_t *>(&Value.Size),
284284
/// sizeof(Value.Size) + Value.Size * sizeof(Value.Elements[0])));
@@ -373,7 +373,7 @@ class HashBuilder : public HashBuilderBase<HasherT> {
373373

374374
template <typename T>
375375
std::enable_if_t<hashbuilder_detail::IsHashableData<T>::value &&
376-
Endianness == support::endian::system_endianness(),
376+
Endianness == llvm::endianness::native,
377377
HashBuilder &>
378378
addRangeElementsImpl(T *First, T *Last, std::forward_iterator_tag) {
379379
this->update(ArrayRef(reinterpret_cast<const uint8_t *>(First),

llvm/lib/DWARFLinkerParallel/DWARFLinkerImpl.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ Error DWARFLinkerImpl::link() {
6464

6565
dwarf::FormParams GlobalFormat = {GlobalData.getOptions().TargetDWARFVersion,
6666
0, dwarf::DwarfFormat::DWARF32};
67-
support::endianness GlobalEndianness = support::endian::system_endianness();
67+
support::endianness GlobalEndianness = llvm::endianness::native;
6868

6969
if (TheDwarfEmitter) {
7070
GlobalEndianness = TheDwarfEmitter->getTargetTriple().isLittleEndian()

llvm/lib/DWARFLinkerParallel/OutputSections.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -432,7 +432,7 @@ class OutputSections {
432432
dwarf::FormParams Format = {4, 4, dwarf::DWARF32};
433433

434434
/// Endiannes for sections.
435-
support::endianness Endianness = support::endian::system_endianness();
435+
support::endianness Endianness = llvm::endianness::native;
436436

437437
/// All keeping sections.
438438
using SectionsSetTy = std::map<DebugSectionKind, SectionDescriptor>;

llvm/lib/DebugInfo/GSYM/FunctionInfo.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ uint64_t FunctionInfo::cacheEncoding() {
101101
if (!isValid())
102102
return 0;
103103
raw_svector_ostream OutStrm(EncodingCache);
104-
FileWriter FW(OutStrm, support::endian::system_endianness());
104+
FileWriter FW(OutStrm, llvm::endianness::native);
105105
llvm::Expected<uint64_t> Result = encode(FW);
106106
if (!Result) {
107107
EncodingCache.clear();
@@ -123,7 +123,7 @@ llvm::Expected<uint64_t> FunctionInfo::encode(FileWriter &Out) const {
123123
// precompute exactly how big FunctionInfo objects encode into so we can
124124
// accurately make segments of a specific size.
125125
if (!EncodingCache.empty() &&
126-
support::endian::system_endianness() == Out.getByteOrder()) {
126+
llvm::endianness::native == Out.getByteOrder()) {
127127
// We already encoded this object, just write out the bytes.
128128
Out.writeData(llvm::ArrayRef<uint8_t>((const uint8_t *)EncodingCache.data(),
129129
EncodingCache.size()));

llvm/lib/DebugInfo/GSYM/GsymReader.cpp

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,10 @@
2323
using namespace llvm;
2424
using namespace gsym;
2525

26-
GsymReader::GsymReader(std::unique_ptr<MemoryBuffer> Buffer) :
27-
MemBuffer(std::move(Buffer)),
28-
Endian(support::endian::system_endianness()) {}
26+
GsymReader::GsymReader(std::unique_ptr<MemoryBuffer> Buffer)
27+
: MemBuffer(std::move(Buffer)), Endian(llvm::endianness::native) {}
2928

30-
GsymReader::GsymReader(GsymReader &&RHS) = default;
29+
GsymReader::GsymReader(GsymReader &&RHS) = default;
3130

3231
GsymReader::~GsymReader() = default;
3332

@@ -60,16 +59,15 @@ GsymReader::create(std::unique_ptr<MemoryBuffer> &MemBuffer) {
6059

6160
llvm::Error
6261
GsymReader::parse() {
63-
BinaryStreamReader FileData(MemBuffer->getBuffer(),
64-
support::endian::system_endianness());
62+
BinaryStreamReader FileData(MemBuffer->getBuffer(), llvm::endianness::native);
6563
// Check for the magic bytes. This file format is designed to be mmap'ed
6664
// into a process and accessed as read only. This is done for performance
6765
// and efficiency for symbolicating and parsing GSYM data.
6866
if (FileData.readObject(Hdr))
6967
return createStringError(std::errc::invalid_argument,
7068
"not enough data for a GSYM header");
7169

72-
const auto HostByteOrder = support::endian::system_endianness();
70+
const auto HostByteOrder = llvm::endianness::native;
7371
switch (Hdr->Magic) {
7472
case GSYM_MAGIC:
7573
Endian = HostByteOrder;

llvm/lib/ExecutionEngine/Orc/MachOPlatform.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ class MachOHeaderMaterializationUnit : public MaterializationUnit {
146146
Hdr.flags = 0;
147147
Hdr.reserved = 0;
148148

149-
if (G.getEndianness() != support::endian::system_endianness())
149+
if (G.getEndianness() != llvm::endianness::native)
150150
MachO::swapStruct(Hdr);
151151

152152
auto HeaderContent = G.allocateContent(
@@ -1460,7 +1460,7 @@ Error MachOPlatform::MachOPlatformPlugin::populateObjCRuntimeObject(
14601460
auto SecContent = SecBlock.getAlreadyMutableContent();
14611461
char *P = SecContent.data();
14621462
auto WriteMachOStruct = [&](auto S) {
1463-
if (G.getEndianness() != support::endian::system_endianness())
1463+
if (G.getEndianness() != llvm::endianness::native)
14641464
MachO::swapStruct(S);
14651465
memcpy(P, &S, sizeof(S));
14661466
P += sizeof(S);

llvm/unittests/DebugInfo/GSYM/GSYMTest.cpp

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -628,7 +628,7 @@ TEST(GSYMTest, TestAddressRangeEncodeDecode) {
628628
// the base address of the parent range for subranges.
629629
SmallString<512> Str;
630630
raw_svector_ostream OutStrm(Str);
631-
const auto ByteOrder = llvm::support::endian::system_endianness();
631+
const auto ByteOrder = llvm::endianness::native;
632632
FileWriter FW(OutStrm, ByteOrder);
633633
const uint64_t BaseAddr = 0x1000;
634634
const AddressRange Range1(0x1000, 0x1010);
@@ -651,7 +651,7 @@ static void TestAddressRangeEncodeDecodeHelper(const AddressRanges &Ranges,
651651
const uint64_t BaseAddr) {
652652
SmallString<512> Str;
653653
raw_svector_ostream OutStrm(Str);
654-
const auto ByteOrder = llvm::support::endian::system_endianness();
654+
const auto ByteOrder = llvm::endianness::native;
655655
FileWriter FW(OutStrm, ByteOrder);
656656
encodeRanges(Ranges, FW, BaseAddr);
657657

@@ -1163,7 +1163,7 @@ TEST(GSYMTest, TestGsymReader) {
11631163
constexpr uint64_t FuncSize = 0x10;
11641164
const uint32_t Func1Name = GC.insertString("foo");
11651165
const uint32_t Func2Name = GC.insertString("bar");
1166-
const auto ByteOrder = support::endian::system_endianness();
1166+
const auto ByteOrder = llvm::endianness::native;
11671167
GC.addFunctionInfo(FunctionInfo(Func1Addr, FuncSize, Func1Name));
11681168
GC.addFunctionInfo(FunctionInfo(Func2Addr, FuncSize, Func2Name));
11691169
Error FinalizeErr = GC.finalize(llvm::nulls());
@@ -1201,7 +1201,7 @@ TEST(GSYMTest, TestGsymLookups) {
12011201
// symbolication.
12021202
GsymCreator GC;
12031203
FunctionInfo FI(0x1000, 0x100, GC.insertString("main"));
1204-
const auto ByteOrder = support::endian::system_endianness();
1204+
const auto ByteOrder = llvm::endianness::native;
12051205
FI.OptLineTable = LineTable();
12061206
const uint32_t MainFileIndex = GC.insertFile("/tmp/main.c");
12071207
const uint32_t FooFileIndex = GC.insertFile("/tmp/foo.h");
@@ -1354,7 +1354,7 @@ TEST(GSYMTest, TestDWARFFunctionWithAddresses) {
13541354
ASSERT_THAT_ERROR(GC.finalize(OS), Succeeded());
13551355
SmallString<512> Str;
13561356
raw_svector_ostream OutStrm(Str);
1357-
const auto ByteOrder = support::endian::system_endianness();
1357+
const auto ByteOrder = llvm::endianness::native;
13581358
FileWriter FW(OutStrm, ByteOrder);
13591359
ASSERT_THAT_ERROR(GC.encode(FW), Succeeded());
13601360
Expected<GsymReader> GR = GsymReader::copyBuffer(OutStrm.str());
@@ -1431,7 +1431,7 @@ TEST(GSYMTest, TestDWARFFunctionWithAddressAndOffset) {
14311431
ASSERT_THAT_ERROR(GC.finalize(OS), Succeeded());
14321432
SmallString<512> Str;
14331433
raw_svector_ostream OutStrm(Str);
1434-
const auto ByteOrder = support::endian::system_endianness();
1434+
const auto ByteOrder = llvm::endianness::native;
14351435
FileWriter FW(OutStrm, ByteOrder);
14361436
ASSERT_THAT_ERROR(GC.encode(FW), Succeeded());
14371437
Expected<GsymReader> GR = GsymReader::copyBuffer(OutStrm.str());
@@ -1538,7 +1538,7 @@ TEST(GSYMTest, TestDWARFStructMethodNoMangled) {
15381538
ASSERT_THAT_ERROR(GC.finalize(OS), Succeeded());
15391539
SmallString<512> Str;
15401540
raw_svector_ostream OutStrm(Str);
1541-
const auto ByteOrder = support::endian::system_endianness();
1541+
const auto ByteOrder = llvm::endianness::native;
15421542
FileWriter FW(OutStrm, ByteOrder);
15431543
ASSERT_THAT_ERROR(GC.encode(FW), Succeeded());
15441544
Expected<GsymReader> GR = GsymReader::copyBuffer(OutStrm.str());
@@ -1643,7 +1643,7 @@ TEST(GSYMTest, TestDWARFTextRanges) {
16431643
ASSERT_THAT_ERROR(GC.finalize(OS), Succeeded());
16441644
SmallString<512> Str;
16451645
raw_svector_ostream OutStrm(Str);
1646-
const auto ByteOrder = support::endian::system_endianness();
1646+
const auto ByteOrder = llvm::endianness::native;
16471647
FileWriter FW(OutStrm, ByteOrder);
16481648
ASSERT_THAT_ERROR(GC.encode(FW), Succeeded());
16491649
Expected<GsymReader> GR = GsymReader::copyBuffer(OutStrm.str());
@@ -1672,7 +1672,7 @@ TEST(GSYMTest, TestEmptySymbolEndAddressOfTextRanges) {
16721672
ASSERT_THAT_ERROR(GC.finalize(OS), Succeeded());
16731673
SmallString<512> Str;
16741674
raw_svector_ostream OutStrm(Str);
1675-
const auto ByteOrder = support::endian::system_endianness();
1675+
const auto ByteOrder = llvm::endianness::native;
16761676
FileWriter FW(OutStrm, ByteOrder);
16771677
ASSERT_THAT_ERROR(GC.encode(FW), Succeeded());
16781678
Expected<GsymReader> GR = GsymReader::copyBuffer(OutStrm.str());
@@ -1841,7 +1841,7 @@ TEST(GSYMTest, TestDWARFInlineInfo) {
18411841
ASSERT_THAT_ERROR(GC.finalize(OS), Succeeded());
18421842
SmallString<512> Str;
18431843
raw_svector_ostream OutStrm(Str);
1844-
const auto ByteOrder = support::endian::system_endianness();
1844+
const auto ByteOrder = llvm::endianness::native;
18451845
FileWriter FW(OutStrm, ByteOrder);
18461846
ASSERT_THAT_ERROR(GC.encode(FW), Succeeded());
18471847
Expected<GsymReader> GR = GsymReader::copyBuffer(OutStrm.str());
@@ -2101,7 +2101,7 @@ TEST(GSYMTest, TestDWARFNoLines) {
21012101
ASSERT_THAT_ERROR(GC.finalize(OS), Succeeded());
21022102
SmallString<512> Str;
21032103
raw_svector_ostream OutStrm(Str);
2104-
const auto ByteOrder = support::endian::system_endianness();
2104+
const auto ByteOrder = llvm::endianness::native;
21052105
FileWriter FW(OutStrm, ByteOrder);
21062106
ASSERT_THAT_ERROR(GC.encode(FW), Succeeded());
21072107
Expected<GsymReader> GR = GsymReader::copyBuffer(OutStrm.str());
@@ -2280,7 +2280,7 @@ TEST(GSYMTest, TestDWARFDeadStripAddr4) {
22802280
ASSERT_THAT_ERROR(GC.finalize(OS), Succeeded());
22812281
SmallString<512> Str;
22822282
raw_svector_ostream OutStrm(Str);
2283-
const auto ByteOrder = support::endian::system_endianness();
2283+
const auto ByteOrder = llvm::endianness::native;
22842284
FileWriter FW(OutStrm, ByteOrder);
22852285
ASSERT_THAT_ERROR(GC.encode(FW), Succeeded());
22862286
Expected<GsymReader> GR = GsymReader::copyBuffer(OutStrm.str());
@@ -2420,7 +2420,7 @@ TEST(GSYMTest, TestDWARFDeadStripAddr8) {
24202420
ASSERT_THAT_ERROR(GC.finalize(OS), Succeeded());
24212421
SmallString<512> Str;
24222422
raw_svector_ostream OutStrm(Str);
2423-
const auto ByteOrder = support::endian::system_endianness();
2423+
const auto ByteOrder = llvm::endianness::native;
24242424
FileWriter FW(OutStrm, ByteOrder);
24252425
ASSERT_THAT_ERROR(GC.encode(FW), Succeeded());
24262426
Expected<GsymReader> GR = GsymReader::copyBuffer(OutStrm.str());
@@ -2507,7 +2507,7 @@ static Expected<GsymReader> FinalizeEncodeAndDecode(GsymCreator &GC) {
25072507
return std::move(FinalizeErr);
25082508
SmallString<1024> Str;
25092509
raw_svector_ostream OutStrm(Str);
2510-
const auto ByteOrder = support::endian::system_endianness();
2510+
const auto ByteOrder = llvm::endianness::native;
25112511
FileWriter FW(OutStrm, ByteOrder);
25122512
llvm::Error Err = GC.encode(FW);
25132513
if (Err)
@@ -3057,7 +3057,7 @@ TEST(GSYMTest, TestDWARFInlineRangeScopes) {
30573057
ASSERT_THAT_ERROR(GC.finalize(OS), Succeeded());
30583058
SmallString<512> Str;
30593059
raw_svector_ostream OutStrm(Str);
3060-
const auto ByteOrder = support::endian::system_endianness();
3060+
const auto ByteOrder = llvm::endianness::native;
30613061
FileWriter FW(OutStrm, ByteOrder);
30623062
ASSERT_THAT_ERROR(GC.encode(FW), Succeeded());
30633063
Expected<GsymReader> GR = GsymReader::copyBuffer(OutStrm.str());
@@ -3284,7 +3284,7 @@ TEST(GSYMTest, TestDWARFEmptyInline) {
32843284
ASSERT_THAT_ERROR(GC.finalize(OS), Succeeded());
32853285
SmallString<512> Str;
32863286
raw_svector_ostream OutStrm(Str);
3287-
const auto ByteOrder = support::endian::system_endianness();
3287+
const auto ByteOrder = llvm::endianness::native;
32883288
FileWriter FW(OutStrm, ByteOrder);
32893289
ASSERT_THAT_ERROR(GC.encode(FW), Succeeded());
32903290
Expected<GsymReader> GR = GsymReader::copyBuffer(OutStrm.str());
@@ -3520,7 +3520,7 @@ TEST(GSYMTest, TestFinalizeForLineTables) {
35203520
ASSERT_THAT_ERROR(GC.finalize(OS), Succeeded());
35213521
SmallString<512> Str;
35223522
raw_svector_ostream OutStrm(Str);
3523-
const auto ByteOrder = support::endian::system_endianness();
3523+
const auto ByteOrder = llvm::endianness::native;
35243524
FileWriter FW(OutStrm, ByteOrder);
35253525
ASSERT_THAT_ERROR(GC.encode(FW), Succeeded());
35263526
Expected<GsymReader> GR = GsymReader::copyBuffer(OutStrm.str());
@@ -3800,7 +3800,7 @@ TEST(GSYMTest, TestRangeWarnings) {
38003800
OS.flush();
38013801
SmallString<512> Str;
38023802
raw_svector_ostream OutStrm(Str);
3803-
const auto ByteOrder = support::endian::system_endianness();
3803+
const auto ByteOrder = llvm::endianness::native;
38043804
FileWriter FW(OutStrm, ByteOrder);
38053805
ASSERT_THAT_ERROR(GC.encode(FW), Succeeded());
38063806
Expected<GsymReader> GR = GsymReader::copyBuffer(OutStrm.str());
@@ -4002,7 +4002,7 @@ TEST(GSYMTest, TestEmptyRangeWarnings) {
40024002
OS.flush();
40034003
SmallString<512> Str;
40044004
raw_svector_ostream OutStrm(Str);
4005-
const auto ByteOrder = support::endian::system_endianness();
4005+
const auto ByteOrder = llvm::endianness::native;
40064006
FileWriter FW(OutStrm, ByteOrder);
40074007
ASSERT_THAT_ERROR(GC.encode(FW), Succeeded());
40084008
Expected<GsymReader> GR = GsymReader::copyBuffer(OutStrm.str());

llvm/unittests/Support/HashBuilderTest.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ struct /* __attribute__((packed)) */ StructWithFastHash {
156156
template <typename HasherT, llvm::support::endianness Endianness>
157157
friend void addHash(llvm::HashBuilder<HasherT, Endianness> &HBuilder,
158158
const StructWithFastHash &Value) {
159-
if (Endianness == llvm::support::endian::system_endianness()) {
159+
if (Endianness == llvm::endianness::native) {
160160
HBuilder.update(llvm::ArrayRef(reinterpret_cast<const uint8_t *>(&Value),
161161
sizeof(Value)));
162162
} else {
@@ -180,7 +180,7 @@ struct CustomContainer {
180180
template <typename HasherT, llvm::support::endianness Endianness>
181181
friend void addHash(llvm::HashBuilder<HasherT, Endianness> &HBuilder,
182182
const CustomContainer &Value) {
183-
if (Endianness == llvm::support::endian::system_endianness()) {
183+
if (Endianness == llvm::endianness::native) {
184184
HBuilder.update(llvm::ArrayRef(
185185
reinterpret_cast<const uint8_t *>(&Value.Size),
186186
sizeof(Value.Size) + Value.Size * sizeof(Value.Elements[0])));

mlir/lib/AsmParser/AttributeParser.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -735,8 +735,7 @@ DenseElementsAttr TensorLiteralParser::getHexAttr(SMLoc loc, ShapedType type) {
735735
return nullptr;
736736
}
737737

738-
if (llvm::support::endian::system_endianness() ==
739-
llvm::support::endianness::big) {
738+
if (llvm::endianness::native == llvm::endianness::big) {
740739
// Convert endianess in big-endian(BE) machines. `rawData` is
741740
// little-endian(LE) because HEX in raw data of dense element attribute
742741
// is always LE format. It is converted into BE here to be used in BE

mlir/lib/IR/AsmPrinter.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2413,8 +2413,7 @@ void AsmPrinter::Impl::printDenseIntOrFPElementsAttr(
24132413
if (!attr.isSplat() && allowHex &&
24142414
shouldPrintElementsAttrWithHex(numElements)) {
24152415
ArrayRef<char> rawData = attr.getRawData();
2416-
if (llvm::support::endian::system_endianness() ==
2417-
llvm::support::endianness::big) {
2416+
if (llvm::endianness::native == llvm::endianness::big) {
24182417
// Convert endianess in big-endian(BE) machines. `rawData` is BE in BE
24192418
// machines. It is converted here to print in LE format.
24202419
SmallVector<char, 64> outDataVec(rawData.size());

0 commit comments

Comments
 (0)