21#ifndef GCC_ANALYZER_SUPERGRAPH_H
22#define GCC_ANALYZER_SUPERGRAPH_H
175 std::unique_ptr<json::object>
to_json ()
const;
189 return *
map.get (fun);
262 std::unique_ptr<json::object>
to_json ()
const;
325 const final override;
328 bool user_facing)
const = 0;
330 std::unique_ptr<json::object>
to_json ()
const;
597 return sedge->dyn_cast_switch_cfg_superedge () !=
NULL;
612 static std::unique_ptr<eh_dispatch_cfg_superedge>
637 std::unique_ptr<rejected_constraint> *out)
const = 0;
656 return sedge->dyn_cast_eh_dispatch_cfg_superedge () !=
NULL;
684 bool user_facing)
const final override;
692 std::unique_ptr<rejected_constraint> *out)
693 const final override;
706 return sedge->dyn_cast_eh_dispatch_try_cfg_superedge () !=
NULL;
734 bool user_facing)
const final override;
740 std::unique_ptr<rejected_constraint> *out)
741 const final override;
756 return sedge->dyn_cast_eh_dispatch_allowed_cfg_superedge () !=
NULL;
769 bool within_table ATTRIBUTE_UNUSED)
776 bool within_row ATTRIBUTE_UNUSED)
#define ENTRY_BLOCK_PTR_FOR_FN(FN)
Definition basic-block.h:194
#define EXIT_BLOCK_PTR_FOR_FN(FN)
Definition basic-block.h:195
Definition supergraph.h:453
call_superedge * dyn_cast_call_superedge() final override
Definition supergraph.h:459
call_superedge(supernode *src, supernode *dst, cgraph_edge *cedge)
Definition supergraph.h:455
const call_superedge * dyn_cast_call_superedge() const final override
Definition supergraph.h:463
return_superedge * get_edge_for_return(const supergraph &sg) const
Definition supergraph.h:468
Definition supergraph.h:400
const gcall & get_call_stmt() const
tree map_expr_from_callee_to_caller(tree callee_expr, callsite_expr *out) const
tree get_arg_for_parm(tree parm, callsite_expr *out) const
function * get_caller_function() const
tree get_callee_decl() const
callgraph_superedge(supernode *src, supernode *dst, enum edge_kind kind, cgraph_edge *cedge)
Definition supergraph.h:402
cgraph_edge *const m_cedge
Definition supergraph.h:433
callgraph_superedge * dyn_cast_callgraph_superedge() final override
Definition supergraph.h:411
tree map_expr_from_caller_to_callee(tree caller_expr, callsite_expr *out) const
tree get_parm_for_arg(tree arg, callsite_expr *out) const
function * get_callee_function() const
tree get_caller_decl() const
void dump_label_to_pp(pretty_printer *pp, bool user_facing) const final override
const callgraph_superedge * dyn_cast_callgraph_superedge() const final override
Definition supergraph.h:415
Definition supergraph.h:366
static callsite_expr from_zero_based_param(int idx)
Definition supergraph.h:370
callsite_expr()
Definition supergraph.h:368
int m_val
Definition supergraph.h:393
static callsite_expr from_return_value()
Definition supergraph.h:375
bool return_value_p() const
Definition supergraph.h:385
callsite_expr(int val)
Definition supergraph.h:391
bool param_p() const
Definition supergraph.h:380
Definition supergraph.h:522
const ::edge m_cfg_edge
Definition supergraph.h:545
int true_value_p() const
Definition supergraph.h:535
location_t get_goto_locus() const
Definition supergraph.h:542
void dump_label_to_pp(pretty_printer *pp, bool user_facing) const override
size_t get_phi_arg_idx() const
cfg_superedge * dyn_cast_cfg_superedge() final override
Definition supergraph.h:530
int get_flags() const
Definition supergraph.h:534
int back_edge_p() const
Definition supergraph.h:537
cfg_superedge(supernode *src, supernode *dst, ::edge e)
Definition supergraph.h:524
const cfg_superedge * dyn_cast_cfg_superedge() const final override
Definition supergraph.h:531
tree get_phi_arg(const gphi *phi) const
::edge get_cfg_edge() const
Definition supergraph.h:533
int false_value_p() const
Definition supergraph.h:536
Definition supergraph.h:764
virtual bool add_node_annotations(graphviz_out *gv, const supernode &n, bool within_table) const
Definition supergraph.h:767
virtual void add_stmt_annotations(graphviz_out *gv, const gimple *stmt, bool within_row) const
Definition supergraph.h:774
virtual bool add_after_node_annotations(graphviz_out *gv, const supernode &n) const
Definition supergraph.h:778
virtual ~dot_annotator()
Definition supergraph.h:766
Definition supergraph.h:715
void dump_label_to_pp(pretty_printer *pp, bool user_facing) const final override
enum eh_kind m_kind
Definition supergraph.h:746
eh_kind
Definition supergraph.h:718
@ expected
Definition supergraph.h:719
@ unexpected
Definition supergraph.h:720
const eh_dispatch_allowed_cfg_superedge * dyn_cast_eh_dispatch_allowed_cfg_superedge() const final override
Definition supergraph.h:728
eh_dispatch_allowed_cfg_superedge(supernode *src, supernode *dst, ::edge e, const geh_dispatch *eh_dispatch_stmt, eh_region eh_reg)
enum eh_kind get_eh_kind() const
Definition supergraph.h:743
bool apply_constraints(region_model *model, region_model_context *ctxt, tree exception_type, std::unique_ptr< rejected_constraint > *out) const final override
Definition supergraph.h:610
const geh_dispatch * m_eh_dispatch_stmt
Definition supergraph.h:645
eh_region get_eh_region() const
Definition supergraph.h:631
eh_region m_eh_region
Definition supergraph.h:646
static std::unique_ptr< eh_dispatch_cfg_superedge > make(supernode *src, supernode *dest, ::edge e, const geh_dispatch *eh_dispatch_stmt)
const geh_dispatch * get_eh_dispatch_stmt() const
Definition supergraph.h:625
virtual bool apply_constraints(region_model *model, region_model_context *ctxt, tree exception_type, std::unique_ptr< rejected_constraint > *out) const =0
const eh_status & get_eh_status() const
eh_dispatch_cfg_superedge(supernode *src, supernode *dst, ::edge e, const geh_dispatch *eh_dispatch_stmt, eh_region eh_reg)
const eh_dispatch_cfg_superedge * dyn_cast_eh_dispatch_cfg_superedge() const final override
Definition supergraph.h:618
Definition supergraph.h:665
eh_catch get_eh_catch() const
Definition supergraph.h:686
eh_dispatch_try_cfg_superedge(supernode *src, supernode *dst, ::edge e, const geh_dispatch *eh_dispatch_stmt, eh_region eh_reg, eh_catch ehc)
Definition supergraph.h:667
void dump_label_to_pp(pretty_printer *pp, bool user_facing) const final override
const eh_dispatch_try_cfg_superedge * dyn_cast_eh_dispatch_try_cfg_superedge() const final override
Definition supergraph.h:678
eh_catch m_eh_catch
Definition supergraph.h:696
bool apply_constraints(region_model *model, region_model_context *ctxt, tree exception_type, std::unique_ptr< rejected_constraint > *out) const final override
Definition analyzer-logging.h:34
Definition region-model.h:815
Definition region-model.h:298
Definition supergraph.h:489
call_superedge * get_edge_for_call(const supergraph &sg) const
Definition supergraph.h:501
return_superedge * dyn_cast_return_superedge() final override
Definition supergraph.h:495
return_superedge(supernode *src, supernode *dst, cgraph_edge *cedge)
Definition supergraph.h:491
const return_superedge * dyn_cast_return_superedge() const final override
Definition supergraph.h:496
Definition supergraph.h:96
void restore_uids() const
void make_uid_unique(gimple *stmt)
auto_vec< std::pair< gimple *, unsigned > > m_old_stmt_uids
Definition supergraph.h:102
Definition supergraph.h:318
void dump_dot(graphviz_out *gv, const dump_args_t &args) const final override
cgraph_edge * get_any_callgraph_edge() const
enum edge_kind get_kind() const
Definition supergraph.h:332
void dump(pretty_printer *pp) const
virtual const eh_dispatch_try_cfg_superedge * dyn_cast_eh_dispatch_try_cfg_superedge() const
Definition supergraph.h:338
::edge get_any_cfg_edge() const
virtual return_superedge * dyn_cast_return_superedge()
Definition supergraph.h:344
virtual const callgraph_superedge * dyn_cast_callgraph_superedge() const
Definition supergraph.h:341
superedge(supernode *src, supernode *dest, enum edge_kind kind)
Definition supergraph.h:353
virtual const switch_cfg_superedge * dyn_cast_switch_cfg_superedge() const
Definition supergraph.h:336
virtual callgraph_superedge * dyn_cast_callgraph_superedge()
Definition supergraph.h:340
virtual cfg_superedge * dyn_cast_cfg_superedge()
Definition supergraph.h:334
virtual const cfg_superedge * dyn_cast_cfg_superedge() const
Definition supergraph.h:335
label_text get_description(bool user_facing) const
std::unique_ptr< json::object > to_json() const
enum edge_kind m_kind
Definition supergraph.h:359
virtual const eh_dispatch_allowed_cfg_superedge * dyn_cast_eh_dispatch_allowed_cfg_superedge() const
Definition supergraph.h:339
virtual ~superedge()
Definition supergraph.h:320
virtual const call_superedge * dyn_cast_call_superedge() const
Definition supergraph.h:343
virtual void dump_label_to_pp(pretty_printer *pp, bool user_facing) const =0
virtual call_superedge * dyn_cast_call_superedge()
Definition supergraph.h:342
virtual const return_superedge * dyn_cast_return_superedge() const
Definition supergraph.h:345
virtual const eh_dispatch_cfg_superedge * dyn_cast_eh_dispatch_cfg_superedge() const
Definition supergraph.h:337
Definition supergraph.h:113
ordered_hash_map< cgraph_edge *, return_superedge * > cgraph_edge_to_return_superedge_t
Definition supergraph.h:220
std::unique_ptr< json::object > to_json() const
cgraph_edge_to_call_superedge_t m_cgraph_edge_to_call_superedge
Definition supergraph.h:217
supernode * get_caller_next_node(cgraph_edge *edge) const
Definition supergraph.h:135
int num_edges() const
Definition supergraph.h:178
stmt_to_node_t m_stmt_to_node_t
Definition supergraph.h:228
supergraph(logger *logger)
ordered_hash_map< ::edge, cfg_superedge * > cfg_edge_to_cfg_superedge_t
Definition supergraph.h:212
unsigned get_num_snodes(const function *fun) const
Definition supergraph.h:185
cgraph_edge_to_intraproc_superedge_t m_cgraph_edge_to_intraproc_superedge
Definition supergraph.h:225
cgraph_edge_to_node_t m_cgraph_edge_to_caller_next_node
Definition supergraph.h:209
int num_nodes() const
Definition supergraph.h:177
supernode * get_node_for_function_exit(const function &fun) const
Definition supergraph.h:123
superedge * get_intraprocedural_edge_for_call(cgraph_edge *edge) const
Definition supergraph.h:153
bb_to_node_t m_bb_to_final_node
Definition supergraph.h:205
ordered_hash_map< cgraph_edge *, supernode * > cgraph_edge_to_node_t
Definition supergraph.h:207
ordered_hash_map< cgraph_edge *, superedge * > cgraph_edge_to_intraproc_superedge_t
Definition supergraph.h:224
supernode * get_node_for_block(basic_block bb) const
Definition supergraph.h:128
ordered_hash_map< cgraph_edge *, call_superedge * > cgraph_edge_to_call_superedge_t
Definition supergraph.h:216
cfg_superedge * add_cfg_edge(supernode *src, supernode *dest, ::edge e)
cfg_edge_to_cfg_superedge_t m_cfg_edge_to_cfg_superedge
Definition supergraph.h:213
supernode * get_node_by_index(int idx) const
Definition supergraph.h:180
return_superedge * add_return_superedge(supernode *src, supernode *dest, cgraph_edge *cedge)
void dump_dot_to_pp(pretty_printer *pp, const dump_args_t &) const
ordered_hash_map< basic_block, supernode * > bb_to_node_t
Definition supergraph.h:203
supernode * get_node_for_function_entry(const function &fun) const
Definition supergraph.h:118
function_to_num_snodes_t m_function_to_num_snodes
Definition supergraph.h:231
hash_map< const function *, unsigned > function_to_num_snodes_t
Definition supergraph.h:230
cfg_superedge * get_edge_for_cfg_edge(edge e) const
Definition supergraph.h:159
call_superedge * add_call_superedge(supernode *src, supernode *dest, cgraph_edge *cedge)
bb_to_node_t m_bb_to_initial_node
Definition supergraph.h:204
supernode * get_supernode_for_stmt(const gimple *stmt) const
Definition supergraph.h:165
ordered_hash_map< gimple *, supernode * > stmt_to_node_t
Definition supergraph.h:227
void dump_dot_to_file(FILE *fp, const dump_args_t &) const
cgraph_edge_to_return_superedge_t m_cgraph_edge_to_return_superedge
Definition supergraph.h:221
call_superedge * get_edge_for_call(cgraph_edge *edge) const
Definition supergraph.h:141
void dump_dot(const char *path, const dump_args_t &) const
return_superedge * get_edge_for_return(cgraph_edge *edge) const
Definition supergraph.h:147
supernode * add_node(function *fun, basic_block bb, gcall *returning_call, gimple_seq phi_nodes)
saved_uids m_stmt_uids
Definition supergraph.h:233
cgraph_edge_to_node_t m_cgraph_edge_to_caller_prev_node
Definition supergraph.h:208
Definition supergraph.h:239
bool entry_p() const
Definition supergraph.h:249
gimple * get_last_stmt() const
Definition supergraph.h:287
gcall * get_final_call() const
Definition supergraph.h:294
location_t get_end_location() const
gphi_iterator start_phis()
Definition supergraph.h:268
const basic_block m_bb
Definition supergraph.h:307
void dump_dot_id(pretty_printer *pp) const
gcall * get_returning_call() const
Definition supergraph.h:282
bool return_p() const
Definition supergraph.h:254
location_t get_start_location() const
void dump_dot(graphviz_out *gv, const dump_args_t &args) const override
gcall *const m_returning_call
Definition supergraph.h:308
unsigned int get_stmt_index(const gimple *stmt) const
std::unique_ptr< json::object > to_json() const
function * get_function() const
Definition supergraph.h:247
supernode(function *fun, basic_block bb, gcall *returning_call, gimple_seq phi_nodes, int index)
Definition supergraph.h:241
const int m_index
Definition supergraph.h:311
auto_vec< gimple * > m_stmts
Definition supergraph.h:310
gimple_seq m_phi_nodes
Definition supergraph.h:309
function *const m_fun
Definition supergraph.h:306
Definition supergraph.h:564
bool implicitly_created_default_p() const
const switch_cfg_superedge * dyn_cast_switch_cfg_superedge() const final override
Definition supergraph.h:568
const vec< tree > & get_case_labels() const
Definition supergraph.h:582
switch_cfg_superedge(supernode *src, supernode *dst, ::edge e)
void dump_label_to_pp(pretty_printer *pp, bool user_facing) const final override
gswitch * get_switch_stmt() const
Definition supergraph.h:577
auto_vec< tree > m_case_labels
Definition supergraph.h:587
node_t *const m_src
Definition digraph.h:71
dedge(node_t *src, node_t *dest)
Definition digraph.h:64
supergraph_traits::dump_args_t dump_args_t
Definition digraph.h:62
auto_delete_vec< edge_t > m_edges
Definition digraph.h:105
auto_delete_vec< node_t > m_nodes
Definition digraph.h:104
supergraph_traits::dump_args_t dump_args_t
Definition digraph.h:85
digraph()
Definition digraph.h:88
supergraph_traits::dump_args_t dump_args_t
Definition digraph.h:46
Definition ordered-hash-map.h:35
Definition pretty-print.h:241
static struct path_prefix cpath path
Definition collect2.cc:514
struct basic_block_def * basic_block
Definition coretypes.h:355
class edge_def * edge
Definition coretypes.h:352
gimple * gimple_seq
Definition coretypes.h:100
union tree_node * tree
Definition coretypes.h:97
static struct string2counter_map map[debug_counter_number_of_counters]
Definition dbgcnt.cc:39
struct eh_catch_d * eh_catch
Definition except.h:183
@ ERT_TRY
Definition except.h:46
struct eh_region_d * eh_region
Definition except.h:184
void final(rtx_insn *first, FILE *file, int optimize_p)
Definition final.cc:2008
gimple_seq phi_nodes(const_basic_block bb)
Definition gimple.h:4678
basic_block gimple_bb(const gimple *g)
Definition gimple.h:1863
gimple_seq_node gimple_seq_first(gimple_seq s)
Definition gimple.h:1686
T as_a(U *p)
Definition is-a.h:253
T dyn_cast(U *p)
Definition is-a.h:280
Definition access-diagram.h:30
function * get_ultimate_function_for_cgraph_edge(cgraph_edge *edge)
@ stmt
Definition checker-event.h:37
supergraph_dot_flags
Definition supergraph.h:67
@ SUPERGRAPH_DOT_SHOW_BBS
Definition supergraph.h:68
cgraph_edge * supergraph_call_edge(function *fun, const gimple *stmt)
edge_kind
Definition supergraph.h:57
@ SUPEREDGE_RETURN
Definition supergraph.h:60
@ SUPEREDGE_CALL
Definition supergraph.h:59
@ SUPEREDGE_CFG_EDGE
Definition supergraph.h:58
@ SUPEREDGE_INTRAPROCEDURAL_CALL
Definition supergraph.h:61
i
Definition poly-int.h:776
dump_args_t(enum supergraph_dot_flags flags, const dot_annotator *node_annotator)
Definition supergraph.h:81
const dot_annotator * m_node_annotator
Definition supergraph.h:88
enum supergraph_dot_flags m_flags
Definition supergraph.h:87
Definition supergraph.h:75
supercluster cluster_t
Definition supergraph.h:90
supernode node_t
Definition supergraph.h:76
supergraph graph_t
Definition supergraph.h:78
superedge edge_t
Definition supergraph.h:77
enum eh_region_type type
Definition except.h:131
Definition function.h:249
Definition gimple-iterator.h:42
#define NULL
Definition system.h:50
#define gcc_assert(EXPR)
Definition system.h:814