GCC Middle and Back End API Reference
|
Data Structures | |
struct | pointer_map_t |
Functions | |
static size_t | hash1 () |
struct pointer_set_t * | pointer_set_create () |
void | pointer_set_destroy () |
bool | pointer_set_lookup () |
int | pointer_set_contains () |
int | pointer_set_insert () |
void | pointer_set_traverse (const struct pointer_set_t *pset, bool(*fn)(const void *, void *), void *data) |
struct pointer_map_t * | pointer_map_create () |
void | pointer_map_destroy (struct pointer_map_t *pmap) |
void ** | pointer_map_contains () |
void ** | pointer_map_insert () |
void | pointer_map_traverse (const struct pointer_map_t *pmap, bool(*fn)(const void *, void **, void *), void *data) |
|
inlinestatic |
@verbatim Set operations on pointers
Copyright (C) 2004-2013 Free Software Foundation, Inc.
This file is part of GCC.
GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3, or (at your option) any later version.
GCC is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with GCC; see the file COPYING3. If not see http://www.gnu.org/licenses/.
Use the multiplicative method, as described in Knuth 6.4, to obtain a hash code for P in the range [0, MAX). MAX == 2^LOGMAX. Summary of this method: Multiply p by some number A that's relatively prime to 2^sizeof(size_t). The result is two words. Discard the most significant word, and return the most significant N bits of the least significant word. As suggested by Knuth, our choice for A is the integer part of (ULONG_MAX + 1.0) / phi, where phi is the golden ratio. We don't need to do anything special for full-width multiplication because we're only interested in the least significant word of the product, and unsigned arithmetic in C is modulo the word size.
References HOST_BITS_PER_LONG, shift, and ul.
Referenced by pointer_set_lookup().
void** pointer_map_contains | ( | ) |
Returns a pointer to the value to which P maps, if PMAP contains P. P must be nonnull. Return NULL if PMAP does not contain P. Collisions are resolved by linear probing.
References pointer_set_lookup(), pointer_map_t::pset, and pointer_map_t::values.
Referenced by add_partitioned_vars_to_ptset(), add_scope_conflicts_1(), ao_ref_from_mem(), base_cand_from_table(), cgraph_node_set_find(), cgraph_node_set_remove(), check_cond_move_block(), clear_bb_predictions(), clear_lim_data(), combine_predictions_for_bb(), cond_move_convert_if_block(), cond_move_process_if_block(), contains_remapped_vars(), convert_nl_goto_receiver(), copy_arguments_for_versioning(), copy_debug_stmt(), copy_phis_for_bb(), copy_tree_body_r(), create_access_1(), create_task_copyfn(), discover_iteration_bound_by_body_walk(), expand_gimple_basic_block(), find_func_by_profile_id(), find_goto_replacement(), find_operand_rank(), get_addr_from_global_cache(), get_addr_from_local_cache(), get_base_access_vector(), get_cases_for_edge(), get_lim_data(), get_vi_for_tree(), gimple_predicted_by_p(), init_node_map(), initialize_inlined_parameters(), label_rtx_for_bb(), local_variable_can_escape(), lookup_call_use_vi(), lookup_decl(), lookup_field_for_decl(), lookup_tramp_for_decl(), lookup_vi_for_tree(), lower_resx(), lower_try_finally_switch(), lto_symtab_encoder_delete_node(), lto_symtab_encoder_encode(), lto_symtab_encoder_lookup(), mark_addressable(), maybe_duplicate_eh_stmt_fn(), maybe_lookup_decl(), move_stmt_eh_region_nr(), nesting_copy_decl(), niter_for_exit(), redirect_edge_var_map_clear(), redirect_edge_var_map_dup(), redirect_edge_var_map_vector(), remap_decl(), remap_eh_region_nr(), remap_gimple_op_r(), remap_gimple_stmt(), remap_save_expr(), remap_ssa_name(), remap_type(), remap_vla_decls(), remove_predictions_associated_with_edge(), replace_by_duplicate_decl(), replace_locals_op(), replace_ssa_name(), val_reset(), varpool_node_set_find(), varpool_node_set_remove(), visit_conflict(), and visit_op().
|
read |
Allocate an empty pointer map.
References pointer_set_t::log_slots, pointer_set_t::n_elements, pointer_set_t::n_slots, pointer_map_t::pset, pointer_set_t::slots, and pointer_map_t::values.
Referenced by add_stack_var(), aff_combination_expand(), build_duplicate_type(), cgraph_node_set_new(), compute_bb_dataflow(), cond_move_process_if_block(), copy_gimple_seq_and_replace_locals(), create_nesting_tree(), create_task_copyfn(), discover_iteration_bound_by_body_walk(), duplicate_eh_regions(), execute_lower_resx(), execute_strength_reduction(), expand_call_inline(), expand_used_vars(), finalize_nesting_tree_1(), find_goto_replacement(), gimple_expand_cfg(), init_alias_vars(), init_node_map(), init_reassoc(), init_vars_expansion(), insert_debug_decl_map(), lower_try_finally_switch(), lto_output_tree(), lto_symtab_encoder_new(), maybe_inline_call_in_expr(), move_sese_region_to_fn(), new_omp_context(), niter_for_exit(), redirect_edge_var_map_add(), remap_vla_decls(), sra_initialize(), start_recording_case_labels(), tree_estimate_probability(), tree_function_versioning(), tree_ssa_lim_initialize(), update_alias_info_with_stack_vars(), varpool_node_set_new(), vt_emit_notes(), and vt_initialize().
void pointer_map_destroy | ( | struct pointer_map_t * | pmap | ) |
Reclaims all memory associated with PMAP.
References pointer_map_t::pset, pointer_set_t::slots, and pointer_map_t::values.
Referenced by build_duplicate_type(), compute_bb_dataflow(), cond_move_process_if_block(), copy_cfg_body(), copy_gimple_seq_and_replace_locals(), create_task_copyfn(), del_node_map(), delete_omp_context(), delete_points_to_sets(), delete_tree_ssa(), discover_iteration_bound_by_body_walk(), end_recording_case_labels(), execute_lower_resx(), execute_strength_reduction(), expand_call_inline(), expand_used_vars(), finalize_nesting_tree_1(), fini_reassoc(), fini_vars_expansion(), free_affine_expand_cache(), free_cgraph_node_set(), free_loop_data(), free_nesting_tree(), free_varpool_node_set(), gimple_expand_cfg(), lower_try_finally(), lower_try_finally_switch(), lto_output_tree(), lto_symtab_encoder_delete(), maybe_inline_call_in_expr(), move_sese_region_to_fn(), redirect_edge_var_map_destroy(), remap_vla_decls(), sra_deinitialize(), tree_estimate_probability(), tree_function_versioning(), tree_ssa_lim_finalize(), update_alias_info_with_stack_vars(), vt_emit_notes(), and vt_finalize().
void** pointer_map_insert | ( | ) |
Inserts P into PMAP if it wasn't already there. Returns a pointer to the value. P must be nonnull.
References pointer_set_t::log_slots, pointer_set_t::n_elements, pointer_set_t::n_slots, pointer_set_lookup(), pointer_map_t::pset, pointer_set_t::slots, and pointer_map_t::values.
Referenced by add_cand_for_stmt(), add_stack_var(), aff_combination_expand(), cgraph_node_set_add(), check_cond_move_block(), convert_nl_goto_reference(), create_access_1(), DFS_write_tree(), discover_iteration_bound_by_body_walk(), duplicate_eh_regions_1(), expand_used_vars(), find_goto_replacement(), find_what_var_points_to(), get_addr_from_global_cache(), get_addr_from_local_cache(), get_call_vi(), get_cases_for_edge(), get_local_debug_decl(), get_nonlocal_debug_decl(), gimple_predict_edge(), init_lim_data(), init_node_map(), insert_debug_decl_map(), insert_decl_map(), insert_operand_rank(), insert_vi_for_tree(), label_rtx_for_bb(), lookup_field_for_decl(), lookup_tramp_for_decl(), lower_resx(), lower_try_finally_switch(), lto_symtab_encoder_encode(), maybe_inline_call_in_expr(), niter_for_exit(), redirect_edge_var_map_add(), redirect_edge_var_map_dup(), remap_save_expr(), replace_by_duplicate_decl(), replace_ssa_name(), task_copyfn_remap_type(), update_alias_info_with_stack_vars(), and varpool_node_set_add().
void pointer_map_traverse | ( | const struct pointer_map_t * | pmap, |
bool(*)(const void *, void **, void *) | fn, | ||
void * | data | ||
) |
Pass each pointer in PMAP to the function in FN, together with the pointer to the value and the fixed parameter DATA. If FN returns false, the iteration stops.
References pointer_set_t::n_slots, pointer_map_t::pset, pointer_set_t::slots, and pointer_map_t::values.
Referenced by end_recording_case_labels(), free_affine_expand_cache(), free_loop_data(), redirect_edge_var_map_destroy(), sra_deinitialize(), tree_estimate_probability(), and val_reset().
int pointer_set_contains | ( | ) |
Returns nonzero if PSET contains P. P must be nonnull. Collisions are resolved by linear probing.
References pointer_set_lookup().
Referenced by cond_store_replacement(), devirt_node_removal_hook(), enqueue_node(), find_comparison_args(), find_decls_types(), fld_worklist_push(), fold_marked_statements(), go_format_type(), go_output_typedef(), go_output_var(), lower_eh_dispatch(), maybe_lower_iteration_bound(), mfb_redirect_edges_in_set(), ssa_undefined_value_p(), suggest_attribute(), symtab_remove_unreachable_nodes(), verify_cgraph_node(), verify_eh_throw_stmt_node(), verify_location(), visit_hist(), and write_symbol().
|
read |
Allocate an empty pointer set.
References pointer_set_t::log_slots, pointer_set_t::n_elements, pointer_set_t::n_slots, and pointer_set_t::slots.
Referenced by add_new_function(), analyze_functions(), build_cgraph_edges(), copy_gimple_seq_and_replace_locals(), create_nesting_tree(), debug_tree_chain(), execute_late_warn_uninitialized(), expand_case(), find_comparison_args(), find_def_preds(), find_uninit_use(), form_subloop(), free_lang_data_in_cgraph(), get_non_trapping(), gimplify_body(), go_finish(), init_varasm_once(), inline_forbidden_p(), lower_eh_dispatch(), maybe_lower_iteration_bound(), merge_latch_edges(), mf_xform_decls(), new_omp_context(), optimize_inline_calls(), possible_polymorphic_call_targets(), produce_symtab(), propagate_threaded_block_debug_into(), pure_const_generate_summary(), record_references_in_initializer(), suggest_attribute(), symtab_remove_unreachable_nodes(), tree_function_versioning(), unshare_body(), update_alias_info_with_stack_vars(), verify_cgraph_node(), verify_gimple_in_cfg(), verify_histograms(), walk_tree_without_duplicates_1(), and walk_use_def_chains().
void pointer_set_destroy | ( | ) |
Reclaims all memory associated with PSET.
References pointer_set_t::slots.
Referenced by add_new_function(), analyze_functions(), build_cgraph_edges(), copy_gimple_seq_and_replace_locals(), debug_tree_chain(), delete_omp_context(), execute_late_warn_uninitialized(), expand_case(), find_comparison_args(), find_def_preds(), find_uninit_use(), form_subloop(), free_lang_data_in_cgraph(), free_nesting_tree(), free_polymorphic_call_targets_hash(), gimplify_body(), go_finish(), inline_forbidden_p(), lower_eh_dispatch(), maybe_lower_iteration_bound(), merge_latch_edges(), mf_xform_decls(), optimize_inline_calls(), possible_polymorphic_call_targets(), process_pending_assemble_externals(), produce_symtab(), propagate_threaded_block_debug_into(), pure_const_generate_summary(), record_references_in_initializer(), symtab_remove_unreachable_nodes(), tree_function_versioning(), tree_ssa_phiopt_worker(), unshare_body(), update_alias_info_with_stack_vars(), verify_cgraph_node(), verify_gimple_in_cfg(), verify_histograms(), walk_tree_without_duplicates_1(), and walk_use_def_chains().
int pointer_set_insert | ( | ) |
Inserts P into PSET if it wasn't already there. Returns nonzero if it was already there. P must be nonnull.
References pointer_set_t::log_slots, pointer_set_t::n_elements, pointer_set_t::n_slots, pointer_set_lookup(), and pointer_set_t::slots.
Referenced by add_or_mark_expr(), add_partitioned_vars_to_ptset(), analyze_functions(), assemble_external(), collect_phi_def_edges(), collect_subblocks(), convert_local_reference_op(), copy_bb(), debug_tree_chain(), execute_late_warn_uninitialized(), expand_case(), find_comparison_args(), find_uninit_use(), form_subloop(), gimplify_var_or_parm_decl(), go_format_type(), go_output_typedef(), go_output_var(), is_use_properly_guarded(), lower_eh_dispatch(), maybe_lower_iteration_bound(), maybe_record_node(), merge_latch_edges(), mostly_copy_tree_r(), omp_firstprivatize_type_sizes(), possible_polymorphic_call_targets(), process_references(), propagate_threaded_block_debug_into(), record_binfo(), suggest_attribute(), symtab_remove_unreachable_nodes(), verify_cgraph_node(), verify_gimple_in_cfg(), verify_histograms(), verify_node_sharing_1(), walk_tree_1(), walk_use_def_chains_1(), and write_symbol().
bool pointer_set_lookup | ( | ) |
Lookup the slot for the pointer P and return true if it exists, otherwise return false in which case *IX points to the slot that would be used on insertion.
References hash1(), pointer_set_t::log_slots, pointer_set_t::n_slots, and pointer_set_t::slots.
Referenced by pointer_map< T >::contains(), pointer_map< T >::insert(), pointer_map_contains(), pointer_map_insert(), pointer_set_contains(), and pointer_set_insert().
void pointer_set_traverse | ( | const struct pointer_set_t * | pset, |
bool(*)(const void *, void *) | fn, | ||
void * | data | ||
) |
Pass each pointer in PSET to the function in FN, together with the fixed parameter DATA. If FN returns false, the iteration stops.
References pointer_set_t::n_slots, and pointer_set_t::slots.
Referenced by finalize_nesting_tree_1(), and go_finish().