================
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);
----------------
Ariel Bernal wrote:
> Manuel Klimek wrote:
> > 1. was it intentional that you removed the Entry != NULL check?
> > 2. please add a regression test
> No it wasn't, it was a mistake, I fixed it and added a regression test. The 
> problem is that this patch breaks many other tests  in c-index-test and also 
> some unit tests.
Which ones and why? The easiest way to review that would be if you included the 
fixes for all breaking tests in the patch :D


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