[llvm-commits] [llvm] r53202 - in /llvm/trunk: include/llvm/CodeGen/MachineModuleInfo.h lib/CodeGen/MachineModuleInfo.cpp

Bill Wendling isanbard at gmail.com
Mon Jul 7 13:59:32 PDT 2008


Author: void
Date: Mon Jul  7 15:59:31 2008
New Revision: 53202

URL: http://llvm.org/viewvc/llvm-project?rev=53202&view=rev
Log:
Use StringMap for greater justice!

Modified:
    llvm/trunk/include/llvm/CodeGen/MachineModuleInfo.h
    llvm/trunk/lib/CodeGen/MachineModuleInfo.cpp

Modified: llvm/trunk/include/llvm/CodeGen/MachineModuleInfo.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/MachineModuleInfo.h?rev=53202&r1=53201&r2=53202&view=diff

==============================================================================
--- llvm/trunk/include/llvm/CodeGen/MachineModuleInfo.h (original)
+++ llvm/trunk/include/llvm/CodeGen/MachineModuleInfo.h Mon Jul  7 15:59:31 2008
@@ -37,6 +37,7 @@
 #include "llvm/ADT/DenseMap.h"
 #include "llvm/ADT/UniqueVector.h"
 #include "llvm/ADT/SmallPtrSet.h"
+#include "llvm/ADT/StringMap.h"
 #include "llvm/GlobalValue.h"
 #include "llvm/Pass.h"
 
@@ -777,7 +778,7 @@
   DenseMap<DebugInfoDesc *, GlobalVariable *> DescGlobals;
 
   // Previously defined strings.
-  DenseMap<const char *, Constant*> StringCache;
+  StringMap<Constant*> StringCache;
 public:
   DISerializer()
     : M(NULL), StrPtrTy(NULL), EmptyStructPtrTy(NULL), TagTypes(),

Modified: llvm/trunk/lib/CodeGen/MachineModuleInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/MachineModuleInfo.cpp?rev=53202&r1=53201&r2=53202&view=diff

==============================================================================
--- llvm/trunk/lib/CodeGen/MachineModuleInfo.cpp (original)
+++ llvm/trunk/lib/CodeGen/MachineModuleInfo.cpp Mon Jul  7 15:59:31 2008
@@ -1321,7 +1321,7 @@
 ///
 Constant *DISerializer::getString(const std::string &String) {
   // Check string cache for previous edition.
-  Constant *&Slot = StringCache[String.c_str()];
+  Constant *&Slot = StringCache[String];
 
   // Return Constant if previously defined.
   if (Slot) return Slot;





More information about the llvm-commits mailing list