[cfe-commits] r146398 - in /cfe/trunk: lib/Frontend/FrontendActions.cpp test/Modules/Inputs/NoUmbrella.framework/Headers/SubDir/ test/Modules/Inputs/NoUmbrella.framework/Headers/SubDir/C.h test/Modules/auto-module-import.m

Douglas Gregor dgregor at apple.com
Mon Dec 12 11:13:53 PST 2011


Author: dgregor
Date: Mon Dec 12 13:13:53 2011
New Revision: 146398

URL: http://llvm.org/viewvc/llvm-project?rev=146398&view=rev
Log:
When we have an umbrella directory in a module map, recursively walk
the subdirectories to find headers in submodules.

Added:
    cfe/trunk/test/Modules/Inputs/NoUmbrella.framework/Headers/SubDir/
    cfe/trunk/test/Modules/Inputs/NoUmbrella.framework/Headers/SubDir/C.h
Modified:
    cfe/trunk/lib/Frontend/FrontendActions.cpp
    cfe/trunk/test/Modules/auto-module-import.m

Modified: cfe/trunk/lib/Frontend/FrontendActions.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Frontend/FrontendActions.cpp?rev=146398&r1=146397&r2=146398&view=diff
==============================================================================
--- cfe/trunk/lib/Frontend/FrontendActions.cpp (original)
+++ cfe/trunk/lib/Frontend/FrontendActions.cpp Mon Dec 12 13:13:53 2011
@@ -161,7 +161,8 @@
     llvm::error_code EC;
     llvm::SmallString<128> DirNative;
     llvm::sys::path::native(UmbrellaDir->getName(), DirNative);
-    for (llvm::sys::fs::directory_iterator Dir(DirNative.str(), EC), DirEnd;
+    for (llvm::sys::fs::recursive_directory_iterator Dir(DirNative.str(), EC), 
+                                                     DirEnd;
          Dir != DirEnd && !EC; Dir.increment(EC)) {
       // Check whether this entry has an extension typically associated with 
       // headers.

Added: cfe/trunk/test/Modules/Inputs/NoUmbrella.framework/Headers/SubDir/C.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Modules/Inputs/NoUmbrella.framework/Headers/SubDir/C.h?rev=146398&view=auto
==============================================================================
--- cfe/trunk/test/Modules/Inputs/NoUmbrella.framework/Headers/SubDir/C.h (added)
+++ cfe/trunk/test/Modules/Inputs/NoUmbrella.framework/Headers/SubDir/C.h Mon Dec 12 13:13:53 2011
@@ -0,0 +1 @@
+int no_umbrella_C;

Modified: cfe/trunk/test/Modules/auto-module-import.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Modules/auto-module-import.m?rev=146398&r1=146397&r2=146398&view=diff
==============================================================================
--- cfe/trunk/test/Modules/auto-module-import.m (original)
+++ cfe/trunk/test/Modules/auto-module-import.m Mon Dec 12 13:13:53 2011
@@ -28,6 +28,10 @@
 #include <NoUmbrella/A.h> // expected-warning{{treating #include as an import of module 'NoUmbrella.A'}}
 int getNoUmbrellaA() { return no_umbrella_A; } 
 
+// Test umbrella-less submodule includes
+#include <NoUmbrella/SubDir/C.h> // expected-warning{{treating #include as an import of module 'NoUmbrella.SubDir.C'}}
+int getNoUmbrellaC() { return no_umbrella_C; } 
+
 // 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.Other'}}
 





More information about the cfe-commits mailing list