]> git.ipfire.org Git - thirdparty/gcc.git/blame - gcc/ipa-ref-inline.h
Autogenerated fixes of "->symbol." to "->"
[thirdparty/gcc.git] / gcc / ipa-ref-inline.h
CommitLineData
8d810329 1/* IPA reference lists.
711789cc 2 Copyright (C) 2010-2013 Free Software Foundation, Inc.
8d810329 3 Contributed by Jan Hubicka
4
5This file is part of GCC.
6
7GCC is free software; you can redistribute it and/or modify it under
8the terms of the GNU General Public License as published by the Free
9Software Foundation; either version 3, or (at your option) any later
10version.
11
12GCC is distributed in the hope that it will be useful, but WITHOUT ANY
13WARRANTY; without even the implied warranty of MERCHANTABILITY or
14FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
15for more details.
16
17You should have received a copy of the GNU General Public License
18along with GCC; see the file COPYING3. If not see
19<http://www.gnu.org/licenses/>. */
20
04ec15fa 21/* Return callgraph node REF is referring. */
8d810329 22static inline struct cgraph_node *
23ipa_ref_node (struct ipa_ref *ref)
24{
04ec15fa 25 return cgraph (ref->referred);
8d810329 26}
27
04ec15fa 28/* Return varpool node REF is referring. */
8d810329 29
30static inline struct varpool_node *
31ipa_ref_varpool_node (struct ipa_ref *ref)
32{
04ec15fa 33 return varpool (ref->referred);
8d810329 34}
35
36/* Return cgraph node REF is in. */
37
38static inline struct cgraph_node *
04ec15fa 39ipa_ref_referring_node (struct ipa_ref *ref)
8d810329 40{
04ec15fa 41 return cgraph (ref->referring);
8d810329 42}
43
44/* Return varpool node REF is in. */
45
46static inline struct varpool_node *
04ec15fa 47ipa_ref_referring_varpool_node (struct ipa_ref *ref)
8d810329 48{
04ec15fa 49 return varpool (ref->referring);
8d810329 50}
51
52/* Return reference list REF is in. */
53
54static inline struct ipa_ref_list *
04ec15fa 55ipa_ref_referring_ref_list (struct ipa_ref *ref)
8d810329 56{
02774f2d 57 return &ref->referring->ref_list;
8d810329 58}
59
60/* Return reference list REF is in. */
61
62static inline struct ipa_ref_list *
04ec15fa 63ipa_ref_referred_ref_list (struct ipa_ref *ref)
8d810329 64{
02774f2d 65 return &ref->referred->ref_list;
8d810329 66}
67
68/* Return first reference in LIST or NULL if empty. */
69
70static inline struct ipa_ref *
71ipa_ref_list_first_reference (struct ipa_ref_list *list)
72{
f1f41a6c 73 if (!vec_safe_length (list->references))
8d810329 74 return NULL;
f1f41a6c 75 return &(*list->references)[0];
8d810329 76}
77
04ec15fa 78/* Return first referring ref in LIST or NULL if empty. */
8d810329 79
80static inline struct ipa_ref *
04ec15fa 81ipa_ref_list_first_referring (struct ipa_ref_list *list)
8d810329 82{
f1f41a6c 83 if (!list->referring.length ())
8d810329 84 return NULL;
f1f41a6c 85 return list->referring[0];
8d810329 86}
87
88/* Clear reference list. */
89
90static inline void
91ipa_empty_ref_list (struct ipa_ref_list *list)
92{
f1f41a6c 93 list->referring.create (0);
8d810329 94 list->references = NULL;
95}
96
97/* Clear reference list. */
98
99static inline unsigned int
100ipa_ref_list_nreferences (struct ipa_ref_list *list)
101{
f1f41a6c 102 return vec_safe_length (list->references);
8d810329 103}
104
105#define ipa_ref_list_reference_iterate(L,I,P) \
f1f41a6c 106 vec_safe_iterate ((L)->references, (I), &(P))
04ec15fa 107#define ipa_ref_list_referring_iterate(L,I,P) \
f1f41a6c 108 (L)->referring.iterate ((I), &(P))