cgraph.h (symtab_node_base): Add next and previous pointers.
[gcc.git] / gcc / cgraph.h
1 /* Callgraph handling code.
2 Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011,
3 2012 Free Software Foundation, Inc.
4 Contributed by Jan Hubicka
5
6 This file is part of GCC.
7
8 GCC is free software; you can redistribute it and/or modify it under
9 the terms of the GNU General Public License as published by the Free
10 Software Foundation; either version 3, or (at your option) any later
11 version.
12
13 GCC is distributed in the hope that it will be useful, but WITHOUT ANY
14 WARRANTY; without even the implied warranty of MERCHANTABILITY or
15 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
16 for more details.
17
18 You should have received a copy of the GNU General Public License
19 along with GCC; see the file COPYING3. If not see
20 <http://www.gnu.org/licenses/>. */
21
22 #ifndef GCC_CGRAPH_H
23 #define GCC_CGRAPH_H
24
25 #include "plugin-api.h"
26 #include "vec.h"
27 #include "tree.h"
28 #include "basic-block.h"
29 #include "function.h"
30 #include "ipa-ref.h"
31
32 /* Symbol table consists of functions and variables.
33 TODO: add labels, constant pool and aliases. */
34 enum symtab_type
35 {
36 SYMTAB_SYMBOL,
37 SYMTAB_FUNCTION,
38 SYMTAB_VARIABLE
39 };
40
41 union symtab_node_def;
42 typedef union symtab_node_def *symtab_node;
43
44 /* Base of all entries in the symbol table.
45 The symtab_node is inherited by cgraph and varpol nodes. */
46 struct GTY(()) symtab_node_base
47 {
48 /* Type of the symbol. */
49 enum symtab_type type;
50 tree decl;
51 struct ipa_ref_list ref_list;
52 /* Circular list of nodes in the same comdat group if non-NULL. */
53 symtab_node same_comdat_group;
54 /* Ordering of all symtab entries. */
55 int order;
56 enum ld_plugin_symbol_resolution resolution;
57 /* File stream where this node is being written to. */
58 struct lto_file_decl_data * lto_file_data;
59
60 /* Linked list of symbol table entries starting with symtab_nodes. */
61 symtab_node next;
62 symtab_node previous;
63
64 PTR GTY ((skip)) aux;
65
66 /* Set when function has address taken.
67 In current implementation it imply needed flag. */
68 unsigned address_taken : 1;
69 /* Set when variable is used from other LTRANS partition. */
70 unsigned used_from_other_partition : 1;
71 /* Set when function is available in the other LTRANS partition.
72 During WPA output it is used to mark nodes that are present in
73 multiple partitions. */
74 unsigned in_other_partition : 1;
75 /* Set when function is visible by other units. */
76 unsigned externally_visible : 1;
77 };
78
79 enum availability
80 {
81 /* Not yet set by cgraph_function_body_availability. */
82 AVAIL_UNSET,
83 /* Function body/variable initializer is unknown. */
84 AVAIL_NOT_AVAILABLE,
85 /* Function body/variable initializer is known but might be replaced
86 by a different one from other compilation unit and thus needs to
87 be dealt with a care. Like AVAIL_NOT_AVAILABLE it can have
88 arbitrary side effects on escaping variables and functions, while
89 like AVAILABLE it might access static variables. */
90 AVAIL_OVERWRITABLE,
91 /* Function body/variable initializer is known and will be used in final
92 program. */
93 AVAIL_AVAILABLE,
94 /* Function body/variable initializer is known and all it's uses are explicitly
95 visible within current unit (ie it's address is never taken and it is not
96 exported to other units).
97 Currently used only for functions. */
98 AVAIL_LOCAL
99 };
100
101 /* This is the information that is put into the cgraph local structure
102 to recover a function. */
103 struct lto_file_decl_data;
104
105 extern const char * const cgraph_availability_names[];
106 extern const char * const ld_plugin_symbol_resolution_names[];
107
108 /* Information about thunk, used only for same body aliases. */
109
110 struct GTY(()) cgraph_thunk_info {
111 /* Information about the thunk. */
112 HOST_WIDE_INT fixed_offset;
113 HOST_WIDE_INT virtual_value;
114 tree alias;
115 bool this_adjusting;
116 bool virtual_offset_p;
117 /* Set to true when alias node is thunk. */
118 bool thunk_p;
119 };
120
121 /* Information about the function collected locally.
122 Available after function is analyzed. */
123
124 struct GTY(()) cgraph_local_info {
125 /* Set when function function is visible in current compilation unit only
126 and its address is never taken. */
127 unsigned local : 1;
128
129 /* Set once it has been finalized so we consider it to be output. */
130 unsigned finalized : 1;
131
132 /* False when there is something makes versioning impossible. */
133 unsigned versionable : 1;
134
135 /* False when function calling convention and signature can not be changed.
136 This is the case when __builtin_apply_args is used. */
137 unsigned can_change_signature : 1;
138
139 /* True when the function has been originally extern inline, but it is
140 redefined now. */
141 unsigned redefined_extern_inline : 1;
142
143 /* True if the function may enter serial irrevocable mode. */
144 unsigned tm_may_enter_irr : 1;
145 };
146
147 /* Information about the function that needs to be computed globally
148 once compilation is finished. Available only with -funit-at-a-time. */
149
150 struct GTY(()) cgraph_global_info {
151 /* For inline clones this points to the function they will be
152 inlined into. */
153 struct cgraph_node *inlined_to;
154 };
155
156 /* Information about the function that is propagated by the RTL backend.
157 Available only for functions that has been already assembled. */
158
159 struct GTY(()) cgraph_rtl_info {
160 unsigned int preferred_incoming_stack_boundary;
161 };
162
163 /* Represent which DECL tree (or reference to such tree)
164 will be replaced by another tree while versioning. */
165 struct GTY(()) ipa_replace_map
166 {
167 /* The tree that will be replaced. */
168 tree old_tree;
169 /* The new (replacing) tree. */
170 tree new_tree;
171 /* Parameter number to replace, when old_tree is NULL. */
172 int parm_num;
173 /* True when a substitution should be done, false otherwise. */
174 bool replace_p;
175 /* True when we replace a reference to old_tree. */
176 bool ref_p;
177 };
178 typedef struct ipa_replace_map *ipa_replace_map_p;
179 DEF_VEC_P(ipa_replace_map_p);
180 DEF_VEC_ALLOC_P(ipa_replace_map_p,gc);
181
182 struct GTY(()) cgraph_clone_info
183 {
184 VEC(ipa_replace_map_p,gc)* tree_map;
185 bitmap args_to_skip;
186 bitmap combined_args_to_skip;
187 };
188
189
190 /* The cgraph data structure.
191 Each function decl has assigned cgraph_node listing callees and callers. */
192
193 struct GTY(()) cgraph_node {
194 struct symtab_node_base symbol;
195 struct cgraph_edge *callees;
196 struct cgraph_edge *callers;
197 /* List of edges representing indirect calls with a yet undetermined
198 callee. */
199 struct cgraph_edge *indirect_calls;
200 /* For nested functions points to function the node is nested in. */
201 struct cgraph_node *
202 GTY ((nested_ptr (union symtab_node_def, "(struct cgraph_node *)(%h)", "(symtab_node)%h")))
203 origin;
204 /* Points to first nested function, if any. */
205 struct cgraph_node *
206 GTY ((nested_ptr (union symtab_node_def, "(struct cgraph_node *)(%h)", "(symtab_node)%h")))
207 nested;
208 /* Pointer to the next function with same origin, if any. */
209 struct cgraph_node *
210 GTY ((nested_ptr (union symtab_node_def, "(struct cgraph_node *)(%h)", "(symtab_node)%h")))
211 next_nested;
212 /* Pointer to the next function in cgraph_nodes_queue. */
213 struct cgraph_node *
214 GTY ((nested_ptr (union symtab_node_def, "(struct cgraph_node *)(%h)", "(symtab_node)%h")))
215 next_needed;
216 /* Pointer to the next clone. */
217 struct cgraph_node *next_sibling_clone;
218 struct cgraph_node *prev_sibling_clone;
219 struct cgraph_node *clones;
220 struct cgraph_node *clone_of;
221 /* For functions with many calls sites it holds map from call expression
222 to the edge to speed up cgraph_edge function. */
223 htab_t GTY((param_is (struct cgraph_edge))) call_site_hash;
224 /* Declaration node used to be clone of. */
225 tree former_clone_of;
226
227 /* Interprocedural passes scheduled to have their transform functions
228 applied next time we execute local pass on them. We maintain it
229 per-function in order to allow IPA passes to introduce new functions. */
230 VEC(ipa_opt_pass,heap) * GTY((skip)) ipa_transforms_to_apply;
231
232 struct cgraph_local_info local;
233 struct cgraph_global_info global;
234 struct cgraph_rtl_info rtl;
235 struct cgraph_clone_info clone;
236 struct cgraph_thunk_info thunk;
237
238 /* Expected number of executions: calculated in profile.c. */
239 gcov_type count;
240 /* How to scale counts at materialization time; used to merge
241 LTO units with different number of profile runs. */
242 int count_materialization_scale;
243 /* Unique id of the node. */
244 int uid;
245
246 /* Set when function must be output for some reason. The primary
247 use of this flag is to mark functions needed to be output for
248 non-standard reason. Functions that are externally visible
249 or reachable from functions needed to be output are marked
250 by specialized flags. */
251 unsigned needed : 1;
252 /* Set when decl is an abstract function pointed to by the
253 ABSTRACT_DECL_ORIGIN of a reachable function. */
254 unsigned abstract_and_needed : 1;
255 /* Set when function is reachable by call from other function
256 that is either reachable or needed.
257 This flag is computed at original cgraph construction and then
258 updated in cgraph_remove_unreachable_nodes. Note that after
259 cgraph_remove_unreachable_nodes cgraph still can contain unreachable
260 nodes when they are needed for virtual clone instantiation. */
261 unsigned reachable : 1;
262 /* Set once the function is lowered (i.e. its CFG is built). */
263 unsigned lowered : 1;
264 /* Set once the function has been instantiated and its callee
265 lists created. */
266 unsigned analyzed : 1;
267 /* Set when function is scheduled to be processed by local passes. */
268 unsigned process : 1;
269 /* Set for aliases once they got through assemble_alias. */
270 unsigned alias : 1;
271 /* Set for aliases created as C++ same body aliases. */
272 unsigned same_body_alias : 1;
273 /* How commonly executed the node is. Initialized during branch
274 probabilities pass. */
275 ENUM_BITFIELD (node_frequency) frequency : 2;
276 /* True when function can only be called at startup (from static ctor). */
277 unsigned only_called_at_startup : 1;
278 /* True when function can only be called at startup (from static dtor). */
279 unsigned only_called_at_exit : 1;
280 /* True when function is the transactional clone of a function which
281 is called only from inside transactions. */
282 /* ?? We should be able to remove this. We have enough bits in
283 cgraph to calculate it. */
284 unsigned tm_clone : 1;
285 };
286
287 typedef struct cgraph_node *cgraph_node_ptr;
288
289 DEF_VEC_P(cgraph_node_ptr);
290 DEF_VEC_ALLOC_P(cgraph_node_ptr,heap);
291 DEF_VEC_ALLOC_P(cgraph_node_ptr,gc);
292
293 /* A cgraph node set is a collection of cgraph nodes. A cgraph node
294 can appear in multiple sets. */
295 struct cgraph_node_set_def
296 {
297 struct pointer_map_t *map;
298 VEC(cgraph_node_ptr, heap) *nodes;
299 };
300
301 typedef struct varpool_node *varpool_node_ptr;
302
303 DEF_VEC_P(varpool_node_ptr);
304 DEF_VEC_ALLOC_P(varpool_node_ptr,heap);
305 DEF_VEC_ALLOC_P(varpool_node_ptr,gc);
306
307 /* A varpool node set is a collection of varpool nodes. A varpool node
308 can appear in multiple sets. */
309 struct varpool_node_set_def
310 {
311 struct pointer_map_t * map;
312 VEC(varpool_node_ptr, heap) *nodes;
313 };
314
315 typedef struct cgraph_node_set_def *cgraph_node_set;
316
317 DEF_VEC_P(cgraph_node_set);
318 DEF_VEC_ALLOC_P(cgraph_node_set,gc);
319 DEF_VEC_ALLOC_P(cgraph_node_set,heap);
320
321 typedef struct varpool_node_set_def *varpool_node_set;
322
323 DEF_VEC_P(varpool_node_set);
324 DEF_VEC_ALLOC_P(varpool_node_set,gc);
325 DEF_VEC_ALLOC_P(varpool_node_set,heap);
326
327 /* Iterator structure for cgraph node sets. */
328 typedef struct
329 {
330 cgraph_node_set set;
331 unsigned index;
332 } cgraph_node_set_iterator;
333
334 /* Iterator structure for varpool node sets. */
335 typedef struct
336 {
337 varpool_node_set set;
338 unsigned index;
339 } varpool_node_set_iterator;
340
341 #define DEFCIFCODE(code, string) CIF_ ## code,
342 /* Reasons for inlining failures. */
343 typedef enum cgraph_inline_failed_enum {
344 #include "cif-code.def"
345 CIF_N_REASONS
346 } cgraph_inline_failed_t;
347
348 /* Structure containing additional information about an indirect call. */
349
350 struct GTY(()) cgraph_indirect_call_info
351 {
352 /* Offset accumulated from ancestor jump functions of inlined call graph
353 edges. */
354 HOST_WIDE_INT anc_offset;
355 /* OBJ_TYPE_REF_TOKEN of a polymorphic call (if polymorphic is set). */
356 HOST_WIDE_INT otr_token;
357 /* Type of the object from OBJ_TYPE_REF_OBJECT. */
358 tree otr_type;
359 /* Index of the parameter that is called. */
360 int param_index;
361 /* ECF flags determined from the caller. */
362 int ecf_flags;
363
364 /* Set when the call is a virtual call with the parameter being the
365 associated object pointer rather than a simple direct call. */
366 unsigned polymorphic : 1;
367 };
368
369 struct GTY((chain_next ("%h.next_caller"), chain_prev ("%h.prev_caller"))) cgraph_edge {
370 /* Expected number of executions: calculated in profile.c. */
371 gcov_type count;
372 struct cgraph_node *caller;
373 struct cgraph_node *callee;
374 struct cgraph_edge *prev_caller;
375 struct cgraph_edge *next_caller;
376 struct cgraph_edge *prev_callee;
377 struct cgraph_edge *next_callee;
378 gimple call_stmt;
379 /* Additional information about an indirect call. Not cleared when an edge
380 becomes direct. */
381 struct cgraph_indirect_call_info *indirect_info;
382 PTR GTY ((skip (""))) aux;
383 /* When equal to CIF_OK, inline this call. Otherwise, points to the
384 explanation why function was not inlined. */
385 cgraph_inline_failed_t inline_failed;
386 /* The stmt_uid of call_stmt. This is used by LTO to recover the call_stmt
387 when the function is serialized in. */
388 unsigned int lto_stmt_uid;
389 /* Expected frequency of executions within the function.
390 When set to CGRAPH_FREQ_BASE, the edge is expected to be called once
391 per function call. The range is 0 to CGRAPH_FREQ_MAX. */
392 int frequency;
393 /* Unique id of the edge. */
394 int uid;
395 /* Whether this edge was made direct by indirect inlining. */
396 unsigned int indirect_inlining_edge : 1;
397 /* Whether this edge describes an indirect call with an undetermined
398 callee. */
399 unsigned int indirect_unknown_callee : 1;
400 /* Whether this edge is still a dangling */
401 /* True if the corresponding CALL stmt cannot be inlined. */
402 unsigned int call_stmt_cannot_inline_p : 1;
403 /* Can this call throw externally? */
404 unsigned int can_throw_external : 1;
405 };
406
407 #define CGRAPH_FREQ_BASE 1000
408 #define CGRAPH_FREQ_MAX 100000
409
410 typedef struct cgraph_edge *cgraph_edge_p;
411
412 DEF_VEC_P(cgraph_edge_p);
413 DEF_VEC_ALLOC_P(cgraph_edge_p,heap);
414
415 /* The varpool data structure.
416 Each static variable decl has assigned varpool_node. */
417
418 struct GTY(()) varpool_node {
419 struct symtab_node_base symbol;
420 /* For aliases points to declaration DECL is alias of. */
421 tree alias_of;
422 /* Pointer to the next function in varpool_nodes_queue. */
423 struct varpool_node *
424 GTY ((nested_ptr (union symtab_node_def, "(struct varpool_node *)(%h)", "(symtab_node)%h")))
425 next_needed;
426 struct varpool_node *
427 GTY ((nested_ptr (union symtab_node_def, "(struct varpool_node *)(%h)", "(symtab_node)%h")))
428 prev_needed;
429
430 /* Set when function must be output - it is externally visible
431 or its address is taken. */
432 unsigned needed : 1;
433 /* Needed variables might become dead by optimization. This flag
434 forces the variable to be output even if it appears dead otherwise. */
435 unsigned force_output : 1;
436 /* Set once the variable has been instantiated and its callee
437 lists created. */
438 unsigned analyzed : 1;
439 /* Set once it has been finalized so we consider it to be output. */
440 unsigned finalized : 1;
441 /* Set when variable is scheduled to be assembled. */
442 unsigned output : 1;
443 /* Set for aliases once they got through assemble_alias. Also set for
444 extra name aliases in varpool_extra_name_alias. */
445 unsigned alias : 1;
446 unsigned extra_name_alias : 1;
447 };
448
449 /* Every top level asm statement is put into a cgraph_asm_node. */
450
451 struct GTY(()) cgraph_asm_node {
452 /* Next asm node. */
453 struct cgraph_asm_node *next;
454 /* String for this asm node. */
455 tree asm_str;
456 /* Ordering of all cgraph nodes. */
457 int order;
458 };
459
460 /* Symbol table entry. */
461 union GTY((desc ("%h.symbol.type"), chain_next ("%h.symbol.next"),
462 chain_prev ("%h.symbol.previous"))) symtab_node_def {
463 struct symtab_node_base GTY ((tag ("SYMTAB_SYMBOL"))) symbol;
464 /* Use cgraph (symbol) accessor to get cgraph_node. */
465 struct cgraph_node GTY ((tag ("SYMTAB_FUNCTION"))) x_function;
466 /* Use varpool (symbol) accessor to get varpool_node. */
467 struct varpool_node GTY ((tag ("SYMTAB_VARIABLE"))) x_variable;
468 };
469
470 extern GTY(()) symtab_node symtab_nodes;
471 extern GTY(()) int cgraph_n_nodes;
472 extern GTY(()) int cgraph_max_uid;
473 extern GTY(()) int cgraph_edge_max_uid;
474 extern bool cgraph_global_info_ready;
475 enum cgraph_state
476 {
477 /* Callgraph is being constructed. It is safe to add new functions. */
478 CGRAPH_STATE_CONSTRUCTION,
479 /* Callgraph is built and IPA passes are being run. */
480 CGRAPH_STATE_IPA,
481 /* Callgraph is built and all functions are transformed to SSA form. */
482 CGRAPH_STATE_IPA_SSA,
483 /* Functions are now ordered and being passed to RTL expanders. */
484 CGRAPH_STATE_EXPANSION,
485 /* All cgraph expansion is done. */
486 CGRAPH_STATE_FINISHED
487 };
488 extern enum cgraph_state cgraph_state;
489 extern bool cgraph_function_flags_ready;
490 extern GTY(()) symtab_node x_cgraph_nodes_queue;
491 #define cgraph_nodes_queue ((struct cgraph_node *)x_cgraph_nodes_queue)
492 extern GTY(()) struct cgraph_node *cgraph_new_nodes;
493
494 extern GTY(()) struct cgraph_asm_node *cgraph_asm_nodes;
495 extern GTY(()) int symtab_order;
496 extern bool same_body_aliases_done;
497
498 /* In symtab.c */
499 void symtab_register_node (symtab_node);
500 void symtab_unregister_node (symtab_node);
501 void symtab_remove_node (symtab_node);
502
503 /* In cgraph.c */
504 void dump_cgraph (FILE *);
505 void debug_cgraph (void);
506 void dump_cgraph_node (FILE *, struct cgraph_node *);
507 void debug_cgraph_node (struct cgraph_node *);
508 void cgraph_insert_node_to_hashtable (struct cgraph_node *node);
509 void cgraph_remove_edge (struct cgraph_edge *);
510 void cgraph_remove_node (struct cgraph_node *);
511 void cgraph_add_to_same_comdat_group (struct cgraph_node *, struct cgraph_node *);
512 bool cgraph_remove_node_and_inline_clones (struct cgraph_node *, struct cgraph_node *);
513 void cgraph_release_function_body (struct cgraph_node *);
514 void cgraph_node_remove_callees (struct cgraph_node *node);
515 struct cgraph_edge *cgraph_create_edge (struct cgraph_node *,
516 struct cgraph_node *,
517 gimple, gcov_type, int);
518 struct cgraph_edge *cgraph_create_indirect_edge (struct cgraph_node *, gimple,
519 int, gcov_type, int);
520 struct cgraph_indirect_call_info *cgraph_allocate_init_indirect_info (void);
521 struct cgraph_node * cgraph_get_node (const_tree);
522 struct cgraph_node * cgraph_create_node (tree);
523 struct cgraph_node * cgraph_get_create_node (tree);
524 struct cgraph_node * cgraph_same_body_alias (struct cgraph_node *, tree, tree);
525 struct cgraph_node * cgraph_add_thunk (struct cgraph_node *, tree, tree, bool, HOST_WIDE_INT,
526 HOST_WIDE_INT, tree, tree);
527 struct cgraph_node *cgraph_node_for_asm (tree);
528 struct cgraph_edge *cgraph_edge (struct cgraph_node *, gimple);
529 void cgraph_set_call_stmt (struct cgraph_edge *, gimple);
530 void cgraph_set_call_stmt_including_clones (struct cgraph_node *, gimple, gimple);
531 void cgraph_create_edge_including_clones (struct cgraph_node *,
532 struct cgraph_node *,
533 gimple, gimple, gcov_type, int,
534 cgraph_inline_failed_t);
535 void cgraph_update_edges_for_call_stmt (gimple, tree, gimple);
536 struct cgraph_local_info *cgraph_local_info (tree);
537 struct cgraph_global_info *cgraph_global_info (tree);
538 struct cgraph_rtl_info *cgraph_rtl_info (tree);
539 const char * cgraph_node_name (struct cgraph_node *);
540 struct cgraph_edge * cgraph_clone_edge (struct cgraph_edge *,
541 struct cgraph_node *, gimple,
542 unsigned, gcov_type, int, bool);
543 struct cgraph_node * cgraph_clone_node (struct cgraph_node *, tree, gcov_type,
544 int, bool, VEC(cgraph_edge_p,heap) *,
545 bool);
546 struct cgraph_node *cgraph_create_function_alias (tree, tree);
547 void cgraph_call_node_duplication_hooks (struct cgraph_node *node1,
548 struct cgraph_node *node2);
549
550 void cgraph_redirect_edge_callee (struct cgraph_edge *, struct cgraph_node *);
551 void cgraph_make_edge_direct (struct cgraph_edge *, struct cgraph_node *);
552 bool cgraph_only_called_directly_p (struct cgraph_node *);
553
554 struct cgraph_asm_node *cgraph_add_asm_node (tree);
555
556 bool cgraph_function_possibly_inlined_p (tree);
557 void cgraph_unnest_node (struct cgraph_node *);
558
559 enum availability cgraph_function_body_availability (struct cgraph_node *);
560 void cgraph_add_new_function (tree, bool);
561 const char* cgraph_inline_failed_string (cgraph_inline_failed_t);
562 struct cgraph_node * cgraph_create_virtual_clone (struct cgraph_node *old_node,
563 VEC(cgraph_edge_p,heap)*,
564 VEC(ipa_replace_map_p,gc)* tree_map,
565 bitmap args_to_skip,
566 const char *clone_name);
567
568 void cgraph_set_nothrow_flag (struct cgraph_node *, bool);
569 void cgraph_set_const_flag (struct cgraph_node *, bool, bool);
570 void cgraph_set_pure_flag (struct cgraph_node *, bool, bool);
571 tree clone_function_name (tree decl, const char *);
572 bool cgraph_node_cannot_return (struct cgraph_node *);
573 bool cgraph_edge_cannot_lead_to_return (struct cgraph_edge *);
574 bool cgraph_will_be_removed_from_program_if_no_direct_calls
575 (struct cgraph_node *node);
576 bool cgraph_can_remove_if_no_direct_calls_and_refs_p
577 (struct cgraph_node *node);
578 bool cgraph_can_remove_if_no_direct_calls_p (struct cgraph_node *node);
579 bool resolution_used_from_other_file_p (enum ld_plugin_symbol_resolution);
580 bool cgraph_used_from_object_file_p (struct cgraph_node *);
581 bool varpool_used_from_object_file_p (struct varpool_node *);
582 bool cgraph_for_node_thunks_and_aliases (struct cgraph_node *,
583 bool (*) (struct cgraph_node *, void *),
584 void *,
585 bool);
586 bool cgraph_for_node_and_aliases (struct cgraph_node *,
587 bool (*) (struct cgraph_node *, void *),
588 void *, bool);
589 VEC (cgraph_edge_p, heap) * collect_callers_of_node (struct cgraph_node *node);
590
591
592 /* In cgraphunit.c */
593 extern FILE *cgraph_dump_file;
594 void cgraph_finalize_function (tree, bool);
595 void cgraph_mark_if_needed (tree);
596 void cgraph_analyze_function (struct cgraph_node *);
597 void cgraph_finalize_compilation_unit (void);
598 void cgraph_optimize (void);
599 void cgraph_mark_needed_node (struct cgraph_node *);
600 void cgraph_mark_address_taken_node (struct cgraph_node *);
601 void cgraph_mark_reachable_node (struct cgraph_node *);
602 bool cgraph_inline_p (struct cgraph_edge *, cgraph_inline_failed_t *reason);
603 bool cgraph_preserve_function_body_p (struct cgraph_node *);
604 void verify_cgraph (void);
605 void verify_cgraph_node (struct cgraph_node *);
606 void cgraph_build_static_cdtor (char which, tree body, int priority);
607 void cgraph_reset_static_var_maps (void);
608 void init_cgraph (void);
609 struct cgraph_node * cgraph_copy_node_for_versioning (struct cgraph_node *,
610 tree, VEC(cgraph_edge_p,heap)*, bitmap);
611 struct cgraph_node *cgraph_function_versioning (struct cgraph_node *,
612 VEC(cgraph_edge_p,heap)*,
613 VEC(ipa_replace_map_p,gc)*,
614 bitmap, bool, bitmap,
615 basic_block, const char *);
616 void tree_function_versioning (tree, tree, VEC (ipa_replace_map_p,gc)*,
617 bool, bitmap, bool, bitmap, basic_block);
618 void record_references_in_initializer (tree, bool);
619 bool cgraph_process_new_functions (void);
620 void cgraph_process_same_body_aliases (void);
621
622 bool cgraph_decide_is_function_needed (struct cgraph_node *, tree);
623
624 typedef void (*cgraph_edge_hook)(struct cgraph_edge *, void *);
625 typedef void (*cgraph_node_hook)(struct cgraph_node *, void *);
626 typedef void (*cgraph_2edge_hook)(struct cgraph_edge *, struct cgraph_edge *,
627 void *);
628 typedef void (*cgraph_2node_hook)(struct cgraph_node *, struct cgraph_node *,
629 void *);
630 struct cgraph_edge_hook_list;
631 struct cgraph_node_hook_list;
632 struct cgraph_2edge_hook_list;
633 struct cgraph_2node_hook_list;
634 struct cgraph_edge_hook_list *cgraph_add_edge_removal_hook (cgraph_edge_hook, void *);
635 void cgraph_remove_edge_removal_hook (struct cgraph_edge_hook_list *);
636 struct cgraph_node_hook_list *cgraph_add_node_removal_hook (cgraph_node_hook,
637 void *);
638 void cgraph_remove_node_removal_hook (struct cgraph_node_hook_list *);
639 struct cgraph_node_hook_list *cgraph_add_function_insertion_hook (cgraph_node_hook,
640 void *);
641 void cgraph_remove_function_insertion_hook (struct cgraph_node_hook_list *);
642 void cgraph_call_function_insertion_hooks (struct cgraph_node *node);
643 struct cgraph_2edge_hook_list *cgraph_add_edge_duplication_hook (cgraph_2edge_hook, void *);
644 void cgraph_remove_edge_duplication_hook (struct cgraph_2edge_hook_list *);
645 struct cgraph_2node_hook_list *cgraph_add_node_duplication_hook (cgraph_2node_hook, void *);
646 void cgraph_remove_node_duplication_hook (struct cgraph_2node_hook_list *);
647 gimple cgraph_redirect_edge_call_stmt_to_callee (struct cgraph_edge *);
648 bool cgraph_propagate_frequency (struct cgraph_node *node);
649 /* In cgraphbuild.c */
650 unsigned int rebuild_cgraph_edges (void);
651 void cgraph_rebuild_references (void);
652 int compute_call_stmt_bb_frequency (tree, basic_block bb);
653
654 /* In ipa.c */
655 bool cgraph_remove_unreachable_nodes (bool, FILE *);
656 cgraph_node_set cgraph_node_set_new (void);
657 cgraph_node_set_iterator cgraph_node_set_find (cgraph_node_set,
658 struct cgraph_node *);
659 void cgraph_node_set_add (cgraph_node_set, struct cgraph_node *);
660 void cgraph_node_set_remove (cgraph_node_set, struct cgraph_node *);
661 void dump_cgraph_node_set (FILE *, cgraph_node_set);
662 void debug_cgraph_node_set (cgraph_node_set);
663 void free_cgraph_node_set (cgraph_node_set);
664
665 varpool_node_set varpool_node_set_new (void);
666 varpool_node_set_iterator varpool_node_set_find (varpool_node_set,
667 struct varpool_node *);
668 void varpool_node_set_add (varpool_node_set, struct varpool_node *);
669 void varpool_node_set_remove (varpool_node_set, struct varpool_node *);
670 void dump_varpool_node_set (FILE *, varpool_node_set);
671 void debug_varpool_node_set (varpool_node_set);
672 void free_varpool_node_set (varpool_node_set);
673 void ipa_discover_readonly_nonaddressable_vars (void);
674 bool cgraph_comdat_can_be_unshared_p (struct cgraph_node *);
675 bool varpool_externally_visible_p (struct varpool_node *, bool);
676
677 /* In predict.c */
678 bool cgraph_maybe_hot_edge_p (struct cgraph_edge *e);
679 bool cgraph_optimize_for_size_p (struct cgraph_node *);
680
681 /* In varpool.c */
682 extern GTY(()) symtab_node x_varpool_nodes_queue;
683 #define varpool_nodes_queue ((struct varpool_node *)x_varpool_nodes_queue)
684
685 struct varpool_node *varpool_node (tree);
686 struct varpool_node *varpool_node_for_asm (tree asmname);
687 void varpool_mark_needed_node (struct varpool_node *);
688 void debug_varpool (void);
689 void dump_varpool (FILE *);
690 void dump_varpool_node (FILE *, struct varpool_node *);
691
692 void varpool_finalize_decl (tree);
693 bool decide_is_variable_needed (struct varpool_node *, tree);
694 enum availability cgraph_variable_initializer_availability (struct varpool_node *);
695 void cgraph_make_decl_local (tree);
696 void cgraph_make_node_local (struct cgraph_node *);
697 bool cgraph_node_can_be_local_p (struct cgraph_node *);
698
699
700 struct varpool_node * varpool_get_node (const_tree decl);
701 void varpool_remove_node (struct varpool_node *node);
702 void varpool_finalize_named_section_flags (struct varpool_node *node);
703 bool varpool_assemble_pending_decls (void);
704 bool varpool_assemble_decl (struct varpool_node *node);
705 bool varpool_analyze_pending_decls (void);
706 void varpool_remove_unreferenced_decls (void);
707 void varpool_empty_needed_queue (void);
708 struct varpool_node * varpool_extra_name_alias (tree, tree);
709 struct varpool_node * varpool_create_variable_alias (tree, tree);
710 const char * varpool_node_name (struct varpool_node *node);
711 void varpool_reset_queue (void);
712 bool const_value_known_p (tree);
713 bool varpool_for_node_and_aliases (struct varpool_node *,
714 bool (*) (struct varpool_node *, void *),
715 void *, bool);
716 void varpool_add_new_variable (tree);
717
718 /* Return true when NODE is function. */
719 static inline bool
720 symtab_function_p (symtab_node node)
721 {
722 return node->symbol.type == SYMTAB_FUNCTION;
723 }
724
725 /* Return true when NODE is variable. */
726 static inline bool
727 symtab_variable_p (symtab_node node)
728 {
729 return node->symbol.type == SYMTAB_VARIABLE;
730 }
731
732 /* Return callgraph node for given symbol and check it is a function. */
733 static inline struct cgraph_node *
734 cgraph (symtab_node node)
735 {
736 gcc_checking_assert (!node || node->symbol.type == SYMTAB_FUNCTION);
737 return &node->x_function;
738 }
739
740 /* Return varpool node for given symbol and check it is a variable. */
741 static inline struct varpool_node *
742 varpool (symtab_node node)
743 {
744 gcc_checking_assert (!node || node->symbol.type == SYMTAB_VARIABLE);
745 return &node->x_variable;
746 }
747
748
749 /* Return first reachable static variable with initializer. */
750 static inline struct varpool_node *
751 varpool_first_static_initializer (void)
752 {
753 struct varpool_node *node;
754 for (node = varpool_nodes_queue; node; node = node->next_needed)
755 {
756 gcc_checking_assert (TREE_CODE (node->symbol.decl) == VAR_DECL);
757 if (DECL_INITIAL (node->symbol.decl))
758 return node;
759 }
760 return NULL;
761 }
762
763 /* Return next reachable static variable with initializer after NODE. */
764 static inline struct varpool_node *
765 varpool_next_static_initializer (struct varpool_node *node)
766 {
767 for (node = node->next_needed; node; node = node->next_needed)
768 {
769 gcc_checking_assert (TREE_CODE (node->symbol.decl) == VAR_DECL);
770 if (DECL_INITIAL (node->symbol.decl))
771 return node;
772 }
773 return NULL;
774 }
775
776 /* Walk all reachable static variables. */
777 #define FOR_EACH_STATIC_VARIABLE(node) \
778 for ((node) = varpool_nodes_queue; (node); (node) = (node)->next_needed)
779 /* Walk all static variables with initializer set. */
780 #define FOR_EACH_STATIC_INITIALIZER(node) \
781 for ((node) = varpool_first_static_initializer (); (node); \
782 (node) = varpool_next_static_initializer (node))
783
784 /* Return first variable. */
785 static inline struct varpool_node *
786 varpool_first_variable (void)
787 {
788 symtab_node node;
789 for (node = symtab_nodes; node; node = node->symbol.next)
790 {
791 if (symtab_variable_p (node))
792 return varpool (node);
793 }
794 return NULL;
795 }
796
797 /* Return next variable after NODE. */
798 static inline struct varpool_node *
799 varpool_next_variable (struct varpool_node *node)
800 {
801 symtab_node node1 = (symtab_node) node->symbol.next;
802 for (; node1; node1 = node1->symbol.next)
803 {
804 if (symtab_variable_p (node1))
805 return varpool (node1);
806 }
807 return NULL;
808 }
809 /* Walk all variables. */
810 #define FOR_EACH_VARIABLE(node) \
811 for ((node) = varpool_first_variable (); \
812 (node); \
813 (node) = varpool_next_variable ((node)))
814 /* Walk all variables with definitions in current unit. */
815 #define FOR_EACH_DEFINED_VARIABLE(node) \
816 for ((node) = varpool_nodes_queue; (node); (node) = (node)->next_needed)
817
818 /* Return first function with body defined. */
819 static inline struct cgraph_node *
820 cgraph_first_defined_function (void)
821 {
822 symtab_node node;
823 for (node = symtab_nodes; node; node = node->symbol.next)
824 {
825 if (symtab_function_p (node) && cgraph (node)->analyzed)
826 return cgraph (node);
827 }
828 return NULL;
829 }
830
831 /* Return next function with body defined after NODE. */
832 static inline struct cgraph_node *
833 cgraph_next_defined_function (struct cgraph_node *node)
834 {
835 symtab_node node1 = (symtab_node) node->symbol.next;
836 for (; node1; node1 = node1->symbol.next)
837 {
838 if (symtab_function_p (node1) && cgraph (node1)->analyzed)
839 return cgraph (node1);
840 }
841 return NULL;
842 }
843
844 /* Walk all functions with body defined. */
845 #define FOR_EACH_DEFINED_FUNCTION(node) \
846 for ((node) = cgraph_first_defined_function (); (node); \
847 (node) = cgraph_next_defined_function ((node)))
848
849 /* Return first function. */
850 static inline struct cgraph_node *
851 cgraph_first_function (void)
852 {
853 symtab_node node;
854 for (node = symtab_nodes; node; node = node->symbol.next)
855 {
856 if (symtab_function_p (node))
857 return cgraph (node);
858 }
859 return NULL;
860 }
861
862 /* Return next function. */
863 static inline struct cgraph_node *
864 cgraph_next_function (struct cgraph_node *node)
865 {
866 symtab_node node1 = (symtab_node) node->symbol.next;
867 for (; node1; node1 = node1->symbol.next)
868 {
869 if (symtab_function_p (node1))
870 return cgraph (node1);
871 }
872 return NULL;
873 }
874 /* Walk all functions. */
875 #define FOR_EACH_FUNCTION(node) \
876 for ((node) = cgraph_first_function (); (node); \
877 (node) = cgraph_next_function ((node)))
878
879 /* Return true when NODE is a function with Gimple body defined
880 in current unit. Functions can also be define externally or they
881 can be thunks with no Gimple representation.
882
883 Note that at WPA stage, the function body may not be present in memory. */
884
885 static inline bool
886 cgraph_function_with_gimple_body_p (struct cgraph_node *node)
887 {
888 return node->analyzed && !node->thunk.thunk_p && !node->alias;
889 }
890
891 /* Return first function with body defined. */
892 static inline struct cgraph_node *
893 cgraph_first_function_with_gimple_body (void)
894 {
895 symtab_node node;
896 for (node = symtab_nodes; node; node = node->symbol.next)
897 {
898 if (symtab_function_p (node)
899 && cgraph_function_with_gimple_body_p (cgraph (node)))
900 return cgraph (node);
901 }
902 return NULL;
903 }
904
905 /* Return next reachable static variable with initializer after NODE. */
906 static inline struct cgraph_node *
907 cgraph_next_function_with_gimple_body (struct cgraph_node *node)
908 {
909 symtab_node node1 = node->symbol.next;
910 for (; node1; node1 = node1->symbol.next)
911 {
912 if (symtab_function_p (node1)
913 && cgraph_function_with_gimple_body_p (cgraph (node1)))
914 return cgraph (node1);
915 }
916 return NULL;
917 }
918
919 /* Walk all functions with body defined. */
920 #define FOR_EACH_FUNCTION_WITH_GIMPLE_BODY(node) \
921 for ((node) = cgraph_first_function_with_gimple_body (); (node); \
922 (node) = cgraph_next_function_with_gimple_body (node))
923
924 /* Create a new static variable of type TYPE. */
925 tree add_new_static_var (tree type);
926
927 /* Return true if iterator CSI points to nothing. */
928 static inline bool
929 csi_end_p (cgraph_node_set_iterator csi)
930 {
931 return csi.index >= VEC_length (cgraph_node_ptr, csi.set->nodes);
932 }
933
934 /* Advance iterator CSI. */
935 static inline void
936 csi_next (cgraph_node_set_iterator *csi)
937 {
938 csi->index++;
939 }
940
941 /* Return the node pointed to by CSI. */
942 static inline struct cgraph_node *
943 csi_node (cgraph_node_set_iterator csi)
944 {
945 return VEC_index (cgraph_node_ptr, csi.set->nodes, csi.index);
946 }
947
948 /* Return an iterator to the first node in SET. */
949 static inline cgraph_node_set_iterator
950 csi_start (cgraph_node_set set)
951 {
952 cgraph_node_set_iterator csi;
953
954 csi.set = set;
955 csi.index = 0;
956 return csi;
957 }
958
959 /* Return true if SET contains NODE. */
960 static inline bool
961 cgraph_node_in_set_p (struct cgraph_node *node, cgraph_node_set set)
962 {
963 cgraph_node_set_iterator csi;
964 csi = cgraph_node_set_find (set, node);
965 return !csi_end_p (csi);
966 }
967
968 /* Return number of nodes in SET. */
969 static inline size_t
970 cgraph_node_set_size (cgraph_node_set set)
971 {
972 return VEC_length (cgraph_node_ptr, set->nodes);
973 }
974
975 /* Return true if iterator VSI points to nothing. */
976 static inline bool
977 vsi_end_p (varpool_node_set_iterator vsi)
978 {
979 return vsi.index >= VEC_length (varpool_node_ptr, vsi.set->nodes);
980 }
981
982 /* Advance iterator VSI. */
983 static inline void
984 vsi_next (varpool_node_set_iterator *vsi)
985 {
986 vsi->index++;
987 }
988
989 /* Return the node pointed to by VSI. */
990 static inline struct varpool_node *
991 vsi_node (varpool_node_set_iterator vsi)
992 {
993 return VEC_index (varpool_node_ptr, vsi.set->nodes, vsi.index);
994 }
995
996 /* Return an iterator to the first node in SET. */
997 static inline varpool_node_set_iterator
998 vsi_start (varpool_node_set set)
999 {
1000 varpool_node_set_iterator vsi;
1001
1002 vsi.set = set;
1003 vsi.index = 0;
1004 return vsi;
1005 }
1006
1007 /* Return true if SET contains NODE. */
1008 static inline bool
1009 varpool_node_in_set_p (struct varpool_node *node, varpool_node_set set)
1010 {
1011 varpool_node_set_iterator vsi;
1012 vsi = varpool_node_set_find (set, node);
1013 return !vsi_end_p (vsi);
1014 }
1015
1016 /* Return number of nodes in SET. */
1017 static inline size_t
1018 varpool_node_set_size (varpool_node_set set)
1019 {
1020 return VEC_length (varpool_node_ptr, set->nodes);
1021 }
1022
1023 /* Uniquize all constants that appear in memory.
1024 Each constant in memory thus far output is recorded
1025 in `const_desc_table'. */
1026
1027 struct GTY(()) constant_descriptor_tree {
1028 /* A MEM for the constant. */
1029 rtx rtl;
1030
1031 /* The value of the constant. */
1032 tree value;
1033
1034 /* Hash of value. Computing the hash from value each time
1035 hashfn is called can't work properly, as that means recursive
1036 use of the hash table during hash table expansion. */
1037 hashval_t hash;
1038 };
1039
1040 /* Return true if set is nonempty. */
1041 static inline bool
1042 cgraph_node_set_nonempty_p (cgraph_node_set set)
1043 {
1044 return !VEC_empty (cgraph_node_ptr, set->nodes);
1045 }
1046
1047 /* Return true if set is nonempty. */
1048 static inline bool
1049 varpool_node_set_nonempty_p (varpool_node_set set)
1050 {
1051 return !VEC_empty (varpool_node_ptr, set->nodes);
1052 }
1053
1054 /* Return true when function NODE is only called directly or it has alias.
1055 i.e. it is not externally visible, address was not taken and
1056 it is not used in any other non-standard way. */
1057
1058 static inline bool
1059 cgraph_only_called_directly_or_aliased_p (struct cgraph_node *node)
1060 {
1061 gcc_assert (!node->global.inlined_to);
1062 return (!node->needed && !node->symbol.address_taken
1063 && !node->symbol.used_from_other_partition
1064 && !DECL_STATIC_CONSTRUCTOR (node->symbol.decl)
1065 && !DECL_STATIC_DESTRUCTOR (node->symbol.decl)
1066 && !node->symbol.externally_visible);
1067 }
1068
1069 /* Return true when function NODE can be removed from callgraph
1070 if all direct calls are eliminated. */
1071
1072 static inline bool
1073 varpool_can_remove_if_no_refs (struct varpool_node *node)
1074 {
1075 return (!node->force_output && !node->symbol.used_from_other_partition
1076 && (DECL_COMDAT (node->symbol.decl)
1077 || !node->symbol.externally_visible));
1078 }
1079
1080 /* Return true when all references to VNODE must be visible in ipa_ref_list.
1081 i.e. if the variable is not externally visible or not used in some magic
1082 way (asm statement or such).
1083 The magic uses are all summarized in force_output flag. */
1084
1085 static inline bool
1086 varpool_all_refs_explicit_p (struct varpool_node *vnode)
1087 {
1088 return (vnode->analyzed
1089 && !vnode->symbol.externally_visible
1090 && !vnode->symbol.used_from_other_partition
1091 && !vnode->force_output);
1092 }
1093
1094 /* Constant pool accessor function. */
1095 htab_t constant_pool_htab (void);
1096
1097 /* FIXME: inappropriate dependency of cgraph on IPA. */
1098 #include "ipa-ref-inline.h"
1099
1100 /* Return node that alias N is aliasing. */
1101
1102 static inline struct cgraph_node *
1103 cgraph_alias_aliased_node (struct cgraph_node *n)
1104 {
1105 struct ipa_ref *ref;
1106
1107 ipa_ref_list_reference_iterate (&n->symbol.ref_list, 0, ref);
1108 gcc_checking_assert (ref->use == IPA_REF_ALIAS);
1109 if (ref->refered_type == IPA_REF_CGRAPH)
1110 return ipa_ref_node (ref);
1111 return NULL;
1112 }
1113
1114 /* Return node that alias N is aliasing. */
1115
1116 static inline struct varpool_node *
1117 varpool_alias_aliased_node (struct varpool_node *n)
1118 {
1119 struct ipa_ref *ref;
1120
1121 ipa_ref_list_reference_iterate (&n->symbol.ref_list, 0, ref);
1122 gcc_checking_assert (ref->use == IPA_REF_ALIAS);
1123 if (ref->refered_type == IPA_REF_VARPOOL)
1124 return ipa_ref_varpool_node (ref);
1125 return NULL;
1126 }
1127
1128 /* Given NODE, walk the alias chain to return the function NODE is alias of.
1129 Walk through thunk, too.
1130 When AVAILABILITY is non-NULL, get minimal availablity in the chain. */
1131
1132 static inline struct cgraph_node *
1133 cgraph_function_node (struct cgraph_node *node, enum availability *availability)
1134 {
1135 if (availability)
1136 *availability = cgraph_function_body_availability (node);
1137 while (node)
1138 {
1139 if (node->alias && node->analyzed)
1140 node = cgraph_alias_aliased_node (node);
1141 else if (node->thunk.thunk_p)
1142 node = node->callees->callee;
1143 else
1144 return node;
1145 if (node && availability)
1146 {
1147 enum availability a;
1148 a = cgraph_function_body_availability (node);
1149 if (a < *availability)
1150 *availability = a;
1151 }
1152 }
1153 if (availability)
1154 *availability = AVAIL_NOT_AVAILABLE;
1155 return NULL;
1156 }
1157
1158 /* Given NODE, walk the alias chain to return the function NODE is alias of.
1159 Do not walk through thunks.
1160 When AVAILABILITY is non-NULL, get minimal availablity in the chain. */
1161
1162 static inline struct cgraph_node *
1163 cgraph_function_or_thunk_node (struct cgraph_node *node, enum availability *availability)
1164 {
1165 if (availability)
1166 *availability = cgraph_function_body_availability (node);
1167 while (node)
1168 {
1169 if (node->alias && node->analyzed)
1170 node = cgraph_alias_aliased_node (node);
1171 else
1172 return node;
1173 if (node && availability)
1174 {
1175 enum availability a;
1176 a = cgraph_function_body_availability (node);
1177 if (a < *availability)
1178 *availability = a;
1179 }
1180 }
1181 if (availability)
1182 *availability = AVAIL_NOT_AVAILABLE;
1183 return NULL;
1184 }
1185
1186 /* Given NODE, walk the alias chain to return the function NODE is alias of.
1187 Do not walk through thunks.
1188 When AVAILABILITY is non-NULL, get minimal availablity in the chain. */
1189
1190 static inline struct varpool_node *
1191 varpool_variable_node (struct varpool_node *node, enum availability *availability)
1192 {
1193 if (availability)
1194 *availability = cgraph_variable_initializer_availability (node);
1195 while (node)
1196 {
1197 if (node->alias && node->analyzed)
1198 node = varpool_alias_aliased_node (node);
1199 else
1200 return node;
1201 if (node && availability)
1202 {
1203 enum availability a;
1204 a = cgraph_variable_initializer_availability (node);
1205 if (a < *availability)
1206 *availability = a;
1207 }
1208 }
1209 if (availability)
1210 *availability = AVAIL_NOT_AVAILABLE;
1211 return NULL;
1212 }
1213
1214 /* Return true when the edge E represents a direct recursion. */
1215 static inline bool
1216 cgraph_edge_recursive_p (struct cgraph_edge *e)
1217 {
1218 struct cgraph_node *callee = cgraph_function_or_thunk_node (e->callee, NULL);
1219 if (e->caller->global.inlined_to)
1220 return e->caller->global.inlined_to->symbol.decl == callee->symbol.decl;
1221 else
1222 return e->caller->symbol.decl == callee->symbol.decl;
1223 }
1224
1225 /* Return true if the TM_CLONE bit is set for a given FNDECL. */
1226 static inline bool
1227 decl_is_tm_clone (const_tree fndecl)
1228 {
1229 struct cgraph_node *n = cgraph_get_node (fndecl);
1230 if (n)
1231 return n->tm_clone;
1232 return false;
1233 }
1234 #endif /* GCC_CGRAPH_H */