aboutsummaryrefslogtreecommitdiff
path: root/lib/Lex/HeaderSearch.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2011-12-08 17:01:29 +0000
committerDouglas Gregor <dgregor@apple.com>2011-12-08 17:01:29 +0000
commit5e3f9223db88227d6d21679c613b139d8160186d (patch)
treecd5f7d3c92868b2cd551b69e486c24bea716cccd /lib/Lex/HeaderSearch.cpp
parent53a75c07dbe79b3dd5dd88a0378aefa18f793083 (diff)
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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146156 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Lex/HeaderSearch.cpp')
-rw-r--r--lib/Lex/HeaderSearch.cpp18
1 files changed, 5 insertions, 13 deletions
diff --git a/lib/Lex/HeaderSearch.cpp b/lib/Lex/HeaderSearch.cpp
index 9a7230c24e..b0668c53a4 100644
--- a/lib/Lex/HeaderSearch.cpp
+++ b/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];