diff options
Diffstat (limited to 'clang/lib')
-rw-r--r-- | clang/lib/Lex/ModuleMap.cpp | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/clang/lib/Lex/ModuleMap.cpp b/clang/lib/Lex/ModuleMap.cpp index 2b6b78aceec..c1b7b33c31e 100644 --- a/clang/lib/Lex/ModuleMap.cpp +++ b/clang/lib/Lex/ModuleMap.cpp @@ -596,8 +596,7 @@ static void inferFrameworkLink(Module *Mod, const DirectoryEntry *FrameworkDir, // The library name of a framework has more than one possible extension since // the introduction of the text-based dynamic library format. We need to check // for both before we give up. - static const char *frameworkExtensions[] = {"", ".tbd"}; - for (const auto *extension : frameworkExtensions) { + for (const char *extension : {"", ".tbd"}) { llvm::sys::path::replace_extension(LibName, extension); if (FileMgr.getFile(LibName)) { Mod->LinkLibraries.push_back(Module::LinkLibrary(Mod->Name, @@ -1655,15 +1654,12 @@ void ModuleMapParser::parseExternModuleDecl() { /// was never correct and causes issues now that we check it, so drop it. static bool shouldAddRequirement(Module *M, StringRef Feature, bool &IsRequiresExcludedHack) { - static const StringRef DarwinCExcluded[] = {"Darwin", "C", "excluded"}; - static const StringRef TclPrivate[] = {"Tcl", "Private"}; - static const StringRef IOKitAVC[] = {"IOKit", "avc"}; - - if (Feature == "excluded" && (M->fullModuleNameIs(DarwinCExcluded) || - M->fullModuleNameIs(TclPrivate))) { + if (Feature == "excluded" && + (M->fullModuleNameIs({"Darwin", "C", "excluded"}) || + M->fullModuleNameIs({"Tcl", "Private"}))) { IsRequiresExcludedHack = true; return false; - } else if (Feature == "cplusplus" && M->fullModuleNameIs(IOKitAVC)) { + } else if (Feature == "cplusplus" && M->fullModuleNameIs({"IOKit", "avc"})) { return false; } |