summaryrefslogtreecommitdiffstats
path: root/llvm/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
commit409afcf174fbb503336aac450a42c8aa36aa09ce (patch)
tree6f6dd0d10a6c39b98315f771e2d1b647340c9a36 /llvm/lib/CodeGen
parent26ad41ed6e2e0aa0dab8b44c01487e36fb711680 (diff)
downloadbcm5719-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
Diffstat (limited to 'llvm/lib/CodeGen')
-rw-r--r--llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp5
1 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.
OpenPOWER on IntegriCloud