summaryrefslogtreecommitdiffstats
path: root/clang/lib/Frontend/CompilerInstance.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2011-11-28 23:16:06 +0000
committerDouglas Gregor <dgregor@apple.com>2011-11-28 23:16:06 +0000
commitca295457e5cb61e2012a7f90be40c4775b973844 (patch)
tree2daf659f1edaacff705cfd6261279bac64f70f32 /clang/lib/Frontend/CompilerInstance.cpp
parent67f5d88869de1262fa766ff16d7338861d194c68 (diff)
downloadbcm5719-llvm-ca295457e5cb61e2012a7f90be40c4775b973844.tar.gz
bcm5719-llvm-ca295457e5cb61e2012a7f90be40c4775b973844.zip
When attempting to load a module that is not in the module cache,
return the module itself (in the module map) rather than returning the umbrella header used to build the module. While doing this, make sure that we're inferring modules for frameworks to build that module. llvm-svn: 145310
Diffstat (limited to 'clang/lib/Frontend/CompilerInstance.cpp')
-rw-r--r--clang/lib/Frontend/CompilerInstance.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/clang/lib/Frontend/CompilerInstance.cpp b/clang/lib/Frontend/CompilerInstance.cpp
index 838a0675f28..d1db46c4e18 100644
--- a/clang/lib/Frontend/CompilerInstance.cpp
+++ b/clang/lib/Frontend/CompilerInstance.cpp
@@ -1045,15 +1045,14 @@ ModuleKey CompilerInstance::loadModule(SourceLocation ImportLoc,
CurFile = SourceMgr.getFileEntryForID(SourceMgr.getMainFileID());
// Search for a module with the given name.
- std::string UmbrellaHeader;
+ ModuleMap::Module *Module = 0;
std::string ModuleFileName;
const FileEntry *ModuleFile
- = PP->getHeaderSearchInfo().lookupModule(ModuleName.getName(),
- &ModuleFileName,
- &UmbrellaHeader);
+ = PP->getHeaderSearchInfo().lookupModule(ModuleName.getName(), Module,
+ &ModuleFileName);
bool BuildingModule = false;
- if (!ModuleFile && !UmbrellaHeader.empty()) {
+ if (!ModuleFile && Module && Module->UmbrellaHeader) {
// We didn't find the module, but there is an umbrella header that
// can be used to create the module file. Create a separate compilation
// module to do so.
@@ -1080,8 +1079,9 @@ ModuleKey CompilerInstance::loadModule(SourceLocation ImportLoc,
getDiagnostics().Report(ModuleNameLoc, diag::warn_module_build)
<< ModuleName.getName();
BuildingModule = true;
- compileModule(*this, ModuleName.getName(), ModuleFileName, UmbrellaHeader);
- ModuleFile = PP->getHeaderSearchInfo().lookupModule(ModuleName.getName());
+ compileModule(*this, ModuleName.getName(), ModuleFileName,
+ Module->UmbrellaHeader->getName());
+ ModuleFile = FileMgr->getFile(ModuleFileName);
}
if (!ModuleFile) {
OpenPOWER on IntegriCloud