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