GCC Middle and Back End API Reference
|
#include <domwalk.h>
Public Types | |
enum | reachability { ALL_BLOCKS , REACHABLE_BLOCKS , REACHABLE_BLOCKS_PRESERVING_FLAGS } |
Public Member Functions | |
dom_walker (cdi_direction direction, enum reachability=ALL_BLOCKS, int *bb_index_to_rpo=NULL) | |
~dom_walker () | |
void | walk (basic_block) |
virtual edge | before_dom_children (basic_block) |
virtual void | after_dom_children (basic_block) |
Static Public Attributes | |
static const edge | STOP = (edge)-1 |
Private Member Functions | |
bool | bb_reachable (struct function *, basic_block) |
void | propagate_unreachable_to_edges (basic_block, FILE *, dump_flags_t) |
Private Attributes | |
enum cdi_direction | m_dom_direction: 2 |
enum reachability | m_reachability: 2 |
bool | m_user_bb_to_rpo |
basic_block | m_unreachable_dom |
int * | m_bb_to_rpo |
Generic dominator tree walker Copyright (C) 2003-2024 Free Software Foundation, Inc. Contributed by Diego Novillo <dnovillo@redhat.com> 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/>.
This is the main class for the dominator walker. It is expected that consumers will have a custom class inheriting from it, which will over ride at least one of before_dom_children and after_dom_children to implement the custom behavior.
dom_walker::dom_walker | ( | cdi_direction | direction, |
enum reachability | reachability = ALL_BLOCKS, | ||
int * | bb_index_to_rpo = NULL ) |
Constructor for a dom walker.
dom_walker::~dom_walker | ( | ) |
Destructor.
References free(), m_bb_to_rpo, and m_user_bb_to_rpo.
|
inlinevirtual |
Reimplemented in dom_opt_dom_walker, eliminate_dom_walker, nontrapping_dom_walker, rewrite_dom_walker, rewrite_update_dom_walker, strlen_pass, substitute_and_fold_dom_walker, and uncprop_dom_walker.
Referenced by walk().
|
private |
Return TRUE if BB is reachable, false otherwise.
References ALL_BLOCKS, CDI_DOMINATORS, dominated_by_p(), ENTRY_BLOCK_PTR_FOR_FN, FOR_EACH_EDGE, m_reachability, m_unreachable_dom, and basic_block_def::preds.
Referenced by walk().
|
inlinevirtual |
Reimplemented in analysis_dom_walker, check_array_bounds_dom_walker, dom_opt_dom_walker, eliminate_dom_walker, find_candidates_dom_walker, find_comparison_dom_walker, ipcp_modif_dom_walker, mark_def_dom_walker, nontrapping_dom_walker, rewrite_dom_walker, rewrite_update_dom_walker, strlen_pass, substitute_and_fold_dom_walker, and uncprop_dom_walker.
References NULL.
Referenced by walk().
|
private |
BB has been determined to be unreachable. Propagate that property to incoming and outgoing edges of BB as appropriate.
References CDI_DOMINATORS, dominated_by_p(), dump_file, dump_flags, FOR_EACH_EDGE, basic_block_def::index, m_unreachable_dom, basic_block_def::preds, basic_block_def::succs, and TDF_DETAILS.
Referenced by walk().
void dom_walker::walk | ( | basic_block | bb | ) |
Recursively walk the dominator tree. BB is the basic block we are currently visiting.
References after_dom_children(), bb_reachable(), before_dom_children(), CDI_DOMINATORS, cfun, dump_file, dump_flags, EDGE_COUNT, ENTRY_BLOCK_PTR_FOR_FN, EXIT_BLOCK_PTR_FOR_FN, first_dom_son(), FOR_EACH_EDGE, free(), i, last_basic_block_for_fn, m_bb_to_rpo, m_dom_direction, m_reachability, m_unreachable_dom, m_user_bb_to_rpo, n_basic_blocks_for_fn, next_dom_son(), NULL, pre_and_rev_post_order_compute(), basic_block_def::preds, propagate_unreachable_to_edges(), REACHABLE_BLOCKS, set_all_edges_as_executable(), sort_bbs_postorder(), STOP, basic_block_def::succs, and worklist.
Referenced by array_bounds_checker::check(), eliminate_with_rpo_vn(), find_comparisons(), get_non_trapping(), ipa_analyze_node(), ipcp_transform_function(), rewrite_blocks(), and substitute_and_fold_engine::substitute_and_fold().
|
private |
Referenced by walk(), and ~dom_walker().
|
private |
Referenced by walk().
|
private |
Referenced by bb_reachable(), and walk().
|
private |
Referenced by bb_reachable(), propagate_unreachable_to_edges(), and walk().
|
private |
Referenced by walk(), and ~dom_walker().
Referenced by rewrite_update_dom_walker::before_dom_children(), and walk().