Mercurial > hg > CbC > CbC_gcc
annotate gcc/params.c @ 132:d34655255c78
update gcc-8.2
author | mir3636 |
---|---|
date | Thu, 25 Oct 2018 10:21:07 +0900 |
parents | 84e7813d76e9 |
children |
rev | line source |
---|---|
0 | 1 /* params.c - Run-time parameters. |
131 | 2 Copyright (C) 2001-2018 Free Software Foundation, Inc. |
0 | 3 Written by Mark Mitchell <mark@codesourcery.com>. |
4 | |
5 This file is part of GCC. | |
6 | |
7 GCC is free software; you can redistribute it and/or modify it under | |
8 the terms of the GNU General Public License as published by the Free | |
9 Software Foundation; either version 3, or (at your option) any later | |
10 version. | |
11 | |
12 GCC is distributed in the hope that it will be useful, but WITHOUT ANY | |
13 WARRANTY; without even the implied warranty of MERCHANTABILITY or | |
14 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | |
15 for more details. | |
16 | |
17 You should have received a copy of the GNU General Public License | |
18 along with GCC; see the file COPYING3. If not see | |
19 <http://www.gnu.org/licenses/>. */ | |
20 | |
21 #include "config.h" | |
22 #include "system.h" | |
23 #include "coretypes.h" | |
111 | 24 #include "common/common-target.h" |
0 | 25 #include "params.h" |
111 | 26 #include "params-enum.h" |
67
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
55
diff
changeset
|
27 #include "diagnostic-core.h" |
131 | 28 #include "diagnostic.h" |
111 | 29 #include "spellcheck.h" |
0 | 30 |
31 /* An array containing the compiler parameters and their current | |
32 values. */ | |
33 | |
34 param_info *compiler_params; | |
35 | |
36 /* The number of entries in the table. */ | |
37 static size_t num_compiler_params; | |
38 | |
67
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
55
diff
changeset
|
39 /* Whether the parameters have all been initialized and had their |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
55
diff
changeset
|
40 default values determined. */ |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
55
diff
changeset
|
41 static bool params_finished; |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
55
diff
changeset
|
42 |
111 | 43 #define DEFPARAM(ENUM, OPTION, HELP, DEFAULT, MIN, MAX) |
44 #define DEFPARAMENUM5(ENUM, OPTION, HELP, DEFAULT, V0, V1, V2, V3, V4) \ | |
45 static const char *values_ ## ENUM [] = { #V0, #V1, #V2, #V3, #V4, NULL }; | |
46 #include "params.def" | |
47 #undef DEFPARAMENUM5 | |
48 #undef DEFPARAM | |
49 | |
50 static const param_info lang_independent_params[] = { | |
51 #define DEFPARAM(ENUM, OPTION, HELP, DEFAULT, MIN, MAX) \ | |
52 { OPTION, DEFAULT, MIN, MAX, HELP, NULL }, | |
53 #define DEFPARAMENUM5(ENUM, OPTION, HELP, DEFAULT, \ | |
54 V0, V1, V2, V3, V4) \ | |
55 { OPTION, (int)ENUM ## _KIND_ ## DEFAULT, 0, 4, HELP, values_ ## ENUM }, | |
56 #include "params.def" | |
57 #undef DEFPARAM | |
58 #undef DEFPARAMENUM5 | |
59 { NULL, 0, 0, 0, NULL, NULL } | |
60 }; | |
61 | |
131 | 62 static bool |
63 validate_param (const int value, const param_info param, const int index); | |
64 | |
65 | |
0 | 66 /* Add the N PARAMS to the current list of compiler parameters. */ |
67 | |
68 void | |
69 add_params (const param_info params[], size_t n) | |
70 { | |
67
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
55
diff
changeset
|
71 gcc_assert (!params_finished); |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
55
diff
changeset
|
72 |
0 | 73 /* Allocate enough space for the new parameters. */ |
74 compiler_params = XRESIZEVEC (param_info, compiler_params, | |
75 num_compiler_params + n); | |
131 | 76 param_info *dst_params = compiler_params + num_compiler_params; |
77 | |
0 | 78 /* Copy them into the table. */ |
131 | 79 memcpy (dst_params, params, n * sizeof (param_info)); |
80 | |
0 | 81 /* Keep track of how many parameters we have. */ |
82 num_compiler_params += n; | |
131 | 83 |
84 /* Initialize the pretty printing machinery in case we need to print an error, | |
85 but be sure not to initialize it if something else already has, e.g. a | |
86 language front-end like cc1. */ | |
87 if (!diagnostic_ready_p ()) | |
88 diagnostic_initialize (global_dc, 0); | |
89 | |
90 /* Now perform some validation and validation failures trigger an error so | |
91 initialization will stop. */ | |
92 for (size_t i = num_compiler_params - n; i < n; i++) | |
93 validate_param (params[i].default_value, params[i], (int)i); | |
0 | 94 } |
95 | |
111 | 96 /* Add all parameters and default values that can be set in both the |
97 driver and the compiler proper. */ | |
98 | |
99 void | |
100 global_init_params (void) | |
101 { | |
102 gcc_assert (!params_finished); | |
103 | |
104 add_params (lang_independent_params, LAST_PARAM); | |
105 targetm_common.option_default_params (); | |
106 } | |
107 | |
67
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
55
diff
changeset
|
108 /* Note that all parameters have been added and all default values |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
55
diff
changeset
|
109 set. */ |
0 | 110 |
111 void | |
67
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
55
diff
changeset
|
112 finish_params (void) |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
55
diff
changeset
|
113 { |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
55
diff
changeset
|
114 params_finished = true; |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
55
diff
changeset
|
115 } |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
55
diff
changeset
|
116 |
111 | 117 /* Reset all state within params.c so that we can rerun the compiler |
118 within the same process. For use by toplev::finalize. */ | |
119 | |
120 void | |
121 params_c_finalize (void) | |
122 { | |
123 XDELETEVEC (compiler_params); | |
124 compiler_params = NULL; | |
125 num_compiler_params = 0; | |
126 params_finished = false; | |
127 } | |
128 | |
67
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
55
diff
changeset
|
129 /* Set the value of the parameter given by NUM to VALUE in PARAMS and |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
55
diff
changeset
|
130 PARAMS_SET. If EXPLICIT_P, this is being set by the user; |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
55
diff
changeset
|
131 otherwise it is being set implicitly by the compiler. */ |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
55
diff
changeset
|
132 |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
55
diff
changeset
|
133 static void |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
55
diff
changeset
|
134 set_param_value_internal (compiler_param num, int value, |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
55
diff
changeset
|
135 int *params, int *params_set, |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
55
diff
changeset
|
136 bool explicit_p) |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
55
diff
changeset
|
137 { |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
55
diff
changeset
|
138 size_t i = (size_t) num; |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
55
diff
changeset
|
139 |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
55
diff
changeset
|
140 gcc_assert (params_finished); |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
55
diff
changeset
|
141 |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
55
diff
changeset
|
142 params[i] = value; |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
55
diff
changeset
|
143 if (explicit_p) |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
55
diff
changeset
|
144 params_set[i] = true; |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
55
diff
changeset
|
145 } |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
55
diff
changeset
|
146 |
131 | 147 /* Validate PARAM and write an error if invalid. */ |
148 | |
149 static bool | |
150 validate_param (const int value, const param_info param, const int index) | |
151 { | |
152 /* These paremeters interpret bounds of 0 to be unbounded, as such don't | |
153 perform any range validation on 0 parameters. */ | |
154 if (value < param.min_value && param.min_value != 0) | |
155 { | |
156 error ("minimum value of parameter %qs is %u", | |
157 param.option, param.min_value); | |
158 return false; | |
159 } | |
160 else if (param.max_value > param.min_value && value > param.max_value) | |
161 { | |
162 error ("maximum value of parameter %qs is %u", | |
163 param.option, param.max_value); | |
164 return false; | |
165 } | |
166 else if (targetm_common.option_validate_param (value, index)) | |
167 return true; | |
168 | |
169 return false; | |
170 } | |
171 | |
111 | 172 /* Return true if it can find the matching entry for NAME in the parameter |
173 table, and assign the entry index to INDEX. Return false otherwise. */ | |
174 | |
175 bool | |
176 find_param (const char *name, enum compiler_param *index) | |
177 { | |
178 for (size_t i = 0; i < num_compiler_params; ++i) | |
179 if (strcmp (compiler_params[i].option, name) == 0) | |
180 { | |
181 *index = (enum compiler_param) i; | |
182 return true; | |
183 } | |
184 | |
185 return false; | |
186 } | |
187 | |
188 /* Look for the closest match for NAME in the parameter table, returning it | |
189 if it is a reasonable suggestion for a misspelling. Return NULL | |
190 otherwise. */ | |
191 | |
192 const char * | |
193 find_param_fuzzy (const char *name) | |
194 { | |
195 best_match <const char *, const char *> bm (name); | |
196 for (size_t i = 0; i < num_compiler_params; ++i) | |
197 bm.consider (compiler_params[i].option); | |
198 return bm.get_best_meaningful_candidate (); | |
199 } | |
200 | |
201 /* Return true if param with entry index INDEX should be defined using strings. | |
202 If so, return the value corresponding to VALUE_NAME in *VALUE_P. */ | |
203 | |
204 bool | |
205 param_string_value_p (enum compiler_param index, const char *value_name, | |
206 int *value_p) | |
207 { | |
208 param_info *entry = &compiler_params[(int) index]; | |
209 if (entry->value_names == NULL) | |
210 return false; | |
211 | |
212 *value_p = -1; | |
213 | |
214 for (int i = 0; entry->value_names[i] != NULL; ++i) | |
215 if (strcmp (entry->value_names[i], value_name) == 0) | |
216 { | |
217 *value_p = i; | |
218 return true; | |
219 } | |
220 | |
221 return true; | |
222 } | |
223 | |
67
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
55
diff
changeset
|
224 /* Set the VALUE associated with the parameter given by NAME in PARAMS |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
55
diff
changeset
|
225 and PARAMS_SET. */ |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
55
diff
changeset
|
226 |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
55
diff
changeset
|
227 void |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
55
diff
changeset
|
228 set_param_value (const char *name, int value, |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
55
diff
changeset
|
229 int *params, int *params_set) |
0 | 230 { |
231 size_t i; | |
232 | |
233 /* Make sure nobody tries to set a parameter to an invalid value. */ | |
234 gcc_assert (value != INVALID_PARAM_VAL); | |
235 | |
111 | 236 enum compiler_param index; |
237 if (!find_param (name, &index)) | |
238 { | |
239 /* If we didn't find this parameter, issue an error message. */ | |
240 error ("invalid parameter %qs", name); | |
241 return; | |
242 } | |
243 i = (size_t)index; | |
0 | 244 |
131 | 245 if (validate_param (value, compiler_params[i], i)) |
111 | 246 set_param_value_internal ((compiler_param) i, value, |
247 params, params_set, true); | |
0 | 248 } |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
249 |
67
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
55
diff
changeset
|
250 /* Set the value of the parameter given by NUM to VALUE in PARAMS and |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
55
diff
changeset
|
251 PARAMS_SET, implicitly, if it has not been set explicitly by the |
131 | 252 user either via the commandline or configure. */ |
67
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
55
diff
changeset
|
253 |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
55
diff
changeset
|
254 void |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
55
diff
changeset
|
255 maybe_set_param_value (compiler_param num, int value, |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
55
diff
changeset
|
256 int *params, int *params_set) |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
55
diff
changeset
|
257 { |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
55
diff
changeset
|
258 if (!params_set[(int) num]) |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
55
diff
changeset
|
259 set_param_value_internal (num, value, params, params_set, false); |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
55
diff
changeset
|
260 } |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
55
diff
changeset
|
261 |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
55
diff
changeset
|
262 /* Set the default value of a parameter given by NUM to VALUE, before |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
55
diff
changeset
|
263 option processing. */ |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
55
diff
changeset
|
264 |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
55
diff
changeset
|
265 void |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
55
diff
changeset
|
266 set_default_param_value (compiler_param num, int value) |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
55
diff
changeset
|
267 { |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
55
diff
changeset
|
268 gcc_assert (!params_finished); |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
55
diff
changeset
|
269 |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
55
diff
changeset
|
270 compiler_params[(int) num].default_value = value; |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
55
diff
changeset
|
271 } |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
55
diff
changeset
|
272 |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
55
diff
changeset
|
273 /* Return the default value of parameter NUM. */ |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
55
diff
changeset
|
274 |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
55
diff
changeset
|
275 int |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
55
diff
changeset
|
276 default_param_value (compiler_param num) |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
55
diff
changeset
|
277 { |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
55
diff
changeset
|
278 return compiler_params[(int) num].default_value; |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
55
diff
changeset
|
279 } |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
55
diff
changeset
|
280 |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
55
diff
changeset
|
281 /* Initialize an array PARAMS with default values of the |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
55
diff
changeset
|
282 parameters. */ |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
55
diff
changeset
|
283 |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
55
diff
changeset
|
284 void |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
55
diff
changeset
|
285 init_param_values (int *params) |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
55
diff
changeset
|
286 { |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
55
diff
changeset
|
287 size_t i; |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
55
diff
changeset
|
288 |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
55
diff
changeset
|
289 gcc_assert (params_finished); |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
55
diff
changeset
|
290 |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
55
diff
changeset
|
291 for (i = 0; i < num_compiler_params; i++) |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
55
diff
changeset
|
292 params[i] = compiler_params[i].default_value; |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
55
diff
changeset
|
293 } |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
55
diff
changeset
|
294 |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
295 /* Return the current value of num_compiler_params, for the benefit of |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
296 plugins that use parameters as features. */ |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
297 |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
298 size_t |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
299 get_num_compiler_params (void) |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
300 { |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
301 return num_compiler_params; |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
302 } |