We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 88015d1 commit ba45592Copy full SHA for ba45592
llvm/lib/Target/AMDGPU/AMDGPUMCInstLower.cpp
@@ -29,6 +29,7 @@
29
#include "llvm/MC/MCInst.h"
30
#include "llvm/MC/MCObjectStreamer.h"
31
#include "llvm/MC/MCStreamer.h"
32
+#include "llvm/Support/Endian.h"
33
#include "llvm/Support/ErrorHandling.h"
34
#include "llvm/Support/Format.h"
35
#include <algorithm>
@@ -316,7 +317,8 @@ void AMDGPUAsmPrinter::emitInstruction(const MachineInstr *MI) {
316
317
raw_string_ostream HexStream(HexLine);
318
319
for (size_t i = 0; i < CodeBytes.size(); i += 4) {
- unsigned int CodeDWord = *(unsigned int *)&CodeBytes[i];
320
+ unsigned int CodeDWord =
321
+ support::endian::read32le(CodeBytes.data() + i);
322
HexStream << format("%s%08X", (i > 0 ? " " : ""), CodeDWord);
323
}
324
0 commit comments