Skip to content

Commit

Permalink
When we have an umbrella directory in a module map, recursively walk
Browse files Browse the repository at this point in the history
the subdirectories to find headers in submodules.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146398 91177308-0d34-0410-b5e6-96231b3b80d8
  • Loading branch information
DougGregor committed Dec 12, 2011
1 parent 4cd9b8f commit 3b29bb9
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/Frontend/FrontendActions.cpp
Expand Up @@ -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.
Expand Down
@@ -0,0 +1 @@
int no_umbrella_C;
4 changes: 4 additions & 0 deletions test/Modules/auto-module-import.m
Expand Up @@ -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'}}

Expand Down

0 comments on commit 3b29bb9

Please sign in to comment.