00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #include "config.h"
00023 #include "system.h"
00024 #include "toplev.h"
00025 #include "tree.h"
00026 #include "c-tree.h"
00027 #include "tree-inline.h"
00028 #include "rtl.h"
00029 #include "insn-config.h"
00030 #include "integrate.h"
00031 #include "flags.h"
00032 #include "langhooks.h"
00033 #include "langhooks-def.h"
00034
00035
00036
00037 void
00038 lhd_do_nothing ()
00039 {
00040 }
00041
00042
00043
00044 void
00045 lhd_do_nothing_t (t)
00046 tree t ATTRIBUTE_UNUSED;
00047 {
00048 }
00049
00050
00051
00052 void
00053 lhd_do_nothing_i (i)
00054 int i ATTRIBUTE_UNUSED;
00055 {
00056 }
00057
00058
00059
00060 void
00061 lhd_do_nothing_f (f)
00062 struct function *f ATTRIBUTE_UNUSED;
00063 {
00064 }
00065
00066
00067
00068 tree
00069 lhd_return_tree (t)
00070 tree t;
00071 {
00072 return t;
00073 }
00074
00075
00076
00077 tree
00078 lhd_return_null_tree (t)
00079 tree t ATTRIBUTE_UNUSED;
00080 {
00081 return NULL_TREE;
00082 }
00083
00084
00085
00086 int
00087 lhd_decode_option (argc, argv)
00088 int argc ATTRIBUTE_UNUSED;
00089 char **argv ATTRIBUTE_UNUSED;
00090 {
00091 return 0;
00092 }
00093
00094
00095
00096 void
00097 lhd_print_tree_nothing (file, node, indent)
00098 FILE *file ATTRIBUTE_UNUSED;
00099 tree node ATTRIBUTE_UNUSED;
00100 int indent ATTRIBUTE_UNUSED;
00101 {
00102 }
00103
00104
00105
00106 int
00107 lhd_safe_from_p (x, exp)
00108 rtx x ATTRIBUTE_UNUSED;
00109 tree exp ATTRIBUTE_UNUSED;
00110 {
00111 return 1;
00112 }
00113
00114
00115
00116 int
00117 lhd_unsafe_for_reeval (t)
00118 tree t ATTRIBUTE_UNUSED;
00119 {
00120 return -1;
00121 }
00122
00123
00124
00125 int
00126 lhd_staticp (exp)
00127 tree exp ATTRIBUTE_UNUSED;
00128 {
00129 return 0;
00130 }
00131
00132
00133
00134 bool
00135 lhd_warn_unused_global_decl (decl)
00136 tree decl;
00137 {
00138
00139
00140
00141 if (TREE_CODE (decl) == FUNCTION_DECL && DECL_INLINE (decl))
00142 return false;
00143 if (TREE_CODE (decl) == VAR_DECL && TREE_READONLY (decl))
00144 return false;
00145 if (DECL_IN_SYSTEM_HEADER (decl))
00146 return false;
00147
00148 return true;
00149 }
00150
00151
00152 void
00153 lhd_set_decl_assembler_name (decl)
00154 tree decl;
00155 {
00156
00157
00158
00159
00160 if (TREE_CODE (decl) == FUNCTION_DECL
00161 || (TREE_CODE (decl) == VAR_DECL
00162 && (TREE_STATIC (decl)
00163 || DECL_EXTERNAL (decl)
00164 || TREE_PUBLIC (decl))))
00165
00166
00167
00168
00169
00170 SET_DECL_ASSEMBLER_NAME (decl, DECL_NAME (decl));
00171 else
00172
00173
00174
00175 abort ();
00176 }
00177
00178
00179 bool
00180 lhd_can_use_bit_fields_p ()
00181 {
00182 return true;
00183 }
00184
00185
00186
00187 void
00188 lhd_clear_binding_stack ()
00189 {
00190 while (! (*lang_hooks.decls.global_bindings_p) ())
00191 poplevel (0, 0, 0);
00192 }
00193
00194
00195 tree
00196 lhd_type_promotes_to (type)
00197 tree type ATTRIBUTE_UNUSED;
00198 {
00199 abort ();
00200 }
00201
00202
00203 void
00204 lhd_incomplete_type_error (value, type)
00205 tree value ATTRIBUTE_UNUSED, type;
00206 {
00207 if (TREE_CODE (type) == ERROR_MARK)
00208 return;
00209
00210 abort ();
00211 }
00212
00213
00214
00215
00216 HOST_WIDE_INT
00217 lhd_get_alias_set (t)
00218 tree t ATTRIBUTE_UNUSED;
00219 {
00220 return -1;
00221 }
00222
00223
00224
00225
00226 HOST_WIDE_INT
00227 hook_get_alias_set_0 (t)
00228 tree t ATTRIBUTE_UNUSED;
00229 {
00230 return 0;
00231 }
00232
00233
00234
00235 rtx
00236 lhd_expand_expr (t, r, mm, em)
00237 tree t ATTRIBUTE_UNUSED;
00238 rtx r ATTRIBUTE_UNUSED;
00239 enum machine_mode mm ATTRIBUTE_UNUSED;
00240 int em ATTRIBUTE_UNUSED;
00241 {
00242 abort ();
00243 }
00244
00245
00246
00247 const char *
00248 lhd_decl_printable_name (decl, verbosity)
00249 tree decl;
00250 int verbosity ATTRIBUTE_UNUSED;
00251 {
00252 return IDENTIFIER_POINTER (DECL_NAME (decl));
00253 }
00254
00255
00256
00257
00258
00259
00260
00261
00262
00263
00264
00265
00266 tree
00267 lhd_tree_inlining_walk_subtrees (tp,subtrees,func,data,htab)
00268 tree *tp ATTRIBUTE_UNUSED;
00269 int *subtrees ATTRIBUTE_UNUSED;
00270 walk_tree_fn func ATTRIBUTE_UNUSED;
00271 void *data ATTRIBUTE_UNUSED;
00272 void *htab ATTRIBUTE_UNUSED;
00273 {
00274 return NULL_TREE;
00275 }
00276
00277
00278
00279
00280
00281 int
00282 lhd_tree_inlining_cannot_inline_tree_fn (fnp)
00283 tree *fnp;
00284 {
00285 if (flag_really_no_inline
00286 && lookup_attribute ("always_inline", DECL_ATTRIBUTES (*fnp)) == NULL)
00287 return 1;
00288
00289 return 0;
00290 }
00291
00292
00293
00294
00295
00296 int
00297 lhd_tree_inlining_disregard_inline_limits (fn)
00298 tree fn;
00299 {
00300 if (lookup_attribute ("always_inline", DECL_ATTRIBUTES (fn)) != NULL)
00301 return 1;
00302
00303 return 0;
00304 }
00305
00306
00307
00308
00309
00310
00311
00312
00313 tree
00314 lhd_tree_inlining_add_pending_fn_decls (vafnp, pfn)
00315 void *vafnp ATTRIBUTE_UNUSED;
00316 tree pfn;
00317 {
00318 return pfn;
00319 }
00320
00321
00322
00323
00324
00325 int
00326 lhd_tree_inlining_tree_chain_matters_p (t)
00327 tree t ATTRIBUTE_UNUSED;
00328 {
00329 return 0;
00330 }
00331
00332
00333
00334
00335 int
00336 lhd_tree_inlining_auto_var_in_fn_p (var, fn)
00337 tree var, fn;
00338 {
00339 return (DECL_P (var) && DECL_CONTEXT (var) == fn
00340 && (((TREE_CODE (var) == VAR_DECL || TREE_CODE (var) == PARM_DECL)
00341 && ! TREE_STATIC (var))
00342 || TREE_CODE (var) == LABEL_DECL
00343 || TREE_CODE (var) == RESULT_DECL));
00344 }
00345
00346
00347
00348
00349
00350
00351
00352
00353
00354
00355 tree
00356 lhd_tree_inlining_copy_res_decl_for_inlining (res, fn, caller,
00357 dm, ndp, texps)
00358 tree res, fn, caller;
00359 void *dm ATTRIBUTE_UNUSED;
00360 int *ndp ATTRIBUTE_UNUSED;
00361 void *texps ATTRIBUTE_UNUSED;
00362 {
00363 return copy_decl_for_inlining (res, fn, caller);
00364 }
00365
00366
00367
00368
00369
00370 int
00371 lhd_tree_inlining_anon_aggr_type_p (t)
00372 tree t ATTRIBUTE_UNUSED;
00373 {
00374 return 0;
00375 }
00376
00377
00378
00379
00380
00381
00382
00383
00384
00385 int
00386 lhd_tree_inlining_start_inlining (fn)
00387 tree fn ATTRIBUTE_UNUSED;
00388 {
00389 return 1;
00390 }
00391
00392 void
00393 lhd_tree_inlining_end_inlining (fn)
00394 tree fn ATTRIBUTE_UNUSED;
00395 {
00396 }
00397
00398
00399
00400
00401 tree
00402 lhd_tree_inlining_convert_parm_for_inlining (parm, value, fndecl)
00403 tree parm ATTRIBUTE_UNUSED;
00404 tree value;
00405 tree fndecl ATTRIBUTE_UNUSED;
00406 {
00407 return value;
00408 }
00409
00410
00411
00412
00413
00414 int
00415 lhd_tree_dump_dump_tree (di, t)
00416 void *di ATTRIBUTE_UNUSED;
00417 tree t ATTRIBUTE_UNUSED;
00418 {
00419 return 0;
00420 }
00421
00422
00423
00424
00425 int
00426 lhd_tree_dump_type_quals (t)
00427 tree t;
00428 {
00429 return TYPE_QUALS (t);
00430 }
00431
00432
00433
00434
00435 tree
00436 lhd_expr_size (exp)
00437 tree exp;
00438 {
00439 if (TREE_CODE_CLASS (TREE_CODE (exp)) == 'd'
00440 && DECL_SIZE_UNIT (exp) != 0)
00441 return DECL_SIZE_UNIT (exp);
00442 else
00443 return size_in_bytes (TREE_TYPE (exp));
00444 }
00445
00446
00447
00448
00449 bool
00450 lhd_decl_ok_for_sibcall (decl)
00451 tree decl ATTRIBUTE_UNUSED;
00452 {
00453 return true;
00454 }
00455
00456
00457
00458 void
00459 write_global_declarations ()
00460 {
00461
00462
00463
00464
00465 tree globals = (*lang_hooks.decls.getdecls) ();
00466 int len = list_length (globals);
00467 tree *vec = (tree *) xmalloc (sizeof (tree) * len);
00468 int i;
00469 tree decl;
00470
00471
00472
00473
00474 for (i = 0, decl = globals; i < len; i++, decl = TREE_CHAIN (decl))
00475 vec[len - i - 1] = decl;
00476
00477 wrapup_global_declarations (vec, len);
00478
00479 check_global_declarations (vec, len);
00480
00481
00482 free (vec);
00483 }