diff options
author | jakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4> | 2014-02-07 16:42:24 +0000 |
---|---|---|
committer | jakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4> | 2014-02-07 16:42:24 +0000 |
commit | 6e5a79132dcd23182f1ce7a6f1960002956100aa (patch) | |
tree | 0bdd845c1adb622d79a45e91abf5a44001f7be1c /libcpp | |
parent | 7a64c761698e15b8be5f4fbda6147bdc53bc0d5f (diff) | |
download | gcc-6e5a79132dcd23182f1ce7a6f1960002956100aa.tar.gz |
PR preprocessor/56824
* line-map.c (get_combined_adhoc_loc, linemap_get_expansion_line,
linemap_get_expansion_filename, linemap_location_in_system_header_p,
linemap_location_from_macro_expansion_p,
linemap_macro_loc_to_spelling_point, linemap_macro_loc_to_def_point,
linemap_macro_loc_to_exp_point, linemap_expand_location): Fix
formatting.
(linemap_compare_locations): Look through adhoc locations for both
l0 and l1.
* gcc.dg/pr56824.c: New test.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@207606 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libcpp')
-rw-r--r-- | libcpp/ChangeLog | 12 | ||||
-rw-r--r-- | libcpp/line-map.c | 45 |
2 files changed, 37 insertions, 20 deletions
diff --git a/libcpp/ChangeLog b/libcpp/ChangeLog index 90512820eb9..b7f2011190e 100644 --- a/libcpp/ChangeLog +++ b/libcpp/ChangeLog @@ -1,3 +1,15 @@ +2014-02-07 Jakub Jelinek <jakub@redhat.com> + + PR preprocessor/56824 + * line-map.c (get_combined_adhoc_loc, linemap_get_expansion_line, + linemap_get_expansion_filename, linemap_location_in_system_header_p, + linemap_location_from_macro_expansion_p, + linemap_macro_loc_to_spelling_point, linemap_macro_loc_to_def_point, + linemap_macro_loc_to_exp_point, linemap_expand_location): Fix + formatting. + (linemap_compare_locations): Look through adhoc locations for both + l0 and l1. + 2014-01-23 Dodji Seketeli <dodji@redhat.com> PR PR preprocessor/58580 diff --git a/libcpp/line-map.c b/libcpp/line-map.c index 7c7facbc760..f9a7658cbdb 100644 --- a/libcpp/line-map.c +++ b/libcpp/line-map.c @@ -106,8 +106,8 @@ get_combined_adhoc_loc (struct line_maps *set, linemap_assert (data); if (IS_ADHOC_LOC (locus)) - locus = - set->location_adhoc_data_map.data[locus & MAX_SOURCE_LOCATION].locus; + locus + = set->location_adhoc_data_map.data[locus & MAX_SOURCE_LOCATION].locus; if (locus == 0 && data == NULL) return 0; lb.locus = locus; @@ -141,8 +141,8 @@ get_combined_adhoc_loc (struct line_maps *set, } *slot = set->location_adhoc_data_map.data + set->location_adhoc_data_map.curr_loc; - set->location_adhoc_data_map.data[ - set->location_adhoc_data_map.curr_loc++] = lb; + set->location_adhoc_data_map.data[set->location_adhoc_data_map.curr_loc++] + = lb; } return ((*slot) - set->location_adhoc_data_map.data) | 0x80000000; } @@ -833,8 +833,8 @@ linemap_get_expansion_line (struct line_maps *set, const struct line_map *map = NULL; if (IS_ADHOC_LOC (location)) - location = set->location_adhoc_data_map.data[ - location & MAX_SOURCE_LOCATION].locus; + location = set->location_adhoc_data_map.data[location + & MAX_SOURCE_LOCATION].locus; if (location < RESERVED_LOCATION_COUNT) return 0; @@ -861,8 +861,8 @@ linemap_get_expansion_filename (struct line_maps *set, const struct line_map *map = NULL; if (IS_ADHOC_LOC (location)) - location = set->location_adhoc_data_map.data[ - location & MAX_SOURCE_LOCATION].locus; + location = set->location_adhoc_data_map.data[location + & MAX_SOURCE_LOCATION].locus; if (location < RESERVED_LOCATION_COUNT) return NULL; @@ -899,8 +899,8 @@ linemap_location_in_system_header_p (struct line_maps *set, const struct line_map *map = NULL; if (IS_ADHOC_LOC (location)) - location = set->location_adhoc_data_map.data[ - location & MAX_SOURCE_LOCATION].locus; + location = set->location_adhoc_data_map.data[location + & MAX_SOURCE_LOCATION].locus; if (location < RESERVED_LOCATION_COUNT) return false; @@ -942,8 +942,8 @@ linemap_location_from_macro_expansion_p (struct line_maps *set, source_location location) { if (IS_ADHOC_LOC (location)) - location = set->location_adhoc_data_map.data[ - location & MAX_SOURCE_LOCATION].locus; + location = set->location_adhoc_data_map.data[location + & MAX_SOURCE_LOCATION].locus; linemap_assert (location <= MAX_SOURCE_LOCATION && (set->highest_location @@ -1024,6 +1024,11 @@ linemap_compare_locations (struct line_maps *set, bool pre_virtual_p, post_virtual_p; source_location l0 = pre, l1 = post; + if (IS_ADHOC_LOC (l0)) + l0 = set->location_adhoc_data_map.data[l0 & MAX_SOURCE_LOCATION].locus; + if (IS_ADHOC_LOC (l1)) + l1 = set->location_adhoc_data_map.data[l1 & MAX_SOURCE_LOCATION].locus; + if (l0 == l1) return 0; @@ -1086,8 +1091,8 @@ linemap_macro_loc_to_spelling_point (struct line_maps *set, struct line_map *map; if (IS_ADHOC_LOC (location)) - location = set->location_adhoc_data_map.data[ - location & MAX_SOURCE_LOCATION].locus; + location = set->location_adhoc_data_map.data[location + & MAX_SOURCE_LOCATION].locus; linemap_assert (set && location >= RESERVED_LOCATION_COUNT); @@ -1124,8 +1129,8 @@ linemap_macro_loc_to_def_point (struct line_maps *set, struct line_map *map; if (IS_ADHOC_LOC (location)) - location = set->location_adhoc_data_map.data[ - location & MAX_SOURCE_LOCATION].locus; + location = set->location_adhoc_data_map.data[location + & MAX_SOURCE_LOCATION].locus; linemap_assert (set && location >= RESERVED_LOCATION_COUNT); @@ -1166,8 +1171,8 @@ linemap_macro_loc_to_exp_point (struct line_maps *set, struct line_map *map; if (IS_ADHOC_LOC (location)) - location = set->location_adhoc_data_map.data[ - location & MAX_SOURCE_LOCATION].locus; + location = set->location_adhoc_data_map.data[location + & MAX_SOURCE_LOCATION].locus; linemap_assert (set && location >= RESERVED_LOCATION_COUNT); @@ -1374,8 +1379,8 @@ linemap_expand_location (struct line_maps *set, if (IS_ADHOC_LOC (loc)) { loc = set->location_adhoc_data_map.data[loc & MAX_SOURCE_LOCATION].locus; - xloc.data = set->location_adhoc_data_map.data[ - loc & MAX_SOURCE_LOCATION].data; + xloc.data + = set->location_adhoc_data_map.data[loc & MAX_SOURCE_LOCATION].data; } if (loc < RESERVED_LOCATION_COUNT) |