================
Comment at: lib/Tooling/Refactoring.cpp:108-112
@@ -105,3 +107,7 @@
   const FileEntry *Entry = Sources.getFileEntryForID(DecomposedLocation.first);
-  this->FilePath = Entry != NULL ? Entry->getName() : InvalidLocation;
+  // Make FilePath absolute so replacements can be applied correctly when
+  // relative paths for files are used.
+  llvm::SmallString<256> FilePath(Entry->getName());
+  llvm::sys::fs::make_absolute(FilePath);
+  this->FilePath = FilePath.c_str();
   this->ReplacementRange = Range(DecomposedLocation.second, Length);
----------------
1. was it intentional that you removed the Entry != NULL check?
2. please add a regression test


http://llvm-reviews.chandlerc.com/D1771
_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

Reply via email to