[Modules] Don't parse any module map if modules are disabled.
Fixes rdar://15644663.
llvm-svn: 197165
diff --git a/clang/lib/Lex/HeaderSearch.cpp b/clang/lib/Lex/HeaderSearch.cpp
index 9e43dda..5770aaa 100644
--- a/clang/lib/Lex/HeaderSearch.cpp
+++ b/clang/lib/Lex/HeaderSearch.cpp
@@ -59,6 +59,8 @@
NumIncluded = 0;
NumMultiIncludeFileOptzn = 0;
NumFrameworkLookups = NumSubFrameworkLookups = 0;
+
+ EnabledModules = LangOpts.Modules;
}
HeaderSearch::~HeaderSearch() {
@@ -953,6 +955,9 @@
bool HeaderSearch::hasModuleMap(StringRef FileName,
const DirectoryEntry *Root,
bool IsSystem) {
+ if (!enabledModules())
+ return false;
+
SmallVector<const DirectoryEntry *, 2> FixUpDirectories;
StringRef DirName = FileName;