yamaguchi updated this revision to Diff 152086.
yamaguchi added a comment.

Update commmit message and comment, add ObjC2


https://reviews.llvm.org/D48367

Files:
  clang/include/clang/Lex/ModuleMap.h
  clang/lib/Lex/HeaderSearch.cpp


Index: clang/lib/Lex/HeaderSearch.cpp
===================================================================
--- clang/lib/Lex/HeaderSearch.cpp
+++ clang/lib/Lex/HeaderSearch.cpp
@@ -282,7 +282,8 @@
 
     // Load all module maps in the immediate subdirectories of this search
     // directory.
-    loadSubdirectoryModuleMaps(SearchDirs[Idx]);
+    if (ModMap.getLangOpts().ObjC1 || ModMap.getLangOpts().ObjC2)
+      loadSubdirectoryModuleMaps(SearchDirs[Idx]);
 
     // Look again for the module.
     Module = ModMap.findModule(ModuleName);
Index: clang/include/clang/Lex/ModuleMap.h
===================================================================
--- clang/include/clang/Lex/ModuleMap.h
+++ clang/include/clang/Lex/ModuleMap.h
@@ -110,6 +110,11 @@
   llvm::StringMap<llvm::StringSet<>> PendingLinkAsModule;
 
 public:
+  /// Get LangOpts of ModuleMap
+  const LangOptions& getLangOpts() {
+    return LangOpts;
+  }
+
   /// Use PendingLinkAsModule information to mark top level link names that
   /// are going to be replaced by export_as aliases.
   void resolveLinkAsDependencies(Module *Mod);


Index: clang/lib/Lex/HeaderSearch.cpp
===================================================================
--- clang/lib/Lex/HeaderSearch.cpp
+++ clang/lib/Lex/HeaderSearch.cpp
@@ -282,7 +282,8 @@
 
     // Load all module maps in the immediate subdirectories of this search
     // directory.
-    loadSubdirectoryModuleMaps(SearchDirs[Idx]);
+    if (ModMap.getLangOpts().ObjC1 || ModMap.getLangOpts().ObjC2)
+      loadSubdirectoryModuleMaps(SearchDirs[Idx]);
 
     // Look again for the module.
     Module = ModMap.findModule(ModuleName);
Index: clang/include/clang/Lex/ModuleMap.h
===================================================================
--- clang/include/clang/Lex/ModuleMap.h
+++ clang/include/clang/Lex/ModuleMap.h
@@ -110,6 +110,11 @@
   llvm::StringMap<llvm::StringSet<>> PendingLinkAsModule;
 
 public:
+  /// Get LangOpts of ModuleMap
+  const LangOptions& getLangOpts() {
+    return LangOpts;
+  }
+
   /// Use PendingLinkAsModule information to mark top level link names that
   /// are going to be replaced by export_as aliases.
   void resolveLinkAsDependencies(Module *Mod);
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to