]> git.ipfire.org Git - thirdparty/gcc.git/blame - gcc/ipa-ref.h
* doc/include/texinfo.tex: Update to version 2012-05-16.16.
[thirdparty/gcc.git] / gcc / ipa-ref.h
CommitLineData
369451ec
JH
1/* IPA reference lists.
2 Copyright (C) 2010
3 Free Software Foundation, Inc.
4 Contributed by Jan Hubicka
5
6This file is part of GCC.
7
8GCC is free software; you can redistribute it and/or modify it under
9the terms of the GNU General Public License as published by the Free
10Software Foundation; either version 3, or (at your option) any later
11version.
12
13GCC is distributed in the hope that it will be useful, but WITHOUT ANY
14WARRANTY; without even the implied warranty of MERCHANTABILITY or
15FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
16for more details.
17
18You should have received a copy of the GNU General Public License
19along with GCC; see the file COPYING3. If not see
20<http://www.gnu.org/licenses/>. */
21
22struct cgraph_node;
23struct varpool_node;
5932a4d4
JH
24union symtab_node_def;
25typedef union symtab_node_def *symtab_node;
26typedef const union symtab_node_def *const_symtab_node;
27
369451ec
JH
28
29/* How the reference is done. */
30enum GTY(()) ipa_ref_use
31{
32 IPA_REF_LOAD,
33 IPA_REF_STORE,
39e2db00
JH
34 IPA_REF_ADDR,
35 IPA_REF_ALIAS
369451ec
JH
36};
37
369451ec
JH
38/* Record of reference in callgraph or varpool. */
39struct GTY(()) ipa_ref
40{
5932a4d4
JH
41 symtab_node referring;
42 symtab_node referred;
369451ec 43 gimple stmt;
5932a4d4 44 unsigned int referred_index;
369451ec
JH
45 ENUM_BITFIELD (ipa_ref_use) use:2;
46};
47
48typedef struct ipa_ref ipa_ref_t;
49typedef struct ipa_ref *ipa_ref_ptr;
50
51DEF_VEC_O(ipa_ref_t);
52DEF_VEC_ALLOC_O(ipa_ref_t,gc);
53DEF_VEC_P(ipa_ref_ptr);
54DEF_VEC_ALLOC_P(ipa_ref_ptr,heap);
55
56/* List of references. This is stored in both callgraph and varpool nodes. */
57struct GTY(()) ipa_ref_list
58{
59 /* Store actual references in references vector. */
60 VEC(ipa_ref_t,gc) *references;
61 /* Refering is vector of pointers to references. It must not live in GGC space
62 or GGC will try to mark middle of references vectors. */
5932a4d4 63 VEC(ipa_ref_ptr,heap) * GTY((skip)) referring;
369451ec
JH
64};
65
5932a4d4
JH
66struct ipa_ref * ipa_record_reference (symtab_node,
67 symtab_node,
369451ec
JH
68 enum ipa_ref_use, gimple);
69
70void ipa_remove_reference (struct ipa_ref *);
71void ipa_remove_all_references (struct ipa_ref_list *);
5932a4d4 72void ipa_remove_all_referring (struct ipa_ref_list *);
369451ec 73void ipa_dump_references (FILE *, struct ipa_ref_list *);
5932a4d4
JH
74void ipa_dump_referring (FILE *, struct ipa_ref_list *);
75void ipa_clone_references (symtab_node, struct ipa_ref_list *);
76void ipa_clone_referring (symtab_node, struct ipa_ref_list *);
f10ea640 77bool ipa_ref_cannot_lead_to_return (struct ipa_ref *);
39e2db00 78bool ipa_ref_has_aliases_p (struct ipa_ref_list *);