[instrprof] Fix issue in binary-ids-padding.test
authorGulfem Savrun Yeniceri <gulfem@google.com>
Thu, 29 Dec 2022 20:37:57 +0000 (20:37 +0000)
committerGulfem Savrun Yeniceri <gulfem@google.com>
Thu, 29 Dec 2022 21:48:26 +0000 (21:48 +0000)
https://reviews.llvm.org/D135929 caused a failure in
binary-ids-padding.test in big endian configurations:
https://lab.llvm.org/buildbot/#/builders/231/builds/6709

binary-ids-padding.test writes the profile in little-endian format.
This patch changes the raw profile reader to use getDataEndianness()
instead of llvm::support::endian::system_endianness() to fix the issue.

llvm/lib/ProfileData/InstrProfReader.cpp

index 4dfc3ba..d0714c9 100644 (file)
@@ -662,14 +662,13 @@ template <class IntPtrT>
 Error RawInstrProfReader<IntPtrT>::readBinaryIds(
     std::vector<llvm::object::BuildID> &BinaryIds) {
   return readBinaryIdsInternal(*DataBuffer, BinaryIdsSize, BinaryIdsStart,
-                               BinaryIds,
-                               llvm::support::endian::system_endianness());
+                               BinaryIds, getDataEndianness());
 }
 
 template <class IntPtrT>
 Error RawInstrProfReader<IntPtrT>::printBinaryIds(raw_ostream &OS) {
   return printBinaryIdsInternal(OS, *DataBuffer, BinaryIdsSize, BinaryIdsStart,
-                                llvm::support::endian::system_endianness());
+                                getDataEndianness());
 }
 
 namespace llvm {