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;
30using text_art::dump_widget_info;
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>
111 make_dump_widget (const dump_widget_info &dwi,
112 const char *prefix = nullptr) const;
113
114 virtual const region_svalue *
115 dyn_cast_region_svalue () const { return NULL; }
116 virtual const constant_svalue *
117 dyn_cast_constant_svalue () const { return NULL; }
118 virtual const poisoned_svalue *
119 dyn_cast_poisoned_svalue () const { return NULL; }
120 virtual const setjmp_svalue *
121 dyn_cast_setjmp_svalue () const { return NULL; }
122 virtual const initial_svalue *
123 dyn_cast_initial_svalue () const { return NULL; }
124 virtual const unaryop_svalue *
125 dyn_cast_unaryop_svalue () const { return NULL; }
126 virtual const binop_svalue *
127 dyn_cast_binop_svalue () const { return NULL; }
128 virtual const sub_svalue *
129 dyn_cast_sub_svalue () const { return NULL; }
130 virtual const repeated_svalue *
131 dyn_cast_repeated_svalue () const { return NULL; }
132 virtual const bits_within_svalue *
134 virtual const unmergeable_svalue *
136 virtual const widening_svalue *
137 dyn_cast_widening_svalue () const { return NULL; }
138 virtual const compound_svalue *
139 dyn_cast_compound_svalue () const { return NULL; }
140 virtual const conjured_svalue *
141 dyn_cast_conjured_svalue () const { return NULL; }
142 virtual const asm_output_svalue *
143 dyn_cast_asm_output_svalue () const { return NULL; }
144 virtual const const_fn_result_svalue *
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
204 add_dump_widget_children (text_art::tree_widget &,
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 != NULL);
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
261 add_dump_widget_children (text_art::tree_widget &w,
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
350 add_dump_widget_children (text_art::tree_widget &w,
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
410 add_dump_widget_children (text_art::tree_widget &w,
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
490 add_dump_widget_children (text_art::tree_widget &w,
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
608 add_dump_widget_children (text_art::tree_widget &w,
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 != NULL);
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
665 add_dump_widget_children (text_art::tree_widget &w,
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
747 add_dump_widget_children (text_art::tree_widget &w,
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
851 add_dump_widget_children (text_art::tree_widget &w,
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
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
939 add_dump_widget_children (text_art::tree_widget &w,
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
1029 add_dump_widget_children (text_art::tree_widget &w,
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
1125 add_dump_widget_children (text_art::tree_widget &w,
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
1191 add_dump_widget_children (text_art::tree_widget &w,
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
1236 add_dump_widget_children (text_art::tree_widget &w,
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
1339 add_dump_widget_children (text_art::tree_widget &w,
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:
1395
1396 /* A support class for uniquifying instances of compound_svalue.
1397 Note that to avoid copies, keys store pointers to binding_maps,
1398 rather than the maps themselves. */
1399 struct key_t
1400 {
1401 key_t (tree type, const binding_map *map_ptr)
1402 : m_type (type), m_map_ptr (map_ptr)
1403 {}
1404
1405 hashval_t hash () const
1406 {
1407 inchash::hash hstate;
1408 hstate.add_ptr (m_type);
1409 //hstate.add_ptr (m_map_ptr); // TODO
1410 return hstate.end ();
1411 }
1412
1413 bool operator== (const key_t &other) const
1414 {
1415 return (m_type == other.m_type
1416 && *m_map_ptr == *other.m_map_ptr);
1417 }
1418
1419 void mark_deleted () { m_type = reinterpret_cast<tree> (1); }
1420 void mark_empty () { m_type = reinterpret_cast<tree> (2); }
1421 bool is_deleted () const { return m_type == reinterpret_cast<tree> (1); }
1422 bool is_empty () const { return m_type == reinterpret_cast<tree> (2); }
1423
1426 };
1427
1429
1430 enum svalue_kind get_kind () const final override { return SK_COMPOUND; }
1432 {
1433 return this;
1434 }
1435
1436 void dump_to_pp (pretty_printer *pp, bool simple) const final override;
1437
1438 void
1439 print_dump_widget_label (pretty_printer *pp) const final override;
1440 void
1441 add_dump_widget_children (text_art::tree_widget &w,
1442 const dump_widget_info &dwi) const final override;
1443
1444 void accept (visitor *v) const final override;
1445
1446 const binding_map &get_map () const { return m_map; }
1447
1448 iterator_t begin () const { return m_map.begin (); }
1449 iterator_t end () const { return m_map.end (); }
1450
1451 struct key_t make_key () const
1452 {
1453 return key_t (get_type (), &m_map);
1454 }
1455
1456 const svalue *
1458 const bit_range &subrange,
1459 region_model_manager *mgr) const final override;
1460
1461 private:
1463
1465};
1466
1467} // namespace ana
1468
1469template <>
1470template <>
1471inline bool
1473{
1474 return sval->get_kind () == SK_COMPOUND;
1475}
1476
1478: public member_function_hash_traits<compound_svalue::key_t>
1479{
1480 static const bool empty_zero_p = false;
1481};
1482
1483namespace ana {
1484
1485/* A bundle of state for purging information from a program_state about
1486 a conjured_svalue. We pass this whenever calling
1487 get_or_create_conjured_svalue, so that if the program_state already
1488 has information about this conjured_svalue on an execution path, we
1489 can purge that information, to avoid the analyzer confusing the two
1490 values as being the same. */
1491
1493{
1494public:
1496 : m_model (model), m_ctxt (ctxt)
1497 {
1498 }
1499 void purge (const conjured_svalue *sval) const;
1500
1501private:
1504};
1505
1506/* A defined value arising from a statement, where we want to identify a
1507 particular unknown value, rather than resorting to the unknown_value
1508 singleton, so that the value can have sm-state.
1509
1510 Comparisons of variables that share the same conjured_svalue are known
1511 to be equal, even if we don't know what the value is.
1512
1513 For example, this is used for the values of regions that may have been
1514 touched when calling an unknown function.
1515
1516 The value captures a region as well as a stmt in order to avoid falsely
1517 aliasing the various values that could arise in one statement. For
1518 example, after:
1519 unknown_fn (&a, &b);
1520 we want values to clobber a and b with, but we don't want to use the
1521 same value, or it would falsely implicitly assume that a == b. */
1522
1524{
1525public:
1526 /* A support class for uniquifying instances of conjured_svalue. */
1527 struct key_t
1528 {
1529 key_t (tree type, const gimple *stmt, const region *id_reg, unsigned idx)
1530 : m_type (type), m_stmt (stmt), m_id_reg (id_reg), m_idx (idx)
1531 {}
1532
1533 hashval_t hash () const
1534 {
1535 inchash::hash hstate;
1536 hstate.add_ptr (m_type);
1537 hstate.add_ptr (m_stmt);
1538 hstate.add_ptr (m_id_reg);
1539 return hstate.end ();
1540 }
1541
1542 bool operator== (const key_t &other) const
1543 {
1544 return (m_type == other.m_type
1545 && m_stmt == other.m_stmt
1546 && m_id_reg == other.m_id_reg
1547 && m_idx == other.m_idx);
1548 }
1549
1550 /* Use m_stmt to mark empty/deleted, as m_type can be NULL for
1551 legitimate instances. */
1552 void mark_deleted () { m_stmt = reinterpret_cast<const gimple *> (1); }
1553 void mark_empty () { m_stmt = NULL; }
1554 bool is_deleted () const
1555 {
1556 return m_stmt == reinterpret_cast<const gimple *> (1);
1557 }
1558 bool is_empty () const { return m_stmt == NULL; }
1559
1563 unsigned m_idx;
1564 };
1565
1567 const region *id_reg, unsigned idx)
1568 : svalue (complexity (id_reg), id, type),
1569 m_stmt (stmt), m_id_reg (id_reg), m_idx (idx)
1570 {
1571 gcc_assert (m_stmt != NULL);
1572 }
1573
1574 enum svalue_kind get_kind () const final override { return SK_CONJURED; }
1576 {
1577 return this;
1578 }
1579
1580 void dump_to_pp (pretty_printer *pp, bool simple) const final override;
1581
1582 void
1583 print_dump_widget_label (pretty_printer *pp) const final override;
1584 void
1585 add_dump_widget_children (text_art::tree_widget &w,
1586 const dump_widget_info &dwi) const final override;
1587
1588 void accept (visitor *v) const final override;
1589
1590 const gimple *get_stmt () const { return m_stmt; }
1591 const region *get_id_region () const { return m_id_reg; }
1592 bool lhs_value_p () const;
1593
1594 private:
1597 unsigned m_idx;
1598};
1599
1600} // namespace ana
1601
1602template <>
1603template <>
1604inline bool
1606{
1607 return sval->get_kind () == SK_CONJURED;
1608}
1609
1611: public member_function_hash_traits<conjured_svalue::key_t>
1612{
1613 static const bool empty_zero_p = true;
1614};
1615
1616namespace ana {
1617
1618/* An output from a deterministic asm stmt, where we want to identify a
1619 particular unknown value, rather than resorting to the unknown_value
1620 singleton.
1621
1622 Comparisons of variables that share the same asm_output_svalue are known
1623 to be equal, even if we don't know what the value is. */
1624
1626{
1627public:
1628 /* Imposing an upper limit and using a (small) array allows key_t
1629 to avoid memory management. */
1630 static const unsigned MAX_INPUTS = 2;
1631
1632 /* A support class for uniquifying instances of asm_output_svalue. */
1633 struct key_t
1634 {
1636 const char *asm_string,
1637 unsigned output_idx,
1638 const vec<const svalue *> &inputs)
1639 : m_type (type), m_asm_string (asm_string), m_output_idx (output_idx),
1640 m_num_inputs (inputs.length ())
1641 {
1642 gcc_assert (inputs.length () <= MAX_INPUTS);
1643 for (unsigned i = 0; i < m_num_inputs; i++)
1644 m_input_arr[i] = inputs[i];
1645 }
1646
1647 hashval_t hash () const
1648 {
1649 inchash::hash hstate;
1650 hstate.add_ptr (m_type);
1651 /* We don't bother hashing m_asm_str. */
1652 hstate.add_int (m_output_idx);
1653 for (unsigned i = 0; i < m_num_inputs; i++)
1654 hstate.add_ptr (m_input_arr[i]);
1655 return hstate.end ();
1656 }
1657
1658 bool operator== (const key_t &other) const
1659 {
1660 if (!(m_type == other.m_type
1661 && 0 == (strcmp (m_asm_string, other.m_asm_string))
1662 && m_output_idx == other.m_output_idx
1663 && m_num_inputs == other.m_num_inputs))
1664 return false;
1665 for (unsigned i = 0; i < m_num_inputs; i++)
1666 if (m_input_arr[i] != other.m_input_arr[i])
1667 return false;
1668 return true;
1669 }
1670
1671 /* Use m_asm_string to mark empty/deleted, as m_type can be NULL for
1672 legitimate instances. */
1673 void mark_deleted () { m_asm_string = reinterpret_cast<const char *> (1); }
1675 bool is_deleted () const
1676 {
1677 return m_asm_string == reinterpret_cast<const char *> (1);
1678 }
1679 bool is_empty () const { return m_asm_string == NULL; }
1680
1682 const char *m_asm_string;
1686 };
1687
1689 tree type,
1690 const char *asm_string,
1691 unsigned output_idx,
1692 unsigned num_outputs,
1693 const vec<const svalue *> &inputs)
1694 : svalue (complexity::from_vec_svalue (inputs), id, type),
1695 m_asm_string (asm_string),
1696 m_output_idx (output_idx),
1697 m_num_outputs (num_outputs),
1698 m_num_inputs (inputs.length ())
1699 {
1700 gcc_assert (inputs.length () <= MAX_INPUTS);
1701 for (unsigned i = 0; i < m_num_inputs; i++)
1702 m_input_arr[i] = inputs[i];
1703 }
1704
1705 enum svalue_kind get_kind () const final override { return SK_ASM_OUTPUT; }
1706 const asm_output_svalue *
1708 {
1709 return this;
1710 }
1711
1712 void dump_to_pp (pretty_printer *pp, bool simple) const final override;
1713
1714 void
1715 print_dump_widget_label (pretty_printer *pp) const final override;
1716 void
1717 add_dump_widget_children (text_art::tree_widget &w,
1718 const dump_widget_info &dwi) const final override;
1719
1720 void accept (visitor *v) const final override;
1721
1722 const char *get_asm_string () const { return m_asm_string; }
1723 unsigned get_output_idx () const { return m_output_idx; }
1724 unsigned get_num_outputs () const { return m_num_outputs; }
1725 unsigned get_num_inputs () const { return m_num_inputs; }
1726 const svalue *get_input (unsigned idx) const { return m_input_arr[idx]; }
1727
1728 private:
1730 unsigned input_idx,
1731 const svalue *sval,
1732 bool simple) const;
1733 unsigned input_idx_to_asm_idx (unsigned input_idx) const;
1734
1735 const char *m_asm_string;
1737
1738 /* We capture this so that we can offset the input indices
1739 to match the %0, %1, %2 in the asm_string when dumping. */
1741
1744};
1745
1746} // namespace ana
1747
1748template <>
1749template <>
1750inline bool
1752{
1753 return sval->get_kind () == SK_ASM_OUTPUT;
1754}
1755
1757: public member_function_hash_traits<asm_output_svalue::key_t>
1758{
1759 static const bool empty_zero_p = true;
1760};
1761
1762namespace ana {
1763
1764/* The return value from a function with __attribute((const)) for given
1765 inputs, provided that we don't have too many inputs, and all of them
1766 are deterministic.
1767
1768 Comparisons of variables that share the same const_fn_result_svalue are known
1769 to be equal, even if we don't know what the value is. */
1770
1772{
1773public:
1774 /* Imposing an upper limit and using a (small) array allows key_t
1775 to avoid memory management. */
1776 static const unsigned MAX_INPUTS = 2;
1777
1778 /* A support class for uniquifying instances of const_fn_result_svalue. */
1779 struct key_t
1780 {
1782 tree fndecl,
1783 const vec<const svalue *> &inputs)
1784 : m_type (type), m_fndecl (fndecl),
1785 m_num_inputs (inputs.length ())
1786 {
1787 gcc_assert (inputs.length () <= MAX_INPUTS);
1788 for (unsigned i = 0; i < m_num_inputs; i++)
1789 m_input_arr[i] = inputs[i];
1790 }
1791
1792 hashval_t hash () const
1793 {
1794 inchash::hash hstate;
1795 hstate.add_ptr (m_type);
1796 hstate.add_ptr (m_fndecl);
1797 for (unsigned i = 0; i < m_num_inputs; i++)
1798 hstate.add_ptr (m_input_arr[i]);
1799 return hstate.end ();
1800 }
1801
1802 bool operator== (const key_t &other) const
1803 {
1804 if (!(m_type == other.m_type
1805 && m_fndecl == other.m_fndecl
1806 && m_num_inputs == other.m_num_inputs))
1807 return false;
1808 for (unsigned i = 0; i < m_num_inputs; i++)
1809 if (m_input_arr[i] != other.m_input_arr[i])
1810 return false;
1811 return true;
1812 }
1813
1814 /* Use m_fndecl to mark empty/deleted. */
1815 void mark_deleted () { m_fndecl = reinterpret_cast<tree> (1); }
1816 void mark_empty () { m_fndecl = NULL; }
1817 bool is_deleted () const
1818 {
1819 return m_fndecl == reinterpret_cast<tree> (1);
1820 }
1821 bool is_empty () const { return m_fndecl == NULL; }
1822
1827 };
1828
1830 tree type,
1831 tree fndecl,
1832 const vec<const svalue *> &inputs)
1833 : svalue (complexity::from_vec_svalue (inputs), id, type),
1834 m_fndecl (fndecl),
1835 m_num_inputs (inputs.length ())
1836 {
1837 gcc_assert (inputs.length () <= MAX_INPUTS);
1838 for (unsigned i = 0; i < m_num_inputs; i++)
1839 m_input_arr[i] = inputs[i];
1840 }
1841
1842 enum svalue_kind get_kind () const final override
1843 {
1844 return SK_CONST_FN_RESULT;
1845 }
1848 {
1849 return this;
1850 }
1851
1852 void dump_to_pp (pretty_printer *pp, bool simple) const final override;
1853
1854 void
1855 print_dump_widget_label (pretty_printer *pp) const final override;
1856 void
1857 add_dump_widget_children (text_art::tree_widget &w,
1858 const dump_widget_info &dwi) const final override;
1859
1860 void accept (visitor *v) const final override;
1861
1862 tree get_fndecl () const { return m_fndecl; }
1863 unsigned get_num_inputs () const { return m_num_inputs; }
1864 const svalue *get_input (unsigned idx) const { return m_input_arr[idx]; }
1865
1866 private:
1868 unsigned input_idx,
1869 const svalue *sval,
1870 bool simple) const;
1871
1875};
1876
1877} // namespace ana
1878
1879template <>
1880template <>
1881inline bool
1883{
1884 return sval->get_kind () == SK_CONST_FN_RESULT;
1885}
1886
1888: public member_function_hash_traits<const_fn_result_svalue::key_t>
1889{
1890 static const bool empty_zero_p = true;
1891};
1892
1893#endif /* GCC_ANALYZER_SVALUE_H */
Definition svalue.h:1626
const asm_output_svalue * dyn_cast_asm_output_svalue() const final override
Definition svalue.h:1707
void dump_input(pretty_printer *pp, unsigned input_idx, const svalue *sval, bool simple) const
const char * get_asm_string() const
Definition svalue.h:1722
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:1688
const char * m_asm_string
Definition svalue.h:1735
unsigned m_num_inputs
Definition svalue.h:1742
unsigned m_output_idx
Definition svalue.h:1736
unsigned get_num_outputs() const
Definition svalue.h:1724
unsigned input_idx_to_asm_idx(unsigned input_idx) const
unsigned get_num_inputs() const
Definition svalue.h:1725
enum svalue_kind get_kind() const final override
Definition svalue.h:1705
const svalue * get_input(unsigned idx) const
Definition svalue.h:1726
unsigned m_num_outputs
Definition svalue.h:1740
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:1723
const svalue * m_input_arr[MAX_INPUTS]
Definition svalue.h:1743
static const unsigned MAX_INPUTS
Definition svalue.h:1630
Definition store.h:508
map_t::iterator iterator_t
Definition store.h:511
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
iterator_t begin() const
Definition svalue.h:1448
static complexity calc_complexity(const binding_map &map)
compound_svalue(symbol::id_t id, tree type, const binding_map &map)
iterator_t end() const
Definition svalue.h:1449
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:1446
binding_map::iterator_t iterator_t
Definition svalue.h:1394
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:1430
const svalue * maybe_fold_bits_within(tree type, const bit_range &subrange, region_model_manager *mgr) const final override
void accept(visitor *v) const final override
binding_map m_map
Definition svalue.h:1464
struct key_t make_key() const
Definition svalue.h:1451
const compound_svalue * dyn_cast_compound_svalue() const final override
Definition svalue.h:1431
void purge(const conjured_svalue *sval) const
conjured_purge(region_model *model, region_model_context *ctxt)
Definition svalue.h:1495
region_model_context * m_ctxt
Definition svalue.h:1503
region_model * m_model
Definition svalue.h:1502
Definition svalue.h:1524
void accept(visitor *v) const final override
bool lhs_value_p() const
const gimple * get_stmt() const
Definition svalue.h:1590
const conjured_svalue * dyn_cast_conjured_svalue() const final override
Definition svalue.h:1575
enum svalue_kind get_kind() const final override
Definition svalue.h:1574
const region * m_id_reg
Definition svalue.h:1596
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:1595
void print_dump_widget_label(pretty_printer *pp) const final override
unsigned m_idx
Definition svalue.h:1597
void dump_to_pp(pretty_printer *pp, bool simple) const final override
const region * get_id_region() const
Definition svalue.h:1591
conjured_svalue(symbol::id_t id, tree type, const gimple *stmt, const region *id_reg, unsigned idx)
Definition svalue.h:1566
Definition svalue.h:1772
tree m_fndecl
Definition svalue.h:1872
unsigned get_num_inputs() const
Definition svalue.h:1863
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:1862
static const unsigned MAX_INPUTS
Definition svalue.h:1776
const svalue * get_input(unsigned idx) const
Definition svalue.h:1864
enum svalue_kind get_kind() const final override
Definition svalue.h:1842
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:1829
const svalue * m_input_arr[MAX_INPUTS]
Definition svalue.h:1874
unsigned m_num_inputs
Definition svalue.h:1873
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:1847
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:203
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 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
bool operator==(const nowarn_spec_t &lhs, const nowarn_spec_t &rhs)
Definition diagnostic-spec.h:131
void final(rtx_insn *first, FILE *file, int optimize_p)
Definition final.cc:2008
tree_code
Definition genmatch.cc:1002
Definition access-diagram.h:30
@ stmt
Definition checker-event.h:37
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:78
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:1635
unsigned m_num_inputs
Definition svalue.h:1684
bool is_deleted() const
Definition svalue.h:1675
void mark_empty()
Definition svalue.h:1674
hashval_t hash() const
Definition svalue.h:1647
bool is_empty() const
Definition svalue.h:1679
unsigned m_output_idx
Definition svalue.h:1683
void mark_deleted()
Definition svalue.h:1673
const char * m_asm_string
Definition svalue.h:1682
const svalue * m_input_arr[MAX_INPUTS]
Definition svalue.h:1685
tree m_type
Definition svalue.h:1681
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:1400
bool is_deleted() const
Definition svalue.h:1421
tree m_type
Definition svalue.h:1424
void mark_empty()
Definition svalue.h:1420
hashval_t hash() const
Definition svalue.h:1405
bool is_empty() const
Definition svalue.h:1422
key_t(tree type, const binding_map *map_ptr)
Definition svalue.h:1401
const binding_map * m_map_ptr
Definition svalue.h:1425
void mark_deleted()
Definition svalue.h:1419
unsigned m_idx
Definition svalue.h:1563
bool is_deleted() const
Definition svalue.h:1554
void mark_empty()
Definition svalue.h:1553
bool is_empty() const
Definition svalue.h:1558
const gimple * m_stmt
Definition svalue.h:1561
void mark_deleted()
Definition svalue.h:1552
key_t(tree type, const gimple *stmt, const region *id_reg, unsigned idx)
Definition svalue.h:1529
tree m_type
Definition svalue.h:1560
hashval_t hash() const
Definition svalue.h:1533
const region * m_id_reg
Definition svalue.h:1562
void mark_empty()
Definition svalue.h:1816
tree m_fndecl
Definition svalue.h:1824
hashval_t hash() const
Definition svalue.h:1792
const svalue * m_input_arr[MAX_INPUTS]
Definition svalue.h:1826
bool is_empty() const
Definition svalue.h:1821
tree m_type
Definition svalue.h:1823
void mark_deleted()
Definition svalue.h:1815
unsigned m_num_inputs
Definition svalue.h:1825
bool is_deleted() const
Definition svalue.h:1817
key_t(tree type, tree fndecl, const vec< const svalue * > &inputs)
Definition svalue.h:1781
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:1229
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:1759
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:1480
static const bool empty_zero_p
Definition svalue.h:1613
static const bool empty_zero_p
Definition svalue.h:1890
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:531
Definition gengtype.h:252
Definition vec.h:450
#define NULL
Definition system.h:50
#define gcc_assert(EXPR)
Definition system.h:814
#define TREE_TYPE(NODE)
Definition tree.h:512
#define CONSTANT_CLASS_P(NODE)
Definition tree.h:215
#define NULL_TREE
Definition tree.h:317