summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Christopher <echristo@gmail.com>2013-08-05 22:07:30 +0000
committerEric Christopher <echristo@gmail.com>2013-08-05 22:07:30 +0000
commitde5cb6b24925c8d3113f02e94d2c16cfed69c47d (patch)
treef15889e9e87a6259da6654fdc8a24dcbcd6f186c
parentc222f671099ae5cc354a22078eeb405b5e02a91b (diff)
downloadllvm-de5cb6b24925c8d3113f02e94d2c16cfed69c47d.tar.gz
llvm-de5cb6b24925c8d3113f02e94d2c16cfed69c47d.tar.bz2
llvm-de5cb6b24925c8d3113f02e94d2c16cfed69c47d.tar.xz
Revert "Use existing builtin hashing functions to make this routine more"
This reverts commit r187745. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187747 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/CodeGen/AsmPrinter/DwarfDebug.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/CodeGen/AsmPrinter/DwarfDebug.cpp b/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
index 047627a5ff..b4bc61b724 100644
--- a/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
+++ b/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
@@ -988,8 +988,11 @@ static StringRef getDIEStringAttr(DIE *Die, unsigned Attr) {
/// a trailing NULL with the string.
static void addStringToHash(MD5 &Hash, StringRef Str) {
DEBUG(dbgs() << "Adding string " << Str << " to hash.\n");
- Hash.update(Str);
- Hash.update('\0');
+ HashValue SVal((const uint8_t *)Str.data(), Str.size());
+ const uint8_t NB = '\0';
+ HashValue NBVal((const uint8_t *)&NB, 1);
+ Hash.update(SVal);
+ Hash.update(NBVal);
}
// FIXME: These are copied and only slightly modified out of LEB128.h.