summaryrefslogtreecommitdiffstats
path: root/clang
diff options
context:
space:
mode:
authorBenjamin Kramer <benny.kra@googlemail.com>2015-10-06 14:45:13 +0000
committerBenjamin Kramer <benny.kra@googlemail.com>2015-10-06 14:45:13 +0000
commitcac8fc2329b8ee623c42944823f88b401a747ada (patch)
tree58424d1eb6cb519488a38fc4e02afc0ebfb95a67 /clang
parent63e6bd368738ea7b3464b16c383161a830b7eb8c (diff)
downloadbcm5719-llvm-cac8fc2329b8ee623c42944823f88b401a747ada.tar.gz
bcm5719-llvm-cac8fc2329b8ee623c42944823f88b401a747ada.zip
[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
Diffstat (limited to 'clang')
-rw-r--r--clang/lib/Tooling/Core/Replacement.cpp10
1 files changed, 1 insertions, 9 deletions
diff --git a/clang/lib/Tooling/Core/Replacement.cpp b/clang/lib/Tooling/Core/Replacement.cpp
index 5bea84fd44a..301c7b71ca9 100644
--- a/clang/lib/Tooling/Core/Replacement.cpp
+++ b/clang/lib/Tooling/Core/Replacement.cpp
@@ -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;
}
OpenPOWER on IntegriCloud