|
GCC Middle and Back End API Reference
|


Public Member Functions | |
| cfg_diagnostic_digraph (function *fun, opt_pass *pass) | |
| std::unique_ptr< diagnostics::digraphs::digraph > | create_object () const final override |
| void | add_cluster_for_function (diagnostics::digraphs::digraph &g, function *fun) const |
| const diagnostics::digraphs::digraph & | get_or_create () const |
Private Types | |
| typedef std::map< basic_block, diagnostics::digraphs::node * > | bb_to_node_map |
Private Member Functions | |
| void | add_cfg_node (diagnostics::digraphs::digraph &g, bb_to_node_map &node_map, diagnostics::digraphs::node &parent_node, int funcdef_no, basic_block bb) const |
| void | add_cfg_node_succ_edges (diagnostics::digraphs::digraph &g, bb_to_node_map &node_map, int, basic_block bb) const |
| void | handle_edge_flag (json::array &flag_arr, const char *flag_name, bool value) const |
| void | add_cfg_nodes_no_loops (diagnostics::digraphs::digraph &g, bb_to_node_map &node_map, diagnostics::digraphs::node &parent_node, function *fun) const |
| void | add_cfg_nodes_for_loop (diagnostics::digraphs::digraph &g, bb_to_node_map &node_map, diagnostics::digraphs::node *parent_node, int funcdef_no, class loop *loop) const |
| void | add_cfg_nodes (diagnostics::digraphs::digraph &g, bb_to_node_map &node_map, diagnostics::digraphs::node &parent_node, function *fun) const |
| void | add_cfg_edges (diagnostics::digraphs::digraph &g, bb_to_node_map &node_map, function *fun) const |
Private Attributes | |
| function * | m_fun |
| opt_pass * | m_pass |
| std::unique_ptr< diagnostics::digraphs::digraph > | m_object |
Disable warnings about quoting issues in the pp_xxx calls below that (intentionally) don't follow GCC diagnostic conventions.
|
private |
|
inlineprivate |
References add_cfg_node_succ_edges(), bitmap_bit_p, bitmap_set_bit, FOR_ALL_BB_FN, FOR_EACH_BB_FN, FOR_EACH_EDGE, function::funcdef_no, g, mark_dfs_back_edges(), and basic_block_def::succs.
Referenced by add_cluster_for_function().
|
inlineprivate |
References diagnostics::digraphs::node::add_child(), dump_bb_as_sarif_properties(), funcdef_no, g, basic_block_def::index, pp_formatted_text(), and pp_printf().
Referenced by add_cfg_nodes_for_loop(), and add_cfg_nodes_no_loops().
|
inlineprivate |
Flags on basic blocks and edges. Copyright (C) 2012-2026 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/>.
This file defines flags that may appear on basic blocks or on edges. Source files define DEF_BASIC_BLOCK_FLAG or DEF_EDGE_FLAG appropriately before including this file.
Masks for edge.flags. The format of this file is: DEF_EDGE_FLAG(NAME, IDX, STRING). NAME is the name of the edge flag. A flag EDGE_#NAME will be created and the name is used in dump_edge_info. IDX is a sequence number that is used to determine the value of the flag, which is 1 << IDX).
'Straight line' flow. In GIMPLE and in cfglayout mode, all normal edges are fallthru edges. In cfgrtl mode, this flag really means that control flow falls through to the next basic block in the line.
Strange flow, like a computed jump or exception handling. Usually this means that the edge cannot be split.
Edge out of a basic block that ends with a CALL_INSN with abnormal exit, like an exception or a non-local goto. ABNORMAL_CALL edges also have ABNORMAL set. This flag is only used for the RTL CFG.
Exception edge. Exception handling edges represent possible control transfers from a trapping instruction to an exception handler. EH edges also have ABNORMAL set for the RTL CFG.
Never merge blocks via this edge. This is used for exception handling, to prevent merging away edges to the post-landing-pad basic block. This flag is only used for the RTL CFG.
Not a real edge. This is used to connect parts of the CFG that do not halt, such as infinite loops and noreturn functions, to the EXIT_BLOCK, so that traversing of the reverse CFG is possible.
A back edge, marked in a depth-first search of the CFG. Back edges are hints that this edge may be part of a loop in the CFG.
Edge in a part of the CFG that is an irreducible loop.
Edge taken when controlling predicate is nonzero. This is only used for the GIMPLE CFG.
Edge taken when controlling predicate is zero. This is only used for the GIMPLE CFG.
Edge is executable. This is only used in GIMPLE SSA-CCP and VRP. This is only used for the GIMPLE CFG.
Edge crosses between hot and cold sections, when we do partitioning. This flag is only used for the RTL CFG.
Edge from a sibcall CALL_INSN to exit. SIBCALL edges also have ABNORMAL set. This flag is only used for the RTL CFG.
Candidate for straight line flow. Only used in bb-reorder.cc. This flag is only used for the RTL CFG.
Exit of a loop. This is only used in ifcvt.cc. This flag is only used for the RTL CFG.
Uninstrumented edge out of a GIMPLE_TRANSACTION statement.
Abort (over) edge out of a GIMPLE_TRANSACTION statement.
An edge we should ignore. It should be entirely local to passes. ie, it is never set on any edge upon the completion of any pass.
References FOR_EACH_EDGE, g, gcc_assert, REG_BR_PROB_BASE, and basic_block_def::succs.
Referenced by add_cfg_edges().
|
inlineprivate |
References add_cfg_nodes_for_loop(), add_cfg_nodes_no_loops(), cfun, function::funcdef_no, g, get_loop(), and loops_for_fn().
Referenced by add_cluster_for_function().
|
inlineprivate |
Add all the basic blocks in LOOP. Add the blocks in breath-first order to get a good ranking of the nodes. This function is recursive: It first adds inner loops, then the body of LOOP itself.
References add_cfg_node(), add_cfg_nodes_for_loop(), diagnostics::digraphs::node::add_child(), cfun, EXIT_BLOCK_PTR_FOR_FN, free(), funcdef_no, g, gcc_assert, get_loop_body(), get_loop_body_in_bfs_order(), loop::header, i, loop::inner, loop::latch, loop_depth(), basic_block_def::loop_father, loop::next, NULL, loop::num, loop::num_nodes, pp_formatted_text(), pp_printf(), and diagnostics::digraphs::object::set_property().
Referenced by add_cfg_nodes(), and add_cfg_nodes_for_loop().
|
inlineprivate |
References add_cfg_node(), BASIC_BLOCK_FOR_FN, bitmap_bit_p, bitmap_clear(), bitmap_set_bit, FOR_ALL_BB_FN, free(), function::funcdef_no, g, i, basic_block_def::index, last_basic_block_for_fn, n_basic_blocks_for_fn, NULL, pre_and_rev_post_order_compute_fn(), and visited.
Referenced by add_cfg_nodes().
|
inline |
References add_cfg_edges(), add_cfg_nodes(), function_name(), and g.
Referenced by create_object().
|
inlinefinaloverridevirtual |
Implements lazily_created< diagnostics::digraphs::digraph >.
References add_cluster_for_function(), final(), function_name(), g, m_fun, m_pass, pp_formatted_text(), and pp_printf().
|
inlineinherited |
|
inlineprivate |
References json::array::append_string().
|
private |
Referenced by cfg_diagnostic_digraph(), and create_object().
|
mutableprivateinherited |
|
private |
Referenced by cfg_diagnostic_digraph(), and create_object().