Mercurial > hg > CbC > CbC_gcc
annotate gcc/ipa-ref.h @ 120:f93fa5091070
fix conv1.c
author | mir3636 |
---|---|
date | Thu, 08 Mar 2018 14:53:42 +0900 |
parents | 04ced10e8804 |
children | 84e7813d76e9 |
rev | line source |
---|---|
63
b7f97abdc517
update gcc from gcc-4.5.0 to gcc-4.6
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1 /* IPA reference lists. |
111 | 2 Copyright (C) 2010-2017 Free Software Foundation, Inc. |
63
b7f97abdc517
update gcc from gcc-4.5.0 to gcc-4.6
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
3 Contributed by Jan Hubicka |
b7f97abdc517
update gcc from gcc-4.5.0 to gcc-4.6
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
4 |
b7f97abdc517
update gcc from gcc-4.5.0 to gcc-4.6
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
5 This file is part of GCC. |
b7f97abdc517
update gcc from gcc-4.5.0 to gcc-4.6
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
6 |
b7f97abdc517
update gcc from gcc-4.5.0 to gcc-4.6
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
7 GCC is free software; you can redistribute it and/or modify it under |
b7f97abdc517
update gcc from gcc-4.5.0 to gcc-4.6
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
8 the terms of the GNU General Public License as published by the Free |
b7f97abdc517
update gcc from gcc-4.5.0 to gcc-4.6
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
9 Software Foundation; either version 3, or (at your option) any later |
b7f97abdc517
update gcc from gcc-4.5.0 to gcc-4.6
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
10 version. |
b7f97abdc517
update gcc from gcc-4.5.0 to gcc-4.6
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
11 |
b7f97abdc517
update gcc from gcc-4.5.0 to gcc-4.6
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
12 GCC is distributed in the hope that it will be useful, but WITHOUT ANY |
b7f97abdc517
update gcc from gcc-4.5.0 to gcc-4.6
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
13 WARRANTY; without even the implied warranty of MERCHANTABILITY or |
b7f97abdc517
update gcc from gcc-4.5.0 to gcc-4.6
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
14 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
b7f97abdc517
update gcc from gcc-4.5.0 to gcc-4.6
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
15 for more details. |
b7f97abdc517
update gcc from gcc-4.5.0 to gcc-4.6
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
16 |
b7f97abdc517
update gcc from gcc-4.5.0 to gcc-4.6
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
17 You should have received a copy of the GNU General Public License |
b7f97abdc517
update gcc from gcc-4.5.0 to gcc-4.6
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
18 along with GCC; see the file COPYING3. If not see |
b7f97abdc517
update gcc from gcc-4.5.0 to gcc-4.6
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
19 <http://www.gnu.org/licenses/>. */ |
b7f97abdc517
update gcc from gcc-4.5.0 to gcc-4.6
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
20 |
111 | 21 #ifndef GCC_IPA_REF_H |
22 #define GCC_IPA_REF_H | |
23 | |
63
b7f97abdc517
update gcc from gcc-4.5.0 to gcc-4.6
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
24 struct cgraph_node; |
111 | 25 class varpool_node; |
26 class symtab_node; | |
27 | |
63
b7f97abdc517
update gcc from gcc-4.5.0 to gcc-4.6
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
28 |
b7f97abdc517
update gcc from gcc-4.5.0 to gcc-4.6
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
29 /* How the reference is done. */ |
b7f97abdc517
update gcc from gcc-4.5.0 to gcc-4.6
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
30 enum GTY(()) ipa_ref_use |
b7f97abdc517
update gcc from gcc-4.5.0 to gcc-4.6
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
31 { |
b7f97abdc517
update gcc from gcc-4.5.0 to gcc-4.6
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
32 IPA_REF_LOAD, |
b7f97abdc517
update gcc from gcc-4.5.0 to gcc-4.6
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
33 IPA_REF_STORE, |
111 | 34 IPA_REF_ADDR, |
35 IPA_REF_ALIAS, | |
36 IPA_REF_CHKP | |
63
b7f97abdc517
update gcc from gcc-4.5.0 to gcc-4.6
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
37 }; |
b7f97abdc517
update gcc from gcc-4.5.0 to gcc-4.6
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
38 |
b7f97abdc517
update gcc from gcc-4.5.0 to gcc-4.6
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
39 /* Record of reference in callgraph or varpool. */ |
b7f97abdc517
update gcc from gcc-4.5.0 to gcc-4.6
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
40 struct GTY(()) ipa_ref |
b7f97abdc517
update gcc from gcc-4.5.0 to gcc-4.6
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
41 { |
111 | 42 public: |
43 /* Remove reference. */ | |
44 void remove_reference (); | |
45 | |
46 /* Return true when execution of reference can lead to return from | |
47 function. */ | |
48 bool cannot_lead_to_return (); | |
49 | |
50 /* Return true if refernece may be used in address compare. */ | |
51 bool address_matters_p (); | |
52 | |
53 /* Return reference list this reference is in. */ | |
54 struct ipa_ref_list * referring_ref_list (void); | |
55 | |
56 /* Return reference list this reference is in. */ | |
57 struct ipa_ref_list * referred_ref_list (void); | |
58 | |
59 symtab_node *referring; | |
60 symtab_node *referred; | |
61 gimple *stmt; | |
62 unsigned int lto_stmt_uid; | |
63 unsigned int referred_index; | |
64 ENUM_BITFIELD (ipa_ref_use) use:3; | |
65 unsigned int speculative:1; | |
63
b7f97abdc517
update gcc from gcc-4.5.0 to gcc-4.6
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
66 }; |
b7f97abdc517
update gcc from gcc-4.5.0 to gcc-4.6
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
67 |
b7f97abdc517
update gcc from gcc-4.5.0 to gcc-4.6
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
68 typedef struct ipa_ref ipa_ref_t; |
b7f97abdc517
update gcc from gcc-4.5.0 to gcc-4.6
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
69 typedef struct ipa_ref *ipa_ref_ptr; |
b7f97abdc517
update gcc from gcc-4.5.0 to gcc-4.6
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
70 |
b7f97abdc517
update gcc from gcc-4.5.0 to gcc-4.6
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
71 |
b7f97abdc517
update gcc from gcc-4.5.0 to gcc-4.6
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
72 /* List of references. This is stored in both callgraph and varpool nodes. */ |
b7f97abdc517
update gcc from gcc-4.5.0 to gcc-4.6
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
73 struct GTY(()) ipa_ref_list |
b7f97abdc517
update gcc from gcc-4.5.0 to gcc-4.6
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
74 { |
111 | 75 public: |
76 /* Return first reference in list or NULL if empty. */ | |
77 struct ipa_ref *first_reference (void) | |
78 { | |
79 if (!vec_safe_length (references)) | |
80 return NULL; | |
81 return &(*references)[0]; | |
82 } | |
83 | |
84 /* Return first referring ref in list or NULL if empty. */ | |
85 struct ipa_ref *first_referring (void) | |
86 { | |
87 if (!referring.length ()) | |
88 return NULL; | |
89 return referring[0]; | |
90 } | |
91 | |
92 /* Return first referring alias. */ | |
93 struct ipa_ref *first_alias (void) | |
94 { | |
95 struct ipa_ref *r = first_referring (); | |
96 | |
97 return r && r->use == IPA_REF_ALIAS ? r : NULL; | |
98 } | |
99 | |
100 /* Return last referring alias. */ | |
101 struct ipa_ref *last_alias (void) | |
102 { | |
103 unsigned int i = 0; | |
104 | |
105 for(i = 0; i < referring.length (); i++) | |
106 if (referring[i]->use != IPA_REF_ALIAS) | |
107 break; | |
108 | |
109 return i == 0 ? NULL : referring[i - 1]; | |
110 } | |
111 | |
112 /* Return true if the symbol has an alias. */ | |
113 bool inline has_aliases_p (void) | |
114 { | |
115 return first_alias (); | |
116 } | |
117 | |
118 /* Clear reference list. */ | |
119 void clear (void) | |
120 { | |
121 referring.create (0); | |
122 references = NULL; | |
123 } | |
124 | |
125 /* Return number of references. */ | |
126 unsigned int nreferences (void) | |
127 { | |
128 return vec_safe_length (references); | |
129 } | |
130 | |
63
b7f97abdc517
update gcc from gcc-4.5.0 to gcc-4.6
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
131 /* Store actual references in references vector. */ |
111 | 132 vec<ipa_ref_t, va_gc> *references; |
133 /* Referring is vector of pointers to references. It must not live in GGC space | |
63
b7f97abdc517
update gcc from gcc-4.5.0 to gcc-4.6
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
134 or GGC will try to mark middle of references vectors. */ |
111 | 135 vec<ipa_ref_ptr> GTY((skip)) referring; |
63
b7f97abdc517
update gcc from gcc-4.5.0 to gcc-4.6
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
136 }; |
b7f97abdc517
update gcc from gcc-4.5.0 to gcc-4.6
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
137 |
111 | 138 #endif /* GCC_IPA_REF_H */ |