diff options
author | Douglas Gregor <dgregor@apple.com> | 2011-11-29 19:06:37 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2011-11-29 19:06:37 +0000 |
commit | 514b636adab8c9934f82ba9a4beb600e2b3072e7 (patch) | |
tree | 04c0bb03b83232301d034d898b432b702f41bb3f /clang/lib/Lex/ModuleMap.cpp | |
parent | 6dc57927ea85c51a0adb8a781eb7c362fb7d7b13 (diff) | |
download | bcm5719-llvm-514b636adab8c9934f82ba9a4beb600e2b3072e7.tar.gz bcm5719-llvm-514b636adab8c9934f82ba9a4beb600e2b3072e7.zip |
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.
llvm-svn: 145415
Diffstat (limited to 'clang/lib/Lex/ModuleMap.cpp')
-rw-r--r-- | clang/lib/Lex/ModuleMap.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/clang/lib/Lex/ModuleMap.cpp b/clang/lib/Lex/ModuleMap.cpp index a25c93bfca4..3cc6478acf6 100644 --- a/clang/lib/Lex/ModuleMap.cpp +++ b/clang/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(), |