[llvm] llvm-readobj: support big-endian attribute printing (PR #87806)

Fangrui Song via llvm-commits llvm-commits at lists.llvm.org
Sat Apr 6 00:56:52 PDT 2024


================
@@ -48,7 +48,7 @@ T DataExtractor::getU(uint64_t *offset_ptr, Error *Err) const {
   if (!prepareRead(offset, sizeof(T), Err))
     return val;
   std::memcpy(&val, &Data.data()[offset], sizeof(val));
-  if (sys::IsLittleEndianHost != IsLittleEndian)
+  if (!IsLittleEndian)
----------------
MaskRay wrote:

The original code is correct.

This change causes llvm/unittests/Support/DataExtractorTest.cpp failures, but I am surprised that there are only a few failures.

https://github.com/llvm/llvm-project/pull/87806


More information about the llvm-commits mailing list