GCC Middle and Back End API Reference
ipa-ref.h
Go to the documentation of this file.
1 /* IPA reference lists.
2  Copyright (C) 2010-2013 Free Software Foundation, Inc.
3  Contributed by Jan Hubicka
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 struct cgraph_node;
22 struct varpool_node;
23 class symtab_node_base;
25 typedef const symtab_node_base *const_symtab_node;
26 
27 
28 /* How the reference is done. */
29 enum GTY(()) ipa_ref_use
30 {
35 };
36 
37 /* Record of reference in callgraph or varpool. */
38 struct GTY(()) ipa_ref
39 {
40  symtab_node referring;
41  symtab_node referred;
42  gimple stmt;
43  unsigned int lto_stmt_uid;
44  unsigned int referred_index;
45  ENUM_BITFIELD (ipa_ref_use) use:2;
46  unsigned int speculative:1;
47 };
48 
49 typedef struct ipa_ref ipa_ref_t;
50 typedef struct ipa_ref *ipa_ref_ptr;
51 
52 
53 /* List of references. This is stored in both callgraph and varpool nodes. */
54 struct GTY(()) ipa_ref_list
55 {
56  /* Store actual references in references vector. */
57  vec<ipa_ref_t, va_gc> *references;
58  /* Referring is vector of pointers to references. It must not live in GGC space
59  or GGC will try to mark middle of references vectors. */
60  vec<ipa_ref_ptr> GTY((skip)) referring;
61 };
62 
64  symtab_node,
65  enum ipa_ref_use, gimple);
66 struct ipa_ref * ipa_maybe_record_reference (symtab_node, tree,
67  enum ipa_ref_use, gimple);
68 
69 void ipa_remove_reference (struct ipa_ref *);
70 void ipa_remove_all_references (struct ipa_ref_list *);
71 void ipa_remove_all_referring (struct ipa_ref_list *);
72 void ipa_dump_references (FILE *, struct ipa_ref_list *);
73 void ipa_dump_referring (FILE *, struct ipa_ref_list *);
74 void ipa_clone_references (symtab_node, struct ipa_ref_list *);
75 void ipa_clone_referring (symtab_node, struct ipa_ref_list *);
76 struct ipa_ref * ipa_clone_ref (struct ipa_ref *, symtab_node, gimple);
77 bool ipa_ref_cannot_lead_to_return (struct ipa_ref *);
78 bool ipa_ref_has_aliases_p (struct ipa_ref_list *);
79 struct ipa_ref * ipa_find_reference (symtab_node, symtab_node, gimple, unsigned int);
80 void ipa_remove_stmt_references (symtab_node, gimple);
81 void ipa_clear_stmts_in_references (symtab_node);