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 // expected-warning{{treating #include as an import of module 'NoUmbrella.A'}} int getNoUmbrellaA() { return no_umbrella_A; } +// Test umbrella-less submodule includes +#include // 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 // expected-warning{{treating #include as an import of module 'DependsOnModule.SubFramework.Other'}}