diff options
author | Douglas Gregor <dgregor@apple.com> | 2011-12-08 17:01:29 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2011-12-08 17:01:29 +0000 |
commit | 2537a3648334fc0a51a68f3ee443cba2db8074be (patch) | |
tree | a10236aa39e0f65ac7efd766a17313c6a100537b /clang/lib/Lex/HeaderSearch.cpp | |
parent | ecd8a94acfc744026beddc1819cc61412904c1ad (diff) | |
download | bcm5719-llvm-2537a3648334fc0a51a68f3ee443cba2db8074be.tar.gz bcm5719-llvm-2537a3648334fc0a51a68f3ee443cba2db8074be.zip |
Keep track of import dependencies between submodules within the module
that's currently being built. This is important for supporting
transitive dependencies ("export *" in the module map) completely.
llvm-svn: 146156
Diffstat (limited to 'clang/lib/Lex/HeaderSearch.cpp')
-rw-r--r-- | clang/lib/Lex/HeaderSearch.cpp | 18 |
1 files changed, 5 insertions, 13 deletions
diff --git a/clang/lib/Lex/HeaderSearch.cpp b/clang/lib/Lex/HeaderSearch.cpp index 9a7230c24e6..b0668c53a44 100644 --- a/clang/lib/Lex/HeaderSearch.cpp +++ b/clang/lib/Lex/HeaderSearch.cpp @@ -197,7 +197,6 @@ const FileEntry *DirectoryLookup::LookupFile( HeaderSearch &HS, SmallVectorImpl<char> *SearchPath, SmallVectorImpl<char> *RelativePath, - StringRef BuildingModule, Module **SuggestedModule) const { llvm::SmallString<1024> TmpDir; if (isNormalDir()) { @@ -224,10 +223,7 @@ const FileEntry *DirectoryLookup::LookupFile( // If there is a module that corresponds to this header, // suggest it. - Module *Module = HS.findModuleForHeader(File); - if (Module && Module->getTopLevelModuleName() != BuildingModule) - *SuggestedModule = Module; - + *SuggestedModule = HS.findModuleForHeader(File); return File; } @@ -236,7 +232,7 @@ const FileEntry *DirectoryLookup::LookupFile( if (isFramework()) return DoFrameworkLookup(Filename, HS, SearchPath, RelativePath, - BuildingModule, SuggestedModule); + SuggestedModule); assert(isHeaderMap() && "Unknown directory lookup"); const FileEntry * const Result = getHeaderMap()->LookupFile( @@ -263,7 +259,6 @@ const FileEntry *DirectoryLookup::DoFrameworkLookup( HeaderSearch &HS, SmallVectorImpl<char> *SearchPath, SmallVectorImpl<char> *RelativePath, - StringRef BuildingModule, Module **SuggestedModule) const { FileManager &FileMgr = HS.getFileMgr(); @@ -322,11 +317,8 @@ const FileEntry *DirectoryLookup::DoFrameworkLookup( Module *Module = 0; if (SuggestedModule) { if (const DirectoryEntry *FrameworkDir - = FileMgr.getDirectory(FrameworkName)) { - if ((Module = HS.getFrameworkModule(ModuleName, FrameworkDir)) && - Module->Name == BuildingModule) - Module = 0; - } + = FileMgr.getDirectory(FrameworkName)) + Module = HS.getFrameworkModule(ModuleName, FrameworkDir); } // Check "/System/Library/Frameworks/Cocoa.framework/Headers/file.h" @@ -475,7 +467,7 @@ const FileEntry *HeaderSearch::LookupFile( for (; i != SearchDirs.size(); ++i) { const FileEntry *FE = SearchDirs[i].LookupFile(Filename, *this, SearchPath, RelativePath, - BuildingModule, SuggestedModule); + SuggestedModule); if (!FE) continue; CurDir = &SearchDirs[i]; |