aboutsummaryrefslogtreecommitdiff
path: root/lib/Lex/HeaderSearch.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Lex/HeaderSearch.cpp')
-rw-r--r--lib/Lex/HeaderSearch.cpp12
1 files changed, 11 insertions, 1 deletions
diff --git a/lib/Lex/HeaderSearch.cpp b/lib/Lex/HeaderSearch.cpp
index 4522de5cf3..3f50285430 100644
--- a/lib/Lex/HeaderSearch.cpp
+++ b/lib/Lex/HeaderSearch.cpp
@@ -127,9 +127,19 @@ const FileEntry *HeaderSearch::lookupModule(StringRef ModuleName,
if (!UmbrellaHeader)
return 0;
+ // Look in the module map to determine if there is a module by this name
+ // that has an umbrella header.
+ // FIXME: Even if it doesn't have an umbrella header, we should be able to
+ // handle the module. However, the caller isn't ready for that yet.
+ if (ModuleMap::Module *Module = ModMap.findModule(ModuleName)) {
+ if (Module->UmbrellaHeader) {
+ *UmbrellaHeader = Module->UmbrellaHeader->getName();
+ return 0;
+ }
+ }
+
// Look in each of the framework directories for an umbrella header with
// the same name as the module.
- // FIXME: We need a way for non-frameworks to provide umbrella headers.
llvm::SmallString<128> UmbrellaHeaderName;
UmbrellaHeaderName = ModuleName;
UmbrellaHeaderName += '/';