[cfe-commits] r145945 - in /cfe/trunk: lib/Lex/ModuleMap.cpp test/Modules/Inputs/DependsOnModule.framework/module.map test/Modules/auto-module-import.c

Douglas Gregor dgregor at apple.com
Tue Dec 6 09:34:59 PST 2011


Author: dgregor
Date: Tue Dec  6 11:34:58 2011
New Revision: 145945

URL: http://llvm.org/viewvc/llvm-project?rev=145945&view=rev
Log:
Allow inferred submodules for any (sub)module that has an umbrella header

Modified:
    cfe/trunk/lib/Lex/ModuleMap.cpp
    cfe/trunk/test/Modules/Inputs/DependsOnModule.framework/module.map
    cfe/trunk/test/Modules/auto-module-import.c

Modified: cfe/trunk/lib/Lex/ModuleMap.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Lex/ModuleMap.cpp?rev=145945&r1=145944&r2=145945&view=diff
==============================================================================
--- cfe/trunk/lib/Lex/ModuleMap.cpp (original)
+++ cfe/trunk/lib/Lex/ModuleMap.cpp Tue Dec  6 11:34:58 2011
@@ -900,16 +900,16 @@
   }
   
   // Inferred modules must have umbrella headers.
-  if (!Failed && !ActiveModule->getTopLevelModule()->UmbrellaHeader) {
+  if (!Failed && !ActiveModule->UmbrellaHeader) {
     Diags.Report(StarLoc, diag::err_mmap_inferred_no_umbrella);
     Failed = true;
   }
   
   // Check for redefinition of an inferred module.
-  if (!Failed && ActiveModule->getTopLevelModule()->InferSubmodules) {
+  if (!Failed && ActiveModule->InferSubmodules) {
     Diags.Report(StarLoc, diag::err_mmap_inferred_redef);
-    if (ActiveModule->getTopLevelModule()->InferredSubmoduleLoc.isValid())
-      Diags.Report(ActiveModule->getTopLevelModule()->InferredSubmoduleLoc,
+    if (ActiveModule->InferredSubmoduleLoc.isValid())
+      Diags.Report(ActiveModule->InferredSubmoduleLoc,
                    diag::note_mmap_prev_definition);
     Failed = true;
   }
@@ -927,10 +927,9 @@
   }
   
   // Note that we have an inferred submodule.
-  Module *TopModule = ActiveModule->getTopLevelModule();
-  TopModule->InferSubmodules = true;
-  TopModule->InferredSubmoduleLoc = StarLoc;
-  TopModule->InferExplicitSubmodules = Explicit;
+  ActiveModule->InferSubmodules = true;
+  ActiveModule->InferredSubmoduleLoc = StarLoc;
+  ActiveModule->InferExplicitSubmodules = Explicit;
   
   // Parse the opening brace.
   if (!Tok.is(MMToken::LBrace)) {
@@ -952,7 +951,7 @@
     case MMToken::ExportKeyword: {
       consumeToken();
       if (Tok.is(MMToken::Star)) 
-        TopModule->InferExportWildcard = true;
+        ActiveModule->InferExportWildcard = true;
       else
         Diags.Report(Tok.getLocation(), 
                      diag::err_mmap_expected_export_wildcard);

Modified: cfe/trunk/test/Modules/Inputs/DependsOnModule.framework/module.map
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Modules/Inputs/DependsOnModule.framework/module.map?rev=145945&r1=145944&r2=145945&view=diff
==============================================================================
--- cfe/trunk/test/Modules/Inputs/DependsOnModule.framework/module.map (original)
+++ cfe/trunk/test/Modules/Inputs/DependsOnModule.framework/module.map Tue Dec  6 11:34:58 2011
@@ -6,5 +6,9 @@
   }
   explicit framework module SubFramework {
     umbrella "SubFramework.h"
+
+    module * {
+      export *
+    }
   }
 }

Modified: cfe/trunk/test/Modules/auto-module-import.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Modules/auto-module-import.c?rev=145945&r1=145944&r2=145945&view=diff
==============================================================================
--- cfe/trunk/test/Modules/auto-module-import.c (original)
+++ cfe/trunk/test/Modules/auto-module-import.c Tue Dec  6 11:34:58 2011
@@ -24,7 +24,7 @@
 }
 
 // Test header cross-subframework include pattern.
-#include <DependsOnModule/../Frameworks/SubFramework.framework/Headers/Other.h> // expected-warning{{treating #include as an import of module 'DependsOnModule.SubFramework'}}
+#include <DependsOnModule/../Frameworks/SubFramework.framework/Headers/Other.h> // expected-warning{{treating #include as an import of module 'DependsOnModule.SubFramework.Other'}}
 
 void testSubframeworkOtherAgain() {
   double *sfo1 = sub_framework_other;





More information about the cfe-commits mailing list