GCC Middle and Back End API Reference
svalue.h
Go to the documentation of this file.
1/* Symbolic values.
2 Copyright (C) 2019-2025 Free Software Foundation, Inc.
3 Contributed by David Malcolm <dmalcolm@redhat.com>.
4
5This file is part of GCC.
6
7GCC is free software; you can redistribute it and/or modify it
8under the terms of the GNU General Public License as published by
9the Free Software Foundation; either version 3, or (at your option)
10any later version.
11
12GCC is distributed in the hope that it will be useful, but
13WITHOUT ANY WARRANTY; without even the implied warranty of
14MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15General Public License for more details.
16
17You should have received a copy of the GNU General Public License
18along with GCC; see the file COPYING3. If not see
19<http://www.gnu.org/licenses/>. */
20
21#ifndef GCC_ANALYZER_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 gcall &setjmp_call)
534 : m_enode (enode), m_setjmp_call (&setjmp_call)
535 {
536 }
537
538 bool operator== (const setjmp_record &other) const
539 {
540 return (m_enode == other.m_enode
541 && m_setjmp_call == other.m_setjmp_call);
542 }
543
544 void add_to_hash (inchash::hash *hstate) const
545 {
546 hstate->add_ptr (m_enode);
547 hstate->add_ptr (m_setjmp_call);
548 }
549
550 static int cmp (const setjmp_record &rec1, const setjmp_record &rec2);
551
554 // non-null, but we can't use a reference since we're putting these in a hash_map
555};
556
557/* Concrete subclass of svalue representing buffers for setjmp/sigsetjmp,
558 so that longjmp/siglongjmp can potentially "return" to an entirely
559 different function. */
560
561class setjmp_svalue : public svalue
562{
563public:
564 /* A support class for uniquifying instances of poisoned_svalue. */
565 struct key_t
566 {
567 key_t (const setjmp_record &record, tree type)
568 : m_record (record), m_type (type)
569 {}
570
571 hashval_t hash () const
572 {
573 inchash::hash hstate;
574 m_record.add_to_hash (&hstate);
575 hstate.add_ptr (m_type);
576 return hstate.end ();
577 }
578
579 bool operator== (const key_t &other) const
580 {
581 return (m_record == other.m_record && m_type == other.m_type);
582 }
583
584 void mark_deleted () { m_type = reinterpret_cast<tree> (1); }
585 void mark_empty () { m_type = reinterpret_cast<tree> (2); }
586 bool is_deleted () const { return m_type == reinterpret_cast<tree> (1); }
587 bool is_empty () const { return m_type == reinterpret_cast<tree> (2); }
588
591 };
592
598
599 enum svalue_kind get_kind () const final override { return SK_SETJMP; }
600 const setjmp_svalue *
601 dyn_cast_setjmp_svalue () const final override { return this; }
602
603 void dump_to_pp (pretty_printer *pp, bool simple) const final override;
604
605 void
606 print_dump_widget_label (pretty_printer *pp) const final override;
607 void
609 const dump_widget_info &dwi) const final override;
610
611 void accept (visitor *v) const final override;
612
613 int get_enode_index () const;
614
616
617 private:
619};
620
621} // namespace ana
622
623template <>
624template <>
625inline bool
627{
628 return sval->get_kind () == SK_SETJMP;
629}
630
632: public member_function_hash_traits<setjmp_svalue::key_t>
633{
634 static const bool empty_zero_p = false;
635};
636
637namespace ana {
638
639/* Concrete subclass of svalue representing the initial value of a
640 specific region.
641
642 This represents the initial value at the start of the analysis path,
643 as opposed to the first time the region is accessed during the path.
644 Hence as soon as we have a call to an unknown function, all previously
645 unmodelled globals become implicitly "unknown" rathen than "initial". */
646
647class initial_svalue : public svalue
648{
649public:
651 : svalue (complexity (reg), id, type), m_reg (reg)
652 {
653 gcc_assert (m_reg != nullptr);
654 }
655
656 enum svalue_kind get_kind () const final override { return SK_INITIAL; }
657 const initial_svalue *
658 dyn_cast_initial_svalue () const final override { return this; }
659
660 void dump_to_pp (pretty_printer *pp, bool simple) const final override;
661
662 void
663 print_dump_widget_label (pretty_printer *pp) const final override;
664 void
666 const dump_widget_info &dwi) const final override;
667
668 void accept (visitor *v) const final override;
670 const region_model *) const final override;
671
673
674 const region *get_region () const { return m_reg; }
675
676 private:
677 const region *m_reg;
678};
679
680} // namespace ana
681
682template <>
683template <>
684inline bool
686{
687 return sval->get_kind () == SK_INITIAL;
688}
689
690namespace ana {
691
692/* Concrete subclass of svalue representing a unary operation on
693 another svalues (e.g. a cast). */
694
695class unaryop_svalue : public svalue
696{
697public:
698 /* A support class for uniquifying instances of unaryop_svalue. */
699 struct key_t
700 {
701 key_t (tree type, enum tree_code op, const svalue *arg)
702 : m_type (type), m_op (op), m_arg (arg)
703 {}
704
705 hashval_t hash () const
706 {
707 inchash::hash hstate;
708 hstate.add_ptr (m_type);
709 hstate.add_int (m_op);
710 hstate.add_ptr (m_arg);
711 return hstate.end ();
712 }
713
714 bool operator== (const key_t &other) const
715 {
716 return (m_type == other.m_type
717 && m_op == other.m_op
718 && m_arg == other.m_arg);
719 }
720
721 void mark_deleted () { m_type = reinterpret_cast<tree> (1); }
722 void mark_empty () { m_type = reinterpret_cast<tree> (2); }
723 bool is_deleted () const { return m_type == reinterpret_cast<tree> (1); }
724 bool is_empty () const { return m_type == reinterpret_cast<tree> (2); }
725
728 const svalue *m_arg;
729 };
730
732 const svalue *arg)
733 : svalue (complexity (arg), id, type), m_op (op), m_arg (arg)
734 {
736 }
737
738 enum svalue_kind get_kind () const final override { return SK_UNARYOP; }
739 const unaryop_svalue *
740 dyn_cast_unaryop_svalue () const final override { return this; }
741
742 void dump_to_pp (pretty_printer *pp, bool simple) const final override;
743
744 void
745 print_dump_widget_label (pretty_printer *pp) const final override;
746 void
748 const dump_widget_info &dwi) const final override;
749
750 void accept (visitor *v) const final override;
752 const region_model *) const final override;
753
754 enum tree_code get_op () const { return m_op; }
755 const svalue *get_arg () const { return m_arg; }
756
757 const svalue *
759 const bit_range &subrange,
760 region_model_manager *mgr) const final override;
761
762 private:
764 const svalue *m_arg;
765};
766
767} // namespace ana
768
769template <>
770template <>
771inline bool
773{
774 return sval->get_kind () == SK_UNARYOP;
775}
776
778: public member_function_hash_traits<unaryop_svalue::key_t>
779{
780 static const bool empty_zero_p = false;
781};
782
783namespace ana {
784
785/* Concrete subclass of svalue representing a binary operation of
786 two svalues. */
787
788class binop_svalue : public svalue
789{
790public:
791 /* A support class for uniquifying instances of binop_svalue. */
792 struct key_t
793 {
795 const svalue *arg0, const svalue *arg1)
796 : m_type (type), m_op (op), m_arg0 (arg0), m_arg1 (arg1)
797 {}
798
799 hashval_t hash () const
800 {
801 inchash::hash hstate;
802 hstate.add_ptr (m_type);
803 hstate.add_int (m_op);
804 hstate.add_ptr (m_arg0);
805 hstate.add_ptr (m_arg1);
806 return hstate.end ();
807 }
808
809 bool operator== (const key_t &other) const
810 {
811 return (m_type == other.m_type
812 && m_op == other.m_op
813 && m_arg0 == other.m_arg0
814 && m_arg1 == other.m_arg1);
815 }
816
817 void mark_deleted () { m_type = reinterpret_cast<tree> (1); }
818 void mark_empty () { m_type = reinterpret_cast<tree> (2); }
819 bool is_deleted () const { return m_type == reinterpret_cast<tree> (1); }
820 bool is_empty () const { return m_type == reinterpret_cast<tree> (2); }
821
826 };
827
829 const svalue *arg0, const svalue *arg1)
830 : svalue (complexity::from_pair (arg0->get_complexity (),
831 arg1->get_complexity ()),
832 id,
833 type),
834 m_op (op), m_arg0 (arg0), m_arg1 (arg1)
835 {
838 }
839
840 enum svalue_kind get_kind () const final override { return SK_BINOP; }
841 const binop_svalue *dyn_cast_binop_svalue () const final override
842 {
843 return this;
844 }
845
846 void dump_to_pp (pretty_printer *pp, bool simple) const final override;
847
848 void
849 print_dump_widget_label (pretty_printer *pp) const final override;
850 void
852 const dump_widget_info &dwi) const final override;
853
854 void accept (visitor *v) const final override;
856 const region_model *) const final override;
857
858 enum tree_code get_op () const { return m_op; }
859 const svalue *get_arg0 () const { return m_arg0; }
860 const svalue *get_arg1 () const { return m_arg1; }
861
862 private:
866};
867
868} // namespace ana
869
870template <>
871template <>
872inline bool
874{
875 return sval->get_kind () == SK_BINOP;
876}
877
879: public member_function_hash_traits<binop_svalue::key_t>
880{
881 static const bool empty_zero_p = false;
882};
883
884namespace ana {
885
886/* Concrete subclass of svalue representing the result of accessing a subregion
887 of another svalue (the value of a component/field of a struct, or an element
888 from an array). */
889
890class sub_svalue : public svalue
891{
892public:
893 /* A support class for uniquifying instances of sub_svalue. */
894 struct key_t
895 {
896 key_t (tree type, const svalue *parent_svalue, const region *subregion)
897 : m_type (type), m_parent_svalue (parent_svalue), m_subregion (subregion)
898 {}
899
900 hashval_t hash () const
901 {
902 inchash::hash hstate;
903 hstate.add_ptr (m_type);
904 hstate.add_ptr (m_parent_svalue);
905 hstate.add_ptr (m_subregion);
906 return hstate.end ();
907 }
908
909 bool operator== (const key_t &other) const
910 {
911 return (m_type == other.m_type
912 && m_parent_svalue == other.m_parent_svalue
913 && m_subregion == other.m_subregion);
914 }
915
916 void mark_deleted () { m_type = reinterpret_cast<tree> (1); }
917 void mark_empty () { m_type = reinterpret_cast<tree> (2); }
918 bool is_deleted () const { return m_type == reinterpret_cast<tree> (1); }
919 bool is_empty () const { return m_type == reinterpret_cast<tree> (2); }
920
924 };
925 sub_svalue (symbol::id_t id, tree type, const svalue *parent_svalue,
926 const region *subregion);
927
928 enum svalue_kind get_kind () const final override { return SK_SUB; }
929 const sub_svalue *dyn_cast_sub_svalue () const final override
930 {
931 return this;
932 }
933
934 void dump_to_pp (pretty_printer *pp, bool simple) const final override;
935
936 void
937 print_dump_widget_label (pretty_printer *pp) const final override;
938 void
940 const dump_widget_info &dwi) const final override;
941
942 void accept (visitor *v) const final override;
944 const region_model *) const final override;
945
946 const svalue *get_parent () const { return m_parent_svalue; }
947 const region *get_subregion () const { return m_subregion; }
948
949 private:
952};
953
954} // namespace ana
955
956template <>
957template <>
958inline bool
960{
961 return sval->get_kind () == SK_SUB;
962}
963
965: public member_function_hash_traits<sub_svalue::key_t>
966{
967 static const bool empty_zero_p = false;
968};
969
970namespace ana {
971
972/* Concrete subclass of svalue representing repeating an inner svalue
973 (possibly not a whole number of times) to fill a larger region of
974 type TYPE of size OUTER_SIZE bytes. */
975
977{
978public:
979 /* A support class for uniquifying instances of repeated_svalue. */
980 struct key_t
981 {
983 const svalue *outer_size,
984 const svalue *inner_svalue)
985 : m_type (type), m_outer_size (outer_size), m_inner_svalue (inner_svalue)
986 {}
987
988 hashval_t hash () const
989 {
990 inchash::hash hstate;
991 hstate.add_ptr (m_type);
992 hstate.add_ptr (m_outer_size);
993 hstate.add_ptr (m_inner_svalue);
994 return hstate.end ();
995 }
996
997 bool operator== (const key_t &other) const
998 {
999 return (m_type == other.m_type
1000 && m_outer_size == other.m_outer_size
1001 && m_inner_svalue == other.m_inner_svalue);
1002 }
1003
1004 void mark_deleted () { m_type = reinterpret_cast<tree> (1); }
1005 void mark_empty () { m_type = reinterpret_cast<tree> (2); }
1006 bool is_deleted () const { return m_type == reinterpret_cast<tree> (1); }
1007 bool is_empty () const { return m_type == reinterpret_cast<tree> (2); }
1008
1012 };
1014 tree type,
1015 const svalue *outer_size,
1016 const svalue *inner_svalue);
1017
1018 enum svalue_kind get_kind () const final override { return SK_REPEATED; }
1020 {
1021 return this;
1022 }
1023
1024 void dump_to_pp (pretty_printer *pp, bool simple) const final override;
1025
1026 void
1027 print_dump_widget_label (pretty_printer *pp) const final override;
1028 void
1030 const dump_widget_info &dwi) const final override;
1031
1032 void accept (visitor *v) const final override;
1033
1034 const svalue *get_outer_size () const { return m_outer_size; }
1035 const svalue *get_inner_svalue () const { return m_inner_svalue; }
1036
1037 bool all_zeroes_p () const final override;
1038
1039 const svalue *
1041 const bit_range &subrange,
1042 region_model_manager *mgr) const final override;
1043
1044 private:
1047};
1048
1049} // namespace ana
1050
1051template <>
1052template <>
1053inline bool
1054is_a_helper <const repeated_svalue *>::test (const svalue *sval)
1055{
1056 return sval->get_kind () == SK_REPEATED;
1057}
1058
1060: public member_function_hash_traits<repeated_svalue::key_t>
1061{
1062 static const bool empty_zero_p = false;
1063};
1064
1065namespace ana {
1066
1067/* A range of bits/bytes within another svalue
1068 e.g. bytes 5-39 of INITIAL_SVALUE(R).
1069 These can be generated for prefixes and suffixes when part of a binding
1070 is clobbered, so that we don't lose too much information. */
1071
1073{
1074public:
1075 /* A support class for uniquifying instances of bits_within_svalue. */
1076 struct key_t
1077 {
1079 const bit_range &bits,
1080 const svalue *inner_svalue)
1081 : m_type (type), m_bits (bits), m_inner_svalue (inner_svalue)
1082 {}
1083
1084 hashval_t hash () const
1085 {
1086 inchash::hash hstate;
1087 hstate.add_ptr (m_type);
1088 hstate.add_ptr (m_inner_svalue);
1089 return hstate.end ();
1090 }
1091
1092 bool operator== (const key_t &other) const
1093 {
1094 return (m_type == other.m_type
1095 && m_bits == other.m_bits
1096 && m_inner_svalue == other.m_inner_svalue);
1097 }
1098
1099 void mark_deleted () { m_type = reinterpret_cast<tree> (1); }
1100 void mark_empty () { m_type = reinterpret_cast<tree> (2); }
1101 bool is_deleted () const { return m_type == reinterpret_cast<tree> (1); }
1102 bool is_empty () const { return m_type == reinterpret_cast<tree> (2); }
1103
1107 };
1109 tree type,
1110 const bit_range &bits,
1111 const svalue *inner_svalue);
1112
1113 enum svalue_kind get_kind () const final override { return SK_BITS_WITHIN; }
1114 const bits_within_svalue *
1116 {
1117 return this;
1118 }
1119
1120 void dump_to_pp (pretty_printer *pp, bool simple) const final override;
1121
1122 void
1123 print_dump_widget_label (pretty_printer *pp) const final override;
1124 void
1126 const dump_widget_info &dwi) const final override;
1127
1128 void accept (visitor *v) const final override;
1130 const region_model *) const final override;
1131
1132 const bit_range &get_bits () const { return m_bits; }
1133 const svalue *get_inner_svalue () const { return m_inner_svalue; }
1134
1135 const svalue *
1137 const bit_range &subrange,
1138 region_model_manager *mgr) const final override;
1139
1140 private:
1143};
1144
1145} // namespace ana
1146
1147template <>
1148template <>
1149inline bool
1151{
1152 return sval->get_kind () == SK_BITS_WITHIN;
1153}
1154
1156: public member_function_hash_traits<bits_within_svalue::key_t>
1157{
1158 static const bool empty_zero_p = false;
1159};
1160
1161namespace ana {
1162
1163/* Concrete subclass of svalue: decorate another svalue,
1164 so that the resulting svalue can be identified as being
1165 "interesting to control flow".
1166 For example, consider the return value from setjmp. We
1167 don't want to merge states in which the result is 0 with
1168 those in which the result is non-zero. By using an
1169 unmergeable_svalue for the result, we can inhibit such merges
1170 and have separate exploded nodes for those states, keeping
1171 the first and second returns from setjmp distinct in the exploded
1172 graph. */
1173
1175{
1176public:
1178 : svalue (complexity (arg), id, arg->get_type ()), m_arg (arg)
1179 {
1180 }
1181
1182 enum svalue_kind get_kind () const final override { return SK_UNMERGEABLE; }
1183 const unmergeable_svalue *
1184 dyn_cast_unmergeable_svalue () const final override { return this; }
1185
1186 void dump_to_pp (pretty_printer *pp, bool simple) const final override;
1187
1188 void
1189 print_dump_widget_label (pretty_printer *pp) const final override;
1190 void
1192 const dump_widget_info &dwi) const final override;
1193
1194 void accept (visitor *v) const final override;
1196 const region_model *) const final override;
1197
1198 const svalue *get_arg () const { return m_arg; }
1199
1200 private:
1202};
1203
1204} // namespace ana
1205
1206template <>
1207template <>
1208inline bool
1210{
1211 return sval->get_kind () == SK_UNMERGEABLE;
1212}
1213
1214namespace ana {
1215
1216/* Concrete subclass of svalue for use in selftests, where
1217 we want a specific but unknown svalue.
1218 Unlike other svalue subclasses these aren't managed by
1219 region_model_manager. */
1220
1222{
1223public:
1225 : svalue (complexity (1, 1), id, type), m_name (name)
1226 {
1227 }
1228
1229 enum svalue_kind get_kind () const final override { return SK_PLACEHOLDER; }
1230
1231 void dump_to_pp (pretty_printer *pp, bool simple) const final override;
1232
1233 void
1234 print_dump_widget_label (pretty_printer *pp) const final override;
1235 void
1237 const dump_widget_info &dwi) const final override;
1238
1239 void accept (visitor *v) const final override;
1240
1241 const char *get_name () const { return m_name; }
1242
1243 private:
1244 const char *m_name;
1245};
1246
1247} // namespace ana
1248
1249template <>
1250template <>
1251inline bool
1253{
1254 return sval->get_kind () == SK_PLACEHOLDER;
1255}
1256
1257namespace ana {
1258
1259/* Concrete subclass of svalue representing a "widening" seen when merging
1260 states, widening from a base value to {base value, iter value} and thus
1261 representing a possible fixed point in an iteration from the base to
1262 +ve infinity, or -ve infinity, and thus useful for representing a value
1263 within a loop.
1264 We also need to capture the program_point at which the merger happens,
1265 so that distinguish between different iterators, and thus handle
1266 nested loops. (currently we capture the function_point instead, for
1267 simplicity of hashing). */
1268
1270{
1271public:
1272 /* A support class for uniquifying instances of widening_svalue. */
1273 struct key_t
1274 {
1276 const svalue *base_sval, const svalue *iter_sval)
1277 : m_type (type), m_point (point),
1278 m_base_sval (base_sval), m_iter_sval (iter_sval)
1279 {}
1280
1281 hashval_t hash () const
1282 {
1283 inchash::hash hstate;
1284 hstate.add_ptr (m_base_sval);
1285 hstate.add_ptr (m_iter_sval);
1286 return hstate.end ();
1287 }
1288
1289 bool operator== (const key_t &other) const
1290 {
1291 return (m_type == other.m_type
1292 && m_point == other.m_point
1293 && m_base_sval == other.m_base_sval
1294 && m_iter_sval == other.m_iter_sval);
1295 }
1296
1297 void mark_deleted () { m_type = reinterpret_cast<tree> (1); }
1298 void mark_empty () { m_type = reinterpret_cast<tree> (2); }
1299 bool is_deleted () const { return m_type == reinterpret_cast<tree> (1); }
1300 bool is_empty () const { return m_type == reinterpret_cast<tree> (2); }
1301
1306 };
1307
1314
1316 const svalue *base_sval, const svalue *iter_sval)
1317 : svalue (complexity::from_pair (base_sval->get_complexity (),
1318 iter_sval->get_complexity ()),
1319 id,
1320 type),
1321 m_point (point),
1322 m_base_sval (base_sval), m_iter_sval (iter_sval)
1323 {
1326 }
1327
1328 enum svalue_kind get_kind () const final override { return SK_WIDENING; }
1330 {
1331 return this;
1332 }
1333
1334 void dump_to_pp (pretty_printer *pp, bool simple) const final override;
1335
1336 void
1337 print_dump_widget_label (pretty_printer *pp) const final override;
1338 void
1340 const dump_widget_info &dwi) const final override;
1341
1342 void accept (visitor *v) const final override;
1343
1344 const function_point &get_point () const { return m_point; }
1345 const svalue *get_base_svalue () const { return m_base_sval; }
1346 const svalue *get_iter_svalue () const { return m_iter_sval; }
1347
1349
1351 tree rhs_cst) const;
1352
1353 private:
1357};
1358
1359} // namespace ana
1360
1361template <>
1362template <>
1363inline bool
1365{
1366 return sval->get_kind () == SK_WIDENING;
1367}
1368
1370: public member_function_hash_traits<widening_svalue::key_t>
1371{
1372 static const bool empty_zero_p = false;
1373};
1374
1375namespace ana {
1376
1377/* Concrete subclass of svalue representing a mapping of bit-ranges
1378 to svalues, analogous to a cluster within the store.
1379
1380 This is for use in places where we want to represent a store-like
1381 mapping, but are required to use an svalue, such as when handling
1382 compound assignments and compound return values.
1383
1384 All keys within the underlying binding_map are required to be concrete,
1385 not symbolic.
1386
1387 Instances of this class shouldn't be bound as-is into the store;
1388 instead they should be unpacked. Similarly, they should not be
1389 nested. */
1390
1392{
1393public:
1396
1397 /* A support class for uniquifying instances of compound_svalue.
1398 Note that to avoid copies, keys store pointers to binding_maps,
1399 rather than the maps themselves. */
1400 struct key_t
1401 {
1402 key_t (tree type, const binding_map *map_ptr)
1403 : m_type (type), m_map_ptr (map_ptr)
1404 {}
1405
1406 hashval_t hash () const
1407 {
1408 inchash::hash hstate;
1409 hstate.add_ptr (m_type);
1410 //hstate.add_ptr (m_map_ptr); // TODO
1411 return hstate.end ();
1412 }
1413
1414 bool operator== (const key_t &other) const
1415 {
1416 return (m_type == other.m_type
1417 && *m_map_ptr == *other.m_map_ptr);
1418 }
1419
1420 void mark_deleted () { m_type = reinterpret_cast<tree> (1); }
1421 void mark_empty () { m_type = reinterpret_cast<tree> (2); }
1422 bool is_deleted () const { return m_type == reinterpret_cast<tree> (1); }
1423 bool is_empty () const { return m_type == reinterpret_cast<tree> (2); }
1424
1427 };
1428
1430
1431 enum svalue_kind get_kind () const final override { return SK_COMPOUND; }
1433 {
1434 return this;
1435 }
1436
1437 void dump_to_pp (pretty_printer *pp, bool simple) const final override;
1438
1439 void
1440 print_dump_widget_label (pretty_printer *pp) const final override;
1441 void
1443 const dump_widget_info &dwi) const final override;
1444
1445 void accept (visitor *v) const final override;
1446
1447 const binding_map &get_map () const { return m_map; }
1448
1449 const_iterator_t begin () const { return m_map.begin (); }
1450 const_iterator_t end () const { return m_map.end (); }
1451 iterator_t begin () { return m_map.begin (); }
1452 iterator_t end () { return m_map.end (); }
1453
1454 struct key_t make_key () const
1455 {
1456 return key_t (get_type (), &m_map);
1457 }
1458
1459 const svalue *
1461 const bit_range &subrange,
1462 region_model_manager *mgr) const final override;
1463
1464 private:
1466
1468};
1469
1470} // namespace ana
1471
1472template <>
1473template <>
1474inline bool
1476{
1477 return sval->get_kind () == SK_COMPOUND;
1478}
1479
1481: public member_function_hash_traits<compound_svalue::key_t>
1482{
1483 static const bool empty_zero_p = false;
1484};
1485
1486namespace ana {
1487
1488/* A bundle of state for purging information from a program_state about
1489 a conjured_svalue. We pass this whenever calling
1490 get_or_create_conjured_svalue, so that if the program_state already
1491 has information about this conjured_svalue on an execution path, we
1492 can purge that information, to avoid the analyzer confusing the two
1493 values as being the same. */
1494
1496{
1497public:
1499 : m_model (model), m_ctxt (ctxt)
1500 {
1501 }
1502 void purge (const conjured_svalue *sval) const;
1503
1504private:
1507};
1508
1509/* A defined value arising from a statement, where we want to identify a
1510 particular unknown value, rather than resorting to the unknown_value
1511 singleton, so that the value can have sm-state.
1512
1513 Comparisons of variables that share the same conjured_svalue are known
1514 to be equal, even if we don't know what the value is.
1515
1516 For example, this is used for the values of regions that may have been
1517 touched when calling an unknown function.
1518
1519 The value captures a region as well as a stmt in order to avoid falsely
1520 aliasing the various values that could arise in one statement. For
1521 example, after:
1522 unknown_fn (&a, &b);
1523 we want values to clobber a and b with, but we don't want to use the
1524 same value, or it would falsely implicitly assume that a == b. */
1525
1527{
1528public:
1529 /* A support class for uniquifying instances of conjured_svalue. */
1530 struct key_t
1531 {
1532 key_t (tree type, const gimple *stmt, const region *id_reg, unsigned idx)
1533 : m_type (type), m_stmt (stmt), m_id_reg (id_reg), m_idx (idx)
1534 {}
1535
1536 hashval_t hash () const
1537 {
1538 inchash::hash hstate;
1539 hstate.add_ptr (m_type);
1540 hstate.add_ptr (m_stmt);
1541 hstate.add_ptr (m_id_reg);
1542 return hstate.end ();
1543 }
1544
1545 bool operator== (const key_t &other) const
1546 {
1547 return (m_type == other.m_type
1548 && m_stmt == other.m_stmt
1549 && m_id_reg == other.m_id_reg
1550 && m_idx == other.m_idx);
1551 }
1552
1553 /* Use m_stmt to mark empty/deleted, as m_type can be NULL_TREE for
1554 legitimate instances. */
1555 void mark_deleted () { m_stmt = reinterpret_cast<const gimple *> (1); }
1556 void mark_empty () { m_stmt = nullptr; }
1557 bool is_deleted () const
1558 {
1559 return m_stmt == reinterpret_cast<const gimple *> (1);
1560 }
1561 bool is_empty () const { return m_stmt == nullptr; }
1562
1566 unsigned m_idx;
1567 };
1568
1570 const region *id_reg, unsigned idx)
1571 : svalue (complexity (id_reg), id, type),
1572 m_stmt (stmt), m_id_reg (id_reg), m_idx (idx)
1573 {
1574 gcc_assert (m_stmt != nullptr);
1575 }
1576
1577 enum svalue_kind get_kind () const final override { return SK_CONJURED; }
1579 {
1580 return this;
1581 }
1582
1583 void dump_to_pp (pretty_printer *pp, bool simple) const final override;
1584
1585 void
1586 print_dump_widget_label (pretty_printer *pp) const final override;
1587 void
1589 const dump_widget_info &dwi) const final override;
1590
1591 void accept (visitor *v) const final override;
1592
1593 const gimple *get_stmt () const { return m_stmt; }
1594 const region *get_id_region () const { return m_id_reg; }
1595 bool lhs_value_p () const;
1596
1597 private:
1600 unsigned m_idx;
1601};
1602
1603} // namespace ana
1604
1605template <>
1606template <>
1607inline bool
1609{
1610 return sval->get_kind () == SK_CONJURED;
1611}
1612
1614: public member_function_hash_traits<conjured_svalue::key_t>
1615{
1616 static const bool empty_zero_p = true;
1617};
1618
1619namespace ana {
1620
1621/* An output from a deterministic asm stmt, where we want to identify a
1622 particular unknown value, rather than resorting to the unknown_value
1623 singleton.
1624
1625 Comparisons of variables that share the same asm_output_svalue are known
1626 to be equal, even if we don't know what the value is. */
1627
1629{
1630public:
1631 /* Imposing an upper limit and using a (small) array allows key_t
1632 to avoid memory management. */
1633 static const unsigned MAX_INPUTS = 2;
1634
1635 /* A support class for uniquifying instances of asm_output_svalue. */
1636 struct key_t
1637 {
1639 const char *asm_string,
1640 unsigned output_idx,
1641 const vec<const svalue *> &inputs)
1642 : m_type (type), m_asm_string (asm_string), m_output_idx (output_idx),
1643 m_num_inputs (inputs.length ())
1644 {
1645 gcc_assert (inputs.length () <= MAX_INPUTS);
1646 for (unsigned i = 0; i < m_num_inputs; i++)
1647 m_input_arr[i] = inputs[i];
1648 }
1649
1650 hashval_t hash () const
1651 {
1652 inchash::hash hstate;
1653 hstate.add_ptr (m_type);
1654 /* We don't bother hashing m_asm_str. */
1655 hstate.add_int (m_output_idx);
1656 for (unsigned i = 0; i < m_num_inputs; i++)
1657 hstate.add_ptr (m_input_arr[i]);
1658 return hstate.end ();
1659 }
1660
1661 bool operator== (const key_t &other) const
1662 {
1663 if (!(m_type == other.m_type
1664 && 0 == (strcmp (m_asm_string, other.m_asm_string))
1665 && m_output_idx == other.m_output_idx
1666 && m_num_inputs == other.m_num_inputs))
1667 return false;
1668 for (unsigned i = 0; i < m_num_inputs; i++)
1669 if (m_input_arr[i] != other.m_input_arr[i])
1670 return false;
1671 return true;
1672 }
1673
1674 /* Use m_asm_string to mark empty/deleted, as m_type can be NULL_TREE for
1675 legitimate instances. */
1676 void mark_deleted () { m_asm_string = reinterpret_cast<const char *> (1); }
1677 void mark_empty () { m_asm_string = nullptr; }
1678 bool is_deleted () const
1679 {
1680 return m_asm_string == reinterpret_cast<const char *> (1);
1681 }
1682 bool is_empty () const { return m_asm_string == nullptr; }
1683
1685 const char *m_asm_string;
1689 };
1690
1692 tree type,
1693 const char *asm_string,
1694 unsigned output_idx,
1695 unsigned num_outputs,
1696 const vec<const svalue *> &inputs)
1697 : svalue (complexity::from_vec_svalue (inputs), id, type),
1698 m_asm_string (asm_string),
1699 m_output_idx (output_idx),
1700 m_num_outputs (num_outputs),
1701 m_num_inputs (inputs.length ())
1702 {
1703 gcc_assert (inputs.length () <= MAX_INPUTS);
1704 for (unsigned i = 0; i < m_num_inputs; i++)
1705 m_input_arr[i] = inputs[i];
1706 }
1707
1708 enum svalue_kind get_kind () const final override { return SK_ASM_OUTPUT; }
1709 const asm_output_svalue *
1711 {
1712 return this;
1713 }
1714
1715 void dump_to_pp (pretty_printer *pp, bool simple) const final override;
1716
1717 void
1718 print_dump_widget_label (pretty_printer *pp) const final override;
1719 void
1721 const dump_widget_info &dwi) const final override;
1722
1723 void accept (visitor *v) const final override;
1724
1725 const char *get_asm_string () const { return m_asm_string; }
1726 unsigned get_output_idx () const { return m_output_idx; }
1727 unsigned get_num_outputs () const { return m_num_outputs; }
1728 unsigned get_num_inputs () const { return m_num_inputs; }
1729 const svalue *get_input (unsigned idx) const { return m_input_arr[idx]; }
1730
1731 private:
1733 unsigned input_idx,
1734 const svalue *sval,
1735 bool simple) const;
1736 unsigned input_idx_to_asm_idx (unsigned input_idx) const;
1737
1738 const char *m_asm_string;
1740
1741 /* We capture this so that we can offset the input indices
1742 to match the %0, %1, %2 in the asm_string when dumping. */
1744
1747};
1748
1749} // namespace ana
1750
1751template <>
1752template <>
1753inline bool
1755{
1756 return sval->get_kind () == SK_ASM_OUTPUT;
1757}
1758
1760: public member_function_hash_traits<asm_output_svalue::key_t>
1761{
1762 static const bool empty_zero_p = true;
1763};
1764
1765namespace ana {
1766
1767/* The return value from a function with __attribute((const)) for given
1768 inputs, provided that we don't have too many inputs, and all of them
1769 are deterministic.
1770
1771 Comparisons of variables that share the same const_fn_result_svalue are known
1772 to be equal, even if we don't know what the value is. */
1773
1775{
1776public:
1777 /* Imposing an upper limit and using a (small) array allows key_t
1778 to avoid memory management. */
1779 static const unsigned MAX_INPUTS = 2;
1780
1781 /* A support class for uniquifying instances of const_fn_result_svalue. */
1782 struct key_t
1783 {
1785 tree fndecl,
1786 const vec<const svalue *> &inputs)
1787 : m_type (type), m_fndecl (fndecl),
1788 m_num_inputs (inputs.length ())
1789 {
1790 gcc_assert (inputs.length () <= MAX_INPUTS);
1791 for (unsigned i = 0; i < m_num_inputs; i++)
1792 m_input_arr[i] = inputs[i];
1793 }
1794
1795 hashval_t hash () const
1796 {
1797 inchash::hash hstate;
1798 hstate.add_ptr (m_type);
1799 hstate.add_ptr (m_fndecl);
1800 for (unsigned i = 0; i < m_num_inputs; i++)
1801 hstate.add_ptr (m_input_arr[i]);
1802 return hstate.end ();
1803 }
1804
1805 bool operator== (const key_t &other) const
1806 {
1807 if (!(m_type == other.m_type
1808 && m_fndecl == other.m_fndecl
1809 && m_num_inputs == other.m_num_inputs))
1810 return false;
1811 for (unsigned i = 0; i < m_num_inputs; i++)
1812 if (m_input_arr[i] != other.m_input_arr[i])
1813 return false;
1814 return true;
1815 }
1816
1817 /* Use m_fndecl to mark empty/deleted. */
1818 void mark_deleted () { m_fndecl = reinterpret_cast<tree> (1); }
1820 bool is_deleted () const
1821 {
1822 return m_fndecl == reinterpret_cast<tree> (1);
1823 }
1824 bool is_empty () const { return m_fndecl == NULL_TREE; }
1825
1830 };
1831
1833 tree type,
1834 tree fndecl,
1835 const vec<const svalue *> &inputs)
1836 : svalue (complexity::from_vec_svalue (inputs), id, type),
1837 m_fndecl (fndecl),
1838 m_num_inputs (inputs.length ())
1839 {
1840 gcc_assert (inputs.length () <= MAX_INPUTS);
1841 for (unsigned i = 0; i < m_num_inputs; i++)
1842 m_input_arr[i] = inputs[i];
1843 }
1844
1845 enum svalue_kind get_kind () const final override
1846 {
1847 return SK_CONST_FN_RESULT;
1848 }
1851 {
1852 return this;
1853 }
1854
1855 void dump_to_pp (pretty_printer *pp, bool simple) const final override;
1856
1857 void
1858 print_dump_widget_label (pretty_printer *pp) const final override;
1859 void
1861 const dump_widget_info &dwi) const final override;
1862
1863 void accept (visitor *v) const final override;
1864
1865 tree get_fndecl () const { return m_fndecl; }
1866 unsigned get_num_inputs () const { return m_num_inputs; }
1867 const svalue *get_input (unsigned idx) const { return m_input_arr[idx]; }
1868
1869 private:
1871 unsigned input_idx,
1872 const svalue *sval,
1873 bool simple) const;
1874
1878};
1879
1880} // namespace ana
1881
1882template <>
1883template <>
1884inline bool
1886{
1887 return sval->get_kind () == SK_CONST_FN_RESULT;
1888}
1889
1891: public member_function_hash_traits<const_fn_result_svalue::key_t>
1892{
1893 static const bool empty_zero_p = true;
1894};
1895
1896#endif /* GCC_ANALYZER_SVALUE_H */
Definition svalue.h:1629
const asm_output_svalue * dyn_cast_asm_output_svalue() const final override
Definition svalue.h:1710
void dump_input(pretty_printer *pp, unsigned input_idx, const svalue *sval, bool simple) const
const char * get_asm_string() const
Definition svalue.h:1725
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:1691
const char * m_asm_string
Definition svalue.h:1738
unsigned m_num_inputs
Definition svalue.h:1745
unsigned m_output_idx
Definition svalue.h:1739
unsigned get_num_outputs() const
Definition svalue.h:1727
unsigned input_idx_to_asm_idx(unsigned input_idx) const
unsigned get_num_inputs() const
Definition svalue.h:1728
enum svalue_kind get_kind() const final override
Definition svalue.h:1708
const svalue * get_input(unsigned idx) const
Definition svalue.h:1729
unsigned m_num_outputs
Definition svalue.h:1743
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:1726
const svalue * m_input_arr[MAX_INPUTS]
Definition svalue.h:1746
static const unsigned MAX_INPUTS
Definition svalue.h:1633
Definition store.h:522
class ana::binding_map::iterator iterator_t
class ana::binding_map::const_iterator const_iterator_t
Definition svalue.h:789
enum tree_code get_op() const
Definition svalue.h:858
const svalue * get_arg1() const
Definition svalue.h:860
void accept(visitor *v) const final override
enum tree_code m_op
Definition svalue.h:863
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:859
const svalue * m_arg1
Definition svalue.h:865
enum svalue_kind get_kind() const final override
Definition svalue.h:840
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:828
const svalue * m_arg0
Definition svalue.h:864
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:841
Definition svalue.h:1073
enum svalue_kind get_kind() const final override
Definition svalue.h:1113
const bit_range m_bits
Definition svalue.h:1141
const svalue * m_inner_svalue
Definition svalue.h:1142
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:1133
const bits_within_svalue * dyn_cast_bits_within_svalue() const final override
Definition svalue.h:1115
const bit_range & get_bits() const
Definition svalue.h:1132
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:1392
const_iterator_t end() const
Definition svalue.h:1450
static complexity calc_complexity(const binding_map &map)
iterator_t end()
Definition svalue.h:1452
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:1447
binding_map::iterator_t iterator_t
Definition svalue.h:1395
void add_dump_widget_children(text_art::tree_widget &w, const dump_widget_info &dwi) const final override
iterator_t begin()
Definition svalue.h:1451
enum svalue_kind get_kind() const final override
Definition svalue.h:1431
binding_map::const_iterator_t const_iterator_t
Definition svalue.h:1394
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:1449
void accept(visitor *v) const final override
binding_map m_map
Definition svalue.h:1467
struct key_t make_key() const
Definition svalue.h:1454
const compound_svalue * dyn_cast_compound_svalue() const final override
Definition svalue.h:1432
void purge(const conjured_svalue *sval) const
conjured_purge(region_model *model, region_model_context *ctxt)
Definition svalue.h:1498
region_model_context * m_ctxt
Definition svalue.h:1506
region_model * m_model
Definition svalue.h:1505
Definition svalue.h:1527
void accept(visitor *v) const final override
bool lhs_value_p() const
const gimple * get_stmt() const
Definition svalue.h:1593
const conjured_svalue * dyn_cast_conjured_svalue() const final override
Definition svalue.h:1578
enum svalue_kind get_kind() const final override
Definition svalue.h:1577
const region * m_id_reg
Definition svalue.h:1599
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:1598
void print_dump_widget_label(pretty_printer *pp) const final override
unsigned m_idx
Definition svalue.h:1600
void dump_to_pp(pretty_printer *pp, bool simple) const final override
const region * get_id_region() const
Definition svalue.h:1594
conjured_svalue(symbol::id_t id, tree type, const gimple *stmt, const region *id_reg, unsigned idx)
Definition svalue.h:1569
Definition svalue.h:1775
tree m_fndecl
Definition svalue.h:1875
unsigned get_num_inputs() const
Definition svalue.h:1866
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:1865
static const unsigned MAX_INPUTS
Definition svalue.h:1779
const svalue * get_input(unsigned idx) const
Definition svalue.h:1867
enum svalue_kind get_kind() const final override
Definition svalue.h:1845
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:1832
const svalue * m_input_arr[MAX_INPUTS]
Definition svalue.h:1877
unsigned m_num_inputs
Definition svalue.h:1876
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:1850
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:205
Definition program-point.h:73
Definition svalue.h:648
const initial_svalue * dyn_cast_initial_svalue() const final override
Definition svalue.h:658
const region * get_region() const
Definition svalue.h:674
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:677
bool implicitly_live_p(const svalue_set *, const region_model *) const final override
enum svalue_kind get_kind() const final override
Definition svalue.h:656
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:650
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:1229
placeholder_svalue(symbol::id_t id, tree type, const char *name)
Definition svalue.h:1224
const char * m_name
Definition svalue.h:1244
const char * get_name() const
Definition svalue.h:1241
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:815
Definition region-model-manager.h:32
Definition region-model.h:298
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:977
const repeated_svalue * dyn_cast_repeated_svalue() const final override
Definition svalue.h:1019
const svalue * m_inner_svalue
Definition svalue.h:1046
const svalue * get_inner_svalue() const
Definition svalue.h:1035
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:1034
enum svalue_kind get_kind() const final override
Definition svalue.h:1018
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:1045
Definition svalue.h:562
const setjmp_svalue * dyn_cast_setjmp_svalue() const final override
Definition svalue.h:601
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:599
setjmp_svalue(const setjmp_record &setjmp_record, symbol::id_t id, tree type)
Definition svalue.h:593
const setjmp_record & get_setjmp_record() const
Definition svalue.h:615
void print_dump_widget_label(pretty_printer *pp) const final override
setjmp_record m_setjmp_record
Definition svalue.h:618
int get_enode_index() const
Definition svalue.h:891
const svalue * get_parent() const
Definition svalue.h:946
const region * m_subregion
Definition svalue.h:951
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:928
const region * get_subregion() const
Definition svalue.h:947
const svalue * m_parent_svalue
Definition svalue.h:950
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:929
void dump_to_pp(pretty_printer *pp, bool simple) const final override
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:696
void accept(visitor *v) const final override
const svalue * m_arg
Definition svalue.h:764
unaryop_svalue(symbol::id_t id, tree type, enum tree_code op, const svalue *arg)
Definition svalue.h:731
void dump_to_pp(pretty_printer *pp, bool simple) const final override
const svalue * get_arg() const
Definition svalue.h:755
enum tree_code get_op() const
Definition svalue.h:754
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:738
const unaryop_svalue * dyn_cast_unaryop_svalue() const final override
Definition svalue.h:740
enum tree_code m_op
Definition svalue.h:763
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:1175
const unmergeable_svalue * dyn_cast_unmergeable_svalue() const final override
Definition svalue.h:1184
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:1182
void accept(visitor *v) const final override
unmergeable_svalue(symbol::id_t id, const svalue *arg)
Definition svalue.h:1177
const svalue * get_arg() const
Definition svalue.h:1198
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:1201
Definition region-model.h:222
Definition svalue.h:1270
void dump_to_pp(pretty_printer *pp, bool simple) const final override
const svalue * m_base_sval
Definition svalue.h:1355
const svalue * get_base_svalue() const
Definition svalue.h:1345
widening_svalue(symbol::id_t id, tree type, const function_point &point, const svalue *base_sval, const svalue *iter_sval)
Definition svalue.h:1315
direction_t
Definition svalue.h:1309
@ DIR_UNKNOWN
Definition svalue.h:1312
@ DIR_DESCENDING
Definition svalue.h:1311
@ DIR_ASCENDING
Definition svalue.h:1310
function_point m_point
Definition svalue.h:1354
const widening_svalue * dyn_cast_widening_svalue() const final override
Definition svalue.h:1329
void print_dump_widget_label(pretty_printer *pp) const final override
enum svalue_kind get_kind() const final override
Definition svalue.h:1328
const function_point & get_point() const
Definition svalue.h:1344
const svalue * get_iter_svalue() const
Definition svalue.h:1346
tristate eval_condition_without_cm(enum tree_code op, tree rhs_cst) const
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:1356
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:80
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:1638
unsigned m_num_inputs
Definition svalue.h:1687
bool is_deleted() const
Definition svalue.h:1678
void mark_empty()
Definition svalue.h:1677
hashval_t hash() const
Definition svalue.h:1650
bool is_empty() const
Definition svalue.h:1682
unsigned m_output_idx
Definition svalue.h:1686
void mark_deleted()
Definition svalue.h:1676
const char * m_asm_string
Definition svalue.h:1685
const svalue * m_input_arr[MAX_INPUTS]
Definition svalue.h:1688
tree m_type
Definition svalue.h:1684
bool is_empty() const
Definition svalue.h:820
enum tree_code m_op
Definition svalue.h:823
hashval_t hash() const
Definition svalue.h:799
const svalue * m_arg1
Definition svalue.h:825
tree m_type
Definition svalue.h:822
void mark_deleted()
Definition svalue.h:817
key_t(tree type, enum tree_code op, const svalue *arg0, const svalue *arg1)
Definition svalue.h:794
void mark_empty()
Definition svalue.h:818
bool is_deleted() const
Definition svalue.h:819
const svalue * m_arg0
Definition svalue.h:824
Definition store.h:233
bool is_deleted() const
Definition svalue.h:1101
key_t(tree type, const bit_range &bits, const svalue *inner_svalue)
Definition svalue.h:1078
hashval_t hash() const
Definition svalue.h:1084
bool is_empty() const
Definition svalue.h:1102
void mark_empty()
Definition svalue.h:1100
bit_range m_bits
Definition svalue.h:1105
void mark_deleted()
Definition svalue.h:1099
const svalue * m_inner_svalue
Definition svalue.h:1106
tree m_type
Definition svalue.h:1104
Definition complexity.h:31
Definition svalue.h:1401
bool is_deleted() const
Definition svalue.h:1422
tree m_type
Definition svalue.h:1425
void mark_empty()
Definition svalue.h:1421
hashval_t hash() const
Definition svalue.h:1406
bool is_empty() const
Definition svalue.h:1423
key_t(tree type, const binding_map *map_ptr)
Definition svalue.h:1402
const binding_map * m_map_ptr
Definition svalue.h:1426
void mark_deleted()
Definition svalue.h:1420
unsigned m_idx
Definition svalue.h:1566
bool is_deleted() const
Definition svalue.h:1557
void mark_empty()
Definition svalue.h:1556
bool is_empty() const
Definition svalue.h:1561
const gimple * m_stmt
Definition svalue.h:1564
void mark_deleted()
Definition svalue.h:1555
key_t(tree type, const gimple *stmt, const region *id_reg, unsigned idx)
Definition svalue.h:1532
tree m_type
Definition svalue.h:1563
hashval_t hash() const
Definition svalue.h:1536
const region * m_id_reg
Definition svalue.h:1565
void mark_empty()
Definition svalue.h:1819
tree m_fndecl
Definition svalue.h:1827
hashval_t hash() const
Definition svalue.h:1795
const svalue * m_input_arr[MAX_INPUTS]
Definition svalue.h:1829
bool is_empty() const
Definition svalue.h:1824
tree m_type
Definition svalue.h:1826
void mark_deleted()
Definition svalue.h:1818
unsigned m_num_inputs
Definition svalue.h:1828
bool is_deleted() const
Definition svalue.h:1820
key_t(tree type, tree fndecl, const vec< const svalue * > &inputs)
Definition svalue.h:1784
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:1243
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:1009
void mark_deleted()
Definition svalue.h:1004
const svalue * m_outer_size
Definition svalue.h:1010
hashval_t hash() const
Definition svalue.h:988
void mark_empty()
Definition svalue.h:1005
bool is_empty() const
Definition svalue.h:1007
key_t(tree type, const svalue *outer_size, const svalue *inner_svalue)
Definition svalue.h:982
const svalue * m_inner_svalue
Definition svalue.h:1011
bool is_deleted() const
Definition svalue.h:1006
Definition svalue.h:531
static int cmp(const setjmp_record &rec1, const setjmp_record &rec2)
const exploded_node * m_enode
Definition svalue.h:552
const gcall * m_setjmp_call
Definition svalue.h:553
void add_to_hash(inchash::hash *hstate) const
Definition svalue.h:544
setjmp_record(const exploded_node *enode, const gcall &setjmp_call)
Definition svalue.h:532
key_t(const setjmp_record &record, tree type)
Definition svalue.h:567
hashval_t hash() const
Definition svalue.h:571
tree m_type
Definition svalue.h:590
setjmp_record m_record
Definition svalue.h:589
void mark_deleted()
Definition svalue.h:584
void mark_empty()
Definition svalue.h:585
bool is_deleted() const
Definition svalue.h:586
bool is_empty() const
Definition svalue.h:587
void mark_empty()
Definition svalue.h:917
void mark_deleted()
Definition svalue.h:916
bool is_deleted() const
Definition svalue.h:918
hashval_t hash() const
Definition svalue.h:900
tree m_type
Definition svalue.h:921
const svalue * m_parent_svalue
Definition svalue.h:922
key_t(tree type, const svalue *parent_svalue, const region *subregion)
Definition svalue.h:896
const region * m_subregion
Definition svalue.h:923
bool is_empty() const
Definition svalue.h:919
tree m_type
Definition svalue.h:726
bool is_deleted() const
Definition svalue.h:723
void mark_empty()
Definition svalue.h:722
bool is_empty() const
Definition svalue.h:724
hashval_t hash() const
Definition svalue.h:705
enum tree_code m_op
Definition svalue.h:727
const svalue * m_arg
Definition svalue.h:728
void mark_deleted()
Definition svalue.h:721
key_t(tree type, enum tree_code op, const svalue *arg)
Definition svalue.h:701
bool is_empty() const
Definition svalue.h:1300
const svalue * m_base_sval
Definition svalue.h:1304
void mark_deleted()
Definition svalue.h:1297
tree m_type
Definition svalue.h:1302
hashval_t hash() const
Definition svalue.h:1281
function_point m_point
Definition svalue.h:1303
bool is_deleted() const
Definition svalue.h:1299
key_t(tree type, const function_point &point, const svalue *base_sval, const svalue *iter_sval)
Definition svalue.h:1275
const svalue * m_iter_sval
Definition svalue.h:1305
void mark_empty()
Definition svalue.h:1298
static const bool empty_zero_p
Definition svalue.h:1762
static const bool empty_zero_p
Definition svalue.h:881
static const bool empty_zero_p
Definition svalue.h:1158
static const bool empty_zero_p
Definition svalue.h:1483
static const bool empty_zero_p
Definition svalue.h:1616
static const bool empty_zero_p
Definition svalue.h:1893
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:1062
static const bool empty_zero_p
Definition svalue.h:634
static const bool empty_zero_p
Definition svalue.h:967
static const bool empty_zero_p
Definition svalue.h:780
static const bool empty_zero_p
Definition svalue.h:1372
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:533
Definition dump-widget-info.h:31
Definition gengtype.h:252
Definition vec.h:450
#define gcc_assert(EXPR)
Definition system.h:814
#define TREE_TYPE(NODE)
Definition tree.h:513
#define CONSTANT_CLASS_P(NODE)
Definition tree.h:216
#define NULL_TREE
Definition tree.h:318