aboutsummaryrefslogtreecommitdiff
path: root/libcpp/lex.cc
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
commit1f68a3e8727f36da80be8fe1c67ed6a4d9a568d9 (patch)
tree922b625640e0d50342b195af4afab81d6c8bc7b7 /libcpp/lex.cc
parent25af7c1a806c0c2464d51fb395a88ced353be22d (diff)
downloadgcc-1f68a3e8727f36da80be8fe1c67ed6a4d9a568d9.zip
gcc-1f68a3e8727f36da80be8fe1c67ed6a4d9a568d9.tar.gz
gcc-1f68a3e8727f36da80be8fe1c67ed6a4d9a568d9.tar.bz2
libcpp: eliminate COMBINE_LOCATION_DATA
This patch eliminates the function "COMBINE_LOCATION_DATA" (which hasn't been a macro since r6-739-g0501dbd932a7e9) and the function "get_combined_adhoc_loc" in favor of a new line_maps::get_or_create_combined_loc member function. No functional change intended. gcc/cp/ChangeLog: * module.cc (module_state::read_location): Update for renaming of get_combined_adhoc_loc. gcc/ChangeLog: * genmatch.cc (main): Update for "m_" prefix of some fields of line_maps. * input.cc (make_location): Update for removal of COMBINE_LOCATION_DATA. (dump_line_table_statistics): Update for "m_" prefix of some fields of line_maps. (location_with_discriminator): Update for removal of COMBINE_LOCATION_DATA. (line_table_test::line_table_test): Update for "m_" prefix of some fields of line_maps. * toplev.cc (general_init): Likewise. * tree.cc (set_block): Update for removal of COMBINE_LOCATION_DATA. (set_source_range): Likewise. libcpp/ChangeLog: * include/line-map.h (line_maps::reallocator): Rename to... (line_maps::m_reallocator): ...this. (line_maps::round_alloc_size): Rename to... (line_maps::m_round_alloc_size): ...this. (line_maps::location_adhoc_data_map): Rename to... (line_maps::m_location_adhoc_data_map): ...this. (line_maps::num_optimized_ranges): Rename to... (line_maps::m_num_optimized_ranges): ..this. (line_maps::num_unoptimized_ranges): Rename to... (line_maps::m_num_unoptimized_ranges): ...this. (get_combined_adhoc_loc): Delete decl. (COMBINE_LOCATION_DATA): Delete. * lex.cc (get_location_for_byte_range_in_cur_line): Update for removal of COMBINE_LOCATION_DATA. (warn_about_normalization): Likewise. (_cpp_lex_direct): Likewise. * line-map.cc (line_maps::~line_maps): Update for "m_" prefix of some fields of line_maps. (rebuild_location_adhoc_htab): Likewise. (can_be_stored_compactly_p): Convert to... (line_maps::can_be_stored_compactly_p): ...this private member function. (get_combined_adhoc_loc): Convert to... (line_maps::get_or_create_combined_loc): ...this public member function. (line_maps::make_location): Update for removal of COMBINE_LOCATION_DATA. (get_data_from_adhoc_loc): Update for "m_" prefix of some fields of line_maps. (get_discriminator_from_adhoc_loc): Likewise. (get_location_from_adhoc_loc): Likewise. (get_range_from_adhoc_loc): Convert to... (line_maps::get_range_from_adhoc_loc): ...this private member function. (line_maps::get_range_from_loc): Update for conversion of get_range_from_adhoc_loc to a member function. (linemap_init): Update for "m_" prefix of some fields of line_maps. (line_map_new_raw): Likewise. (linemap_enter_macro): Likewise. (linemap_get_statistics): Likewise. Signed-off-by: David Malcolm <dmalcolm@redhat.com>
Diffstat (limited to 'libcpp/lex.cc')
-rw-r--r--libcpp/lex.cc20
1 files changed, 10 insertions, 10 deletions
diff --git a/libcpp/lex.cc b/libcpp/lex.cc
index 8dea4d3..ce8ff61 100644
--- a/libcpp/lex.cc
+++ b/libcpp/lex.cc
@@ -1362,11 +1362,11 @@ get_location_for_byte_range_in_cur_line (cpp_reader *pfile,
source_range src_range;
src_range.m_start = start_loc;
src_range.m_finish = end_loc;
- location_t combined_loc = COMBINE_LOCATION_DATA (pfile->line_table,
- start_loc,
- src_range,
- NULL,
- 0);
+ location_t combined_loc
+ = pfile->line_table->get_or_create_combined_loc (start_loc,
+ src_range,
+ nullptr,
+ 0);
return combined_loc;
}
@@ -2032,8 +2032,8 @@ warn_about_normalization (cpp_reader *pfile,
= linemap_position_for_column (pfile->line_table,
CPP_BUF_COLUMN (pfile->buffer,
pfile->buffer->cur));
- loc = COMBINE_LOCATION_DATA (pfile->line_table,
- loc, tok_range, NULL, 0);
+ loc = pfile->line_table->get_or_create_combined_loc (loc, tok_range,
+ nullptr, 0);
}
encoding_rich_location rich_loc (pfile, loc);
@@ -4333,9 +4333,9 @@ _cpp_lex_direct (cpp_reader *pfile)
= linemap_position_for_column (pfile->line_table,
CPP_BUF_COLUMN (buffer, buffer->cur));
- result->src_loc = COMBINE_LOCATION_DATA (pfile->line_table,
- result->src_loc,
- tok_range, NULL, 0);
+ result->src_loc
+ = pfile->line_table->get_or_create_combined_loc (result->src_loc,
+ tok_range, nullptr, 0);
}
return result;