summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/CodeGen/AsmPrinter/DwarfDebug.cpp5
-rw-r--r--test/DebugInfo/generate-odr-hash.ll (renamed from test/DebugInfo/X86/generate-odr-hash.ll)0
2 files changed, 3 insertions, 2 deletions
diff --git a/lib/CodeGen/AsmPrinter/DwarfDebug.cpp b/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
index 0d2d02eba4..7ba1fc187d 100644
--- a/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
+++ b/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
@@ -1059,8 +1059,9 @@ static void addDIEODRSignature(MD5 &Hash, CompileUnit *CU, DIE *Die) {
Hash.final(Result);
// ... take the least significant 8 bytes and store those as the attribute.
- uint64_t Signature;
- memcpy(&Signature, &Result[8], 8);
+ // Our MD5 implementation always returns its results in little endian, swap
+ // bytes appropriately.
+ uint64_t Signature = *reinterpret_cast<support::ulittle64_t *>(Result + 8);
// FIXME: This should be added onto the type unit, not the type, but this
// works as an intermediate stage.
diff --git a/test/DebugInfo/X86/generate-odr-hash.ll b/test/DebugInfo/generate-odr-hash.ll
index 0b35e3f9d5..0b35e3f9d5 100644
--- a/test/DebugInfo/X86/generate-odr-hash.ll
+++ b/test/DebugInfo/generate-odr-hash.ll