diff options
author | Benjamin Kramer <benny.kra@googlemail.com> | 2013-07-27 14:14:43 +0000 |
---|---|---|
committer | Benjamin Kramer <benny.kra@googlemail.com> | 2013-07-27 14:14:43 +0000 |
commit | 409afcf174fbb503336aac450a42c8aa36aa09ce (patch) | |
tree | 6f6dd0d10a6c39b98315f771e2d1b647340c9a36 | |
parent | 26ad41ed6e2e0aa0dab8b44c01487e36fb711680 (diff) | |
download | bcm5719-llvm-409afcf174fbb503336aac450a42c8aa36aa09ce.tar.gz bcm5719-llvm-409afcf174fbb503336aac450a42c8aa36aa09ce.zip |
DwarfDebug: MD5 is always little endian, bswap on big endian platforms.
This makes LLVM emit the same signature regardless of host and target endianess.
llvm-svn: 187304
-rw-r--r-- | llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp | 5 | ||||
-rw-r--r-- | llvm/test/DebugInfo/generate-odr-hash.ll (renamed from llvm/test/DebugInfo/X86/generate-odr-hash.ll) | 0 |
2 files changed, 3 insertions, 2 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp index 0d2d02eba4d..7ba1fc187da 100644 --- a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp +++ b/llvm/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/llvm/test/DebugInfo/X86/generate-odr-hash.ll b/llvm/test/DebugInfo/generate-odr-hash.ll index 0b35e3f9d5b..0b35e3f9d5b 100644 --- a/llvm/test/DebugInfo/X86/generate-odr-hash.ll +++ b/llvm/test/DebugInfo/generate-odr-hash.ll |