summaryrefslogtreecommitdiff
path: root/lib/Lex/ModuleMap.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2011-11-29 19:06:37 +0000
committerDouglas Gregor <dgregor@apple.com>2011-11-29 19:06:37 +0000
commitf9e357d8a66c606a86a6e1aef678898b8843bd30 (patch)
tree7ab77c3935faa49ea645bd0de570bbe875e5d8c9 /lib/Lex/ModuleMap.cpp
parent933e7a61da12400d8971890719cb03d68c1b02eb (diff)
downloadclang-f9e357d8a66c606a86a6e1aef678898b8843bd30.tar.gz
clang-f9e357d8a66c606a86a6e1aef678898b8843bd30.tar.bz2
clang-f9e357d8a66c606a86a6e1aef678898b8843bd30.tar.xz
Teach the module import mechanism how to rebuild modules expressed via
module map, rather than assuming that there is an umbrella header. This allows us to automatically build umbrella-less modules. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@145415 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Lex/ModuleMap.cpp')
-rw-r--r--lib/Lex/ModuleMap.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/Lex/ModuleMap.cpp b/lib/Lex/ModuleMap.cpp
index a25c93bfca..3cc6478acf 100644
--- a/lib/Lex/ModuleMap.cpp
+++ b/lib/Lex/ModuleMap.cpp
@@ -206,6 +206,15 @@ ModuleMap::inferFrameworkModule(StringRef ModuleName,
return Result;
}
+const FileEntry *
+ModuleMap::getContainingModuleMapFile(ModuleMap::Module *Module) {
+ if (Module->DefinitionLoc.isInvalid() || !SourceMgr)
+ return 0;
+
+ return SourceMgr->getFileEntryForID(
+ SourceMgr->getFileID(Module->DefinitionLoc));
+}
+
void ModuleMap::dump() {
llvm::errs() << "Modules:";
for (llvm::StringMap<Module *>::iterator M = Modules.begin(),