diff options
author | Douglas Gregor <dgregor@apple.com> | 2011-12-12 19:13:53 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2011-12-12 19:13:53 +0000 |
commit | 3b29bb99948f9e8b4a4e829445c753f6858f607e (patch) | |
tree | 6a021ce0641b5b33900990a94e6d3bd93adc84fb | |
parent | 4cd9b8f7fb2cebf614e6e2bc766fad27ffd2e9de (diff) |
When we have an umbrella directory in a module map, recursively walk
the subdirectories to find headers in submodules.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146398 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/Frontend/FrontendActions.cpp | 3 | ||||
-rw-r--r-- | test/Modules/Inputs/NoUmbrella.framework/Headers/SubDir/C.h | 1 | ||||
-rw-r--r-- | test/Modules/auto-module-import.m | 4 |
3 files changed, 7 insertions, 1 deletions
diff --git a/lib/Frontend/FrontendActions.cpp b/lib/Frontend/FrontendActions.cpp index 5dabe81996..a97a32ba06 100644 --- a/lib/Frontend/FrontendActions.cpp +++ b/lib/Frontend/FrontendActions.cpp @@ -161,7 +161,8 @@ static void collectModuleHeaderIncludes(const LangOptions &LangOpts, 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. diff --git a/test/Modules/Inputs/NoUmbrella.framework/Headers/SubDir/C.h b/test/Modules/Inputs/NoUmbrella.framework/Headers/SubDir/C.h new file mode 100644 index 0000000000..4a9351aaaa --- /dev/null +++ b/test/Modules/Inputs/NoUmbrella.framework/Headers/SubDir/C.h @@ -0,0 +1 @@ +int no_umbrella_C; diff --git a/test/Modules/auto-module-import.m b/test/Modules/auto-module-import.m index d59099f5de..21e7968761 100644 --- a/test/Modules/auto-module-import.m +++ b/test/Modules/auto-module-import.m @@ -28,6 +28,10 @@ void testSubframeworkOther() { #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'}} |