Use StringMap for greater justice!
authorBill Wendling <isanbard@gmail.com>
Mon, 7 Jul 2008 20:59:31 +0000 (20:59 +0000)
committerBill Wendling <isanbard@gmail.com>
Mon, 7 Jul 2008 20:59:31 +0000 (20:59 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53202 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/CodeGen/MachineModuleInfo.h
lib/CodeGen/MachineModuleInfo.cpp

index a9567d2e255d4436c31096f4d61e3c6ac8b85bf9..9d98776f548d38249eab64dcc74f320b4a3d930c 100644 (file)
@@ -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 @@ class DISerializer {
   DenseMap<DebugInfoDesc *, GlobalVariable *> DescGlobals;
 
   // Previously defined strings.
-  DenseMap<const char *, Constant*> StringCache;
+  StringMap<Constant*> StringCache;
 public:
   DISerializer()
     : M(NULL), StrPtrTy(NULL), EmptyStructPtrTy(NULL), TagTypes(),
index 3d3a9957bb082080f9a1393c7730a70a901ca795..149451b8301cdbe6185db91fadd2d36ab9638b7e 100644 (file)
@@ -1321,7 +1321,7 @@ const StructType *DISerializer::getTagType(DebugInfoDesc *DD) {
 ///
 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;