Use heterogenous lookup for std;:map<std::string with a StringRef. NFCI.
diff --git a/clang/include/clang/Frontend/CompilerInstance.h b/clang/include/clang/Frontend/CompilerInstance.h
index e501dde..a935851 100644
--- a/clang/include/clang/Frontend/CompilerInstance.h
+++ b/clang/include/clang/Frontend/CompilerInstance.h
@@ -128,7 +128,7 @@
/// The set of top-level modules that has already been built on the
/// fly as part of this overall compilation action.
- std::map<std::string, std::string> BuiltModules;
+ std::map<std::string, std::string, std::less<>> 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 30a9d75..3af49e1 100644
--- a/clang/include/clang/Lex/HeaderSearchOptions.h
+++ b/clang/include/clang/Lex/HeaderSearchOptions.h
@@ -115,7 +115,7 @@
std::string ModuleUserBuildPath;
/// The mapping of module names to prebuilt module files.
- std::map<std::string, std::string> PrebuiltModuleFiles;
+ std::map<std::string, std::string, std::less<>> PrebuiltModuleFiles;
/// The directories used to load prebuilt module files.
std::vector<std::string> PrebuiltModulePaths;
diff --git a/clang/lib/Frontend/CompilerInstance.cpp b/clang/lib/Frontend/CompilerInstance.cpp
index 0db8df0..fe78791 100644
--- a/clang/lib/Frontend/CompilerInstance.cpp
+++ b/clang/lib/Frontend/CompilerInstance.cpp
@@ -1634,15 +1634,15 @@
/// 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<std::string, std::string> &BuiltModules,
- HeaderSearch &HS) {
+static ModuleSource selectModuleSource(
+ Module *M, StringRef ModuleName, std::string &ModuleFilename,
+ const std::map<std::string, std::string, std::less<>> &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 73c02d7..65d109e 100644
--- a/clang/lib/Lex/HeaderSearch.cpp
+++ b/clang/lib/Lex/HeaderSearch.cpp
@@ -145,7 +145,7 @@
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;