summaryrefslogtreecommitdiff
path: root/lib/CodeGen
diff options
context:
space:
mode:
authorBenjamin Kramer <benny.kra@googlemail.com>2013-07-27 14:14:43 +0000
committerBenjamin Kramer <benny.kra@googlemail.com>2013-07-27 14:14:43 +0000
commit1faea8f0869a173c5952b59fd17718cf42111416 (patch)
tree2cc26b950424ced0d1847d05a1d5f86b6486291f /lib/CodeGen
parent214de30d9d3739bb384188720aa6c389edcf89dc (diff)
downloadllvm-1faea8f0869a173c5952b59fd17718cf42111416.tar.gz
llvm-1faea8f0869a173c5952b59fd17718cf42111416.tar.bz2
llvm-1faea8f0869a173c5952b59fd17718cf42111416.tar.xz
DwarfDebug: MD5 is always little endian, bswap on big endian platforms.
This makes LLVM emit the same signature regardless of host and target endianess. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187304 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen')
-rw-r--r--lib/CodeGen/AsmPrinter/DwarfDebug.cpp5
1 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.