diff --git a/clang/include/clang/Frontend/CompilerInstance.h b/clang/include/clang/Frontend/CompilerInstance.h index e501dde465cc52..a935851d5b6061 100644 --- a/clang/include/clang/Frontend/CompilerInstance.h +++ b/clang/include/clang/Frontend/CompilerInstance.h @@ -128,7 +128,7 @@ class CompilerInstance : public ModuleLoader { /// The set of top-level modules that has already been built on the /// fly as part of this overall compilation action. - std::map BuiltModules; + std::map> BuiltModules; /// Should we delete the BuiltModules when we're done? bool DeleteBuiltModules = true; diff --git a/clang/include/clang/Lex/HeaderSearchOptions.h b/clang/include/clang/Lex/HeaderSearchOptions.h index 30a9d7564fd335..3af49e17539561 100644 --- a/clang/include/clang/Lex/HeaderSearchOptions.h +++ b/clang/include/clang/Lex/HeaderSearchOptions.h @@ -115,7 +115,7 @@ class HeaderSearchOptions { std::string ModuleUserBuildPath; /// The mapping of module names to prebuilt module files. - std::map PrebuiltModuleFiles; + std::map> PrebuiltModuleFiles; /// The directories used to load prebuilt module files. std::vector PrebuiltModulePaths; diff --git a/clang/lib/Frontend/CompilerInstance.cpp b/clang/lib/Frontend/CompilerInstance.cpp index 0db8df0fada8f8..fe787918b41bcf 100644 --- a/clang/lib/Frontend/CompilerInstance.cpp +++ b/clang/lib/Frontend/CompilerInstance.cpp @@ -1634,15 +1634,15 @@ enum ModuleSource { /// Select a source for loading the named module and compute the filename to /// load it from. -static ModuleSource -selectModuleSource(Module *M, StringRef ModuleName, std::string &ModuleFilename, - const std::map &BuiltModules, - HeaderSearch &HS) { +static ModuleSource selectModuleSource( + Module *M, StringRef ModuleName, std::string &ModuleFilename, + const std::map> &BuiltModules, + HeaderSearch &HS) { assert(ModuleFilename.empty() && "Already has a module source?"); // Check to see if the module has been built as part of this compilation // via a module build pragma. - auto BuiltModuleIt = BuiltModules.find(std::string(ModuleName)); + auto BuiltModuleIt = BuiltModules.find(ModuleName); if (BuiltModuleIt != BuiltModules.end()) { ModuleFilename = BuiltModuleIt->second; return MS_ModuleBuildPragma; diff --git a/clang/lib/Lex/HeaderSearch.cpp b/clang/lib/Lex/HeaderSearch.cpp index 73c02d7f6e6df4..65d109ebf034e1 100644 --- a/clang/lib/Lex/HeaderSearch.cpp +++ b/clang/lib/Lex/HeaderSearch.cpp @@ -145,7 +145,7 @@ std::string HeaderSearch::getCachedModuleFileName(Module *Module) { std::string HeaderSearch::getPrebuiltModuleFileName(StringRef ModuleName, bool FileMapOnly) { // First check the module name to pcm file map. - auto i(HSOpts->PrebuiltModuleFiles.find(std::string(ModuleName))); + auto i(HSOpts->PrebuiltModuleFiles.find(ModuleName)); if (i != HSOpts->PrebuiltModuleFiles.end()) return i->second; diff --git a/llvm/include/llvm/DebugInfo/Symbolize/Symbolize.h b/llvm/include/llvm/DebugInfo/Symbolize/Symbolize.h index 8bfa5432b81123..632540c79b0dfd 100644 --- a/llvm/include/llvm/DebugInfo/Symbolize/Symbolize.h +++ b/llvm/include/llvm/DebugInfo/Symbolize/Symbolize.h @@ -114,7 +114,8 @@ class LLVMSymbolizer { Expected getOrCreateObject(const std::string &Path, const std::string &ArchName); - std::map> Modules; + std::map, std::less<>> + Modules; /// Contains cached results of getOrCreateObjectPair(). std::map, ObjectPair> diff --git a/llvm/include/llvm/IR/ModuleSummaryIndex.h b/llvm/include/llvm/IR/ModuleSummaryIndex.h index 1296de75325b0b..dab0ad9fe055c4 100644 --- a/llvm/include/llvm/IR/ModuleSummaryIndex.h +++ b/llvm/include/llvm/IR/ModuleSummaryIndex.h @@ -959,7 +959,8 @@ class ModuleSummaryIndex { /// with that type identifier's metadata. Produced by per module summary /// analysis and consumed by thin link. For more information, see description /// above where TypeIdCompatibleVtableInfo is defined. - std::map TypeIdCompatibleVtableMap; + std::map> + TypeIdCompatibleVtableMap; /// Mapping from original ID to GUID. If original ID can map to multiple /// GUIDs, it will be mapped to 0. @@ -1361,8 +1362,7 @@ class ModuleSummaryIndex { TypeId)); } - const std::map & - typeIdCompatibleVtableMap() const { + const auto &typeIdCompatibleVtableMap() const { return TypeIdCompatibleVtableMap; } @@ -1378,7 +1378,7 @@ class ModuleSummaryIndex { /// entry if present in the summary map. This may be used when importing. Optional getTypeIdCompatibleVtableSummary(StringRef TypeId) const { - auto I = TypeIdCompatibleVtableMap.find(std::string(TypeId)); + auto I = TypeIdCompatibleVtableMap.find(TypeId); if (I == TypeIdCompatibleVtableMap.end()) return None; return I->second; diff --git a/llvm/lib/DebugInfo/Symbolize/Symbolize.cpp b/llvm/lib/DebugInfo/Symbolize/Symbolize.cpp index d0948fd9ab8ca8..84cf4d40318ff5 100644 --- a/llvm/lib/DebugInfo/Symbolize/Symbolize.cpp +++ b/llvm/lib/DebugInfo/Symbolize/Symbolize.cpp @@ -62,7 +62,7 @@ Expected LLVMSymbolizer::symbolizeCode(const ObjectFile &Obj, object::SectionedAddress ModuleOffset) { StringRef ModuleName = Obj.getFileName(); - auto I = Modules.find(std::string(ModuleName)); + auto I = Modules.find(ModuleName); if (I != Modules.end()) return symbolizeCodeCommon(I->second.get(), ModuleOffset);