GCC Middle and Back End API Reference
ops.h
Go to the documentation of this file.
1/* Operations within the code being analyzed.
2 Copyright (C) 2019-2025 Free Software Foundation, Inc.
3 Contributed by David Malcolm <dmalcolm@redhat.com>.
4
5This file is part of GCC.
6
7GCC is free software; you can redistribute it and/or modify it
8under the terms of the GNU General Public License as published by
9the Free Software Foundation; either version 3, or (at your option)
10any later version.
11
12GCC is distributed in the hope that it will be useful, but
13WITHOUT ANY WARRANTY; without even the implied warranty of
14MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15General Public License for more details.
16
17You should have received a copy of the GNU General Public License
18along with GCC; see the file COPYING3. If not see
19<http://www.gnu.org/licenses/>. */
20
21#ifndef GCC_ANALYZER_OPS_H
22#define GCC_ANALYZER_OPS_H
23
24#include "except.h"
25#include "gimple-walk.h"
26
27namespace ana {
28
29class operation;
30 class control_flow_op;
32 class phis_for_edge_op;
33
34class callsite_expr;
35
37{
39 exploded_node &src_enode,
40 const superedge &sedge)
41 : m_eg (eg),
42 m_src_enode (src_enode),
43 m_sedge (sedge)
44 {
45 }
46
47 void DEBUG_FUNCTION dump () const;
48
49 logger *get_logger () const;
50
52
53 const program_point &
55
56 const program_state &
58
59 const supergraph &
61
64
65 void
66 add_outcome (const program_point &dst_point,
67 program_state dst_state,
68 bool could_do_work,
69 uncertainty_t *uncertainty,
70 std::unique_ptr<custom_edge_info> info = nullptr);
71
75};
76
77/* Abstract base class for an operation along a superedge. */
78
80{
81 public:
82 // Discriminator for concrete subclasses
98
100
101 void
102 dump () const;
103
104 virtual std::unique_ptr<operation>
105 clone () const = 0;
106
107 virtual void
108 print_as_edge_label (pretty_printer *pp, bool user_facing) const = 0;
109
110 virtual bool
112
113 virtual void
118
119 virtual const gimple *
121 {
122 return nullptr;
123 }
124
125 virtual void
126 execute (operation_context &op_ctxt) const = 0;
127
128 virtual bool
132 std::unique_ptr<rejected_constraint> */*out_rc*/) const
133 {
134 // no-op
135 return true;
136 }
137
138 /* Is this op suitable for bulk-merging?
139 It must have a single outcome, at the intraprocedural
140 next point, with some state. */
141 virtual bool
143 virtual void
145 program_state &) const
146 {
147 /* Must be implemented for any subclasses that return true
148 for supports_bulk_merge_p. */
150 }
151 virtual void
153 checker_path &out_path) const = 0;
154
155 virtual const control_flow_op *
156 dyn_cast_control_flow_op () const { return nullptr; }
157
158 virtual const call_and_return_op *
159 dyn_cast_call_and_return_op () const { return nullptr; }
160
161 virtual const phis_for_edge_op *
162 dyn_cast_phis_for_edge_op () const { return nullptr; }
163
164 enum kind get_kind () const { return m_kind; }
165
166protected:
167 operation (enum kind kind_)
168 : m_kind (kind_)
169 {
170 }
171
172 static void
174 program_state &dst_state,
175 path_context *path_ctxt,
176 bool &unknown_side_effects,
177 const gimple &stmt);
178
179private:
181};
182
183/* Subclass for an operation representing a specific gimple stmt
184 that isn't control flow. */
185
187{
188public:
189 const gimple &get_stmt () const { return m_stmt; }
190
191 void
192 print_as_edge_label (pretty_printer *pp, bool user_facing) const override;
193
194 bool
195 defines_ssa_name_p (const_tree ssa_name) const final override;
196
197 void
201 walk_stmt_load_store_addr_fn) const final override;
202
203 const gimple *
204 maybe_get_stmt () const final override
205 {
206 return &m_stmt;
207 }
208
209 void
210 execute (operation_context &op_ctxt) const override;
211
212 void
214 program_state dst_state) const;
215
216 bool
220 std::unique_ptr<rejected_constraint> *out_rc) const override;
221
222 virtual bool
223 supports_bulk_merge_p () const override;
224
225 void
227 checker_path &out_path) const override;
228
229protected:
230 gimple_stmt_op (enum kind kind_, const gimple &stmt)
231 : operation (kind_), m_stmt (stmt)
232 {}
233
234private:
236};
237
238/* Various subclasses of gimple_stmt_op. */
239
240/* An operation subclass representing the effect of a GIMPLE_ASM stmt. */
241
243{
244public:
247 {
248 }
249
250 std::unique_ptr<operation>
251 clone () const final override
252 {
253 return std::make_unique<gasm_op> (get_gasm ());
254 }
255
256 const gasm &get_gasm () const
257 {
258 return *as_a <const gasm *> (&get_stmt ());
259 }
260};
261
262/* An operation subclass representing the effect of a GIMPLE_ASSIGN stmt. */
263
265{
266public:
267 gassign_op (const gassign &assign_stmt)
268 : gimple_stmt_op (kind::assignment, assign_stmt)
269 {
270 }
271
272 std::unique_ptr<operation>
273 clone () const final override
274 {
275 return std::make_unique<gassign_op> (get_gassign ());
276 }
277
278 const gassign &get_gassign () const
279 {
280 return *as_a <const gassign *> (&get_stmt ());
281 }
282};
283
284/* An operation subclass for a GIMPLE_PREDICT stmt.
285 They have no effect on state, but can be useful for reconstructing
286 where "return" statements were in the code the user originally wrote,
287 to improve the reported locations in diagnostics. */
288
290{
291public:
294 {
295 gcc_assert (predict_stmt.code == GIMPLE_PREDICT);
296 }
297
298 std::unique_ptr<operation>
299 clone () const final override
300 {
301 return std::make_unique<predict_op> (get_stmt ());
302 }
303};
304
305/* An operation subclass representing both:
306 (a) the effect of a GIMPLE_RETURN stmt: copying a value into the
307 RESULT_DECL of the current frame, and
308 (b) a hint when reporting diagnostics that this is the return
309 path from the function (rather than say, throwing an exception). */
310
312{
313public:
318
319 std::unique_ptr<operation>
320 clone () const final override
321 {
322 return std::make_unique<greturn_op> (get_greturn ());
323 }
324
325 void
326 execute (operation_context &op_ctxt) const final override;
327
328 bool
332 std::unique_ptr<rejected_constraint> *out_rc) const override;
333
334 bool
335 supports_bulk_merge_p () const final override
336 {
337 return false;
338 }
339
340 void
342 checker_path &out_path) const final override;
343
344 const greturn &get_greturn () const
345 {
346 return *as_a <const greturn *> (&get_stmt ());
347 }
348
350 {
352 }
353};
354
355/* A concrete operation subclass representing the effect of a GIMPLE_CALL stmt.
356
357 If the function is identified and has a known body, either simulate
358 it interprocedurally by pushing a stack frame and transitioning to the
359 callee, or simulate it intraprocedurally by replaying a summary of the
360 effects of the call.
361
362 If the function is identified but has an unknown body,
363 simulate it intraprocedurally, either using a known_function
364 subclass for precision, or following conservative rules that
365 assume various side-effects.
366
367 If the function is unidentified (for some kinds of dynamic calls),
368 simulate it intraprocedurally, following conservative rules that
369 assume various side-effects.
370
371 In the various intraprocedural simulation cases, the exploded edge will
372 correspond to the underlying superedge.
373
374 In the interprocedural simulation case, the exploded edge will
375 link two supernodes in different functions, and thus will require
376 custom edge info.
377
378 Various subclasses exist for handling awkward special cases,
379 such as longjmp. */
380
382{
383public:
384 static std::unique_ptr<operation>
385 make (const gcall &call_stmt);
386
387 std::unique_ptr<operation>
388 clone () const override
389 {
390 return std::make_unique<call_and_return_op> (get_gcall ());
391 }
392
393 const gcall &get_gcall () const
394 {
395 return *as_a <const gcall *> (&get_stmt ());
396 }
397
398 void
399 execute (operation_context &op_ctxt) const override;
400
401 bool
402 supports_bulk_merge_p () const final override
403 {
404 return false;
405 }
406
407 void
409 checker_path &out_path) const override;
410
411 const call_and_return_op *
412 dyn_cast_call_and_return_op () const final override { return this; }
413
414 tree
416 tree caller_expr,
417 callsite_expr *out) const;
418 tree
420 tree callee_expr,
421 callsite_expr *out) const;
422
423 call_and_return_op (const gcall &call_stmt)
424 : gimple_stmt_op (kind::call_and_return, call_stmt)
425 {
426 }
427
428 const known_function *
430
431private:
434
435 void
437 function &called_fn,
438 per_function_data &called_fn_data,
439 region_model_context *ctxt) const;
440
441 void
443 function &called_fn,
444 call_summary &summary,
445 region_model_context *ctxt) const;
446
447 tree
448 get_arg_for_parm (tree callee_fndecl,
449 tree parm,
450 callsite_expr *out) const;
451 tree
452 get_parm_for_arg (tree callee_fndecl,
453 tree arg,
454 callsite_expr *out) const;
455};
456
457/* A call to one of the various __analyzer_dump* functions.
458 These have no effect on state. */
459
461{
462public:
470
471 dump_op (const gcall &call_stmt, enum dump_kind dump_kind_)
472 : call_and_return_op (call_stmt),
473 m_dump_kind (dump_kind_)
474 {
475 }
476
477 std::unique_ptr<operation>
478 clone () const final override
479 {
480 return std::make_unique<dump_op> (get_gcall (), m_dump_kind);
481 }
482
483 void
484 execute (operation_context &op_ctxt) const final override;
485
486private:
488};
489
491{
492public:
493 setjmp_op (const gcall &call_stmt)
494 : call_and_return_op (call_stmt)
495 {
496 }
497
498 std::unique_ptr<operation>
499 clone () const final override
500 {
501 return std::make_unique<setjmp_op> (get_gcall ());
502 }
503
504 void
505 execute (operation_context &op_ctxt) const final override;
506
507 void
509 checker_path &out_path) const final override;
510};
511
513{
514public:
515 longjmp_op (const gcall &call_stmt)
516 : call_and_return_op (call_stmt)
517 {
518 }
519
520 std::unique_ptr<operation>
521 clone () const final override
522 {
523 return std::make_unique<longjmp_op> (get_gcall ());
524 }
525
526 void
527 execute (operation_context &op_ctxt) const final override;
528};
529
531{
532public:
533 cxa_throw_op (const gcall &call_stmt, bool is_rethrow)
534 : call_and_return_op (call_stmt),
535 m_is_rethrow (is_rethrow)
536 {
537 }
538
539 std::unique_ptr<operation>
540 clone () const final override
541 {
542 return std::make_unique<cxa_throw_op> (get_gcall (), m_is_rethrow);
543 }
544
545 void
546 execute (operation_context &op_ctxt) const final override;
547
548private:
550};
551
553{
554public:
555 resx_op (const gresx &resx_stmt)
556 : gimple_stmt_op (kind::resx, resx_stmt)
557 {
558 }
559
560 std::unique_ptr<operation>
561 clone () const final override
562 {
563 return std::make_unique<resx_op> (get_gresx ());
564 }
565
566 const gresx &get_gresx () const
567 {
568 return *as_a <const gresx *> (&get_stmt ());
569 }
570
571 void
572 execute (operation_context &op_ctxt) const final override;
573
574 bool
575 supports_bulk_merge_p () const final override
576 {
577 return false;
578 }
579
580 void
582 checker_path &out_path) const final override;
583};
584
585/* An abstract subclass of operation representing the filtering effect on
586 state of a gimple control-flow statement at the end of a BB, for
587 a specific CFG out-edge from that BB. */
588
590{
591public:
592 void
594 checker_path &out_path) const override;
595
596 bool
597 defines_ssa_name_p (const_tree) const final override
598 {
599 return false;
600 }
601
602 void
606 walk_stmt_load_store_addr_fn) const final override;
607
608 const gimple *
609 maybe_get_stmt () const final override
610 {
611 return &m_ctrlflow_stmt;
612 }
613
614 virtual label_text
615 maybe_describe_condition (bool can_colorize) const;
616
617 void
618 execute (operation_context &op_ctxt) const final override;
619
620 bool
621 supports_bulk_merge_p () const final override
622 {
623 return false;
624 }
625
626 bool
630 std::unique_ptr<rejected_constraint> *out_rc) const override;
631
632 const control_flow_op *
633 dyn_cast_control_flow_op () const { return this; }
634
635 ::edge get_cfg_edge () const { return m_cfg_edge; }
636 int get_flags () const { return m_cfg_edge->flags; }
637 int back_edge_p () const { return get_flags () & EDGE_DFS_BACK; }
638
639 const gimple &get_ctrlflow_stmt () const { return m_ctrlflow_stmt; }
640
641protected:
643 ::edge cfg_edge,
644 const gimple &ctrlflow_stmt)
645 : operation (kind_),
646 m_cfg_edge (cfg_edge),
647 m_ctrlflow_stmt (ctrlflow_stmt)
648 {}
649
650private:
651 virtual bool
653 region_model &model,
655 std::unique_ptr<rejected_constraint> *out) const = 0;
656
659};
660
661/* Concrete operation subclass representing filtering/applying state
662 transitions on a specific CFG edge after a GIMPLE_COND stmt, either the
663 "if (cond) is true" or the "if (cond) is false" branch. */
664
666{
667public:
669 const gcond &cond_stmt);
670
671 std::unique_ptr<operation>
672 clone () const final override
673 {
674 return std::make_unique<gcond_edge_op> (get_cfg_edge (),
675 get_gcond ());
676 }
677
678 void
680 bool user_facing) const final override;
681
682 label_text
683 maybe_describe_condition (bool can_colorize) const final override;
684
685 const gcond &get_gcond () const
686 {
688 }
689
690private:
691 static label_text
692 maybe_describe_condition (bool can_colorize,
693 tree lhs,
694 enum tree_code op,
695 tree rhs);
697
698 bool
700 region_model &model,
702 std::unique_ptr<rejected_constraint> *out)
703 const final override;
704
706};
707
708/* Concrete operation subclass representing filtering/applying state
709 transitions on a specific CFG edge after a GIMPLE_GOTO stmt, thus
710 handling computed gotos. */
711
713{
714public:
716 const ggoto &goto_stmt,
717 tree dst_label);
718
719 std::unique_ptr<operation>
720 clone () const final override
721 {
722 return std::make_unique<ggoto_edge_op> (get_cfg_edge (),
723 get_ggoto (),
725 }
726
727 void
729 bool user_facing) const final override;
730
731 label_text
732 maybe_describe_condition (bool can_colorize) const final override;
733
734 const ggoto &get_ggoto () const
735 {
737 }
738
739private:
740 bool
742 region_model &model,
744 std::unique_ptr<rejected_constraint> *out)
745 const final override;
746
748};
749
750/* Concrete operation subclass representing filtering/applying state
751 transitions on a specific CFG edge after a GIMPLE_SWITCH stmt, thus
752 handling a cluster of cases/default value. */
753
755{
756 public:
758 ::edge cfg_edge,
759 const gswitch &switch_stmt,
761
762 std::unique_ptr<operation>
763 clone () const final override
764 {
765 return std::make_unique<switch_case_op> (*this);
766 }
767
768 void
770 bool user_facing) const final override;
771
773
774 const gswitch &get_gswitch () const
775 {
777 }
778
779 private:
780 bool
782 region_model &model,
784 std::unique_ptr<rejected_constraint> *out)
785 const final override;
786
787 std::vector<tree> m_case_labels;
789};
790
791/* Abstract subclass for edges from eh_dispatch statements. */
792
794{
795public:
796 static std::unique_ptr<eh_dispatch_edge_op>
798 supernode *dest,
799 ::edge cfg_edge,
800 const geh_dispatch &geh_dispatch_stmt);
801
802 const geh_dispatch &
804 {
806 }
807
809 get_eh_region () const { return m_eh_region; }
810
811protected:
813 supernode *dst_snode,
814 enum kind kind_,
815 ::edge cfg_edge,
816 const geh_dispatch &geh_dispatch_stmt,
817 eh_region eh_reg);
818
819 supernode *get_src_snode () const { return m_src_snode; }
820
821private:
822 bool
824 region_model &model,
826 std::unique_ptr<rejected_constraint> *out)
827 const final override;
828
829 virtual bool
831 region_model &model,
833 tree exception_type,
834 std::unique_ptr<rejected_constraint> *out) const = 0;
835
839};
840
841/* Concrete operation for edges from an eh_dispatch statement
842 for ERT_TRY regions. */
843
845{
846public:
848 supernode *dst_snode,
849 ::edge cfg_edge,
850 const geh_dispatch &geh_dispatch_stmt,
851 eh_region eh_reg,
852 eh_catch ehc);
853
854 std::unique_ptr<operation>
855 clone () const final override
856 {
857 return std::make_unique<eh_dispatch_try_edge_op> (*this);
858 }
859
860 void
862 bool user_facing) const final override;
863
864 void
866 checker_path &out_path) const final override;
867
868private:
869 bool
871 region_model &model,
873 tree exception_type,
874 std::unique_ptr<rejected_constraint> *out)
875 const final override;
876
878};
879
880/* Concrete operation for edges from an eh_dispatch statement
881 for ERT_ALLOWED_EXCEPTIONS regions. */
882
884{
885public:
891
893 supernode *dst_snode,
894 ::edge cfg_edge,
895 const geh_dispatch &geh_dispatch_stmt,
896 eh_region eh_reg);
897
898 std::unique_ptr<operation>
899 clone () const final override
900 {
901 return std::make_unique<eh_dispatch_allowed_edge_op> (*this);
902 }
903
904 void
906 bool user_facing) const final override;
907
908 enum eh_kind get_eh_kind () const { return m_kind; }
909
910private:
911 bool
913 region_model &model,
915 tree exception_type,
916 std::unique_ptr<rejected_constraint> *out)
917 const final override;
918
920};
921
922/* Concrete operation subclass representing the state transition
923 for simultaneously handling all of the phi nodes at the entry to a BB,
924 after following a specific CFG in-edge.
925 Note that this covers multiple gimple stmts: all of the gphi stmts
926 at a basic block entry (albeit for just one in-edge).
927 This can be thought of as handling one column of the entries in the
928 phi nodes of a BB (for a specific in-edge).
929 We ignore MEM entries, and discard phi nodes purely affecting them. */
930
932{
933public:
934 /* A "dst=src;" pair within a phi node. */
935 struct pair
936 {
939 };
940
941 static std::unique_ptr<operation>
942 maybe_make (::edge cfg_in_edge);
943
944 std::unique_ptr<operation>
945 clone () const final override
946 {
947 return std::make_unique<phis_for_edge_op> (*this);
948 }
949
950 phis_for_edge_op (std::vector<pair> &&pairs,
951 ::edge cfg_in_edge);
952
953 const phis_for_edge_op *
954 dyn_cast_phis_for_edge_op () const final override { return this; }
955
956 void
958 bool user_facing) const final override;
959
960 bool
961 defines_ssa_name_p (const_tree ssa_name) const final override;
962
963 void
967 walk_stmt_load_store_addr_fn) const final override;
968 void
969 execute (operation_context &op_ctxt) const final override;
970
971 bool
975 std::unique_ptr<rejected_constraint> *out_rc) const override;
976
977 bool
978 supports_bulk_merge_p () const final override
979 {
980 return true;
981 }
982 void
984 program_state &dst_state) const final override;
985
986 void
988 checker_path &out_path) const final override;
989
990 const std::vector<pair> &get_pairs () const { return m_pairs; }
991
992private:
993 static std::vector<pair>
995
996 void
997 update_state (const program_state &src_state,
998 program_state &dst_state,
999 region_model_context *ctxt) const;
1000
1001 std::vector<pair> m_pairs;
1003};
1004
1005} // namespace ana
1006
1007#endif /* GCC_ANALYZER_OPS_H */
Definition constraint-manager.h:178
Definition ops.h:382
const gcall & get_gcall() const
Definition ops.h:393
const call_and_return_op * dyn_cast_call_and_return_op() const final override
Definition ops.h:412
bool supports_bulk_merge_p() const final override
Definition ops.h:402
cgraph_edge * get_any_cgraph_edge(operation_context &op_ctxt) const
std::unique_ptr< operation > clone() const override
Definition ops.h:388
tree get_parm_for_arg(tree callee_fndecl, tree arg, callsite_expr *out) const
void execute(operation_context &op_ctxt) const override
const known_function * maybe_get_known_function(const call_details &cd) const
tree get_arg_for_parm(tree callee_fndecl, tree parm, callsite_expr *out) const
call_and_return_op(const gcall &call_stmt)
Definition ops.h:423
tree map_expr_from_callee_to_caller(tree callee_fndecl, tree callee_expr, callsite_expr *out) const
void add_any_events_for_eedge(const exploded_edge &eedge, checker_path &out_path) const override
static std::unique_ptr< operation > make(const gcall &call_stmt)
void replay_call_summary(operation_context &op_ctxt, function &called_fn, call_summary &summary, region_model_context *ctxt) const
void replay_call_summaries(operation_context &op_ctxt, function &called_fn, per_function_data &called_fn_data, region_model_context *ctxt) const
tree map_expr_from_caller_to_callee(tree callee_fndecl, tree caller_expr, callsite_expr *out) const
Definition call-details.h:31
Definition call-summary.h:34
Definition supergraph.h:330
Definition checker-path.h:32
Definition ops.h:590
void walk_load_store_addr_ops(void *, walk_stmt_load_store_addr_fn, walk_stmt_load_store_addr_fn, walk_stmt_load_store_addr_fn) const final override
int get_flags() const
Definition ops.h:636
const gimple & get_ctrlflow_stmt() const
Definition ops.h:639
::edge m_cfg_edge
Definition ops.h:657
bool execute_for_feasibility(const exploded_edge &, feasibility_state &, region_model_context *, std::unique_ptr< rejected_constraint > *out_rc) const override
const control_flow_op * dyn_cast_control_flow_op() const
Definition ops.h:633
bool defines_ssa_name_p(const_tree) const final override
Definition ops.h:597
const gimple & m_ctrlflow_stmt
Definition ops.h:658
void add_any_events_for_eedge(const exploded_edge &eedge, checker_path &out_path) const override
int back_edge_p() const
Definition ops.h:637
virtual bool apply_constraints(const superedge *sedge, region_model &model, region_model_context *ctxt, std::unique_ptr< rejected_constraint > *out) const =0
const gimple * maybe_get_stmt() const final override
Definition ops.h:609
void execute(operation_context &op_ctxt) const final override
control_flow_op(enum kind kind_, ::edge cfg_edge, const gimple &ctrlflow_stmt)
Definition ops.h:642
::edge get_cfg_edge() const
Definition ops.h:635
virtual label_text maybe_describe_condition(bool can_colorize) const
bool supports_bulk_merge_p() const final override
Definition ops.h:621
bool m_is_rethrow
Definition ops.h:549
cxa_throw_op(const gcall &call_stmt, bool is_rethrow)
Definition ops.h:533
void execute(operation_context &op_ctxt) const final override
std::unique_ptr< operation > clone() const final override
Definition ops.h:540
void execute(operation_context &op_ctxt) const final override
dump_kind
Definition ops.h:464
@ state_2
Definition ops.h:468
@ state
Definition ops.h:465
@ sarif
Definition ops.h:466
enum dump_kind m_dump_kind
Definition ops.h:487
dump_op(const gcall &call_stmt, enum dump_kind dump_kind_)
Definition ops.h:471
std::unique_ptr< operation > clone() const final override
Definition ops.h:478
std::unique_ptr< operation > clone() const final override
Definition ops.h:899
@ expected
Definition ops.h:888
@ unexpected
Definition ops.h:889
enum eh_kind get_eh_kind() const
Definition ops.h:908
eh_dispatch_allowed_edge_op(supernode *src_snode, supernode *dst_snode, ::edge cfg_edge, const geh_dispatch &geh_dispatch_stmt, eh_region eh_reg)
bool apply_eh_constraints(const superedge *sedge, region_model &model, region_model_context *ctxt, tree exception_type, std::unique_ptr< rejected_constraint > *out) const final override
enum eh_kind m_kind
Definition ops.h:919
void print_as_edge_label(pretty_printer *pp, bool user_facing) const final override
virtual bool apply_eh_constraints(const superedge *sedge, region_model &model, region_model_context *ctxt, tree exception_type, std::unique_ptr< rejected_constraint > *out) const =0
supernode * get_src_snode() const
Definition ops.h:819
static std::unique_ptr< eh_dispatch_edge_op > make(supernode *src, supernode *dest, ::edge cfg_edge, const geh_dispatch &geh_dispatch_stmt)
supernode * m_dst_snode
Definition ops.h:837
eh_region m_eh_region
Definition ops.h:838
eh_region get_eh_region() const
Definition ops.h:809
const geh_dispatch & get_geh_dispatch() const
Definition ops.h:803
supernode * m_src_snode
Definition ops.h:836
eh_dispatch_edge_op(supernode *src_snode, supernode *dst_snode, enum kind kind_, ::edge cfg_edge, const geh_dispatch &geh_dispatch_stmt, eh_region eh_reg)
bool apply_constraints(const superedge *sedge, region_model &model, region_model_context *ctxt, std::unique_ptr< rejected_constraint > *out) const final override
void print_as_edge_label(pretty_printer *pp, bool user_facing) const final override
bool apply_eh_constraints(const superedge *sedge, region_model &model, region_model_context *ctxt, tree exception_type, std::unique_ptr< rejected_constraint > *out) const final override
void add_any_events_for_eedge(const exploded_edge &eedge, checker_path &out_path) const final override
std::unique_ptr< operation > clone() const final override
Definition ops.h:855
eh_catch m_eh_catch
Definition ops.h:877
eh_dispatch_try_edge_op(supernode *src_snode, supernode *dst_snode, ::edge cfg_edge, const geh_dispatch &geh_dispatch_stmt, eh_region eh_reg, eh_catch ehc)
Definition exploded-graph.h:335
Definition exploded-graph.h:783
Definition exploded-graph.h:206
Definition program-state.h:34
Definition exploded-graph.h:980
gasm_op(const gasm &asm_stmt)
Definition ops.h:245
const gasm & get_gasm() const
Definition ops.h:256
std::unique_ptr< operation > clone() const final override
Definition ops.h:251
const gassign & get_gassign() const
Definition ops.h:278
std::unique_ptr< operation > clone() const final override
Definition ops.h:273
gassign_op(const gassign &assign_stmt)
Definition ops.h:267
std::unique_ptr< operation > clone() const final override
Definition ops.h:672
label_text maybe_describe_condition(bool can_colorize) const final override
static bool should_print_expr_p(tree expr)
const gcond & get_gcond() const
Definition ops.h:685
static label_text maybe_describe_condition(bool can_colorize, tree lhs, enum tree_code op, tree rhs)
bool apply_constraints(const superedge *sedge, region_model &model, region_model_context *ctxt, std::unique_ptr< rejected_constraint > *out) const final override
gcond_edge_op(::edge cfg_edge, const gcond &cond_stmt)
bool m_true_value
Definition ops.h:705
void print_as_edge_label(pretty_printer *pp, bool user_facing) const final override
tree m_dst_label
Definition ops.h:747
bool apply_constraints(const superedge *sedge, region_model &model, region_model_context *ctxt, std::unique_ptr< rejected_constraint > *out) const final override
void print_as_edge_label(pretty_printer *pp, bool user_facing) const final override
label_text maybe_describe_condition(bool can_colorize) const final override
ggoto_edge_op(::edge cfg_edge, const ggoto &goto_stmt, tree dst_label)
const ggoto & get_ggoto() const
Definition ops.h:734
std::unique_ptr< operation > clone() const final override
Definition ops.h:720
virtual bool supports_bulk_merge_p() const override
gimple_stmt_op(enum kind kind_, const gimple &stmt)
Definition ops.h:230
bool execute_for_feasibility(const exploded_edge &, feasibility_state &, region_model_context *, std::unique_ptr< rejected_constraint > *out_rc) const override
void print_as_edge_label(pretty_printer *pp, bool user_facing) const override
void add_any_events_for_eedge(const exploded_edge &eedge, checker_path &out_path) const override
const gimple & m_stmt
Definition ops.h:235
void execute_on_state(operation_context &op_ctxt, program_state dst_state) const
const gimple & get_stmt() const
Definition ops.h:189
void execute(operation_context &op_ctxt) const override
void walk_load_store_addr_ops(void *, walk_stmt_load_store_addr_fn, walk_stmt_load_store_addr_fn, walk_stmt_load_store_addr_fn) const final override
const gimple * maybe_get_stmt() const final override
Definition ops.h:204
bool defines_ssa_name_p(const_tree ssa_name) const final override
void add_any_events_for_eedge(const exploded_edge &eedge, checker_path &out_path) const final override
std::unique_ptr< operation > clone() const final override
Definition ops.h:320
void execute(operation_context &op_ctxt) const final override
const greturn & get_greturn() const
Definition ops.h:344
bool execute_for_feasibility(const exploded_edge &, feasibility_state &, region_model_context *ctxt, std::unique_ptr< rejected_constraint > *out_rc) const override
greturn_op(const greturn &return_stmt)
Definition ops.h:314
tree get_retval() const
Definition ops.h:349
bool supports_bulk_merge_p() const final override
Definition ops.h:335
Definition common.h:294
Definition analyzer-logging.h:34
longjmp_op(const gcall &call_stmt)
Definition ops.h:515
std::unique_ptr< operation > clone() const final override
Definition ops.h:521
void execute(operation_context &op_ctxt) const final override
Definition ops.h:80
virtual const gimple * maybe_get_stmt() const
Definition ops.h:120
enum kind m_kind
Definition ops.h:180
virtual const call_and_return_op * dyn_cast_call_and_return_op() const
Definition ops.h:159
virtual void walk_load_store_addr_ops(void *, walk_stmt_load_store_addr_fn, walk_stmt_load_store_addr_fn, walk_stmt_load_store_addr_fn) const =0
virtual bool supports_bulk_merge_p() const =0
virtual const control_flow_op * dyn_cast_control_flow_op() const
Definition ops.h:156
~operation()
Definition ops.h:99
kind
Definition ops.h:84
@ predict_stmt
Definition ops.h:87
@ call_and_return
Definition ops.h:96
@ asm_stmt
Definition ops.h:85
@ resx
Definition ops.h:89
@ phis
Definition ops.h:95
@ eh_dispatch_allowed_edge
Definition ops.h:94
@ assignment
Definition ops.h:86
@ eh_dispatch_try_edge
Definition ops.h:93
@ cond_edge
Definition ops.h:90
@ goto_edge
Definition ops.h:91
@ return_stmt
Definition ops.h:88
@ switch_edge
Definition ops.h:92
virtual std::unique_ptr< operation > clone() const =0
enum kind get_kind() const
Definition ops.h:164
virtual void update_state_for_bulk_merger(const program_state &, program_state &) const
Definition ops.h:144
operation(enum kind kind_)
Definition ops.h:167
static void handle_on_stmt_for_state_machines(operation_context &op_ctxt, program_state &dst_state, path_context *path_ctxt, bool &unknown_side_effects, const gimple &stmt)
virtual void add_any_events_for_eedge(const exploded_edge &eedge, checker_path &out_path) const =0
virtual bool execute_for_feasibility(const exploded_edge &, feasibility_state &, region_model_context *, std::unique_ptr< rejected_constraint > @endverbatim *) const
Definition ops.h:129
virtual void execute(operation_context &op_ctxt) const =0
virtual const phis_for_edge_op * dyn_cast_phis_for_edge_op() const
Definition ops.h:162
virtual void print_as_edge_label(pretty_printer *pp, bool user_facing) const =0
virtual bool defines_ssa_name_p(const_tree ssa_name) const =0
void dump() const
Definition common.h:435
Definition ops.h:932
std::vector< pair > m_pairs
Definition ops.h:1001
void update_state(const program_state &src_state, program_state &dst_state, region_model_context *ctxt) const
const std::vector< pair > & get_pairs() const
Definition ops.h:990
const phis_for_edge_op * dyn_cast_phis_for_edge_op() const final override
Definition ops.h:954
bool supports_bulk_merge_p() const final override
Definition ops.h:978
bool execute_for_feasibility(const exploded_edge &, feasibility_state &, region_model_context *, std::unique_ptr< rejected_constraint > *out_rc) const override
static std::unique_ptr< operation > maybe_make(::edge cfg_in_edge)
std::unique_ptr< operation > clone() const final override
Definition ops.h:945
void print_as_edge_label(pretty_printer *pp, bool user_facing) const final override
bool defines_ssa_name_p(const_tree ssa_name) const final override
::edge m_cfg_in_edge
Definition ops.h:1002
void walk_load_store_addr_ops(void *, walk_stmt_load_store_addr_fn, walk_stmt_load_store_addr_fn, walk_stmt_load_store_addr_fn) const final override
static std::vector< pair > get_pairs_for_phi_along_in_edge(::edge cfg_in_edge)
void execute(operation_context &op_ctxt) const final override
void add_any_events_for_eedge(const exploded_edge &eedge, checker_path &out_path) const final override
phis_for_edge_op(std::vector< pair > &&pairs, ::edge cfg_in_edge)
void update_state_for_bulk_merger(const program_state &src_state, program_state &dst_state) const final override
predict_op(const gimple &predict_stmt)
Definition ops.h:292
std::unique_ptr< operation > clone() const final override
Definition ops.h:299
Definition program-point.h:54
Definition program-state.h:224
Definition region-model.h:768
Definition region-model.h:299
const gresx & get_gresx() const
Definition ops.h:566
std::unique_ptr< operation > clone() const final override
Definition ops.h:561
resx_op(const gresx &resx_stmt)
Definition ops.h:555
bool supports_bulk_merge_p() const final override
Definition ops.h:575
void add_any_events_for_eedge(const exploded_edge &eedge, checker_path &out_path) const final override
void execute(operation_context &op_ctxt) const final override
std::unique_ptr< operation > clone() const final override
Definition ops.h:499
void execute(operation_context &op_ctxt) const final override
void add_any_events_for_eedge(const exploded_edge &eedge, checker_path &out_path) const final override
setjmp_op(const gcall &call_stmt)
Definition ops.h:493
Definition supergraph.h:281
Definition supergraph.h:105
Definition supergraph.h:224
std::unique_ptr< operation > clone() const final override
Definition ops.h:763
bool implicitly_created_default_p() const
void print_as_edge_label(pretty_printer *pp, bool user_facing) const final override
bool apply_constraints(const superedge *sedge, region_model &model, region_model_context *ctxt, std::unique_ptr< rejected_constraint > *out) const final override
const bounded_ranges * m_all_cases_ranges
Definition ops.h:788
std::vector< tree > m_case_labels
Definition ops.h:787
const gswitch & get_gswitch() const
Definition ops.h:774
switch_case_op(function &fun, ::edge cfg_edge, const gswitch &switch_stmt, bounded_ranges_manager &mgr)
Definition store.h:161
Definition cgraph.h:1747
Definition genmatch.cc:1506
Definition pretty-print.h:241
class edge_def * edge
Definition coretypes.h:369
const union tree_node * const_tree
Definition coretypes.h:98
union tree_node * tree
Definition coretypes.h:97
struct eh_catch_d * eh_catch
Definition except.h:183
struct eh_region_d * eh_region
Definition except.h:184
void final(rtx_insn *first, FILE *file, int optimize_p)
Definition final.cc:2009
tree_code
Definition genmatch.cc:1002
bool(* walk_stmt_load_store_addr_fn)(gimple *, tree, tree, void *)
Definition gimple-walk.h:93
tree gimple_return_retval(const greturn *gs)
Definition gimple.h:6827
T as_a(U *p)
Definition is-a.h:253
Definition access-diagram.h:30
@ stmt
Definition checker-event.h:38
Definition graphviz.cc:147
Definition constraint-manager.h:123
Definition ops.h:37
const extrinsic_state & get_ext_state() const
const superedge & m_sedge
Definition ops.h:74
const program_point & get_initial_point() const
const program_state & get_initial_state() const
exploded_node & m_src_enode
Definition ops.h:73
program_point get_next_intraprocedural_point() const
void DEBUG_FUNCTION dump() const
const supergraph & get_supergraph() const
exploded_graph & m_eg
Definition ops.h:72
operation_context(exploded_graph &eg, exploded_node &src_enode, const superedge &sedge)
Definition ops.h:38
void add_outcome(const program_point &dst_point, program_state dst_state, bool could_do_work, uncertainty_t *uncertainty, std::unique_ptr< custom_edge_info > info=nullptr)
logger * get_logger() const
Definition exploded-graph.h:658
Definition ops.h:936
tree m_dst
Definition ops.h:937
tree m_src
Definition ops.h:938
Definition function.h:249
Definition gimple.h:549
Definition gimple.h:907
Definition gimple.h:352
Definition gimple.h:861
Definition gimple.h:494
Definition gimple.h:880
Definition gimple.h:221
Definition gimple.h:488
Definition gimple.h:917
Definition gimple.h:898
#define gcc_assert(EXPR)
Definition system.h:817
#define gcc_unreachable()
Definition system.h:844
#define DEBUG_FUNCTION
Definition system.h:1239
static control_dependences * cd
Definition tree-ssa-dce.cc:104
#define ssa_name(i)
Definition tree-ssanames.h:53