aboutsummaryrefslogtreecommitdiff
path: root/lib/Lex/HeaderSearch.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2011-11-11 22:18:48 +0000
committerDouglas Gregor <dgregor@apple.com>2011-11-11 22:18:48 +0000
commit65f3b5e99009f49d51eb00a859dbd2c2ee660718 (patch)
treebfe0e47aa7bbb690bd96e44adb23a058e196fd07 /lib/Lex/HeaderSearch.cpp
parent8b6d3deb5af464e1afbbeccdec369c5d4252b1a0 (diff)
Wire up the mapping from header files mentioned in module maps over to
the corresponding (top-level) modules. This isn't actually useful yet, because we don't yet have a way to build modules out of module maps. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@144410 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Lex/HeaderSearch.cpp')
-rw-r--r--lib/Lex/HeaderSearch.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/Lex/HeaderSearch.cpp b/lib/Lex/HeaderSearch.cpp
index 6403cfb868..4522de5cf3 100644
--- a/lib/Lex/HeaderSearch.cpp
+++ b/lib/Lex/HeaderSearch.cpp
@@ -205,7 +205,7 @@ const FileEntry *DirectoryLookup::LookupFile(
// If there is a module that corresponds to this header,
// suggest it.
- StringRef Module = HS.getModuleForHeader(File);
+ StringRef Module = HS.findModuleForHeader(File);
if (!Module.empty() && Module != BuildingModule)
*SuggestedModule = Module;
@@ -772,8 +772,10 @@ bool HeaderSearch::hasModuleMap(StringRef FileName,
return false;
}
-StringRef HeaderSearch::getModuleForHeader(const FileEntry *File) {
- // FIXME: Actually look for the corresponding module for this header.
+StringRef HeaderSearch::findModuleForHeader(const FileEntry *File) {
+ if (ModuleMap::Module *Module = ModMap.findModuleForHeader(File))
+ return Module->getTopLevelModuleName();
+
return StringRef();
}