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-2026 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
78{
80 diagnostic_state input_state)
81 : m_logger (logger),
82 m_input (input_state),
83 m_output (input_state)
84 {
85 }
86
87 void
89
90 void
92
93 virtual const region_model &
95
96 virtual const region_model &
98
99 virtual bool
101
102 virtual void
103 add_state_transition (std::unique_ptr<state_transition>) = 0;
104
108};
109
110/* Abstract base class for an operation along a superedge. */
111
113{
114 public:
115 // Discriminator for concrete subclasses
131
132 virtual ~operation () {}
133
134 void
135 dump () const;
136
137 virtual std::unique_ptr<operation>
138 clone () const = 0;
139
140 virtual void
141 print_as_edge_label (pretty_printer *pp, bool user_facing) const = 0;
142
143 virtual bool
145
146 virtual void
151
152 virtual const gimple *
154 {
155 return nullptr;
156 }
157
158 virtual void
159 execute (operation_context &op_ctxt) const = 0;
160
161 virtual bool
165 std::unique_ptr<rejected_constraint> */*out_rc*/) const
166 {
167 // no-op
168 return true;
169 }
170
171 /* Is this op suitable for bulk-merging?
172 It must have a single outcome, at the intraprocedural
173 next point, with some state. */
174 virtual bool
176 virtual void
178 program_state &) const
179 {
180 /* Must be implemented for any subclasses that return true
181 for supports_bulk_merge_p. */
183 }
184 virtual void
186 checker_path &out_path) const = 0;
187
188 virtual const control_flow_op *
189 dyn_cast_control_flow_op () const { return nullptr; }
190
191 virtual const call_and_return_op *
192 dyn_cast_call_and_return_op () const { return nullptr; }
193
194 virtual const phis_for_edge_op *
195 dyn_cast_phis_for_edge_op () const { return nullptr; }
196
197 enum kind get_kind () const { return m_kind; }
198
199 virtual bool
201 {
202 return false;
203 }
204
205protected:
206 operation (enum kind kind_)
207 : m_kind (kind_)
208 {
209 }
210
211 static void
213 program_state &dst_state,
214 path_context *path_ctxt,
215 bool &unknown_side_effects,
216 const gimple &stmt);
217
218private:
220};
221
222/* Subclass for an operation representing a specific gimple stmt
223 that isn't control flow. */
224
226{
227public:
228 const gimple &get_stmt () const { return m_stmt; }
229
230 void
231 print_as_edge_label (pretty_printer *pp, bool user_facing) const override;
232
233 bool
234 defines_ssa_name_p (const_tree ssa_name) const final override;
235
236 void
240 walk_stmt_load_store_addr_fn) const final override;
241
242 const gimple *
243 maybe_get_stmt () const final override
244 {
245 return &m_stmt;
246 }
247
248 void
249 execute (operation_context &op_ctxt) const override;
250
251 void
253 program_state dst_state) const;
254
255 bool
259 std::unique_ptr<rejected_constraint> *out_rc) const override;
260
261 virtual bool
262 supports_bulk_merge_p () const override;
263
264 void
266 checker_path &out_path) const override;
267
268protected:
269 gimple_stmt_op (enum kind kind_, const gimple &stmt)
270 : operation (kind_), m_stmt (stmt)
271 {}
272
273private:
275};
276
277/* Various subclasses of gimple_stmt_op. */
278
279/* An operation subclass representing the effect of a GIMPLE_ASM stmt. */
280
282{
283public:
286 {
287 }
288
289 std::unique_ptr<operation>
290 clone () const final override
291 {
292 return std::make_unique<gasm_op> (get_gasm ());
293 }
294
295 const gasm &get_gasm () const
296 {
297 return *as_a <const gasm *> (&get_stmt ());
298 }
299};
300
301/* An operation subclass representing the effect of a GIMPLE_ASSIGN stmt. */
302
304{
305public:
306 gassign_op (const gassign &assign_stmt)
307 : gimple_stmt_op (kind::assignment, assign_stmt)
308 {
309 }
310
311 std::unique_ptr<operation>
312 clone () const final override
313 {
314 return std::make_unique<gassign_op> (get_gassign ());
315 }
316
317 const gassign &get_gassign () const
318 {
319 return *as_a <const gassign *> (&get_stmt ());
320 }
321
322 bool
323 try_to_rewind_data_flow (rewind_context &ctxt) const final override;
324};
325
326/* An operation subclass for a GIMPLE_PREDICT stmt.
327 They have no effect on state, but can be useful for reconstructing
328 where "return" statements were in the code the user originally wrote,
329 to improve the reported locations in diagnostics. */
330
332{
333public:
336 {
337 gcc_assert (predict_stmt.code == GIMPLE_PREDICT);
338 }
339
340 std::unique_ptr<operation>
341 clone () const final override
342 {
343 return std::make_unique<predict_op> (get_stmt ());
344 }
345
346 bool
348 {
349 return true;
350 }
351};
352
353/* An operation subclass representing both:
354 (a) the effect of a GIMPLE_RETURN stmt: copying a value into the
355 RESULT_DECL of the current frame, and
356 (b) a hint when reporting diagnostics that this is the return
357 path from the function (rather than say, throwing an exception). */
358
360{
361public:
366
367 std::unique_ptr<operation>
368 clone () const final override
369 {
370 return std::make_unique<greturn_op> (get_greturn ());
371 }
372
373 void
374 execute (operation_context &op_ctxt) const final override;
375
376 bool
380 std::unique_ptr<rejected_constraint> *out_rc) const override;
381
382 bool
383 supports_bulk_merge_p () const final override
384 {
385 return false;
386 }
387
388 void
390 checker_path &out_path) const final override;
391
392 const greturn &get_greturn () const
393 {
394 return *as_a <const greturn *> (&get_stmt ());
395 }
396
398 {
400 }
401
402 bool
403 try_to_rewind_data_flow (rewind_context &ctxt) const final override;
404};
405
406/* A concrete operation subclass representing the effect of a GIMPLE_CALL stmt.
407
408 If the function is identified and has a known body, either simulate
409 it interprocedurally by pushing a stack frame and transitioning to the
410 callee, or simulate it intraprocedurally by replaying a summary of the
411 effects of the call.
412
413 If the function is identified but has an unknown body,
414 simulate it intraprocedurally, either using a known_function
415 subclass for precision, or following conservative rules that
416 assume various side-effects.
417
418 If the function is unidentified (for some kinds of dynamic calls),
419 simulate it intraprocedurally, following conservative rules that
420 assume various side-effects.
421
422 In the various intraprocedural simulation cases, the exploded edge will
423 correspond to the underlying superedge.
424
425 In the interprocedural simulation case, the exploded edge will
426 link two supernodes in different functions, and thus will require
427 custom edge info.
428
429 Various subclasses exist for handling awkward special cases,
430 such as longjmp. */
431
433{
434public:
435 static std::unique_ptr<operation>
436 make (const gcall &call_stmt);
437
438 std::unique_ptr<operation>
439 clone () const override
440 {
441 return std::make_unique<call_and_return_op> (get_gcall ());
442 }
443
444 const gcall &get_gcall () const
445 {
446 return *as_a <const gcall *> (&get_stmt ());
447 }
448
449 void
450 execute (operation_context &op_ctxt) const override;
451
452 bool
453 supports_bulk_merge_p () const final override
454 {
455 return false;
456 }
457
458 void
460 checker_path &out_path) const override;
461
462 const call_and_return_op *
463 dyn_cast_call_and_return_op () const final override { return this; }
464
465 tree
467 tree caller_expr,
468 callsite_expr *out) const;
469 tree
471 tree callee_expr,
472 callsite_expr *out) const;
473
474 call_and_return_op (const gcall &call_stmt)
475 : gimple_stmt_op (kind::call_and_return, call_stmt)
476 {
477 }
478
479 const known_function *
481
482 bool
483 try_to_rewind_data_flow (rewind_context &ctxt) const final override;
484
485private:
488
489 void
491 function &called_fn,
492 per_function_data &called_fn_data,
493 region_model_context *ctxt) const;
494
495 void
497 function &called_fn,
498 call_summary &summary,
499 region_model_context *ctxt) const;
500
501 tree
502 get_arg_for_parm (tree callee_fndecl,
503 tree parm,
504 callsite_expr *out) const;
505 tree
506 get_parm_for_arg (tree callee_fndecl,
507 tree arg,
508 callsite_expr *out) const;
509};
510
511/* A call to one of the various __analyzer_dump* functions.
512 These have no effect on state. */
513
515{
516public:
524
525 dump_op (const gcall &call_stmt, enum dump_kind dump_kind_)
526 : call_and_return_op (call_stmt),
527 m_dump_kind (dump_kind_)
528 {
529 }
530
531 std::unique_ptr<operation>
532 clone () const final override
533 {
534 return std::make_unique<dump_op> (get_gcall (), m_dump_kind);
535 }
536
537 void
538 execute (operation_context &op_ctxt) const final override;
539
540private:
542};
543
545{
546public:
547 setjmp_op (const gcall &call_stmt)
548 : call_and_return_op (call_stmt)
549 {
550 }
551
552 std::unique_ptr<operation>
553 clone () const final override
554 {
555 return std::make_unique<setjmp_op> (get_gcall ());
556 }
557
558 void
559 execute (operation_context &op_ctxt) const final override;
560
561 void
563 checker_path &out_path) const final override;
564};
565
567{
568public:
569 longjmp_op (const gcall &call_stmt)
570 : call_and_return_op (call_stmt)
571 {
572 }
573
574 std::unique_ptr<operation>
575 clone () const final override
576 {
577 return std::make_unique<longjmp_op> (get_gcall ());
578 }
579
580 void
581 execute (operation_context &op_ctxt) const final override;
582};
583
585{
586public:
587 cxa_throw_op (const gcall &call_stmt, bool is_rethrow)
588 : call_and_return_op (call_stmt),
589 m_is_rethrow (is_rethrow)
590 {
591 }
592
593 std::unique_ptr<operation>
594 clone () const final override
595 {
596 return std::make_unique<cxa_throw_op> (get_gcall (), m_is_rethrow);
597 }
598
599 void
600 execute (operation_context &op_ctxt) const final override;
601
602private:
604};
605
607{
608public:
609 resx_op (const gresx &resx_stmt)
610 : gimple_stmt_op (kind::resx, resx_stmt)
611 {
612 }
613
614 std::unique_ptr<operation>
615 clone () const final override
616 {
617 return std::make_unique<resx_op> (get_gresx ());
618 }
619
620 const gresx &get_gresx () const
621 {
622 return *as_a <const gresx *> (&get_stmt ());
623 }
624
625 void
626 execute (operation_context &op_ctxt) const final override;
627
628 bool
629 supports_bulk_merge_p () const final override
630 {
631 return false;
632 }
633
634 void
636 checker_path &out_path) const final override;
637};
638
639/* An abstract subclass of operation representing the filtering effect on
640 state of a gimple control-flow statement at the end of a BB, for
641 a specific CFG out-edge from that BB. */
642
644{
645public:
646 void
648 checker_path &out_path) const override;
649
650 bool
651 defines_ssa_name_p (const_tree) const final override
652 {
653 return false;
654 }
655
656 void
660 walk_stmt_load_store_addr_fn) const final override;
661
662 const gimple *
663 maybe_get_stmt () const final override
664 {
665 return &m_ctrlflow_stmt;
666 }
667
668 virtual label_text
669 maybe_describe_condition (bool can_colorize) const;
670
671 void
672 execute (operation_context &op_ctxt) const final override;
673
674 bool
675 supports_bulk_merge_p () const final override
676 {
677 return false;
678 }
679
680 bool
684 std::unique_ptr<rejected_constraint> *out_rc) const override;
685
686 const control_flow_op *
687 dyn_cast_control_flow_op () const final override { return this; }
688
689 ::edge get_cfg_edge () const { return m_cfg_edge; }
690 int get_flags () const { return m_cfg_edge->flags; }
691 int back_edge_p () const { return get_flags () & EDGE_DFS_BACK; }
692
693 const gimple &get_ctrlflow_stmt () const { return m_ctrlflow_stmt; }
694
695 bool
697 {
698 return true;
699 }
700
701protected:
703 ::edge cfg_edge,
704 const gimple &ctrlflow_stmt)
705 : operation (kind_),
706 m_cfg_edge (cfg_edge),
707 m_ctrlflow_stmt (ctrlflow_stmt)
708 {}
709
710private:
711 virtual bool
713 region_model &model,
715 std::unique_ptr<rejected_constraint> *out) const = 0;
716
719};
720
721/* Concrete operation subclass representing filtering/applying state
722 transitions on a specific CFG edge after a GIMPLE_COND stmt, either the
723 "if (cond) is true" or the "if (cond) is false" branch. */
724
726{
727public:
729 const gcond &cond_stmt);
730
731 std::unique_ptr<operation>
732 clone () const final override
733 {
734 return std::make_unique<gcond_edge_op> (get_cfg_edge (),
735 get_gcond ());
736 }
737
738 void
740 bool user_facing) const final override;
741
742 label_text
743 maybe_describe_condition (bool can_colorize) const final override;
744
745 const gcond &get_gcond () const
746 {
748 }
749
750private:
751 static label_text
752 maybe_describe_condition (bool can_colorize,
753 tree lhs,
754 enum tree_code op,
755 tree rhs);
757
758 bool
760 region_model &model,
762 std::unique_ptr<rejected_constraint> *out)
763 const final override;
764
766};
767
768/* Concrete operation subclass representing filtering/applying state
769 transitions on a specific CFG edge after a GIMPLE_GOTO stmt, thus
770 handling computed gotos. */
771
773{
774public:
776 const ggoto &goto_stmt,
777 tree dst_label);
778
779 std::unique_ptr<operation>
780 clone () const final override
781 {
782 return std::make_unique<ggoto_edge_op> (get_cfg_edge (),
783 get_ggoto (),
785 }
786
787 void
789 bool user_facing) const final override;
790
791 label_text
792 maybe_describe_condition (bool can_colorize) const final override;
793
794 const ggoto &get_ggoto () const
795 {
797 }
798
799private:
800 bool
802 region_model &model,
804 std::unique_ptr<rejected_constraint> *out)
805 const final override;
806
808};
809
810/* Concrete operation subclass representing filtering/applying state
811 transitions on a specific CFG edge after a GIMPLE_SWITCH stmt, thus
812 handling a cluster of cases/default value. */
813
815{
816 public:
818 ::edge cfg_edge,
819 const gswitch &switch_stmt,
821
822 std::unique_ptr<operation>
823 clone () const final override
824 {
825 return std::make_unique<switch_case_op> (*this);
826 }
827
828 void
830 bool user_facing) const final override;
831
833
834 const gswitch &get_gswitch () const
835 {
837 }
838
839 private:
840 bool
842 region_model &model,
844 std::unique_ptr<rejected_constraint> *out)
845 const final override;
846
847 std::vector<tree> m_case_labels;
849};
850
851/* Abstract subclass for edges from eh_dispatch statements. */
852
854{
855public:
856 static std::unique_ptr<eh_dispatch_edge_op>
858 supernode *dest,
859 ::edge cfg_edge,
860 const geh_dispatch &geh_dispatch_stmt);
861
862 const geh_dispatch &
864 {
866 }
867
869 get_eh_region () const { return m_eh_region; }
870
871protected:
873 enum kind kind_,
874 ::edge cfg_edge,
875 const geh_dispatch &geh_dispatch_stmt,
876 eh_region eh_reg);
877
878 supernode *get_src_snode () const { return m_src_snode; }
879
880private:
881 bool
883 region_model &model,
885 std::unique_ptr<rejected_constraint> *out)
886 const final override;
887
888 virtual bool
890 region_model &model,
892 tree exception_type,
893 std::unique_ptr<rejected_constraint> *out) const = 0;
894
897};
898
899/* Concrete operation for edges from an eh_dispatch statement
900 for ERT_TRY regions. */
901
903{
904public:
906 ::edge cfg_edge,
907 const geh_dispatch &geh_dispatch_stmt,
908 eh_region eh_reg,
909 eh_catch ehc);
910
911 std::unique_ptr<operation>
912 clone () const final override
913 {
914 return std::make_unique<eh_dispatch_try_edge_op> (*this);
915 }
916
917 void
919 bool user_facing) const final override;
920
921 void
923 checker_path &out_path) const final override;
924
925private:
926 bool
928 region_model &model,
930 tree exception_type,
931 std::unique_ptr<rejected_constraint> *out)
932 const final override;
933
935};
936
937/* Concrete operation for edges from an eh_dispatch statement
938 for ERT_ALLOWED_EXCEPTIONS regions. */
939
941{
942public:
948
950 supernode *dst_snode,
951 ::edge cfg_edge,
952 const geh_dispatch &geh_dispatch_stmt,
953 eh_region eh_reg);
954
955 std::unique_ptr<operation>
956 clone () const final override
957 {
958 return std::make_unique<eh_dispatch_allowed_edge_op> (*this);
959 }
960
961 void
963 bool user_facing) const final override;
964
965 enum eh_kind get_eh_kind () const { return m_kind; }
966
967private:
968 bool
970 region_model &model,
972 tree exception_type,
973 std::unique_ptr<rejected_constraint> *out)
974 const final override;
975
977};
978
979/* Concrete operation subclass representing the state transition
980 for simultaneously handling all of the phi nodes at the entry to a BB,
981 after following a specific CFG in-edge.
982 Note that this covers multiple gimple stmts: all of the gphi stmts
983 at a basic block entry (albeit for just one in-edge).
984 This can be thought of as handling one column of the entries in the
985 phi nodes of a BB (for a specific in-edge).
986 We ignore MEM entries, and discard phi nodes purely affecting them. */
987
989{
990public:
991 /* A "dst=src;" pair within a phi node. */
992 struct pair
993 {
996 };
997
998 static std::unique_ptr<operation>
999 maybe_make (::edge cfg_in_edge);
1000
1001 std::unique_ptr<operation>
1002 clone () const final override
1003 {
1004 return std::make_unique<phis_for_edge_op> (*this);
1005 }
1006
1007 phis_for_edge_op (std::vector<pair> &&pairs);
1008
1009 const phis_for_edge_op *
1010 dyn_cast_phis_for_edge_op () const final override { return this; }
1011
1012 void
1014 bool user_facing) const final override;
1015
1016 bool
1018
1019 void
1023 walk_stmt_load_store_addr_fn) const final override;
1024 void
1025 execute (operation_context &op_ctxt) const final override;
1026
1027 bool
1031 std::unique_ptr<rejected_constraint> *out_rc) const override;
1032
1033 bool
1035 {
1036 return true;
1037 }
1038 void
1040 program_state &dst_state) const final override;
1041
1042 void
1044 checker_path &out_path) const final override;
1045
1046 bool
1047 try_to_rewind_data_flow (rewind_context &ctxt) const final override;
1048
1049 const std::vector<pair> &get_pairs () const { return m_pairs; }
1050
1051private:
1052 static std::vector<pair>
1054
1055 void
1056 update_state (const program_state &src_state,
1057 program_state &dst_state,
1058 region_model_context *ctxt) const;
1059
1060 std::vector<pair> m_pairs;
1061};
1062
1063} // namespace ana
1064
1065#endif /* GCC_ANALYZER_OPS_H */
Definition constraint-manager.h:178
Definition ops.h:433
const gcall & get_gcall() const
Definition ops.h:444
const call_and_return_op * dyn_cast_call_and_return_op() const final override
Definition ops.h:463
bool supports_bulk_merge_p() const final override
Definition ops.h:453
cgraph_edge * get_any_cgraph_edge(operation_context &op_ctxt) const
std::unique_ptr< operation > clone() const override
Definition ops.h:439
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:474
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
bool try_to_rewind_data_flow(rewind_context &ctxt) const final override
Definition call-details.h:31
Definition call-summary.h:34
Definition callsite-expr.h:32
Definition checker-path.h:32
Definition ops.h:644
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:690
const gimple & get_ctrlflow_stmt() const
Definition ops.h:693
::edge m_cfg_edge
Definition ops.h:717
bool execute_for_feasibility(const exploded_edge &, feasibility_state &, region_model_context *, std::unique_ptr< rejected_constraint > *out_rc) const override
bool defines_ssa_name_p(const_tree) const final override
Definition ops.h:651
const gimple & m_ctrlflow_stmt
Definition ops.h:718
void add_any_events_for_eedge(const exploded_edge &eedge, checker_path &out_path) const override
int back_edge_p() const
Definition ops.h:691
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:663
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:702
::edge get_cfg_edge() const
Definition ops.h:689
const control_flow_op * dyn_cast_control_flow_op() const final override
Definition ops.h:687
bool try_to_rewind_data_flow(rewind_context &) const final override
Definition ops.h:696
virtual label_text maybe_describe_condition(bool can_colorize) const
bool supports_bulk_merge_p() const final override
Definition ops.h:675
bool m_is_rethrow
Definition ops.h:603
cxa_throw_op(const gcall &call_stmt, bool is_rethrow)
Definition ops.h:587
void execute(operation_context &op_ctxt) const final override
std::unique_ptr< operation > clone() const final override
Definition ops.h:594
void execute(operation_context &op_ctxt) const final override
dump_kind
Definition ops.h:518
@ state_2
Definition ops.h:522
@ state
Definition ops.h:519
@ sarif
Definition ops.h:520
enum dump_kind m_dump_kind
Definition ops.h:541
dump_op(const gcall &call_stmt, enum dump_kind dump_kind_)
Definition ops.h:525
std::unique_ptr< operation > clone() const final override
Definition ops.h:532
std::unique_ptr< operation > clone() const final override
Definition ops.h:956
@ expected
Definition ops.h:945
@ unexpected
Definition ops.h:946
enum eh_kind get_eh_kind() const
Definition ops.h:965
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:976
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:878
static std::unique_ptr< eh_dispatch_edge_op > make(supernode *src, supernode *dest, ::edge cfg_edge, const geh_dispatch &geh_dispatch_stmt)
eh_region m_eh_region
Definition ops.h:896
eh_region get_eh_region() const
Definition ops.h:869
const geh_dispatch & get_geh_dispatch() const
Definition ops.h:863
supernode * m_src_snode
Definition ops.h:895
bool apply_constraints(const superedge *sedge, region_model &model, region_model_context *ctxt, std::unique_ptr< rejected_constraint > *out) const final override
eh_dispatch_edge_op(supernode *src_snode, enum kind kind_, ::edge cfg_edge, const geh_dispatch &geh_dispatch_stmt, eh_region eh_reg)
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:912
eh_catch m_eh_catch
Definition ops.h:934
eh_dispatch_try_edge_op(supernode *src_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:794
Definition exploded-graph.h:206
Definition program-state.h:34
Definition exploded-graph.h:963
gasm_op(const gasm &asm_stmt)
Definition ops.h:284
const gasm & get_gasm() const
Definition ops.h:295
std::unique_ptr< operation > clone() const final override
Definition ops.h:290
const gassign & get_gassign() const
Definition ops.h:317
std::unique_ptr< operation > clone() const final override
Definition ops.h:312
gassign_op(const gassign &assign_stmt)
Definition ops.h:306
bool try_to_rewind_data_flow(rewind_context &ctxt) const final override
std::unique_ptr< operation > clone() const final override
Definition ops.h:732
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:745
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:765
void print_as_edge_label(pretty_printer *pp, bool user_facing) const final override
tree m_dst_label
Definition ops.h:807
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:794
std::unique_ptr< operation > clone() const final override
Definition ops.h:780
virtual bool supports_bulk_merge_p() const override
gimple_stmt_op(enum kind kind_, const gimple &stmt)
Definition ops.h:269
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:274
void execute_on_state(operation_context &op_ctxt, program_state dst_state) const
const gimple & get_stmt() const
Definition ops.h:228
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:243
bool defines_ssa_name_p(const_tree ssa_name) const final override
bool try_to_rewind_data_flow(rewind_context &ctxt) 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:368
void execute(operation_context &op_ctxt) const final override
const greturn & get_greturn() const
Definition ops.h:392
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:362
tree get_retval() const
Definition ops.h:397
bool supports_bulk_merge_p() const final override
Definition ops.h:383
Definition common.h:303
Definition analyzer-logging.h:36
longjmp_op(const gcall &call_stmt)
Definition ops.h:569
std::unique_ptr< operation > clone() const final override
Definition ops.h:575
void execute(operation_context &op_ctxt) const final override
Definition ops.h:113
virtual const gimple * maybe_get_stmt() const
Definition ops.h:153
enum kind m_kind
Definition ops.h:219
virtual const call_and_return_op * dyn_cast_call_and_return_op() const
Definition ops.h:192
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:189
virtual ~operation()
Definition ops.h:132
kind
Definition ops.h:117
@ predict_stmt
Definition ops.h:120
@ call_and_return
Definition ops.h:129
@ asm_stmt
Definition ops.h:118
@ resx
Definition ops.h:122
@ phis
Definition ops.h:128
@ eh_dispatch_allowed_edge
Definition ops.h:127
@ assignment
Definition ops.h:119
@ eh_dispatch_try_edge
Definition ops.h:126
@ cond_edge
Definition ops.h:123
@ goto_edge
Definition ops.h:124
@ return_stmt
Definition ops.h:121
@ switch_edge
Definition ops.h:125
virtual std::unique_ptr< operation > clone() const =0
enum kind get_kind() const
Definition ops.h:197
virtual void update_state_for_bulk_merger(const program_state &, program_state &) const
Definition ops.h:177
operation(enum kind kind_)
Definition ops.h:206
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:162
virtual void execute(operation_context &op_ctxt) const =0
virtual bool try_to_rewind_data_flow(rewind_context &) const
Definition ops.h:200
virtual const phis_for_edge_op * dyn_cast_phis_for_edge_op() const
Definition ops.h:195
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:478
Definition ops.h:989
std::vector< pair > m_pairs
Definition ops.h:1060
bool try_to_rewind_data_flow(rewind_context &ctxt) const final override
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:1049
phis_for_edge_op(std::vector< pair > &&pairs)
const phis_for_edge_op * dyn_cast_phis_for_edge_op() const final override
Definition ops.h:1010
bool supports_bulk_merge_p() const final override
Definition ops.h:1034
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:1002
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
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
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:334
bool try_to_rewind_data_flow(rewind_context &) const final override
Definition ops.h:347
std::unique_ptr< operation > clone() const final override
Definition ops.h:341
Definition program-point.h:54
Definition program-state.h:224
Definition region-model.h:748
Definition region-model.h:294
const gresx & get_gresx() const
Definition ops.h:620
std::unique_ptr< operation > clone() const final override
Definition ops.h:615
resx_op(const gresx &resx_stmt)
Definition ops.h:609
bool supports_bulk_merge_p() const final override
Definition ops.h:629
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:553
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:547
Definition supergraph.h:281
Definition supergraph.h:105
Definition supergraph.h:224
std::unique_ptr< operation > clone() const final override
Definition ops.h:823
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:848
std::vector< tree > m_case_labels
Definition ops.h:847
const gswitch & get_gswitch() const
Definition ops.h:834
switch_case_op(function &fun, ::edge cfg_edge, const gswitch &switch_stmt, bounded_ranges_manager &mgr)
Definition store.h:162
Definition cgraph.h:1872
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:6839
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 common.h:387
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:669
Definition ops.h:993
tree m_dst
Definition ops.h:994
tree m_src
Definition ops.h:995
Definition ops.h:78
virtual void add_state_transition(std::unique_ptr< state_transition >)=0
void on_data_flow(tree src, tree dst)
diagnostic_state m_output
Definition ops.h:107
logger * m_logger
Definition ops.h:105
virtual bool could_be_affected_by_write_p(tree lhs)=0
virtual const region_model & get_src_region_model() const =0
void on_data_origin(tree dst)
rewind_context(logger *logger, diagnostic_state input_state)
Definition ops.h:79
virtual const region_model & get_dst_region_model() const =0
diagnostic_state m_input
Definition ops.h:106
Definition function.h:249
Definition gimple.h:552
Definition gimple.h:910
Definition gimple.h:355
Definition gimple.h:864
Definition gimple.h:497
Definition gimple.h:883
Definition gimple.h:224
Definition gimple.h:491
Definition gimple.h:920
Definition gimple.h:901
#define gcc_assert(EXPR)
Definition system.h:817
#define gcc_unreachable()
Definition system.h:844
#define DEBUG_FUNCTION
Definition system.h:1191
static control_dependences * cd
Definition tree-ssa-dce.cc:105
#define ssa_name(i)
Definition tree-ssanames.h:53