Revert "Use existing builtin hashing functions to make this routine more"
authorEric Christopher <echristo@gmail.com>
Mon, 5 Aug 2013 22:07:30 +0000 (22:07 +0000)
committerEric Christopher <echristo@gmail.com>
Mon, 5 Aug 2013 22:07:30 +0000 (22:07 +0000)
This reverts commit r187745.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187747 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/AsmPrinter/DwarfDebug.cpp

index 047627a5ff698719eab035c586a05a9cbe013d39..b4bc61b72434768318f174d2791712b314b676d0 100644 (file)
@@ -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.