From 514b636adab8c9934f82ba9a4beb600e2b3072e7 Mon Sep 17 00:00:00 2001 From: Douglas Gregor Date: Tue, 29 Nov 2011 19:06:37 +0000 Subject: 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 --- clang/lib/Lex/ModuleMap.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'clang/lib/Lex/ModuleMap.cpp') diff --git a/clang/lib/Lex/ModuleMap.cpp b/clang/lib/Lex/ModuleMap.cpp index a25c93b..3cc6478 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::iterator M = Modules.begin(), -- cgit v1.1