[PATCH] Tooling: Remove broken code in Replacement::setFromSourceLocation

Manuel Klimek klimek at google.com
Tue Sep 2 01:26:03 PDT 2014


+ariel who wrote the original patch

On Tue Sep 02 2014 at 1:41:37 AM Justin Bogner <mail at justinbogner.com>
wrote:

> Steffen Prohaska pointed out on cfe-dev that a condition is exactly
> backwards in an error_code check in Replaceent::setFromSourceLocation.
>
> The obvious fix of reversing the condition causes about 30 tests to
> fail, so it looks to me like we actually rely on the path *not* being
> made absolute. Furthermore, this has been broken like this for at least
> a year, and before that it didn't try making the path absolute.
>
> The attached patch simplifies the code such that it doesn't bother
> calling make_absolute. This preserves the current behaviour, passes all
> tests, and avoids the case where make_absolute fails and we use the
> result anyway.
>

The original patch where this was introduced is:
http://reviews.llvm.org/rL191776
Apparently the test in test/Tooling/clang-check-rel-path.cpp is incorrect
(?)
Ariel, did you actually see this test break at least once?

Cheers,
/Manuel


>
> _______________________________________________
> cfe-commits mailing list
> cfe-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20140902/27d63d16/attachment.html>


More information about the cfe-commits mailing list