[llvm] r187747 - Revert "Use existing builtin hashing functions to make this routine more"

Eric Christopher echristo at gmail.com
Mon Aug 5 15:07:30 PDT 2013


Author: echristo
Date: Mon Aug  5 17:07:30 2013
New Revision: 187747

URL: http://llvm.org/viewvc/llvm-project?rev=187747&view=rev
Log:
Revert "Use existing builtin hashing functions to make this routine more"

This reverts commit r187745.

Modified:
    llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp

Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp?rev=187747&r1=187746&r2=187747&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp (original)
+++ llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp Mon Aug  5 17:07:30 2013
@@ -988,8 +988,11 @@ static StringRef getDIEStringAttr(DIE *D
 /// 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.





More information about the llvm-commits mailing list