[Tooling] Remove dead code.

It took me some time to figure out why this is not working as expected:
std:error_code converts to true if there is an error. This means we never
ever took the generated absolute path, which happens to be the right thing
anyways as it properly works with virtual files. Just remove the whole
thing, relative paths are covered by existing tooling tests.

llvm-svn: 249408
This commit is contained in:
Benjamin Kramer 2015-10-06 14:45:13 +00:00
parent 63e6bd3687
commit cac8fc2329
1 changed files with 1 additions and 9 deletions

View File

@ -113,15 +113,7 @@ void Replacement::setFromSourceLocation(const SourceManager &Sources,
const std::pair<FileID, unsigned> DecomposedLocation =
Sources.getDecomposedLoc(Start);
const FileEntry *Entry = Sources.getFileEntryForID(DecomposedLocation.first);
if (Entry) {
// Make FilePath absolute so replacements can be applied correctly when
// relative paths for files are used.
llvm::SmallString<256> FilePath(Entry->getName());
std::error_code EC = llvm::sys::fs::make_absolute(FilePath);
this->FilePath = EC ? FilePath.c_str() : Entry->getName();
} else {
this->FilePath = InvalidLocation;
}
this->FilePath = Entry ? Entry->getName() : InvalidLocation;
this->ReplacementRange = Range(DecomposedLocation.second, Length);
this->ReplacementText = ReplacementText;
}