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

Justin Bogner mail at justinbogner.com
Mon Sep 1 16:38:39 PDT 2014


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.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: refactoring.patch
Type: text/x-patch
Size: 998 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20140901/8651f551/attachment.bin>


More information about the cfe-commits mailing list