Line data Source code
1 : // is_a<> support for RTL SSA classes -*- C++ -*-
2 : // Copyright (C) 2020-2026 Free Software Foundation, Inc.
3 : //
4 : // This file is part of GCC.
5 : //
6 : // GCC is free software; you can redistribute it and/or modify it under
7 : // the terms of the GNU General Public License as published by the Free
8 : // Software Foundation; either version 3, or (at your option) any later
9 : // version.
10 : //
11 : // GCC is distributed in the hope that it will be useful, but WITHOUT ANY
12 : // WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 : // FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 : // for more details.
15 : //
16 : // You should have received a copy of the GNU General Public License
17 : // along with GCC; see the file COPYING3. If not see
18 : // <http://www.gnu.org/licenses/>.
19 :
20 : template<>
21 : struct is_a_helper<rtl_ssa::def_info *>
22 : : static_is_a_helper<rtl_ssa::def_info *>
23 : {
24 : static inline bool
25 858513970 : test (const rtl_ssa::access_info *ref)
26 : {
27 858513970 : return (ref->kind () == rtl_ssa::access_kind::SET
28 153547878 : || ref->kind () == rtl_ssa::access_kind::PHI
29 469267387 : || ref->kind () == rtl_ssa::access_kind::CLOBBER);
30 : }
31 : };
32 :
33 : template<>
34 : struct is_a_helper<rtl_ssa::clobber_info *>
35 : : static_is_a_helper<rtl_ssa::clobber_info *>
36 : {
37 : static inline bool
38 1219314468 : test (const rtl_ssa::access_info *ref)
39 : {
40 1132221793 : return ref->kind () == rtl_ssa::access_kind::CLOBBER;
41 : }
42 : };
43 :
44 : template<>
45 : struct is_a_helper<rtl_ssa::use_info *>
46 : : static_is_a_helper<rtl_ssa::use_info *>
47 : {
48 : static inline bool
49 1447745728 : test (const rtl_ssa::access_info *ref)
50 : {
51 1437927002 : return ref->kind () == rtl_ssa::access_kind::USE;
52 : }
53 : };
54 :
55 : template<>
56 : struct is_a_helper<rtl_ssa::set_info *>
57 : : static_is_a_helper<rtl_ssa::set_info *>
58 : {
59 : static inline bool
60 2011518433 : test (const rtl_ssa::access_info *ref)
61 : {
62 2011518433 : return (ref->kind () == rtl_ssa::access_kind::SET
63 2011518433 : || ref->kind () == rtl_ssa::access_kind::PHI);
64 : }
65 : };
66 :
67 : template<>
68 : struct is_a_helper<rtl_ssa::phi_info *>
69 : : static_is_a_helper<rtl_ssa::phi_info *>
70 : {
71 : static inline bool
72 719997140 : test (const rtl_ssa::access_info *ref)
73 : {
74 719997140 : return ref->kind () == rtl_ssa::access_kind::PHI;
75 : }
76 : };
77 :
78 : template<>
79 : struct is_a_helper<rtl_ssa::set_node *>
80 : : static_is_a_helper<rtl_ssa::set_node *>
81 : {
82 : static inline bool
83 0 : test (const rtl_ssa::def_node *node)
84 : {
85 0 : return node->contains_set ();
86 : }
87 : };
88 :
89 : template<>
90 : struct is_a_helper<rtl_ssa::clobber_group *>
91 : : static_is_a_helper<rtl_ssa::clobber_group *>
92 : {
93 : static inline bool
94 10374722 : test (const rtl_ssa::def_node *node)
95 : {
96 10374722 : return node->contains_clobber ();
97 : }
98 : };
|