OSDN Git Service

6f1e052756f3bd146d3fc30e8f95476af9e085d6
[pf3gnuchains/gcc-fork.git] / gcc / cgraph.h
1 /* Callgraph handling code.
2    Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009
3    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 #include "tree.h"
25 #include "basic-block.h"
26
27 enum availability
28 {
29   /* Not yet set by cgraph_function_body_availability.  */
30   AVAIL_UNSET,
31   /* Function body/variable initializer is unknown.  */
32   AVAIL_NOT_AVAILABLE,
33   /* Function body/variable initializer is known but might be replaced
34      by a different one from other compilation unit and thus needs to
35      be dealt with a care.  Like AVAIL_NOT_AVAILABLE it can have
36      arbitrary side effects on escaping variables and functions, while
37      like AVAILABLE it might access static variables.  */
38   AVAIL_OVERWRITABLE,
39   /* Function body/variable initializer is known and will be used in final
40      program.  */
41   AVAIL_AVAILABLE,
42   /* Function body/variable initializer is known and all it's uses are explicitly
43      visible within current unit (ie it's address is never taken and it is not
44      exported to other units).
45      Currently used only for functions.  */
46   AVAIL_LOCAL
47 };
48
49 extern const char * const cgraph_availability_names[];
50
51 /* Function inlining information.  */
52
53 struct GTY(()) inline_summary
54 {
55   /* Estimated stack frame consumption by the function.  */
56   HOST_WIDE_INT estimated_self_stack_size;
57
58   /* Size of the function before inlining.  */
59   int self_insns;
60 };
61
62 /* Information about the function collected locally.
63    Available after function is analyzed.  */
64
65 struct GTY(()) cgraph_local_info {
66   struct inline_summary inline_summary;
67
68   /* Set when function function is visible in current compilation unit only
69      and its address is never taken.  */
70   unsigned local : 1;
71
72   /* Set when function is visible by other units.  */
73   unsigned externally_visible : 1;
74
75   /* Set once it has been finalized so we consider it to be output.  */
76   unsigned finalized : 1;
77
78   /* False when there something makes inlining impossible (such as va_arg).  */
79   unsigned inlinable : 1;
80
81   /* True when function should be inlined independently on its size.  */
82   unsigned disregard_inline_limits : 1;
83
84   /* True when the function has been originally extern inline, but it is
85      redefined now.  */
86   unsigned redefined_extern_inline : 1;
87
88   /* True if statics_read_for_function and
89      statics_written_for_function contain valid data.  */
90   unsigned for_functions_valid : 1;
91
92   /* True if the function is going to be emitted in some other translation
93      unit, referenced from vtable.  */
94   unsigned vtable_method : 1;
95 };
96
97 /* Information about the function that needs to be computed globally
98    once compilation is finished.  Available only with -funit-at-a-time.  */
99
100 struct GTY(()) cgraph_global_info {
101   /* Estimated stack frame consumption by the function.  */
102   HOST_WIDE_INT estimated_stack_size;
103   /* Expected offset of the stack frame of inlined function.  */
104   HOST_WIDE_INT stack_frame_offset;
105
106   /* For inline clones this points to the function they will be
107      inlined into.  */
108   struct cgraph_node *inlined_to;
109
110   /* Estimated size of the function after inlining.  */
111   int insns;
112
113   /* Estimated growth after inlining.  INT_MIN if not computed.  */
114   int estimated_growth;
115
116   /* Set iff the function has been inlined at least once.  */
117   bool inlined;
118 };
119
120 /* Information about the function that is propagated by the RTL backend.
121    Available only for functions that has been already assembled.  */
122
123 struct GTY(()) cgraph_rtl_info {
124    unsigned int preferred_incoming_stack_boundary;
125 };
126
127 /* Represent which DECL tree (or reference to such tree)
128    will be replaced by another tree while versioning.  */
129 struct GTY(()) ipa_replace_map
130 {
131   /* The tree that will be replaced.  */
132   tree old_tree;
133   /* The new (replacing) tree.  */
134   tree new_tree;
135   /* True when a substitution should be done, false otherwise.  */
136   bool replace_p;
137   /* True when we replace a reference to old_tree.  */
138   bool ref_p;
139 };
140 typedef struct ipa_replace_map *ipa_replace_map_p;
141 DEF_VEC_P(ipa_replace_map_p);
142 DEF_VEC_ALLOC_P(ipa_replace_map_p,gc);
143
144 struct GTY(()) cgraph_clone_info
145 {
146   VEC(ipa_replace_map_p,gc)* tree_map;
147   bitmap args_to_skip;
148 };
149
150 /* The cgraph data structure.
151    Each function decl has assigned cgraph_node listing callees and callers.  */
152
153 struct GTY((chain_next ("%h.next"), chain_prev ("%h.previous"))) cgraph_node {
154   tree decl;
155   struct cgraph_edge *callees;
156   struct cgraph_edge *callers;
157   struct cgraph_node *next;
158   struct cgraph_node *previous;
159   /* For nested functions points to function the node is nested in.  */
160   struct cgraph_node *origin;
161   /* Points to first nested function, if any.  */
162   struct cgraph_node *nested;
163   /* Pointer to the next function with same origin, if any.  */
164   struct cgraph_node *next_nested;
165   /* Pointer to the next function in cgraph_nodes_queue.  */
166   struct cgraph_node *next_needed;
167   /* Pointer to the next clone.  */
168   struct cgraph_node *next_sibling_clone;
169   struct cgraph_node *prev_sibling_clone;
170   struct cgraph_node *clones;
171   struct cgraph_node *clone_of;
172   /* For functions with many calls sites it holds map from call expression
173      to the edge to speed up cgraph_edge function.  */
174   htab_t GTY((param_is (struct cgraph_edge))) call_site_hash;
175
176   PTR GTY ((skip)) aux;
177
178   struct cgraph_local_info local;
179   struct cgraph_global_info global;
180   struct cgraph_rtl_info rtl;
181   struct cgraph_clone_info clone;
182
183   /* Expected number of executions: calculated in profile.c.  */
184   gcov_type count;
185   /* Unique id of the node.  */
186   int uid;
187   /* Ordering of all cgraph nodes.  */
188   int order;
189
190   /* unique id for profiling. pid is not suitable because of different
191      number of cfg nodes with -fprofile-generate and -fprofile-use */
192   int pid;
193
194   /* Set when function must be output - it is externally visible
195      or its address is taken.  */
196   unsigned needed : 1;
197   /* Set when function has address taken.  */
198   unsigned address_taken : 1;
199   /* Set when decl is an abstract function pointed to by the
200      ABSTRACT_DECL_ORIGIN of a reachable function.  */
201   unsigned abstract_and_needed : 1;
202   /* Set when function is reachable by call from other function
203      that is either reachable or needed.  */
204   unsigned reachable : 1;
205   /* Set once the function is lowered (i.e. its CFG is built).  */
206   unsigned lowered : 1;
207   /* Set once the function has been instantiated and its callee
208      lists created.  */
209   unsigned analyzed : 1;
210   /* Set when function is scheduled to be processed by local passes.  */
211   unsigned process : 1;
212   /* Set for aliases once they got through assemble_alias.  */
213   unsigned alias : 1;
214   /* Set for nodes that was constructed and finalized by frontend.  */
215   unsigned finalized_by_frontend : 1;
216
217   /* In non-unit-at-a-time mode the function body of inline candidates is saved
218      into clone before compiling so the function in original form can be
219      inlined later.  This pointer points to the clone.  */
220   tree inline_decl;
221 };
222
223 typedef struct cgraph_node *cgraph_node_ptr;
224
225 DEF_VEC_P(cgraph_node_ptr);
226 DEF_VEC_ALLOC_P(cgraph_node_ptr,heap);
227 DEF_VEC_ALLOC_P(cgraph_node_ptr,gc);
228
229 /* A cgraph node set is a collection of cgraph nodes.  A cgraph node
230    can appear in multiple sets.  */
231 struct GTY(()) cgraph_node_set_def
232 {
233   htab_t GTY((param_is (struct cgraph_node_set_element_def))) hashtab;
234   VEC(cgraph_node_ptr, gc) *nodes;
235   PTR GTY ((skip)) aux;
236 };
237
238 typedef struct cgraph_node_set_def *cgraph_node_set;
239
240 DEF_VEC_P(cgraph_node_set);
241 DEF_VEC_ALLOC_P(cgraph_node_set,gc);
242 DEF_VEC_ALLOC_P(cgraph_node_set,heap);
243
244 /* A cgraph node set element contains an index in the vector of nodes in
245    the set.  */
246 struct GTY(()) cgraph_node_set_element_def
247 {
248   struct cgraph_node *node;
249   HOST_WIDE_INT index;
250 };
251
252 typedef struct cgraph_node_set_element_def *cgraph_node_set_element;
253 typedef const struct cgraph_node_set_element_def *const_cgraph_node_set_element;
254
255 /* Iterator structure for cgraph node sets.  */
256 typedef struct
257 {
258   cgraph_node_set set;
259   unsigned index;
260 } cgraph_node_set_iterator;
261
262 #define DEFCIFCODE(code, string)        CIF_ ## code,
263 /* Reasons for inlining failures.  */
264 typedef enum {
265 #include "cif-code.def"
266   CIF_N_REASONS
267 } cgraph_inline_failed_t;
268
269 struct GTY((chain_next ("%h.next_caller"), chain_prev ("%h.prev_caller"))) cgraph_edge {
270   struct cgraph_node *caller;
271   struct cgraph_node *callee;
272   struct cgraph_edge *prev_caller;
273   struct cgraph_edge *next_caller;
274   struct cgraph_edge *prev_callee;
275   struct cgraph_edge *next_callee;
276   gimple call_stmt;
277   PTR GTY ((skip (""))) aux;
278   /* When equal to CIF_OK, inline this call.  Otherwise, points to the
279      explanation why function was not inlined.  */
280   cgraph_inline_failed_t inline_failed;
281   /* Expected number of executions: calculated in profile.c.  */
282   gcov_type count;
283   /* Expected frequency of executions within the function. 
284      When set to CGRAPH_FREQ_BASE, the edge is expected to be called once
285      per function call.  The range is 0 to CGRAPH_FREQ_MAX.  */
286   int frequency;
287   /* Depth of loop nest, 1 means no loop nest.  */
288   unsigned int loop_nest : 30;
289   /* Whether this edge describes a call that was originally indirect.  */
290   unsigned int indirect_call : 1;
291   /* Can this call throw externally?  */
292   unsigned int can_throw_external : 1;
293   /* Unique id of the edge.  */
294   int uid;
295 };
296
297 #define CGRAPH_FREQ_BASE 1000
298 #define CGRAPH_FREQ_MAX 100000
299
300 typedef struct cgraph_edge *cgraph_edge_p;
301
302 DEF_VEC_P(cgraph_edge_p);
303 DEF_VEC_ALLOC_P(cgraph_edge_p,heap);
304
305 /* The varpool data structure.
306    Each static variable decl has assigned varpool_node.  */
307
308 struct GTY((chain_next ("%h.next"))) varpool_node {
309   tree decl;
310   /* Pointer to the next function in varpool_nodes.  */
311   struct varpool_node *next;
312   /* Pointer to the next function in varpool_nodes_queue.  */
313   struct varpool_node *next_needed;
314   /* Ordering of all cgraph nodes.  */
315   int order;
316
317   /* Set when function must be output - it is externally visible
318      or its address is taken.  */
319   unsigned needed : 1;
320   /* Needed variables might become dead by optimization.  This flag
321      forces the variable to be output even if it appears dead otherwise.  */
322   unsigned force_output : 1;
323   /* Set once the variable has been instantiated and its callee
324      lists created.  */
325   unsigned analyzed : 1;
326   /* Set once it has been finalized so we consider it to be output.  */
327   unsigned finalized : 1;
328   /* Set when variable is scheduled to be assembled.  */
329   unsigned output : 1;
330   /* Set when function is visible by other units.  */
331   unsigned externally_visible : 1;
332   /* Set for aliases once they got through assemble_alias.  */
333   unsigned alias : 1;
334 };
335
336 /* Every top level asm statement is put into a cgraph_asm_node.  */
337
338 struct GTY(()) cgraph_asm_node {
339   /* Next asm node.  */
340   struct cgraph_asm_node *next;
341   /* String for this asm node.  */
342   tree asm_str;
343   /* Ordering of all cgraph nodes.  */
344   int order;
345 };
346
347 extern GTY(()) struct cgraph_node *cgraph_nodes;
348 extern GTY(()) int cgraph_n_nodes;
349 extern GTY(()) int cgraph_max_uid;
350 extern GTY(()) int cgraph_edge_max_uid;
351 extern GTY(()) int cgraph_max_pid;
352 extern bool cgraph_global_info_ready;
353 enum cgraph_state
354 {
355   /* Callgraph is being constructed.  It is safe to add new functions.  */
356   CGRAPH_STATE_CONSTRUCTION,
357   /* Callgraph is built and IPA passes are being run.  */
358   CGRAPH_STATE_IPA,
359   /* Callgraph is built and all functions are transformed to SSA form.  */
360   CGRAPH_STATE_IPA_SSA,
361   /* Functions are now ordered and being passed to RTL expanders.  */
362   CGRAPH_STATE_EXPANSION,
363   /* All cgraph expansion is done.  */
364   CGRAPH_STATE_FINISHED
365 };
366 extern enum cgraph_state cgraph_state;
367 extern bool cgraph_function_flags_ready;
368 extern GTY(()) struct cgraph_node *cgraph_nodes_queue;
369 extern GTY(()) struct cgraph_node *cgraph_new_nodes;
370
371 extern GTY(()) struct cgraph_asm_node *cgraph_asm_nodes;
372 extern GTY(()) int cgraph_order;
373
374 /* In cgraph.c  */
375 void dump_cgraph (FILE *);
376 void debug_cgraph (void);
377 void dump_cgraph_node (FILE *, struct cgraph_node *);
378 void debug_cgraph_node (struct cgraph_node *);
379 void cgraph_insert_node_to_hashtable (struct cgraph_node *node);
380 void cgraph_remove_edge (struct cgraph_edge *);
381 void cgraph_remove_node (struct cgraph_node *);
382 void cgraph_remove_node_and_inline_clones (struct cgraph_node *);
383 void cgraph_release_function_body (struct cgraph_node *);
384 void cgraph_node_remove_callees (struct cgraph_node *node);
385 struct cgraph_edge *cgraph_create_edge (struct cgraph_node *,
386                                         struct cgraph_node *,
387                                         gimple, gcov_type, int, int);
388 struct cgraph_node *cgraph_node (tree);
389 struct cgraph_node *cgraph_node_for_asm (tree asmname);
390 struct cgraph_edge *cgraph_edge (struct cgraph_node *, gimple);
391 void cgraph_set_call_stmt (struct cgraph_edge *, gimple);
392 void cgraph_set_call_stmt_including_clones (struct cgraph_node *, gimple, gimple);
393 void cgraph_create_edge_including_clones (struct cgraph_node *,
394                                           struct cgraph_node *,
395                                           gimple, gcov_type, int, int,
396                                           cgraph_inline_failed_t);
397 void cgraph_update_edges_for_call_stmt (gimple, tree, gimple);
398 struct cgraph_local_info *cgraph_local_info (tree);
399 struct cgraph_global_info *cgraph_global_info (tree);
400 struct cgraph_rtl_info *cgraph_rtl_info (tree);
401 const char * cgraph_node_name (struct cgraph_node *);
402 struct cgraph_edge * cgraph_clone_edge (struct cgraph_edge *,
403                                         struct cgraph_node *,
404                                         gimple, gcov_type, int, int, bool);
405 struct cgraph_node * cgraph_clone_node (struct cgraph_node *, gcov_type, int,
406                                         int, bool);
407
408 void cgraph_redirect_edge_callee (struct cgraph_edge *, struct cgraph_node *);
409
410 struct cgraph_asm_node *cgraph_add_asm_node (tree);
411
412 bool cgraph_function_possibly_inlined_p (tree);
413 void cgraph_unnest_node (struct cgraph_node *);
414
415 enum availability cgraph_function_body_availability (struct cgraph_node *);
416 void cgraph_add_new_function (tree, bool);
417 const char* cgraph_inline_failed_string (cgraph_inline_failed_t);
418 struct cgraph_node * cgraph_create_virtual_clone (struct cgraph_node *old_node,
419                                                   VEC(cgraph_edge_p,heap)*,
420                                                   VEC(ipa_replace_map_p,gc)* tree_map,
421                                                   bitmap args_to_skip);
422
423 /* In cgraphunit.c  */
424 void cgraph_finalize_function (tree, bool);
425 void cgraph_mark_if_needed (tree);
426 void cgraph_finalize_compilation_unit (void);
427 void cgraph_optimize (void);
428 void cgraph_mark_needed_node (struct cgraph_node *);
429 void cgraph_mark_address_taken_node (struct cgraph_node *);
430 void cgraph_mark_reachable_node (struct cgraph_node *);
431 bool cgraph_inline_p (struct cgraph_edge *, cgraph_inline_failed_t *reason);
432 bool cgraph_preserve_function_body_p (tree);
433 void verify_cgraph (void);
434 void verify_cgraph_node (struct cgraph_node *);
435 void cgraph_build_static_cdtor (char which, tree body, int priority);
436 void cgraph_reset_static_var_maps (void);
437 void init_cgraph (void);
438 struct cgraph_node *cgraph_function_versioning (struct cgraph_node *,
439                                                 VEC(cgraph_edge_p,heap)*,
440                                                 VEC(ipa_replace_map_p,gc)*,
441                                                 bitmap);
442 void tree_function_versioning (tree, tree, VEC (ipa_replace_map_p,gc)*, bool, bitmap);
443 void cgraph_analyze_function (struct cgraph_node *);
444 struct cgraph_node *save_inline_function_body (struct cgraph_node *);
445 void record_references_in_initializer (tree);
446 bool cgraph_process_new_functions (void);
447
448 typedef void (*cgraph_edge_hook)(struct cgraph_edge *, void *);
449 typedef void (*cgraph_node_hook)(struct cgraph_node *, void *);
450 typedef void (*cgraph_2edge_hook)(struct cgraph_edge *, struct cgraph_edge *,
451                                   void *);
452 typedef void (*cgraph_2node_hook)(struct cgraph_node *, struct cgraph_node *,
453                                   void *);
454 struct cgraph_edge_hook_list;
455 struct cgraph_node_hook_list;
456 struct cgraph_2edge_hook_list;
457 struct cgraph_2node_hook_list;
458 struct cgraph_edge_hook_list *cgraph_add_edge_removal_hook (cgraph_edge_hook, void *);
459 void cgraph_remove_edge_removal_hook (struct cgraph_edge_hook_list *);
460 struct cgraph_node_hook_list *cgraph_add_node_removal_hook (cgraph_node_hook,
461                                                             void *);
462 void cgraph_remove_node_removal_hook (struct cgraph_node_hook_list *);
463 struct cgraph_node_hook_list *cgraph_add_function_insertion_hook (cgraph_node_hook,
464                                                                   void *);
465 void cgraph_remove_function_insertion_hook (struct cgraph_node_hook_list *);
466 void cgraph_call_function_insertion_hooks (struct cgraph_node *node);
467 struct cgraph_2edge_hook_list *cgraph_add_edge_duplication_hook (cgraph_2edge_hook, void *);
468 void cgraph_remove_edge_duplication_hook (struct cgraph_2edge_hook_list *);
469 struct cgraph_2node_hook_list *cgraph_add_node_duplication_hook (cgraph_2node_hook, void *);
470 void cgraph_remove_node_duplication_hook (struct cgraph_2node_hook_list *);
471 void cgraph_materialize_all_clones (void);
472
473 /* In cgraphbuild.c  */
474 unsigned int rebuild_cgraph_edges (void);
475 int compute_call_stmt_bb_frequency (tree, basic_block bb);
476
477 /* In ipa.c  */
478 bool cgraph_remove_unreachable_nodes (bool, FILE *);
479 int cgraph_postorder (struct cgraph_node **);
480 cgraph_node_set cgraph_node_set_new (void);
481 cgraph_node_set_iterator cgraph_node_set_find (cgraph_node_set,
482                                                struct cgraph_node *);
483 void cgraph_node_set_add (cgraph_node_set, struct cgraph_node *);
484 void cgraph_node_set_remove (cgraph_node_set, struct cgraph_node *);
485 void dump_cgraph_node_set (FILE *, cgraph_node_set);
486 void debug_cgraph_node_set (cgraph_node_set);
487
488
489 /* In predict.c  */
490 bool cgraph_maybe_hot_edge_p (struct cgraph_edge *e);
491
492 /* In varpool.c  */
493 extern GTY(()) struct varpool_node *varpool_nodes_queue;
494 extern GTY(()) struct varpool_node *varpool_nodes;
495
496 struct varpool_node *varpool_node (tree);
497 struct varpool_node *varpool_node_for_asm (tree asmname);
498 void varpool_mark_needed_node (struct varpool_node *);
499 void debug_varpool (void);
500 void dump_varpool (FILE *);
501 void dump_varpool_node (FILE *, struct varpool_node *);
502
503 void varpool_finalize_decl (tree);
504 bool decide_is_variable_needed (struct varpool_node *, tree);
505 enum availability cgraph_variable_initializer_availability (struct varpool_node *);
506
507 bool varpool_assemble_pending_decls (void);
508 bool varpool_assemble_decl (struct varpool_node *node);
509 bool varpool_analyze_pending_decls (void);
510 void varpool_remove_unreferenced_decls (void);
511 void varpool_empty_needed_queue (void);
512
513 /* Walk all reachable static variables.  */
514 #define FOR_EACH_STATIC_VARIABLE(node) \
515    for ((node) = varpool_nodes_queue; (node); (node) = (node)->next_needed)
516
517 /* Return first reachable static variable with initializer.  */
518 static inline struct varpool_node *
519 varpool_first_static_initializer (void)
520 {
521   struct varpool_node *node;
522   for (node = varpool_nodes_queue; node; node = node->next_needed)
523     {
524       gcc_assert (TREE_CODE (node->decl) == VAR_DECL);
525       if (DECL_INITIAL (node->decl))
526         return node;
527     }
528   return NULL;
529 }
530
531 /* Return next reachable static variable with initializer after NODE.  */
532 static inline struct varpool_node *
533 varpool_next_static_initializer (struct varpool_node *node)
534 {
535   for (node = node->next_needed; node; node = node->next_needed)
536     {
537       gcc_assert (TREE_CODE (node->decl) == VAR_DECL);
538       if (DECL_INITIAL (node->decl))
539         return node;
540     }
541   return NULL;
542 }
543
544 /* Walk all static variables with initializer set.  */
545 #define FOR_EACH_STATIC_INITIALIZER(node) \
546    for ((node) = varpool_first_static_initializer (); (node); \
547         (node) = varpool_next_static_initializer (node))
548
549 /* In ipa-inline.c  */
550 void cgraph_clone_inlined_nodes (struct cgraph_edge *, bool, bool);
551 unsigned int compute_inline_parameters (struct cgraph_node *);
552
553
554 /* Create a new static variable of type TYPE.  */
555 tree add_new_static_var (tree type);
556
557
558 /* Return true if iterator CSI points to nothing.  */
559 static inline bool
560 csi_end_p (cgraph_node_set_iterator csi)
561 {
562   return csi.index >= VEC_length (cgraph_node_ptr, csi.set->nodes);
563 }
564
565 /* Advance iterator CSI.  */
566 static inline void
567 csi_next (cgraph_node_set_iterator *csi)
568 {
569   csi->index++;
570 }
571
572 /* Return the node pointed to by CSI.  */
573 static inline struct cgraph_node *
574 csi_node (cgraph_node_set_iterator csi)
575 {
576   return VEC_index (cgraph_node_ptr, csi.set->nodes, csi.index);
577 }
578
579 /* Return an iterator to the first node in SET.  */
580 static inline cgraph_node_set_iterator
581 csi_start (cgraph_node_set set)
582 {
583   cgraph_node_set_iterator csi;
584
585   csi.set = set;
586   csi.index = 0;
587   return csi;
588 }
589
590 /* Return true if SET contains NODE.  */
591 static inline bool
592 cgraph_node_in_set_p (struct cgraph_node *node, cgraph_node_set set)
593 {
594   cgraph_node_set_iterator csi;
595   csi = cgraph_node_set_find (set, node);
596   return !csi_end_p (csi);
597 }
598
599 /* Return number of nodes in SET.  */
600 static inline size_t
601 cgraph_node_set_size (cgraph_node_set set)
602 {
603   return htab_elements (set->hashtab);
604 }
605
606
607 #endif  /* GCC_CGRAPH_H  */