GCC Middle and Back End API Reference
svalue.h
Go to the documentation of this file.
1/* Symbolic values.
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_SVALUE_H
22#define GCC_ANALYZER_SVALUE_H
23
24#include "analyzer/symbol.h"
25#include "analyzer/store.h"
27#include "text-art/widget.h"
28
29using namespace ana;
31
32namespace ana {
33
34/* An enum for discriminating between the different concrete subclasses
35 of svalue. */
36
58
59/* svalue and its subclasses.
60
61 The class hierarchy looks like this (using indentation to show
62 inheritance, and with svalue_kinds shown for the concrete subclasses):
63
64 svalue
65 region_svalue (SK_REGION): a pointer to a region
66 constant_svalue (SK_CONSTANT): a constant
67 unknown_svalue (SK_UNKNOWN): an unknowable value
68 poisoned_svalue (SK_POISONED): a unusable value (undefined)
69 setjmp_svalue (SK_SETJMP): a setjmp/longjmp buffer
70 initial_svalue (SK_INITIAL): the initial value of a region
71 unaryop_svalue (SK_UNARYOP): unary operation on another svalue
72 binop_svalue (SK_BINOP): binary operation on two svalues
73 sub_svalue (SK_SUB): the result of accessing a subregion
74 repeated_svalue (SK_REPEATED): repeating an svalue to fill a larger region
75 bits_within_svalue (SK_BITS_WITHIN): a range of bits/bytes within a larger
76 svalue
77 unmergeable_svalue (SK_UNMERGEABLE): a value that is so interesting
78 from a control-flow perspective that it can inhibit state-merging
79 placeholder_svalue (SK_PLACEHOLDER): for use in selftests.
80 widening_svalue (SK_WIDENING): a merger of two svalues (possibly
81 in an iteration).
82 compound_svalue (SK_COMPOUND): a mapping of bit-ranges to svalues
83 conjured_svalue (SK_CONJURED): a value arising from a stmt
84 asm_output_svalue (SK_ASM_OUTPUT): an output from a deterministic
85 asm stmt.
86 const_fn_result_svalue (SK_CONST_FN_RESULT): the return value from
87 a function with __attribute((const)) for given inputs. */
88
89/* An abstract base class representing a value held by a region of memory. */
90
91class svalue : public symbol
92{
93public:
94 virtual ~svalue () {}
95
96 tree get_type () const { return m_type; }
97
98 virtual enum svalue_kind get_kind () const = 0;
99
100 void print (const region_model &model,
101 pretty_printer *pp) const;
102
103 virtual void dump_to_pp (pretty_printer *pp, bool simple) const = 0;
104 void dump () const;
105 void dump (bool simple) const;
106 label_text get_desc (bool simple=true) const;
107
108 std::unique_ptr<json::value> to_json () const;
109
110 std::unique_ptr<text_art::tree_widget>
112 const char *prefix = nullptr) const;
113
114 virtual const region_svalue *
115 dyn_cast_region_svalue () const { return nullptr; }
116 virtual const constant_svalue *
117 dyn_cast_constant_svalue () const { return nullptr; }
118 virtual const poisoned_svalue *
119 dyn_cast_poisoned_svalue () const { return nullptr; }
120 virtual const setjmp_svalue *
121 dyn_cast_setjmp_svalue () const { return nullptr; }
122 virtual const initial_svalue *
123 dyn_cast_initial_svalue () const { return nullptr; }
124 virtual const unaryop_svalue *
125 dyn_cast_unaryop_svalue () const { return nullptr; }
126 virtual const binop_svalue *
127 dyn_cast_binop_svalue () const { return nullptr; }
128 virtual const sub_svalue *
129 dyn_cast_sub_svalue () const { return nullptr; }
130 virtual const repeated_svalue *
131 dyn_cast_repeated_svalue () const { return nullptr; }
132 virtual const bits_within_svalue *
133 dyn_cast_bits_within_svalue () const { return nullptr; }
134 virtual const unmergeable_svalue *
135 dyn_cast_unmergeable_svalue () const { return nullptr; }
136 virtual const widening_svalue *
137 dyn_cast_widening_svalue () const { return nullptr; }
138 virtual const compound_svalue *
139 dyn_cast_compound_svalue () const { return nullptr; }
140 virtual const conjured_svalue *
141 dyn_cast_conjured_svalue () const { return nullptr; }
142 virtual const asm_output_svalue *
143 dyn_cast_asm_output_svalue () const { return nullptr; }
144 virtual const const_fn_result_svalue *
145 dyn_cast_const_fn_result_svalue () const { return nullptr; }
146
148 const region *maybe_get_region () const;
149 const svalue *maybe_undo_cast () const;
151
152 const svalue *can_merge_p (const svalue *other,
154 model_merger *merger) const;
155
156 virtual void accept (visitor *v) const = 0;
157
158 bool live_p (const svalue_set *live_svalues,
159 const region_model *model) const;
160 virtual bool implicitly_live_p (const svalue_set *live_svalues,
161 const region_model *model) const;
162
163 static int cmp_ptr (const svalue *, const svalue *);
164 static int cmp_ptr_ptr (const void *, const void *);
165
166 bool involves_p (const svalue *other) const;
167
168 const svalue *
170 const bit_range &subrange,
171 region_model_manager *mgr) const;
172
173 virtual const svalue *
175 const bit_range &subrange,
176 region_model_manager *mgr) const;
177
178 virtual bool all_zeroes_p () const;
179
180 /* Can this svalue be involved in constraints and sm-state?
181 Most can, but UNKNOWN and POISONED svalues are singletons
182 per-type and thus it's meaningless for them to "have state". */
183 virtual bool can_have_associated_state_p () const { return true; }
184
186
188 const region_model &model,
189 const svalue *outer_sval = nullptr) const;
190
192
193 protected:
195 : symbol (c, id), m_type (type)
196 {}
197
199
200 private:
201 virtual void
203 virtual void
205 const dump_widget_info &dwi) const = 0;
206
208};
209
210/* Concrete subclass of svalue representing a pointer value that points to
211 a known region */
212
213class region_svalue : public svalue
214{
215public:
216 /* A support class for uniquifying instances of region_svalue. */
217 struct key_t
218 {
219 key_t (tree type, const region *reg)
220 : m_type (type), m_reg (reg)
221 {}
222
223 hashval_t hash () const
224 {
225 inchash::hash hstate;
226 hstate.add_ptr (m_type);
227 hstate.add_ptr (m_reg);
228 return hstate.end ();
229 }
230
231 bool operator== (const key_t &other) const
232 {
233 return (m_type == other.m_type && m_reg == other.m_reg);
234 }
235
236 void mark_deleted () { m_type = reinterpret_cast<tree> (1); }
237 void mark_empty () { m_type = reinterpret_cast<tree> (2); }
238 bool is_deleted () const { return m_type == reinterpret_cast<tree> (1); }
239 bool is_empty () const { return m_type == reinterpret_cast<tree> (2); }
240
242 const region *m_reg;
243 };
244
246 : svalue (complexity (reg), id, type),
247 m_reg (reg)
248 {
249 gcc_assert (m_reg != nullptr);
250 }
251
252 enum svalue_kind get_kind () const final override { return SK_REGION; }
253 const region_svalue *
254 dyn_cast_region_svalue () const final override { return this; }
255
256 void dump_to_pp (pretty_printer *pp, bool simple) const final override;
257
258 void
259 print_dump_widget_label (pretty_printer *pp) const final override;
260 void
262 const dump_widget_info &dwi) const final override;
263
264 void accept (visitor *v) const final override;
266 const region_model *) const final override;
267
268 const region * get_pointee () const { return m_reg; }
269
270 static tristate eval_condition (const region_svalue *lhs_ptr,
271 enum tree_code op,
272 const region_svalue *rhs_ptr);
273
274 private:
275 const region *m_reg;
276};
277
278} // namespace ana
279
280template <>
281template <>
282inline bool
284{
285 return sval->get_kind () == SK_REGION;
286}
287
289: public member_function_hash_traits<region_svalue::key_t>
290{
291 static const bool empty_zero_p = false;
292};
293
294namespace ana {
295
296/* Concrete subclass of svalue representing a specific constant value.
297 The type will either be the same as that of the underlying tree constant,
298 or NULL_TREE indicating the constant is intended to be "typeless". */
299
301{
302public:
303 /* A support class for uniquifying instances of region_svalue. */
304 struct key_t
305 {
307 : m_type (type), m_cst (cst)
308 {}
309
310 hashval_t hash () const
311 {
312 inchash::hash hstate;
313 hstate.add_ptr (m_type);
314 hstate.add_ptr (m_cst);
315 return hstate.end ();
316 }
317
318 bool operator== (const key_t &other) const
319 {
320 return (m_type == other.m_type && m_cst == other.m_cst);
321 }
322
323 void mark_deleted () { m_type = reinterpret_cast<tree> (1); }
324 void mark_empty () { m_type = reinterpret_cast<tree> (2); }
325 bool is_deleted () const { return m_type == reinterpret_cast<tree> (1); }
326 bool is_empty () const { return m_type == reinterpret_cast<tree> (2); }
327
330 };
331
333 : svalue (complexity (1, 1), id, type),
334 m_cst_expr (cst_expr)
335 {
336 gcc_assert (cst_expr);
337 gcc_assert (CONSTANT_CLASS_P (cst_expr));
338 gcc_assert (type == TREE_TYPE (cst_expr) || type == NULL_TREE);
339 }
340
341 enum svalue_kind get_kind () const final override { return SK_CONSTANT; }
342 const constant_svalue *
343 dyn_cast_constant_svalue () const final override { return this; }
344
345 void dump_to_pp (pretty_printer *pp, bool simple) const final override;
346
347 void
348 print_dump_widget_label (pretty_printer *pp) const final override;
349 void
351 const dump_widget_info &dwi) const final override;
352
353 void accept (visitor *v) const final override;
355 const region_model *) const final override;
356
357 tree get_constant () const { return m_cst_expr; }
359 enum tree_code op,
360 const constant_svalue *rhs);
361
362 const svalue *
364 const bit_range &subrange,
365 region_model_manager *mgr) const final override;
366
367 bool all_zeroes_p () const final override;
368
369 private:
371};
372
373} // namespace ana
374
375template <>
376template <>
377inline bool
378is_a_helper <const constant_svalue *>::test (const svalue *sval)
379{
380 return sval->get_kind () == SK_CONSTANT;
381}
382
384: public member_function_hash_traits<constant_svalue::key_t>
385{
386 static const bool empty_zero_p = false;
387};
388
389namespace ana {
390
391/* Concrete subclass of svalue representing an unknowable value, the bottom
392 value when thinking of svalues as a lattice.
393 This is a singleton (w.r.t. its manager): there is a single unknown_svalue
394 per type. Self-comparisons of such instances yield "unknown". */
395
396class unknown_svalue : public svalue
397{
398public:
402
403 enum svalue_kind get_kind () const final override { return SK_UNKNOWN; }
404
405 void dump_to_pp (pretty_printer *pp, bool simple) const final override;
406
407 void
408 print_dump_widget_label (pretty_printer *pp) const final override;
409 void
411 const dump_widget_info &dwi) const final override;
412
413 void accept (visitor *v) const final override;
414
415 const svalue *
417 const bit_range &subrange,
418 region_model_manager *mgr) const final override;
419
420 /* Unknown values are singletons per-type, so can't have state. */
421 bool can_have_associated_state_p () const final override { return false; }
422};
423
424/* An enum describing a particular kind of "poisoned" value. */
425
426enum class poison_kind
427{
428 /* For use to describe uninitialized memory. */
430
431 /* For use to describe freed memory. */
433
434 /* For use to describe deleted memory. */
436
437 /* For use on pointers to regions within popped stack frames. */
439};
440
441extern const char *poison_kind_to_str (enum poison_kind);
442
443/* Concrete subclass of svalue representing a value that should not
444 be used (e.g. uninitialized memory, freed memory). */
445
447{
448public:
449 /* A support class for uniquifying instances of poisoned_svalue. */
450 struct key_t
451 {
453 : m_kind (kind), m_type (type)
454 {}
455
456 hashval_t hash () const
457 {
458 inchash::hash hstate;
459 hstate.add_int (static_cast<int> (m_kind));
460 hstate.add_ptr (m_type);
461 return hstate.end ();
462 }
463
464 bool operator== (const key_t &other) const
465 {
466 return (m_kind == other.m_kind && m_type == other.m_type);
467 }
468
469 void mark_deleted () { m_type = reinterpret_cast<tree> (1); }
470 void mark_empty () { m_type = reinterpret_cast<tree> (2); }
471 bool is_deleted () const { return m_type == reinterpret_cast<tree> (1); }
472 bool is_empty () const { return m_type == reinterpret_cast<tree> (2); }
473
476 };
477
479 : svalue (complexity (1, 1), id, type), m_kind (kind) {}
480
481 enum svalue_kind get_kind () const final override { return SK_POISONED; }
482 const poisoned_svalue *
483 dyn_cast_poisoned_svalue () const final override { return this; }
484
485 void dump_to_pp (pretty_printer *pp, bool simple) const final override;
486
487 void
488 print_dump_widget_label (pretty_printer *pp) const final override;
489 void
491 const dump_widget_info &dwi) const final override;
492
493 void accept (visitor *v) const final override;
494
495 const svalue *
497 const bit_range &subrange,
498 region_model_manager *mgr) const final override;
499
500 enum poison_kind get_poison_kind () const { return m_kind; }
501
502 /* Poisoned svalues are singletons per-type, so can't have state. */
503 bool can_have_associated_state_p () const final override { return false; }
504
505 private:
507};
508
509} // namespace ana
510
511template <>
512template <>
513inline bool
515{
516 return sval->get_kind () == SK_POISONED;
517}
518
520: public member_function_hash_traits<poisoned_svalue::key_t>
521{
522 static const bool empty_zero_p = false;
523};
524
525namespace ana {
526
527/* A bundle of information recording a setjmp/sigsetjmp call, corresponding
528 roughly to a jmp_buf. */
529
531{
533 const superedge *sedge,
534 const gcall &setjmp_call)
535 : m_enode (enode), m_sedge (sedge), m_setjmp_call (&setjmp_call)
536 {
537 }
538
539 bool operator== (const setjmp_record &other) const
540 {
541 return (m_enode == other.m_enode
542 && m_sedge == other.m_sedge
543 && m_setjmp_call == other.m_setjmp_call);
544 }
545
546 void add_to_hash (inchash::hash *hstate) const
547 {
548 hstate->add_ptr (m_enode);
549 hstate->add_ptr (m_sedge);
550 hstate->add_ptr (m_setjmp_call);
551 }
552
553 static int cmp (const setjmp_record &rec1, const setjmp_record &rec2);
554
558 // non-null, but we can't use a reference since we're putting these in a hash_map
559};
560
561/* Concrete subclass of svalue representing buffers for setjmp/sigsetjmp,
562 so that longjmp/siglongjmp can potentially "return" to an entirely
563 different function. */
564
565class setjmp_svalue : public svalue
566{
567public:
568 /* A support class for uniquifying instances of poisoned_svalue. */
569 struct key_t
570 {
571 key_t (const setjmp_record &record, tree type)
572 : m_record (record), m_type (type)
573 {}
574
575 hashval_t hash () const
576 {
577 inchash::hash hstate;
578 m_record.add_to_hash (&hstate);
579 hstate.add_ptr (m_type);
580 return hstate.end ();
581 }
582
583 bool operator== (const key_t &other) const
584 {
585 return (m_record == other.m_record && m_type == other.m_type);
586 }
587
588 void mark_deleted () { m_type = reinterpret_cast<tree> (1); }
589 void mark_empty () { m_type = reinterpret_cast<tree> (2); }
590 bool is_deleted () const { return m_type == reinterpret_cast<tree> (1); }
591 bool is_empty () const { return m_type == reinterpret_cast<tree> (2); }
592
595 };
596
602
603 enum svalue_kind get_kind () const final override { return SK_SETJMP; }
604 const setjmp_svalue *
605 dyn_cast_setjmp_svalue () const final override { return this; }
606
607 void dump_to_pp (pretty_printer *pp, bool simple) const final override;
608
609 void
610 print_dump_widget_label (pretty_printer *pp) const final override;
611 void
613 const dump_widget_info &dwi) const final override;
614
615 void accept (visitor *v) const final override;
616
617 int get_enode_index () const;
618
620
621 private:
623};
624
625} // namespace ana
626
627template <>
628template <>
629inline bool
631{
632 return sval->get_kind () == SK_SETJMP;
633}
634
636: public member_function_hash_traits<setjmp_svalue::key_t>
637{
638 static const bool empty_zero_p = false;
639};
640
641namespace ana {
642
643/* Concrete subclass of svalue representing the initial value of a
644 specific region.
645
646 This represents the initial value at the start of the analysis path,
647 as opposed to the first time the region is accessed during the path.
648 Hence as soon as we have a call to an unknown function, all previously
649 unmodelled globals become implicitly "unknown" rathen than "initial". */
650
651class initial_svalue : public svalue
652{
653public:
655 : svalue (complexity (reg), id, type), m_reg (reg)
656 {
657 gcc_assert (m_reg != nullptr);
658 }
659
660 enum svalue_kind get_kind () const final override { return SK_INITIAL; }
661 const initial_svalue *
662 dyn_cast_initial_svalue () const final override { return this; }
663
664 void dump_to_pp (pretty_printer *pp, bool simple) const final override;
665
666 void
667 print_dump_widget_label (pretty_printer *pp) const final override;
668 void
670 const dump_widget_info &dwi) const final override;
671
672 void accept (visitor *v) const final override;
674 const region_model *) const final override;
675
677
678 const region *get_region () const { return m_reg; }
679
680 private:
681 const region *m_reg;
682};
683
684} // namespace ana
685
686template <>
687template <>
688inline bool
690{
691 return sval->get_kind () == SK_INITIAL;
692}
693
694namespace ana {
695
696/* Concrete subclass of svalue representing a unary operation on
697 another svalues (e.g. a cast). */
698
699class unaryop_svalue : public svalue
700{
701public:
702 /* A support class for uniquifying instances of unaryop_svalue. */
703 struct key_t
704 {
705 key_t (tree type, enum tree_code op, const svalue *arg)
706 : m_type (type), m_op (op), m_arg (arg)
707 {}
708
709 hashval_t hash () const
710 {
711 inchash::hash hstate;
712 hstate.add_ptr (m_type);
713 hstate.add_int (m_op);
714 hstate.add_ptr (m_arg);
715 return hstate.end ();
716 }
717
718 bool operator== (const key_t &other) const
719 {
720 return (m_type == other.m_type
721 && m_op == other.m_op
722 && m_arg == other.m_arg);
723 }
724
725 void mark_deleted () { m_type = reinterpret_cast<tree> (1); }
726 void mark_empty () { m_type = reinterpret_cast<tree> (2); }
727 bool is_deleted () const { return m_type == reinterpret_cast<tree> (1); }
728 bool is_empty () const { return m_type == reinterpret_cast<tree> (2); }
729
732 const svalue *m_arg;
733 };
734
736 const svalue *arg)
737 : svalue (complexity (arg), id, type), m_op (op), m_arg (arg)
738 {
740 }
741
742 enum svalue_kind get_kind () const final override { return SK_UNARYOP; }
743 const unaryop_svalue *
744 dyn_cast_unaryop_svalue () const final override { return this; }
745
746 void dump_to_pp (pretty_printer *pp, bool simple) const final override;
747
748 void
749 print_dump_widget_label (pretty_printer *pp) const final override;
750 void
752 const dump_widget_info &dwi) const final override;
753
754 void accept (visitor *v) const final override;
756 const region_model *) const final override;
757
758 enum tree_code get_op () const { return m_op; }
759 const svalue *get_arg () const { return m_arg; }
760
761 const svalue *
763 const bit_range &subrange,
764 region_model_manager *mgr) const final override;
765
766 private:
768 const svalue *m_arg;
769};
770
771} // namespace ana
772
773template <>
774template <>
775inline bool
777{
778 return sval->get_kind () == SK_UNARYOP;
779}
780
782: public member_function_hash_traits<unaryop_svalue::key_t>
783{
784 static const bool empty_zero_p = false;
785};
786
787namespace ana {
788
789/* Concrete subclass of svalue representing a binary operation of
790 two svalues. */
791
792class binop_svalue : public svalue
793{
794public:
795 /* A support class for uniquifying instances of binop_svalue. */
796 struct key_t
797 {
799 const svalue *arg0, const svalue *arg1)
800 : m_type (type), m_op (op), m_arg0 (arg0), m_arg1 (arg1)
801 {}
802
803 hashval_t hash () const
804 {
805 inchash::hash hstate;
806 hstate.add_ptr (m_type);
807 hstate.add_int (m_op);
808 hstate.add_ptr (m_arg0);
809 hstate.add_ptr (m_arg1);
810 return hstate.end ();
811 }
812
813 bool operator== (const key_t &other) const
814 {
815 return (m_type == other.m_type
816 && m_op == other.m_op
817 && m_arg0 == other.m_arg0
818 && m_arg1 == other.m_arg1);
819 }
820
821 void mark_deleted () { m_type = reinterpret_cast<tree> (1); }
822 void mark_empty () { m_type = reinterpret_cast<tree> (2); }
823 bool is_deleted () const { return m_type == reinterpret_cast<tree> (1); }
824 bool is_empty () const { return m_type == reinterpret_cast<tree> (2); }
825
830 };
831
833 const svalue *arg0, const svalue *arg1)
834 : svalue (complexity::from_pair (arg0->get_complexity (),
835 arg1->get_complexity ()),
836 id,
837 type),
838 m_op (op), m_arg0 (arg0), m_arg1 (arg1)
839 {
842 }
843
844 enum svalue_kind get_kind () const final override { return SK_BINOP; }
845 const binop_svalue *dyn_cast_binop_svalue () const final override
846 {
847 return this;
848 }
849
850 void dump_to_pp (pretty_printer *pp, bool simple) const final override;
851
852 void
853 print_dump_widget_label (pretty_printer *pp) const final override;
854 void
856 const dump_widget_info &dwi) const final override;
857
858 void accept (visitor *v) const final override;
860 const region_model *) const final override;
861
862 enum tree_code get_op () const { return m_op; }
863 const svalue *get_arg0 () const { return m_arg0; }
864 const svalue *get_arg1 () const { return m_arg1; }
865
866 private:
870};
871
872} // namespace ana
873
874template <>
875template <>
876inline bool
878{
879 return sval->get_kind () == SK_BINOP;
880}
881
883: public member_function_hash_traits<binop_svalue::key_t>
884{
885 static const bool empty_zero_p = false;
886};
887
888namespace ana {
889
890/* Concrete subclass of svalue representing the result of accessing a subregion
891 of another svalue (the value of a component/field of a struct, or an element
892 from an array). */
893
894class sub_svalue : public svalue
895{
896public:
897 /* A support class for uniquifying instances of sub_svalue. */
898 struct key_t
899 {
900 key_t (tree type, const svalue *parent_svalue, const region *subregion)
901 : m_type (type), m_parent_svalue (parent_svalue), m_subregion (subregion)
902 {}
903
904 hashval_t hash () const
905 {
906 inchash::hash hstate;
907 hstate.add_ptr (m_type);
908 hstate.add_ptr (m_parent_svalue);
909 hstate.add_ptr (m_subregion);
910 return hstate.end ();
911 }
912
913 bool operator== (const key_t &other) const
914 {
915 return (m_type == other.m_type
916 && m_parent_svalue == other.m_parent_svalue
917 && m_subregion == other.m_subregion);
918 }
919
920 void mark_deleted () { m_type = reinterpret_cast<tree> (1); }
921 void mark_empty () { m_type = reinterpret_cast<tree> (2); }
922 bool is_deleted () const { return m_type == reinterpret_cast<tree> (1); }
923 bool is_empty () const { return m_type == reinterpret_cast<tree> (2); }
924
928 };
929 sub_svalue (symbol::id_t id, tree type, const svalue *parent_svalue,
930 const region *subregion);
931
932 enum svalue_kind get_kind () const final override { return SK_SUB; }
933 const sub_svalue *dyn_cast_sub_svalue () const final override
934 {
935 return this;
936 }
937
938 void dump_to_pp (pretty_printer *pp, bool simple) const final override;
939
940 void
941 print_dump_widget_label (pretty_printer *pp) const final override;
942 void
944 const dump_widget_info &dwi) const final override;
945
946 void accept (visitor *v) const final override;
948 const region_model *) const final override;
949
950 const svalue *get_parent () const { return m_parent_svalue; }
951 const region *get_subregion () const { return m_subregion; }
952
953 private:
956};
957
958} // namespace ana
959
960template <>
961template <>
962inline bool
964{
965 return sval->get_kind () == SK_SUB;
966}
967
969: public member_function_hash_traits<sub_svalue::key_t>
970{
971 static const bool empty_zero_p = false;
972};
973
974namespace ana {
975
976/* Concrete subclass of svalue representing repeating an inner svalue
977 (possibly not a whole number of times) to fill a larger region of
978 type TYPE of size OUTER_SIZE bytes. */
979
981{
982public:
983 /* A support class for uniquifying instances of repeated_svalue. */
984 struct key_t
985 {
987 const svalue *outer_size,
988 const svalue *inner_svalue)
989 : m_type (type), m_outer_size (outer_size), m_inner_svalue (inner_svalue)
990 {}
991
992 hashval_t hash () const
993 {
994 inchash::hash hstate;
995 hstate.add_ptr (m_type);
996 hstate.add_ptr (m_outer_size);
997 hstate.add_ptr (m_inner_svalue);
998 return hstate.end ();
999 }
1000
1001 bool operator== (const key_t &other) const
1002 {
1003 return (m_type == other.m_type
1004 && m_outer_size == other.m_outer_size
1005 && m_inner_svalue == other.m_inner_svalue);
1006 }
1007
1008 void mark_deleted () { m_type = reinterpret_cast<tree> (1); }
1009 void mark_empty () { m_type = reinterpret_cast<tree> (2); }
1010 bool is_deleted () const { return m_type == reinterpret_cast<tree> (1); }
1011 bool is_empty () const { return m_type == reinterpret_cast<tree> (2); }
1012
1016 };
1018 tree type,
1019 const svalue *outer_size,
1020 const svalue *inner_svalue);
1021
1022 enum svalue_kind get_kind () const final override { return SK_REPEATED; }
1024 {
1025 return this;
1026 }
1027
1028 void dump_to_pp (pretty_printer *pp, bool simple) const final override;
1029
1030 void
1031 print_dump_widget_label (pretty_printer *pp) const final override;
1032 void
1034 const dump_widget_info &dwi) const final override;
1035
1036 void accept (visitor *v) const final override;
1037
1038 const svalue *get_outer_size () const { return m_outer_size; }
1039 const svalue *get_inner_svalue () const { return m_inner_svalue; }
1040
1041 bool all_zeroes_p () const final override;
1042
1043 const svalue *
1045 const bit_range &subrange,
1046 region_model_manager *mgr) const final override;
1047
1048 private:
1051};
1052
1053} // namespace ana
1054
1055template <>
1056template <>
1057inline bool
1058is_a_helper <const repeated_svalue *>::test (const svalue *sval)
1059{
1060 return sval->get_kind () == SK_REPEATED;
1061}
1062
1064: public member_function_hash_traits<repeated_svalue::key_t>
1065{
1066 static const bool empty_zero_p = false;
1067};
1068
1069namespace ana {
1070
1071/* A range of bits/bytes within another svalue
1072 e.g. bytes 5-39 of INITIAL_SVALUE(R).
1073 These can be generated for prefixes and suffixes when part of a binding
1074 is clobbered, so that we don't lose too much information. */
1075
1077{
1078public:
1079 /* A support class for uniquifying instances of bits_within_svalue. */
1080 struct key_t
1081 {
1083 const bit_range &bits,
1084 const svalue *inner_svalue)
1085 : m_type (type), m_bits (bits), m_inner_svalue (inner_svalue)
1086 {}
1087
1088 hashval_t hash () const
1089 {
1090 inchash::hash hstate;
1091 hstate.add_ptr (m_type);
1092 hstate.add_ptr (m_inner_svalue);
1093 return hstate.end ();
1094 }
1095
1096 bool operator== (const key_t &other) const
1097 {
1098 return (m_type == other.m_type
1099 && m_bits == other.m_bits
1100 && m_inner_svalue == other.m_inner_svalue);
1101 }
1102
1103 void mark_deleted () { m_type = reinterpret_cast<tree> (1); }
1104 void mark_empty () { m_type = reinterpret_cast<tree> (2); }
1105 bool is_deleted () const { return m_type == reinterpret_cast<tree> (1); }
1106 bool is_empty () const { return m_type == reinterpret_cast<tree> (2); }
1107
1111 };
1113 tree type,
1114 const bit_range &bits,
1115 const svalue *inner_svalue);
1116
1117 enum svalue_kind get_kind () const final override { return SK_BITS_WITHIN; }
1118 const bits_within_svalue *
1120 {
1121 return this;
1122 }
1123
1124 void dump_to_pp (pretty_printer *pp, bool simple) const final override;
1125
1126 void
1127 print_dump_widget_label (pretty_printer *pp) const final override;
1128 void
1130 const dump_widget_info &dwi) const final override;
1131
1132 void accept (visitor *v) const final override;
1134 const region_model *) const final override;
1135
1136 const bit_range &get_bits () const { return m_bits; }
1137 const svalue *get_inner_svalue () const { return m_inner_svalue; }
1138
1139 const svalue *
1141 const bit_range &subrange,
1142 region_model_manager *mgr) const final override;
1143
1144 private:
1147};
1148
1149} // namespace ana
1150
1151template <>
1152template <>
1153inline bool
1155{
1156 return sval->get_kind () == SK_BITS_WITHIN;
1157}
1158
1160: public member_function_hash_traits<bits_within_svalue::key_t>
1161{
1162 static const bool empty_zero_p = false;
1163};
1164
1165namespace ana {
1166
1167/* Concrete subclass of svalue: decorate another svalue,
1168 so that the resulting svalue can be identified as being
1169 "interesting to control flow".
1170 For example, consider the return value from setjmp. We
1171 don't want to merge states in which the result is 0 with
1172 those in which the result is non-zero. By using an
1173 unmergeable_svalue for the result, we can inhibit such merges
1174 and have separate exploded nodes for those states, keeping
1175 the first and second returns from setjmp distinct in the exploded
1176 graph. */
1177
1179{
1180public:
1182 : svalue (complexity (arg), id, arg->get_type ()), m_arg (arg)
1183 {
1184 }
1185
1186 enum svalue_kind get_kind () const final override { return SK_UNMERGEABLE; }
1187 const unmergeable_svalue *
1188 dyn_cast_unmergeable_svalue () const final override { return this; }
1189
1190 void dump_to_pp (pretty_printer *pp, bool simple) const final override;
1191
1192 void
1193 print_dump_widget_label (pretty_printer *pp) const final override;
1194 void
1196 const dump_widget_info &dwi) const final override;
1197
1198 void accept (visitor *v) const final override;
1200 const region_model *) const final override;
1201
1202 const svalue *get_arg () const { return m_arg; }
1203
1204 private:
1206};
1207
1208} // namespace ana
1209
1210template <>
1211template <>
1212inline bool
1214{
1215 return sval->get_kind () == SK_UNMERGEABLE;
1216}
1217
1218namespace ana {
1219
1220/* Concrete subclass of svalue for use in selftests, where
1221 we want a specific but unknown svalue.
1222 Unlike other svalue subclasses these aren't managed by
1223 region_model_manager. */
1224
1226{
1227public:
1229 : svalue (complexity (1, 1), id, type), m_name (name)
1230 {
1231 }
1232
1233 enum svalue_kind get_kind () const final override { return SK_PLACEHOLDER; }
1234
1235 void dump_to_pp (pretty_printer *pp, bool simple) const final override;
1236
1237 void
1238 print_dump_widget_label (pretty_printer *pp) const final override;
1239 void
1241 const dump_widget_info &dwi) const final override;
1242
1243 void accept (visitor *v) const final override;
1244
1245 const char *get_name () const { return m_name; }
1246
1247 private:
1248 const char *m_name;
1249};
1250
1251} // namespace ana
1252
1253template <>
1254template <>
1255inline bool
1257{
1258 return sval->get_kind () == SK_PLACEHOLDER;
1259}
1260
1261namespace ana {
1262
1263/* Concrete subclass of svalue representing a "widening" seen when merging
1264 states, widening from a base value to {base value, iter value} and thus
1265 representing a possible fixed point in an iteration from the base to
1266 +ve infinity, or -ve infinity, and thus useful for representing a value
1267 within a loop.
1268 We also need to capture the program_point at which the merger happens,
1269 so that distinguish between different iterators, and thus handle
1270 nested loops. (currently we capture the function_point instead, for
1271 simplicity of hashing). */
1272
1274{
1275public:
1276 /* A support class for uniquifying instances of widening_svalue. */
1277 struct key_t
1278 {
1279 key_t (tree type, const supernode *snode,
1280 const svalue *base_sval, const svalue *iter_sval)
1281 : m_type (type), m_snode (snode),
1282 m_base_sval (base_sval), m_iter_sval (iter_sval)
1283 {}
1284
1285 hashval_t hash () const
1286 {
1287 inchash::hash hstate;
1288 hstate.add_ptr (m_base_sval);
1289 hstate.add_ptr (m_iter_sval);
1290 return hstate.end ();
1291 }
1292
1293 bool operator== (const key_t &other) const
1294 {
1295 return (m_type == other.m_type
1296 && m_snode == other.m_snode
1297 && m_base_sval == other.m_base_sval
1298 && m_iter_sval == other.m_iter_sval);
1299 }
1300
1301 void mark_deleted () { m_type = reinterpret_cast<tree> (1); }
1302 void mark_empty () { m_type = reinterpret_cast<tree> (2); }
1303 bool is_deleted () const { return m_type == reinterpret_cast<tree> (1); }
1304 bool is_empty () const { return m_type == reinterpret_cast<tree> (2); }
1305
1310 };
1311
1318
1320 const svalue *base_sval, const svalue *iter_sval)
1321 : svalue (complexity::from_pair (base_sval->get_complexity (),
1322 iter_sval->get_complexity ()),
1323 id,
1324 type),
1325 m_snode (snode),
1326 m_base_sval (base_sval), m_iter_sval (iter_sval)
1327 {
1330 }
1331
1332 enum svalue_kind get_kind () const final override { return SK_WIDENING; }
1334 {
1335 return this;
1336 }
1337
1338 void dump_to_pp (pretty_printer *pp, bool simple) const final override;
1339
1340 void
1341 print_dump_widget_label (pretty_printer *pp) const final override;
1342 void
1344 const dump_widget_info &dwi) const final override;
1345
1346 void accept (visitor *v) const final override;
1347
1348 const supernode *get_snode () const { return m_snode; }
1349 const svalue *get_base_svalue () const { return m_base_sval; }
1350 const svalue *get_iter_svalue () const { return m_iter_sval; }
1351
1353
1355 tree rhs_cst) const;
1356
1357 private:
1361};
1362
1363} // namespace ana
1364
1365template <>
1366template <>
1367inline bool
1369{
1370 return sval->get_kind () == SK_WIDENING;
1371}
1372
1374: public member_function_hash_traits<widening_svalue::key_t>
1375{
1376 static const bool empty_zero_p = false;
1377};
1378
1379namespace ana {
1380
1381/* Concrete subclass of svalue representing a mapping of bit-ranges
1382 to svalues, analogous to a cluster within the store.
1383
1384 This is for use in places where we want to represent a store-like
1385 mapping, but are required to use an svalue, such as when handling
1386 compound assignments and compound return values.
1387
1388 All keys within the underlying binding_map are required to be concrete,
1389 not symbolic.
1390
1391 Instances of this class shouldn't be bound as-is into the store;
1392 instead they should be unpacked. Similarly, they should not be
1393 nested. */
1394
1396{
1397public:
1400
1401 /* A support class for uniquifying instances of compound_svalue.
1402 Note that to avoid copies, keys store pointers to binding_maps,
1403 rather than the maps themselves. */
1404 struct key_t
1405 {
1406 key_t (tree type, const binding_map *map_ptr)
1407 : m_type (type), m_map_ptr (map_ptr)
1408 {}
1409
1410 hashval_t hash () const
1411 {
1412 inchash::hash hstate;
1413 hstate.add_ptr (m_type);
1414 //hstate.add_ptr (m_map_ptr); // TODO
1415 return hstate.end ();
1416 }
1417
1418 bool operator== (const key_t &other) const
1419 {
1420 return (m_type == other.m_type
1421 && *m_map_ptr == *other.m_map_ptr);
1422 }
1423
1424 void mark_deleted () { m_type = reinterpret_cast<tree> (1); }
1425 void mark_empty () { m_type = reinterpret_cast<tree> (2); }
1426 bool is_deleted () const { return m_type == reinterpret_cast<tree> (1); }
1427 bool is_empty () const { return m_type == reinterpret_cast<tree> (2); }
1428
1431 };
1432
1434
1435 enum svalue_kind get_kind () const final override { return SK_COMPOUND; }
1437 {
1438 return this;
1439 }
1440
1441 void dump_to_pp (pretty_printer *pp, bool simple) const final override;
1442
1443 void
1444 print_dump_widget_label (pretty_printer *pp) const final override;
1445 void
1447 const dump_widget_info &dwi) const final override;
1448
1449 void accept (visitor *v) const final override;
1450
1451 const binding_map &get_map () const { return m_map; }
1452
1453 const_iterator_t begin () const { return m_map.begin (); }
1454 const_iterator_t end () const { return m_map.end (); }
1455 iterator_t begin () { return m_map.begin (); }
1456 iterator_t end () { return m_map.end (); }
1457
1458 struct key_t make_key () const
1459 {
1460 return key_t (get_type (), &m_map);
1461 }
1462
1463 const svalue *
1465 const bit_range &subrange,
1466 region_model_manager *mgr) const final override;
1467
1468 private:
1470
1472};
1473
1474} // namespace ana
1475
1476template <>
1477template <>
1478inline bool
1480{
1481 return sval->get_kind () == SK_COMPOUND;
1482}
1483
1485: public member_function_hash_traits<compound_svalue::key_t>
1486{
1487 static const bool empty_zero_p = false;
1488};
1489
1490namespace ana {
1491
1492/* A bundle of state for purging information from a program_state about
1493 a conjured_svalue. We pass this whenever calling
1494 get_or_create_conjured_svalue, so that if the program_state already
1495 has information about this conjured_svalue on an execution path, we
1496 can purge that information, to avoid the analyzer confusing the two
1497 values as being the same. */
1498
1500{
1501public:
1503 : m_model (model), m_ctxt (ctxt)
1504 {
1505 }
1506 void purge (const conjured_svalue *sval) const;
1507
1508private:
1511};
1512
1513/* A defined value arising from a statement, where we want to identify a
1514 particular unknown value, rather than resorting to the unknown_value
1515 singleton, so that the value can have sm-state.
1516
1517 Comparisons of variables that share the same conjured_svalue are known
1518 to be equal, even if we don't know what the value is.
1519
1520 For example, this is used for the values of regions that may have been
1521 touched when calling an unknown function.
1522
1523 The value captures a region as well as a stmt in order to avoid falsely
1524 aliasing the various values that could arise in one statement. For
1525 example, after:
1526 unknown_fn (&a, &b);
1527 we want values to clobber a and b with, but we don't want to use the
1528 same value, or it would falsely implicitly assume that a == b. */
1529
1531{
1532public:
1533 /* A support class for uniquifying instances of conjured_svalue. */
1534 struct key_t
1535 {
1536 key_t (tree type, const gimple *stmt, const region *id_reg, unsigned idx)
1537 : m_type (type), m_stmt (stmt), m_id_reg (id_reg), m_idx (idx)
1538 {}
1539
1540 hashval_t hash () const
1541 {
1542 inchash::hash hstate;
1543 hstate.add_ptr (m_type);
1544 hstate.add_ptr (m_stmt);
1545 hstate.add_ptr (m_id_reg);
1546 return hstate.end ();
1547 }
1548
1549 bool operator== (const key_t &other) const
1550 {
1551 return (m_type == other.m_type
1552 && m_stmt == other.m_stmt
1553 && m_id_reg == other.m_id_reg
1554 && m_idx == other.m_idx);
1555 }
1556
1557 /* Use m_stmt to mark empty/deleted, as m_type can be NULL_TREE for
1558 legitimate instances. */
1559 void mark_deleted () { m_stmt = reinterpret_cast<const gimple *> (1); }
1560 void mark_empty () { m_stmt = nullptr; }
1561 bool is_deleted () const
1562 {
1563 return m_stmt == reinterpret_cast<const gimple *> (1);
1564 }
1565 bool is_empty () const { return m_stmt == nullptr; }
1566
1570 unsigned m_idx;
1571 };
1572
1574 const region *id_reg, unsigned idx)
1575 : svalue (complexity (id_reg), id, type),
1576 m_stmt (stmt), m_id_reg (id_reg), m_idx (idx)
1577 {
1578 gcc_assert (m_stmt != nullptr);
1579 }
1580
1581 enum svalue_kind get_kind () const final override { return SK_CONJURED; }
1583 {
1584 return this;
1585 }
1586
1587 void dump_to_pp (pretty_printer *pp, bool simple) const final override;
1588
1589 void
1590 print_dump_widget_label (pretty_printer *pp) const final override;
1591 void
1593 const dump_widget_info &dwi) const final override;
1594
1595 void accept (visitor *v) const final override;
1596
1597 const gimple *get_stmt () const { return m_stmt; }
1598 const region *get_id_region () const { return m_id_reg; }
1599 bool lhs_value_p () const;
1600
1601 private:
1604 unsigned m_idx;
1605};
1606
1607} // namespace ana
1608
1609template <>
1610template <>
1611inline bool
1613{
1614 return sval->get_kind () == SK_CONJURED;
1615}
1616
1618: public member_function_hash_traits<conjured_svalue::key_t>
1619{
1620 static const bool empty_zero_p = true;
1621};
1622
1623namespace ana {
1624
1625/* An output from a deterministic asm stmt, where we want to identify a
1626 particular unknown value, rather than resorting to the unknown_value
1627 singleton.
1628
1629 Comparisons of variables that share the same asm_output_svalue are known
1630 to be equal, even if we don't know what the value is. */
1631
1633{
1634public:
1635 /* Imposing an upper limit and using a (small) array allows key_t
1636 to avoid memory management. */
1637 static const unsigned MAX_INPUTS = 2;
1638
1639 /* A support class for uniquifying instances of asm_output_svalue. */
1640 struct key_t
1641 {
1643 const char *asm_string,
1644 unsigned output_idx,
1645 const vec<const svalue *> &inputs)
1646 : m_type (type), m_asm_string (asm_string), m_output_idx (output_idx),
1647 m_num_inputs (inputs.length ())
1648 {
1649 gcc_assert (inputs.length () <= MAX_INPUTS);
1650 for (unsigned i = 0; i < m_num_inputs; i++)
1651 m_input_arr[i] = inputs[i];
1652 }
1653
1654 hashval_t hash () const
1655 {
1656 inchash::hash hstate;
1657 hstate.add_ptr (m_type);
1658 /* We don't bother hashing m_asm_str. */
1659 hstate.add_int (m_output_idx);
1660 for (unsigned i = 0; i < m_num_inputs; i++)
1661 hstate.add_ptr (m_input_arr[i]);
1662 return hstate.end ();
1663 }
1664
1665 bool operator== (const key_t &other) const
1666 {
1667 if (!(m_type == other.m_type
1668 && 0 == (strcmp (m_asm_string, other.m_asm_string))
1669 && m_output_idx == other.m_output_idx
1670 && m_num_inputs == other.m_num_inputs))
1671 return false;
1672 for (unsigned i = 0; i < m_num_inputs; i++)
1673 if (m_input_arr[i] != other.m_input_arr[i])
1674 return false;
1675 return true;
1676 }
1677
1678 /* Use m_asm_string to mark empty/deleted, as m_type can be NULL_TREE for
1679 legitimate instances. */
1680 void mark_deleted () { m_asm_string = reinterpret_cast<const char *> (1); }
1681 void mark_empty () { m_asm_string = nullptr; }
1682 bool is_deleted () const
1683 {
1684 return m_asm_string == reinterpret_cast<const char *> (1);
1685 }
1686 bool is_empty () const { return m_asm_string == nullptr; }
1687
1689 const char *m_asm_string;
1693 };
1694
1696 tree type,
1697 const char *asm_string,
1698 unsigned output_idx,
1699 unsigned num_outputs,
1700 const vec<const svalue *> &inputs)
1701 : svalue (complexity::from_vec_svalue (inputs), id, type),
1702 m_asm_string (asm_string),
1703 m_output_idx (output_idx),
1704 m_num_outputs (num_outputs),
1705 m_num_inputs (inputs.length ())
1706 {
1707 gcc_assert (inputs.length () <= MAX_INPUTS);
1708 for (unsigned i = 0; i < m_num_inputs; i++)
1709 m_input_arr[i] = inputs[i];
1710 }
1711
1712 enum svalue_kind get_kind () const final override { return SK_ASM_OUTPUT; }
1713 const asm_output_svalue *
1715 {
1716 return this;
1717 }
1718
1719 void dump_to_pp (pretty_printer *pp, bool simple) const final override;
1720
1721 void
1722 print_dump_widget_label (pretty_printer *pp) const final override;
1723 void
1725 const dump_widget_info &dwi) const final override;
1726
1727 void accept (visitor *v) const final override;
1728
1729 const char *get_asm_string () const { return m_asm_string; }
1730 unsigned get_output_idx () const { return m_output_idx; }
1731 unsigned get_num_outputs () const { return m_num_outputs; }
1732 unsigned get_num_inputs () const { return m_num_inputs; }
1733 const svalue *get_input (unsigned idx) const { return m_input_arr[idx]; }
1734
1735 private:
1737 unsigned input_idx,
1738 const svalue *sval,
1739 bool simple) const;
1740 unsigned input_idx_to_asm_idx (unsigned input_idx) const;
1741
1742 const char *m_asm_string;
1744
1745 /* We capture this so that we can offset the input indices
1746 to match the %0, %1, %2 in the asm_string when dumping. */
1748
1751};
1752
1753} // namespace ana
1754
1755template <>
1756template <>
1757inline bool
1759{
1760 return sval->get_kind () == SK_ASM_OUTPUT;
1761}
1762
1764: public member_function_hash_traits<asm_output_svalue::key_t>
1765{
1766 static const bool empty_zero_p = true;
1767};
1768
1769namespace ana {
1770
1771/* The return value from a function with __attribute((const)) for given
1772 inputs, provided that we don't have too many inputs, and all of them
1773 are deterministic.
1774
1775 Comparisons of variables that share the same const_fn_result_svalue are known
1776 to be equal, even if we don't know what the value is. */
1777
1779{
1780public:
1781 /* Imposing an upper limit and using a (small) array allows key_t
1782 to avoid memory management. */
1783 static const unsigned MAX_INPUTS = 2;
1784
1785 /* A support class for uniquifying instances of const_fn_result_svalue. */
1786 struct key_t
1787 {
1789 tree fndecl,
1790 const vec<const svalue *> &inputs)
1791 : m_type (type), m_fndecl (fndecl),
1792 m_num_inputs (inputs.length ())
1793 {
1794 gcc_assert (inputs.length () <= MAX_INPUTS);
1795 for (unsigned i = 0; i < m_num_inputs; i++)
1796 m_input_arr[i] = inputs[i];
1797 }
1798
1799 hashval_t hash () const
1800 {
1801 inchash::hash hstate;
1802 hstate.add_ptr (m_type);
1803 hstate.add_ptr (m_fndecl);
1804 for (unsigned i = 0; i < m_num_inputs; i++)
1805 hstate.add_ptr (m_input_arr[i]);
1806 return hstate.end ();
1807 }
1808
1809 bool operator== (const key_t &other) const
1810 {
1811 if (!(m_type == other.m_type
1812 && m_fndecl == other.m_fndecl
1813 && m_num_inputs == other.m_num_inputs))
1814 return false;
1815 for (unsigned i = 0; i < m_num_inputs; i++)
1816 if (m_input_arr[i] != other.m_input_arr[i])
1817 return false;
1818 return true;
1819 }
1820
1821 /* Use m_fndecl to mark empty/deleted. */
1822 void mark_deleted () { m_fndecl = reinterpret_cast<tree> (1); }
1824 bool is_deleted () const
1825 {
1826 return m_fndecl == reinterpret_cast<tree> (1);
1827 }
1828 bool is_empty () const { return m_fndecl == NULL_TREE; }
1829
1834 };
1835
1837 tree type,
1838 tree fndecl,
1839 const vec<const svalue *> &inputs)
1840 : svalue (complexity::from_vec_svalue (inputs), id, type),
1841 m_fndecl (fndecl),
1842 m_num_inputs (inputs.length ())
1843 {
1844 gcc_assert (inputs.length () <= MAX_INPUTS);
1845 for (unsigned i = 0; i < m_num_inputs; i++)
1846 m_input_arr[i] = inputs[i];
1847 }
1848
1849 enum svalue_kind get_kind () const final override
1850 {
1851 return SK_CONST_FN_RESULT;
1852 }
1855 {
1856 return this;
1857 }
1858
1859 void dump_to_pp (pretty_printer *pp, bool simple) const final override;
1860
1861 void
1862 print_dump_widget_label (pretty_printer *pp) const final override;
1863 void
1865 const dump_widget_info &dwi) const final override;
1866
1867 void accept (visitor *v) const final override;
1868
1869 tree get_fndecl () const { return m_fndecl; }
1870 unsigned get_num_inputs () const { return m_num_inputs; }
1871 const svalue *get_input (unsigned idx) const { return m_input_arr[idx]; }
1872
1873 private:
1875 unsigned input_idx,
1876 const svalue *sval,
1877 bool simple) const;
1878
1882};
1883
1884} // namespace ana
1885
1886template <>
1887template <>
1888inline bool
1890{
1891 return sval->get_kind () == SK_CONST_FN_RESULT;
1892}
1893
1895: public member_function_hash_traits<const_fn_result_svalue::key_t>
1896{
1897 static const bool empty_zero_p = true;
1898};
1899
1900#endif /* GCC_ANALYZER_SVALUE_H */
Definition svalue.h:1633
const asm_output_svalue * dyn_cast_asm_output_svalue() const final override
Definition svalue.h:1714
void dump_input(pretty_printer *pp, unsigned input_idx, const svalue *sval, bool simple) const
const char * get_asm_string() const
Definition svalue.h:1729
asm_output_svalue(symbol::id_t id, tree type, const char *asm_string, unsigned output_idx, unsigned num_outputs, const vec< const svalue * > &inputs)
Definition svalue.h:1695
const char * m_asm_string
Definition svalue.h:1742
unsigned m_num_inputs
Definition svalue.h:1749
unsigned m_output_idx
Definition svalue.h:1743
unsigned get_num_outputs() const
Definition svalue.h:1731
unsigned input_idx_to_asm_idx(unsigned input_idx) const
unsigned get_num_inputs() const
Definition svalue.h:1732
enum svalue_kind get_kind() const final override
Definition svalue.h:1712
const svalue * get_input(unsigned idx) const
Definition svalue.h:1733
unsigned m_num_outputs
Definition svalue.h:1747
void print_dump_widget_label(pretty_printer *pp) const final override
void accept(visitor *v) const final override
void dump_to_pp(pretty_printer *pp, bool simple) const final override
void add_dump_widget_children(text_art::tree_widget &w, const dump_widget_info &dwi) const final override
unsigned get_output_idx() const
Definition svalue.h:1730
const svalue * m_input_arr[MAX_INPUTS]
Definition svalue.h:1750
static const unsigned MAX_INPUTS
Definition svalue.h:1637
Definition store.h:522
class ana::binding_map::iterator iterator_t
class ana::binding_map::const_iterator const_iterator_t
Definition svalue.h:793
enum tree_code get_op() const
Definition svalue.h:862
const svalue * get_arg1() const
Definition svalue.h:864
void accept(visitor *v) const final override
enum tree_code m_op
Definition svalue.h:867
void add_dump_widget_children(text_art::tree_widget &w, const dump_widget_info &dwi) const final override
const svalue * get_arg0() const
Definition svalue.h:863
const svalue * m_arg1
Definition svalue.h:869
enum svalue_kind get_kind() const final override
Definition svalue.h:844
void print_dump_widget_label(pretty_printer *pp) const final override
binop_svalue(symbol::id_t id, tree type, enum tree_code op, const svalue *arg0, const svalue *arg1)
Definition svalue.h:832
const svalue * m_arg0
Definition svalue.h:868
void dump_to_pp(pretty_printer *pp, bool simple) const final override
bool implicitly_live_p(const svalue_set *, const region_model *) const final override
const binop_svalue * dyn_cast_binop_svalue() const final override
Definition svalue.h:845
Definition svalue.h:1077
enum svalue_kind get_kind() const final override
Definition svalue.h:1117
const bit_range m_bits
Definition svalue.h:1145
const svalue * m_inner_svalue
Definition svalue.h:1146
void add_dump_widget_children(text_art::tree_widget &w, const dump_widget_info &dwi) const final override
bool implicitly_live_p(const svalue_set *, const region_model *) const final override
void accept(visitor *v) const final override
bits_within_svalue(symbol::id_t id, tree type, const bit_range &bits, const svalue *inner_svalue)
void dump_to_pp(pretty_printer *pp, bool simple) const final override
const svalue * get_inner_svalue() const
Definition svalue.h:1137
const bits_within_svalue * dyn_cast_bits_within_svalue() const final override
Definition svalue.h:1119
const bit_range & get_bits() const
Definition svalue.h:1136
void print_dump_widget_label(pretty_printer *pp) const final override
const svalue * maybe_fold_bits_within(tree type, const bit_range &subrange, region_model_manager *mgr) const final override
Definition svalue.h:1396
const_iterator_t end() const
Definition svalue.h:1454
static complexity calc_complexity(const binding_map &map)
iterator_t end()
Definition svalue.h:1456
compound_svalue(symbol::id_t id, tree type, const binding_map &map)
void print_dump_widget_label(pretty_printer *pp) const final override
void dump_to_pp(pretty_printer *pp, bool simple) const final override
const binding_map & get_map() const
Definition svalue.h:1451
binding_map::iterator_t iterator_t
Definition svalue.h:1399
void add_dump_widget_children(text_art::tree_widget &w, const dump_widget_info &dwi) const final override
iterator_t begin()
Definition svalue.h:1455
enum svalue_kind get_kind() const final override
Definition svalue.h:1435
binding_map::const_iterator_t const_iterator_t
Definition svalue.h:1398
const svalue * maybe_fold_bits_within(tree type, const bit_range &subrange, region_model_manager *mgr) const final override
const_iterator_t begin() const
Definition svalue.h:1453
void accept(visitor *v) const final override
binding_map m_map
Definition svalue.h:1471
struct key_t make_key() const
Definition svalue.h:1458
const compound_svalue * dyn_cast_compound_svalue() const final override
Definition svalue.h:1436
void purge(const conjured_svalue *sval) const
conjured_purge(region_model *model, region_model_context *ctxt)
Definition svalue.h:1502
region_model_context * m_ctxt
Definition svalue.h:1510
region_model * m_model
Definition svalue.h:1509
Definition svalue.h:1531
void accept(visitor *v) const final override
bool lhs_value_p() const
const gimple * get_stmt() const
Definition svalue.h:1597
const conjured_svalue * dyn_cast_conjured_svalue() const final override
Definition svalue.h:1582
enum svalue_kind get_kind() const final override
Definition svalue.h:1581
const region * m_id_reg
Definition svalue.h:1603
void add_dump_widget_children(text_art::tree_widget &w, const dump_widget_info &dwi) const final override
const gimple * m_stmt
Definition svalue.h:1602
void print_dump_widget_label(pretty_printer *pp) const final override
unsigned m_idx
Definition svalue.h:1604
void dump_to_pp(pretty_printer *pp, bool simple) const final override
const region * get_id_region() const
Definition svalue.h:1598
conjured_svalue(symbol::id_t id, tree type, const gimple *stmt, const region *id_reg, unsigned idx)
Definition svalue.h:1573
Definition svalue.h:1779
tree m_fndecl
Definition svalue.h:1879
unsigned get_num_inputs() const
Definition svalue.h:1870
void add_dump_widget_children(text_art::tree_widget &w, const dump_widget_info &dwi) const final override
void accept(visitor *v) const final override
tree get_fndecl() const
Definition svalue.h:1869
static const unsigned MAX_INPUTS
Definition svalue.h:1783
const svalue * get_input(unsigned idx) const
Definition svalue.h:1871
enum svalue_kind get_kind() const final override
Definition svalue.h:1849
void dump_input(pretty_printer *pp, unsigned input_idx, const svalue *sval, bool simple) const
const_fn_result_svalue(symbol::id_t id, tree type, tree fndecl, const vec< const svalue * > &inputs)
Definition svalue.h:1836
const svalue * m_input_arr[MAX_INPUTS]
Definition svalue.h:1881
unsigned m_num_inputs
Definition svalue.h:1880
void dump_to_pp(pretty_printer *pp, bool simple) const final override
const const_fn_result_svalue * dyn_cast_const_fn_result_svalue() const final override
Definition svalue.h:1854
void print_dump_widget_label(pretty_printer *pp) const final override
Definition svalue.h:301
bool all_zeroes_p() const final override
static tristate eval_condition(const constant_svalue *lhs, enum tree_code op, const constant_svalue *rhs)
enum svalue_kind get_kind() const final override
Definition svalue.h:341
const svalue * maybe_fold_bits_within(tree type, const bit_range &subrange, region_model_manager *mgr) const final override
const constant_svalue * dyn_cast_constant_svalue() const final override
Definition svalue.h:343
constant_svalue(symbol::id_t id, tree type, tree cst_expr)
Definition svalue.h:332
tree get_constant() const
Definition svalue.h:357
void print_dump_widget_label(pretty_printer *pp) const final override
void add_dump_widget_children(text_art::tree_widget &w, const dump_widget_info &dwi) const final override
tree m_cst_expr
Definition svalue.h:370
void dump_to_pp(pretty_printer *pp, bool simple) const final override
void accept(visitor *v) const final override
bool implicitly_live_p(const svalue_set *, const region_model *) const final override
Definition exploded-graph.h:206
Definition svalue.h:652
const initial_svalue * dyn_cast_initial_svalue() const final override
Definition svalue.h:662
const region * get_region() const
Definition svalue.h:678
void accept(visitor *v) const final override
bool initial_value_of_param_p() const
void add_dump_widget_children(text_art::tree_widget &w, const dump_widget_info &dwi) const final override
const region * m_reg
Definition svalue.h:681
bool implicitly_live_p(const svalue_set *, const region_model *) const final override
enum svalue_kind get_kind() const final override
Definition svalue.h:660
void print_dump_widget_label(pretty_printer *pp) const final override
initial_svalue(symbol::id_t id, tree type, const region *reg)
Definition svalue.h:654
void dump_to_pp(pretty_printer *pp, bool simple) const final override
void dump_to_pp(pretty_printer *pp, bool simple) const final override
enum svalue_kind get_kind() const final override
Definition svalue.h:1233
placeholder_svalue(symbol::id_t id, tree type, const char *name)
Definition svalue.h:1228
const char * m_name
Definition svalue.h:1248
const char * get_name() const
Definition svalue.h:1245
void accept(visitor *v) const final override
void print_dump_widget_label(pretty_printer *pp) const final override
void add_dump_widget_children(text_art::tree_widget &w, const dump_widget_info &dwi) const final override
Definition svalue.h:447
enum poison_kind get_poison_kind() const
Definition svalue.h:500
void accept(visitor *v) const final override
void add_dump_widget_children(text_art::tree_widget &w, const dump_widget_info &dwi) const final override
const svalue * maybe_fold_bits_within(tree type, const bit_range &subrange, region_model_manager *mgr) const final override
const poisoned_svalue * dyn_cast_poisoned_svalue() const final override
Definition svalue.h:483
void dump_to_pp(pretty_printer *pp, bool simple) const final override
enum svalue_kind get_kind() const final override
Definition svalue.h:481
bool can_have_associated_state_p() const final override
Definition svalue.h:503
enum poison_kind m_kind
Definition svalue.h:506
poisoned_svalue(enum poison_kind kind, symbol::id_t id, tree type)
Definition svalue.h:478
void print_dump_widget_label(pretty_printer *pp) const final override
Definition region-model.h:768
Definition region-model-manager.h:32
Definition region-model.h:299
Definition svalue.h:214
enum svalue_kind get_kind() const final override
Definition svalue.h:252
void add_dump_widget_children(text_art::tree_widget &w, const dump_widget_info &dwi) const final override
const region_svalue * dyn_cast_region_svalue() const final override
Definition svalue.h:254
void dump_to_pp(pretty_printer *pp, bool simple) const final override
const region * get_pointee() const
Definition svalue.h:268
static tristate eval_condition(const region_svalue *lhs_ptr, enum tree_code op, const region_svalue *rhs_ptr)
bool implicitly_live_p(const svalue_set *, const region_model *) const final override
void print_dump_widget_label(pretty_printer *pp) const final override
void accept(visitor *v) const final override
region_svalue(symbol::id_t id, tree type, const region *reg)
Definition svalue.h:245
const region * m_reg
Definition svalue.h:275
Definition region.h:126
Definition svalue.h:981
const repeated_svalue * dyn_cast_repeated_svalue() const final override
Definition svalue.h:1023
const svalue * m_inner_svalue
Definition svalue.h:1050
const svalue * get_inner_svalue() const
Definition svalue.h:1039
bool all_zeroes_p() const final override
void dump_to_pp(pretty_printer *pp, bool simple) const final override
void add_dump_widget_children(text_art::tree_widget &w, const dump_widget_info &dwi) const final override
void print_dump_widget_label(pretty_printer *pp) const final override
void accept(visitor *v) const final override
const svalue * get_outer_size() const
Definition svalue.h:1038
enum svalue_kind get_kind() const final override
Definition svalue.h:1022
const svalue * maybe_fold_bits_within(tree type, const bit_range &subrange, region_model_manager *mgr) const final override
repeated_svalue(symbol::id_t id, tree type, const svalue *outer_size, const svalue *inner_svalue)
const svalue * m_outer_size
Definition svalue.h:1049
Definition svalue.h:566
const setjmp_svalue * dyn_cast_setjmp_svalue() const final override
Definition svalue.h:605
void accept(visitor *v) const final override
void add_dump_widget_children(text_art::tree_widget &w, const dump_widget_info &dwi) const final override
void dump_to_pp(pretty_printer *pp, bool simple) const final override
enum svalue_kind get_kind() const final override
Definition svalue.h:603
setjmp_svalue(const setjmp_record &setjmp_record, symbol::id_t id, tree type)
Definition svalue.h:597
const setjmp_record & get_setjmp_record() const
Definition svalue.h:619
void print_dump_widget_label(pretty_printer *pp) const final override
setjmp_record m_setjmp_record
Definition svalue.h:622
int get_enode_index() const
Definition svalue.h:895
const svalue * get_parent() const
Definition svalue.h:950
const region * m_subregion
Definition svalue.h:955
void add_dump_widget_children(text_art::tree_widget &w, const dump_widget_info &dwi) const final override
void print_dump_widget_label(pretty_printer *pp) const final override
bool implicitly_live_p(const svalue_set *, const region_model *) const final override
void accept(visitor *v) const final override
enum svalue_kind get_kind() const final override
Definition svalue.h:932
const region * get_subregion() const
Definition svalue.h:951
const svalue * m_parent_svalue
Definition svalue.h:954
sub_svalue(symbol::id_t id, tree type, const svalue *parent_svalue, const region *subregion)
const sub_svalue * dyn_cast_sub_svalue() const final override
Definition svalue.h:933
void dump_to_pp(pretty_printer *pp, bool simple) const final override
Definition supergraph.h:281
Definition supergraph.h:224
Definition svalue.h:92
virtual const unaryop_svalue * dyn_cast_unaryop_svalue() const
Definition svalue.h:125
virtual const compound_svalue * dyn_cast_compound_svalue() const
Definition svalue.h:139
virtual void accept(visitor *v) const =0
virtual const asm_output_svalue * dyn_cast_asm_output_svalue() const
Definition svalue.h:143
virtual void dump_to_pp(pretty_printer *pp, bool simple) const =0
virtual const repeated_svalue * dyn_cast_repeated_svalue() const
Definition svalue.h:131
const svalue * extract_bit_range(tree type, const bit_range &subrange, region_model_manager *mgr) const
virtual const widening_svalue * dyn_cast_widening_svalue() const
Definition svalue.h:137
bool live_p(const svalue_set *live_svalues, const region_model *model) const
const region * maybe_get_deref_base_region() const
virtual const poisoned_svalue * dyn_cast_poisoned_svalue() const
Definition svalue.h:119
tree m_type
Definition svalue.h:207
void dump() const
void dump(bool simple) const
bool involves_p(const svalue *other) const
label_text get_desc(bool simple=true) const
virtual const unmergeable_svalue * dyn_cast_unmergeable_svalue() const
Definition svalue.h:135
virtual const const_fn_result_svalue * dyn_cast_const_fn_result_svalue() const
Definition svalue.h:145
virtual const region_svalue * dyn_cast_region_svalue() const
Definition svalue.h:115
virtual enum svalue_kind get_kind() const =0
virtual ~svalue()
Definition svalue.h:94
virtual const initial_svalue * dyn_cast_initial_svalue() const
Definition svalue.h:123
virtual const svalue * maybe_fold_bits_within(tree type, const bit_range &subrange, region_model_manager *mgr) const
virtual bool can_have_associated_state_p() const
Definition svalue.h:183
tree maybe_get_constant() const
virtual const sub_svalue * dyn_cast_sub_svalue() const
Definition svalue.h:129
const svalue * can_merge_p(const svalue *other, region_model_manager *mgr, model_merger *merger) const
void print_svalue_node_label(pretty_printer *pp) const
virtual const constant_svalue * dyn_cast_constant_svalue() const
Definition svalue.h:117
virtual const conjured_svalue * dyn_cast_conjured_svalue() const
Definition svalue.h:141
static int cmp_ptr_ptr(const void *, const void *)
tree maybe_get_type_from_typeinfo() const
svalue(complexity c, symbol::id_t id, tree type)
Definition svalue.h:194
virtual void print_dump_widget_label(pretty_printer *pp) const =0
virtual const binop_svalue * dyn_cast_binop_svalue() const
Definition svalue.h:127
const svalue * unwrap_any_unmergeable() const
virtual const setjmp_svalue * dyn_cast_setjmp_svalue() const
Definition svalue.h:121
std::unique_ptr< text_art::tree_widget > make_dump_widget(const dump_widget_info &dwi, const char *prefix=nullptr) const
virtual void add_dump_widget_children(text_art::tree_widget &, const dump_widget_info &dwi) const =0
tree get_type() const
Definition svalue.h:96
static int cmp_ptr(const svalue *, const svalue *)
void print(const region_model &model, pretty_printer *pp) const
const svalue * maybe_undo_cast() const
const region * maybe_get_region() const
virtual const bits_within_svalue * dyn_cast_bits_within_svalue() const
Definition svalue.h:133
bool maybe_print_for_user(pretty_printer *pp, const region_model &model, const svalue *outer_sval=nullptr) const
std::unique_ptr< json::value > to_json() const
virtual bool implicitly_live_p(const svalue_set *live_svalues, const region_model *model) const
virtual bool all_zeroes_p() const
unsigned id_t
Definition symbol.h:33
const complexity & get_complexity() const
Definition symbol.h:35
symbol(complexity c, unsigned id)
Definition symbol.h:41
Definition svalue.h:700
void accept(visitor *v) const final override
const svalue * m_arg
Definition svalue.h:768
unaryop_svalue(symbol::id_t id, tree type, enum tree_code op, const svalue *arg)
Definition svalue.h:735
void dump_to_pp(pretty_printer *pp, bool simple) const final override
const svalue * get_arg() const
Definition svalue.h:759
enum tree_code get_op() const
Definition svalue.h:758
void add_dump_widget_children(text_art::tree_widget &w, const dump_widget_info &dwi) const final override
bool implicitly_live_p(const svalue_set *, const region_model *) const final override
enum svalue_kind get_kind() const final override
Definition svalue.h:742
const unaryop_svalue * dyn_cast_unaryop_svalue() const final override
Definition svalue.h:744
enum tree_code m_op
Definition svalue.h:767
void print_dump_widget_label(pretty_printer *pp) const final override
const svalue * maybe_fold_bits_within(tree type, const bit_range &subrange, region_model_manager *mgr) const final override
bool can_have_associated_state_p() const final override
Definition svalue.h:421
unknown_svalue(symbol::id_t id, tree type)
Definition svalue.h:399
void print_dump_widget_label(pretty_printer *pp) const final override
enum svalue_kind get_kind() const final override
Definition svalue.h:403
void accept(visitor *v) const final override
void dump_to_pp(pretty_printer *pp, bool simple) const final override
void add_dump_widget_children(text_art::tree_widget &w, const dump_widget_info &dwi) const final override
const svalue * maybe_fold_bits_within(tree type, const bit_range &subrange, region_model_manager *mgr) const final override
Definition svalue.h:1179
const unmergeable_svalue * dyn_cast_unmergeable_svalue() const final override
Definition svalue.h:1188
void add_dump_widget_children(text_art::tree_widget &w, const dump_widget_info &dwi) const final override
enum svalue_kind get_kind() const final override
Definition svalue.h:1186
void accept(visitor *v) const final override
unmergeable_svalue(symbol::id_t id, const svalue *arg)
Definition svalue.h:1181
const svalue * get_arg() const
Definition svalue.h:1202
void print_dump_widget_label(pretty_printer *pp) const final override
bool implicitly_live_p(const svalue_set *, const region_model *) const final override
void dump_to_pp(pretty_printer *pp, bool simple) const final override
const svalue * m_arg
Definition svalue.h:1205
Definition region-model.h:223
Definition svalue.h:1274
const supernode * get_snode() const
Definition svalue.h:1348
void dump_to_pp(pretty_printer *pp, bool simple) const final override
const svalue * m_base_sval
Definition svalue.h:1359
const svalue * get_base_svalue() const
Definition svalue.h:1349
widening_svalue(symbol::id_t id, tree type, const supernode *snode, const svalue *base_sval, const svalue *iter_sval)
Definition svalue.h:1319
direction_t
Definition svalue.h:1313
@ DIR_UNKNOWN
Definition svalue.h:1316
@ DIR_DESCENDING
Definition svalue.h:1315
@ DIR_ASCENDING
Definition svalue.h:1314
const widening_svalue * dyn_cast_widening_svalue() const final override
Definition svalue.h:1333
void print_dump_widget_label(pretty_printer *pp) const final override
enum svalue_kind get_kind() const final override
Definition svalue.h:1332
const svalue * get_iter_svalue() const
Definition svalue.h:1350
tristate eval_condition_without_cm(enum tree_code op, tree rhs_cst) const
const supernode * m_snode
Definition svalue.h:1358
void add_dump_widget_children(text_art::tree_widget &w, const dump_widget_info &dwi) const final override
void accept(visitor *v) const final override
const svalue * m_iter_sval
Definition svalue.h:1360
enum direction_t get_direction() const
Definition inchash.h:38
void add_int(unsigned v)
Definition inchash.h:55
hashval_t end() const
Definition inchash.h:49
void add_ptr(const void *ptr)
Definition inchash.h:94
Definition pretty-print.h:241
Definition tree-widget.h:32
Definition tristate.h:26
union tree_node * tree
Definition coretypes.h:97
static struct string2counter_map map[debug_counter_number_of_counters]
Definition dbgcnt.cc:39
static bool operator==(cfa_reg &cfa, rtx reg)
Definition dwarf2cfi.cc:1164
void final(rtx_insn *first, FILE *file, int optimize_p)
Definition final.cc:2009
tree_code
Definition genmatch.cc:1002
Definition access-diagram.h:30
@ stmt
Definition checker-event.h:38
poison_kind
Definition svalue.h:427
@ uninit
Definition svalue.h:429
@ freed
Definition svalue.h:432
@ popped_stack
Definition svalue.h:438
@ deleted
Definition svalue.h:435
const char * poison_kind_to_str(enum poison_kind)
hash_set< const svalue * > svalue_set
Definition common.h:73
svalue_kind
Definition svalue.h:38
@ SK_BINOP
Definition svalue.h:46
@ SK_REPEATED
Definition svalue.h:48
@ SK_BITS_WITHIN
Definition svalue.h:49
@ SK_INITIAL
Definition svalue.h:44
@ SK_COMPOUND
Definition svalue.h:53
@ SK_ASM_OUTPUT
Definition svalue.h:55
@ SK_UNKNOWN
Definition svalue.h:41
@ SK_SUB
Definition svalue.h:47
@ SK_UNARYOP
Definition svalue.h:45
@ SK_POISONED
Definition svalue.h:42
@ SK_CONSTANT
Definition svalue.h:40
@ SK_PLACEHOLDER
Definition svalue.h:51
@ SK_UNMERGEABLE
Definition svalue.h:50
@ SK_CONJURED
Definition svalue.h:54
@ SK_SETJMP
Definition svalue.h:43
@ SK_CONST_FN_RESULT
Definition svalue.h:56
@ SK_WIDENING
Definition svalue.h:52
@ SK_REGION
Definition svalue.h:39
i
Definition poly-int.h:776
key_t(tree type, const char *asm_string, unsigned output_idx, const vec< const svalue * > &inputs)
Definition svalue.h:1642
unsigned m_num_inputs
Definition svalue.h:1691
bool is_deleted() const
Definition svalue.h:1682
void mark_empty()
Definition svalue.h:1681
hashval_t hash() const
Definition svalue.h:1654
bool is_empty() const
Definition svalue.h:1686
unsigned m_output_idx
Definition svalue.h:1690
void mark_deleted()
Definition svalue.h:1680
const char * m_asm_string
Definition svalue.h:1689
const svalue * m_input_arr[MAX_INPUTS]
Definition svalue.h:1692
tree m_type
Definition svalue.h:1688
bool is_empty() const
Definition svalue.h:824
enum tree_code m_op
Definition svalue.h:827
hashval_t hash() const
Definition svalue.h:803
const svalue * m_arg1
Definition svalue.h:829
tree m_type
Definition svalue.h:826
void mark_deleted()
Definition svalue.h:821
key_t(tree type, enum tree_code op, const svalue *arg0, const svalue *arg1)
Definition svalue.h:798
void mark_empty()
Definition svalue.h:822
bool is_deleted() const
Definition svalue.h:823
const svalue * m_arg0
Definition svalue.h:828
Definition store.h:233
bool is_deleted() const
Definition svalue.h:1105
key_t(tree type, const bit_range &bits, const svalue *inner_svalue)
Definition svalue.h:1082
hashval_t hash() const
Definition svalue.h:1088
bool is_empty() const
Definition svalue.h:1106
void mark_empty()
Definition svalue.h:1104
bit_range m_bits
Definition svalue.h:1109
void mark_deleted()
Definition svalue.h:1103
const svalue * m_inner_svalue
Definition svalue.h:1110
tree m_type
Definition svalue.h:1108
Definition complexity.h:31
Definition svalue.h:1405
bool is_deleted() const
Definition svalue.h:1426
tree m_type
Definition svalue.h:1429
void mark_empty()
Definition svalue.h:1425
hashval_t hash() const
Definition svalue.h:1410
bool is_empty() const
Definition svalue.h:1427
key_t(tree type, const binding_map *map_ptr)
Definition svalue.h:1406
const binding_map * m_map_ptr
Definition svalue.h:1430
void mark_deleted()
Definition svalue.h:1424
unsigned m_idx
Definition svalue.h:1570
bool is_deleted() const
Definition svalue.h:1561
void mark_empty()
Definition svalue.h:1560
bool is_empty() const
Definition svalue.h:1565
const gimple * m_stmt
Definition svalue.h:1568
void mark_deleted()
Definition svalue.h:1559
key_t(tree type, const gimple *stmt, const region *id_reg, unsigned idx)
Definition svalue.h:1536
tree m_type
Definition svalue.h:1567
hashval_t hash() const
Definition svalue.h:1540
const region * m_id_reg
Definition svalue.h:1569
void mark_empty()
Definition svalue.h:1823
tree m_fndecl
Definition svalue.h:1831
hashval_t hash() const
Definition svalue.h:1799
const svalue * m_input_arr[MAX_INPUTS]
Definition svalue.h:1833
bool is_empty() const
Definition svalue.h:1828
tree m_type
Definition svalue.h:1830
void mark_deleted()
Definition svalue.h:1822
unsigned m_num_inputs
Definition svalue.h:1832
bool is_deleted() const
Definition svalue.h:1824
key_t(tree type, tree fndecl, const vec< const svalue * > &inputs)
Definition svalue.h:1788
bool is_empty() const
Definition svalue.h:326
void mark_deleted()
Definition svalue.h:323
bool is_deleted() const
Definition svalue.h:325
key_t(tree type, tree cst)
Definition svalue.h:306
tree m_cst
Definition svalue.h:329
hashval_t hash() const
Definition svalue.h:310
void mark_empty()
Definition svalue.h:324
tree m_type
Definition svalue.h:328
bool operator==(const key_t &other) const
Definition svalue.h:318
Definition region-model.h:1224
void mark_deleted()
Definition svalue.h:469
bool is_deleted() const
Definition svalue.h:471
hashval_t hash() const
Definition svalue.h:456
enum poison_kind m_kind
Definition svalue.h:474
bool is_empty() const
Definition svalue.h:472
key_t(enum poison_kind kind, tree type)
Definition svalue.h:452
bool operator==(const key_t &other) const
Definition svalue.h:464
tree m_type
Definition svalue.h:475
void mark_empty()
Definition svalue.h:470
bool operator==(const key_t &other) const
Definition svalue.h:231
bool is_deleted() const
Definition svalue.h:238
bool is_empty() const
Definition svalue.h:239
key_t(tree type, const region *reg)
Definition svalue.h:219
void mark_deleted()
Definition svalue.h:236
tree m_type
Definition svalue.h:241
const region * m_reg
Definition svalue.h:242
void mark_empty()
Definition svalue.h:237
hashval_t hash() const
Definition svalue.h:223
tree m_type
Definition svalue.h:1013
void mark_deleted()
Definition svalue.h:1008
const svalue * m_outer_size
Definition svalue.h:1014
hashval_t hash() const
Definition svalue.h:992
void mark_empty()
Definition svalue.h:1009
bool is_empty() const
Definition svalue.h:1011
key_t(tree type, const svalue *outer_size, const svalue *inner_svalue)
Definition svalue.h:986
const svalue * m_inner_svalue
Definition svalue.h:1015
bool is_deleted() const
Definition svalue.h:1010
Definition svalue.h:531
setjmp_record(const exploded_node *enode, const superedge *sedge, const gcall &setjmp_call)
Definition svalue.h:532
static int cmp(const setjmp_record &rec1, const setjmp_record &rec2)
const exploded_node * m_enode
Definition svalue.h:555
const gcall * m_setjmp_call
Definition svalue.h:557
void add_to_hash(inchash::hash *hstate) const
Definition svalue.h:546
const superedge * m_sedge
Definition svalue.h:556
key_t(const setjmp_record &record, tree type)
Definition svalue.h:571
hashval_t hash() const
Definition svalue.h:575
tree m_type
Definition svalue.h:594
setjmp_record m_record
Definition svalue.h:593
void mark_deleted()
Definition svalue.h:588
void mark_empty()
Definition svalue.h:589
bool is_deleted() const
Definition svalue.h:590
bool is_empty() const
Definition svalue.h:591
void mark_empty()
Definition svalue.h:921
void mark_deleted()
Definition svalue.h:920
bool is_deleted() const
Definition svalue.h:922
hashval_t hash() const
Definition svalue.h:904
tree m_type
Definition svalue.h:925
const svalue * m_parent_svalue
Definition svalue.h:926
key_t(tree type, const svalue *parent_svalue, const region *subregion)
Definition svalue.h:900
const region * m_subregion
Definition svalue.h:927
bool is_empty() const
Definition svalue.h:923
tree m_type
Definition svalue.h:730
bool is_deleted() const
Definition svalue.h:727
void mark_empty()
Definition svalue.h:726
bool is_empty() const
Definition svalue.h:728
hashval_t hash() const
Definition svalue.h:709
enum tree_code m_op
Definition svalue.h:731
const svalue * m_arg
Definition svalue.h:732
void mark_deleted()
Definition svalue.h:725
key_t(tree type, enum tree_code op, const svalue *arg)
Definition svalue.h:705
bool is_empty() const
Definition svalue.h:1304
const supernode * m_snode
Definition svalue.h:1307
const svalue * m_base_sval
Definition svalue.h:1308
void mark_deleted()
Definition svalue.h:1301
tree m_type
Definition svalue.h:1306
hashval_t hash() const
Definition svalue.h:1285
bool is_deleted() const
Definition svalue.h:1303
key_t(tree type, const supernode *snode, const svalue *base_sval, const svalue *iter_sval)
Definition svalue.h:1279
const svalue * m_iter_sval
Definition svalue.h:1309
void mark_empty()
Definition svalue.h:1302
static const bool empty_zero_p
Definition svalue.h:1766
static const bool empty_zero_p
Definition svalue.h:885
static const bool empty_zero_p
Definition svalue.h:1162
static const bool empty_zero_p
Definition svalue.h:1487
static const bool empty_zero_p
Definition svalue.h:1620
static const bool empty_zero_p
Definition svalue.h:1897
static const bool empty_zero_p
Definition svalue.h:386
static const bool empty_zero_p
Definition svalue.h:522
static const bool empty_zero_p
Definition svalue.h:291
static const bool empty_zero_p
Definition svalue.h:1066
static const bool empty_zero_p
Definition svalue.h:638
static const bool empty_zero_p
Definition svalue.h:971
static const bool empty_zero_p
Definition svalue.h:784
static const bool empty_zero_p
Definition svalue.h:1376
Definition hash-traits.h:466
Definition gimple.h:352
Definition gimple.h:221
Definition collect2.cc:168
static bool test(const U *p)
Definition is-a.h:211
Definition is-a.h:194
static bool test(U *p)
Definition common.h:547
Definition dump-widget-info.h:31
Definition gengtype.h:252
Definition vec.h:450
#define gcc_assert(EXPR)
Definition system.h:817
#define TREE_TYPE(NODE)
Definition tree.h:513
#define CONSTANT_CLASS_P(NODE)
Definition tree.h:216
#define NULL_TREE
Definition tree.h:318