summaryrefslogtreecommitdiffstats
path: root/clang/lib/Tooling
diff options
context:
space:
mode:
authorAriel J. Bernal <ariel.j.bernal@intel.com>2013-10-18 19:48:31 +0000
committerAriel J. Bernal <ariel.j.bernal@intel.com>2013-10-18 19:48:31 +0000
commit3255134ac516413f34aba4ef7125ec6b3493764a (patch)
treeeb12bfbfeb05b49d86ef17fbc0b77c92acd59271 /clang/lib/Tooling
parentd578b6986752966ec7e5ea05c97a5422bc38398c (diff)
downloadbcm5719-llvm-3255134ac516413f34aba4ef7125ec6b3493764a.tar.gz
bcm5719-llvm-3255134ac516413f34aba4ef7125ec6b3493764a.zip
Reverted r192992 broke windows and freebsd builds.
llvm-svn: 192997
Diffstat (limited to 'clang/lib/Tooling')
-rw-r--r--clang/lib/Tooling/Refactoring.cpp14
1 files changed, 4 insertions, 10 deletions
diff --git a/clang/lib/Tooling/Refactoring.cpp b/clang/lib/Tooling/Refactoring.cpp
index 175dbd42ace..9e58db0f482 100644
--- a/clang/lib/Tooling/Refactoring.cpp
+++ b/clang/lib/Tooling/Refactoring.cpp
@@ -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;
}
OpenPOWER on IntegriCloud