From 2aa514130a99ffeaff6ae3cdddf609be358022be Mon Sep 17 00:00:00 2001 From: David Malcolm Date: Mon, 29 Aug 2016 20:42:57 +0000 Subject: Allow the use of ad-hoc locations for fix-it hints Currently the fix-it validator rejects ad-hoc locations. Fix this by calling get_pure_location on the input locations to add_fixit_insert/replace. Doing so requires moving get_pure_location from gcc to libcpp. gcc/ChangeLog: * diagnostic-show-locus.c (selftest::test_one_liner_fixit_validation_adhoc_locations): New function. (selftest::test_diagnostic_show_locus_one_liner): Call it. * input.c (get_pure_location): Move to libcpp/line-map.c. * input.h (get_pure_location): Convert decl to an inline function calling implementation in libcpp. libcpp/ChangeLog: * include/line-map.h (get_pure_location): New decl. * line-map.c (get_pure_location): Move here, from gcc/input.c, adding a line_maps * param. (rich_location::add_fixit_insert): Call get_pure_location on "where". (rich_location::add_fixit_replace): Call get_pure_location on the end-points. From-SVN: r239843 --- libcpp/ChangeLog | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'libcpp/ChangeLog') diff --git a/libcpp/ChangeLog b/libcpp/ChangeLog index 56971ad8e0c..37825f524d3 100644 --- a/libcpp/ChangeLog +++ b/libcpp/ChangeLog @@ -1,3 +1,12 @@ +2016-08-26 David Malcolm + + * include/line-map.h (get_pure_location): New decl. + * line-map.c (get_pure_location): Move here, from gcc/input.c, adding + a line_maps * param. + (rich_location::add_fixit_insert): Call get_pure_location on "where". + (rich_location::add_fixit_replace): Call get_pure_location on the + end-points. + 2016-08-26 David Malcolm * include/line-map.h (rich_location): Eliminate unimplemented -- cgit v1.2.3