avoid ///usr/include/foo.h, patch by Sean Middleditch

llvm-svn: 44731
This commit is contained in:
Chris Lattner 2007-12-09 00:39:55 +00:00
parent 283d094b75
commit 9c4aad2dba
1 changed files with 10 additions and 3 deletions

View File

@ -622,10 +622,17 @@ static std::vector<DirectoryLookup> IncludeGroup[4];
static void AddPath(const std::string &Path, IncludeDirGroup Group,
bool isCXXAware, bool isUserSupplied,
bool isFramework, FileManager &FM) {
assert(!Path.empty() && "can't handle empty path here");
const DirectoryEntry *DE;
if (Group == System)
if (Group == System) {
if (isysroot != "/")
DE = FM.getDirectory(isysroot + "/" + Path);
else if (Path[0] == '/')
DE = FM.getDirectory(Path);
else
DE = FM.getDirectory("/" + Path);
} else
DE = FM.getDirectory(Path);
if (DE == 0) {