aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorDavid Malcolm <dmalcolm@redhat.com>2023-10-08 18:43:16 -0400
committerDavid Malcolm <dmalcolm@redhat.com>2023-10-08 18:43:16 -0400
commit25af7c1a806c0c2464d51fb395a88ced353be22d (patch)
tree4cb4618fa8025e0c99b7f6ef002f4221246295df /gcc
parent94caa6a6b4bd73b6c2bf3ab5e43ca42c5da4287a (diff)
downloadgcc-25af7c1a806c0c2464d51fb395a88ced353be22d.zip
gcc-25af7c1a806c0c2464d51fb395a88ced353be22d.tar.gz
gcc-25af7c1a806c0c2464d51fb395a88ced353be22d.tar.bz2
libcpp: "const" and other cleanups
No functional change intended. gcc/ChangeLog: * input.cc (make_location): Move implementation to line_maps::make_location. libcpp/ChangeLog: * include/line-map.h (line_maps::pure_location_p): New decl. (line_maps::get_pure_location): New decl. (line_maps::get_range_from_loc): New decl. (line_maps::get_start): New. (line_maps::get_finish): New. (line_maps::make_location): New decl. (get_range_from_loc): Make line_maps param const. (get_discriminator_from_loc): Likewise. (pure_location_p): Likewise. (get_pure_location): Likewise. (linemap_check_files_exited): Likewise. (linemap_tracks_macro_expansion_locs_p): Likewise. (linemap_location_in_system_header_p): Likewise. (linemap_location_from_macro_definition_p): Likewise. (linemap_macro_map_loc_unwind_toward_spelling): Likewise. (linemap_included_from_linemap): Likewise. (first_map_in_common): Likewise. (linemap_compare_locations): Likewise. (linemap_location_before_p): Likewise. (linemap_resolve_location): Likewise. (linemap_unwind_toward_expansion): Likewise. (linemap_unwind_to_first_non_reserved_loc): Likewise. (linemap_expand_location): Likewise. (linemap_get_file_highest_location): Likewise. (linemap_get_statistics): Likewise. (linemap_dump_location): Likewise. (linemap_dump): Likewise. (line_table_dump): Likewise. * internal.h (linemap_get_expansion_line): Likewise. (linemap_get_expansion_filename): Likewise. * line-map.cc (can_be_stored_compactly_p): Likewise. (get_data_from_adhoc_loc): Drop redundant "class". (get_discriminator_from_adhoc_loc): Likewise. (get_location_from_adhoc_loc): Likewise. (get_range_from_adhoc_loc): Likewise. (get_range_from_loc): Make const and move implementation to... (line_maps::get_range_from_loc): ...this new function. (get_discriminator_from_loc): Make line_maps param const. (pure_location_p): Make const and move implementation to... (line_maps::pure_location_p): ...this new function. (get_pure_location): Make const and move implementation to... (line_maps::get_pure_location): ...this new function. (linemap_included_from_linemap): Make line_maps param const. (linemap_check_files_exited): Likewise. (linemap_tracks_macro_expansion_locs_p): Likewise. (linemap_macro_map_loc_unwind_toward_spelling): Likewise. (linemap_get_expansion_line): Likewise. (linemap_get_expansion_filename): Likewise. (linemap_location_in_system_header_p): Likewise. (first_map_in_common_1): Likewise. (linemap_compare_locations): Likewise. (linemap_macro_loc_to_spelling_point): Likewise. (linemap_macro_loc_to_def_point): Likewise. (linemap_macro_loc_to_exp_point): Likewise. (linemap_resolve_location): Likewise. (linemap_location_from_macro_definition_p): Likewise. (linemap_unwind_toward_expansion): Likewise. (linemap_unwind_to_first_non_reserved_loc): Likewise. (linemap_expand_location): Likewise. (linemap_dump): Likewise. (linemap_dump_location): Likewise. (linemap_get_file_highest_location): Likewise. (linemap_get_statistics): Likewise. (line_table_dump): Likewise. Signed-off-by: David Malcolm <dmalcolm@redhat.com>
Diffstat (limited to 'gcc')
-rw-r--r--gcc/input.cc15
1 files changed, 4 insertions, 11 deletions
diff --git a/gcc/input.cc b/gcc/input.cc
index 1956f2f..a0e7cb1 100644
--- a/gcc/input.cc
+++ b/gcc/input.cc
@@ -1204,7 +1204,9 @@ expansion_point_location (location_t location)
}
/* Construct a location with caret at CARET, ranging from START to
- finish e.g.
+ FINISH.
+
+ For example, consider:
11111111112
12345678901234567890
@@ -1220,16 +1222,7 @@ expansion_point_location (location_t location)
location_t
make_location (location_t caret, location_t start, location_t finish)
{
- location_t pure_loc = get_pure_location (caret);
- source_range src_range;
- src_range.m_start = get_start (start);
- src_range.m_finish = get_finish (finish);
- location_t combined_loc = COMBINE_LOCATION_DATA (line_table,
- pure_loc,
- src_range,
- NULL,
- 0);
- return combined_loc;
+ return line_table->make_location (caret, start, finish);
}
/* Same as above, but taking a source range rather than two locations. */