aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Lex/HeaderSearch.cpp
diff options
context:
space:
mode:
authorBen Langmuir <blangmuir@apple.com>2014-05-15 16:20:33 +0000
committerBen Langmuir <blangmuir@apple.com>2014-05-15 16:20:33 +0000
commitef914b89b4d1a8b203f506358e713e54b7b4865a (patch)
tree5e95b9979aa549ab4ec8ad76ed2f505d7c0a9d1d /clang/lib/Lex/HeaderSearch.cpp
parent73e047e54c8c09cd4aac146a809db663180ed441 (diff)
downloadllvm-ef914b89b4d1a8b203f506358e713e54b7b4865a.zip
llvm-ef914b89b4d1a8b203f506358e713e54b7b4865a.tar.gz
llvm-ef914b89b4d1a8b203f506358e713e54b7b4865a.tar.bz2
Use the virtual name of headers when searching for a module
When using the VFS, we want the virtual header location when searching for a framework module, since that will be the one in the correct directory structure for the module. I'll add a regression test once I finish reducing the larger one I have. llvm-svn: 208901
Diffstat (limited to 'clang/lib/Lex/HeaderSearch.cpp')
-rw-r--r--clang/lib/Lex/HeaderSearch.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/clang/lib/Lex/HeaderSearch.cpp b/clang/lib/Lex/HeaderSearch.cpp
index 87a5053..6d68c38 100644
--- a/clang/lib/Lex/HeaderSearch.cpp
+++ b/clang/lib/Lex/HeaderSearch.cpp
@@ -483,14 +483,9 @@ const FileEntry *DirectoryLookup::DoFrameworkLookup(
// If we found the header and are allowed to suggest a module, do so now.
if (FE && SuggestedModule) {
// Find the framework in which this header occurs.
- StringRef FrameworkPath = FE->getName();
+ StringRef FrameworkPath = FE->getDir()->getName();
bool FoundFramework = false;
do {
- // Get the parent directory name.
- FrameworkPath = llvm::sys::path::parent_path(FrameworkPath);
- if (FrameworkPath.empty())
- break;
-
// Determine whether this directory exists.
const DirectoryEntry *Dir = FileMgr.getDirectory(FrameworkPath);
if (!Dir)
@@ -502,6 +497,11 @@ const FileEntry *DirectoryLookup::DoFrameworkLookup(
FoundFramework = true;
break;
}
+
+ // Get the parent directory name.
+ FrameworkPath = llvm::sys::path::parent_path(FrameworkPath);
+ if (FrameworkPath.empty())
+ break;
} while (true);
if (FoundFramework) {