GCC Middle and Back End API Reference
cfg_diagnostic_digraph Class Reference
Inheritance diagram for cfg_diagnostic_digraph:
Collaboration diagram for cfg_diagnostic_digraph:

Public Member Functions

 cfg_diagnostic_digraph (function *fun, opt_pass *pass)
std::unique_ptr< diagnostics::digraphs::digraphcreate_object () const final override
void add_cluster_for_function (diagnostics::digraphs::digraph &g, function *fun) const
const diagnostics::digraphs::digraphget_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

functionm_fun
opt_passm_pass
std::unique_ptr< diagnostics::digraphs::digraphm_object

Detailed Description

Disable warnings about quoting issues in the pp_xxx calls below
that (intentionally) don't follow GCC diagnostic conventions.   

Member Typedef Documentation

◆ bb_to_node_map

Constructor & Destructor Documentation

◆ cfg_diagnostic_digraph()

cfg_diagnostic_digraph::cfg_diagnostic_digraph ( function * fun,
opt_pass * pass )
inline

References m_fun, and m_pass.

Member Function Documentation

◆ add_cfg_edges()

◆ add_cfg_node()

◆ add_cfg_node_succ_edges()

void cfg_diagnostic_digraph::add_cfg_node_succ_edges ( diagnostics::digraphs::digraph & g,
bb_to_node_map & node_map,
int ,
basic_block bb ) const
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().

◆ add_cfg_nodes()

void cfg_diagnostic_digraph::add_cfg_nodes ( diagnostics::digraphs::digraph & g,
bb_to_node_map & node_map,
diagnostics::digraphs::node & parent_node,
function * fun ) const
inlineprivate

◆ add_cfg_nodes_for_loop()

void cfg_diagnostic_digraph::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
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().

◆ add_cfg_nodes_no_loops()

◆ add_cluster_for_function()

void cfg_diagnostic_digraph::add_cluster_for_function ( diagnostics::digraphs::digraph & g,
function * fun ) const
inline

◆ create_object()

std::unique_ptr< diagnostics::digraphs::digraph > cfg_diagnostic_digraph::create_object ( ) const
inlinefinaloverridevirtual

◆ get_or_create()

const diagnostics::digraphs::digraph & lazily_created< diagnostics::digraphs::digraph >::get_or_create ( ) const
inlineinherited

◆ handle_edge_flag()

void cfg_diagnostic_digraph::handle_edge_flag ( json::array & flag_arr,
const char * flag_name,
bool value ) const
inlineprivate

Field Documentation

◆ m_fun

function* cfg_diagnostic_digraph::m_fun
private

◆ m_object

std::unique_ptr<diagnostics::digraphs::digraph> lazily_created< diagnostics::digraphs::digraph >::m_object
mutableprivateinherited

◆ m_pass

opt_pass* cfg_diagnostic_digraph::m_pass
private

The documentation for this class was generated from the following file: