[llvm] r187745 - Use existing builtin hashing functions to make this routine more

Eric Christopher echristo at gmail.com
Mon Aug 5 15:00:51 PDT 2013


Author: echristo
Date: Mon Aug  5 17:00:50 2013
New Revision: 187745

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

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=187745&r1=187744&r2=187745&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp (original)
+++ llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp Mon Aug  5 17:00:50 2013
@@ -988,11 +988,8 @@ 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");
-  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);
+  Hash.update(Str);
+  Hash.update('\0');
 }
 
 // FIXME: These are copied and only slightly modified out of LEB128.h.





More information about the llvm-commits mailing list