[llvm] b505ef5 - [DX] Hopefully really fix the big endian bots

Chris Bieneman via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 2 06:13:47 PST 2023


Author: Chris Bieneman
Date: 2023-02-02T08:13:39-06:00
New Revision: b505ef5e3eb9f9ba2ff8245eb37af9a7ea180072

URL: https://github.com/llvm/llvm-project/commit/b505ef5e3eb9f9ba2ff8245eb37af9a7ea180072
DIFF: https://github.com/llvm/llvm-project/commit/b505ef5e3eb9f9ba2ff8245eb37af9a7ea180072.diff

LOG: [DX] Hopefully really fix the big endian bots

Slly mistake in my first attempt. Hopefully this will do it.

Added: 
    

Modified: 
    llvm/lib/MC/DXContainerPSVInfo.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/MC/DXContainerPSVInfo.cpp b/llvm/lib/MC/DXContainerPSVInfo.cpp
index 399f54c8332f8..48a987eb03765 100644
--- a/llvm/lib/MC/DXContainerPSVInfo.cpp
+++ b/llvm/lib/MC/DXContainerPSVInfo.cpp
@@ -26,10 +26,11 @@ void PSVRuntimeInfo::write(raw_ostream &OS, uint32_t Version) const {
   default:
     InfoSize = sizeof(dxbc::PSV::v2::RuntimeInfo);
   }
+  uint32_t InfoSizeSwapped = InfoSize;
   if (sys::IsBigEndianHost)
-    sys::swapByteOrder(InfoSize);
+    sys::swapByteOrder(InfoSizeSwapped);
   // Write the size of the info.
-  OS.write(reinterpret_cast<const char *>(&InfoSize), sizeof(uint32_t));
+  OS.write(reinterpret_cast<const char *>(&InfoSizeSwapped), sizeof(uint32_t));
   // Write the info itself.
   OS.write(reinterpret_cast<const char *>(&BaseData), InfoSize);
 }


        


More information about the llvm-commits mailing list