diff --git a/include/llvm/CodeGen/MachineModuleInfo.h b/include/llvm/CodeGen/MachineModuleInfo.h index a9567d2e255..9d98776f548 100644 --- a/include/llvm/CodeGen/MachineModuleInfo.h +++ b/include/llvm/CodeGen/MachineModuleInfo.h @@ -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 DescGlobals; // Previously defined strings. - DenseMap StringCache; + StringMap StringCache; public: DISerializer() : M(NULL), StrPtrTy(NULL), EmptyStructPtrTy(NULL), TagTypes(), diff --git a/lib/CodeGen/MachineModuleInfo.cpp b/lib/CodeGen/MachineModuleInfo.cpp index 3d3a9957bb0..149451b8301 100644 --- a/lib/CodeGen/MachineModuleInfo.cpp +++ b/lib/CodeGen/MachineModuleInfo.cpp @@ -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;