Reverted r192992 broke windows and freebsd builds.

llvm-svn: 192997
This commit is contained in:
Ariel J. Bernal
2013-10-18 19:48:31 +00:00
parent d578b69867
commit 3255134ac5
2 changed files with 4 additions and 56 deletions

View File

@@ -107,16 +107,10 @@ void Replacement::setFromSourceLocation(SourceManager &Sources,
const FileEntry *Entry = Sources.getFileEntryForID(DecomposedLocation.first);
if (Entry != NULL) {
// Make FilePath absolute so replacements can be applied correctly when
// relative paths for files are used. But we don't want to change virtual
// files.
if (llvm::sys::fs::exists(Entry->getName())) {
llvm::SmallString<256> FilePath(Entry->getName());
llvm::sys::fs::make_absolute(FilePath);
this->FilePath = FilePath.c_str();
}
else {
this->FilePath = Entry->getName();
}
// relative paths for files are used.
llvm::SmallString<256> FilePath(Entry->getName());
llvm::error_code EC = llvm::sys::fs::make_absolute(FilePath);
this->FilePath = EC ? FilePath.c_str() : Entry->getName();
} else {
this->FilePath = InvalidLocation;
}