GCC Middle and Back End API Reference
Main Page
Namespaces
Data Structures
Files
File List
Globals
ipa-utils.h
Go to the documentation of this file.
1
/* Utilities for ipa analysis.
2
Copyright (C) 2004-2013 Free Software Foundation, Inc.
3
Contributed by Kenneth Zadeck <zadeck@naturalbridge.com>
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
#ifndef GCC_IPA_UTILS_H
22
#define GCC_IPA_UTILS_H
23
#include "
cgraph.h
"
24
25
struct
ipa_dfs_info
{
26
int
dfn_number
;
27
int
low_link
;
28
/* This field will have the samy value for any two nodes in the same strongly
29
connected component. */
30
int
scc_no
;
31
bool
new_node
;
32
bool
on_stack
;
33
struct
cgraph_node
*
next_cycle
;
34
PTR
aux
;
35
};
36
37
38
/* In ipa-utils.c */
39
void
ipa_print_order
(FILE*,
const
char
*,
struct
cgraph_node
**,
int
);
40
int
ipa_reduced_postorder
(
struct
cgraph_node
**,
bool
,
bool
,
41
bool
(*
ignore_edge
) (
struct
cgraph_edge
*));
42
void
ipa_free_postorder_info
(
void
);
43
vec<cgraph_node_ptr>
ipa_get_nodes_in_cycle
(
struct
cgraph_node
*);
44
bool
ipa_edge_within_scc
(
struct
cgraph_edge
*);
45
int
ipa_reverse_postorder
(
struct
cgraph_node
**);
46
tree
get_base_var
(
tree
);
47
void
ipa_merge_profiles
(
struct
cgraph_node
*dst,
48
struct
cgraph_node
*src);
49
bool
recursive_call_p
(
tree
,
tree
);
50
51
/* In ipa-profile.c */
52
bool
ipa_propagate_frequency
(
struct
cgraph_node
*node);
53
54
/* In ipa-devirt.c */
55
56
struct
odr_type_d
;
57
typedef
odr_type_d
*
odr_type
;
58
void
build_type_inheritance_graph
(
void
);
59
void
update_type_inheritance_graph
(
void
);
60
vec <cgraph_node *>
61
possible_polymorphic_call_targets
(
tree
,
HOST_WIDE_INT
,
62
bool
*
final
=
NULL
,
63
void
**cache_token =
NULL
);
64
odr_type
get_odr_type
(
tree
,
bool
insert
=
false
);
65
void
dump_possible_polymorphic_call_targets
(FILE *,
tree
,
HOST_WIDE_INT
);
66
bool
possible_polymorphic_call_target_p
(
tree
,
HOST_WIDE_INT
,
67
struct
cgraph_node
*n);
68
tree
method_class_type
(
tree
);
69
70
/* Return vector containing possible targets of polymorphic call E.
71
If FINALP is non-NULL, store true if the list is complette.
72
CACHE_TOKEN (if non-NULL) will get stored to an unique ID of entry
73
in the target cache. If user needs to visit every target list
74
just once, it can memoize them.
75
76
Returned vector is placed into cache. It is NOT caller's responsibility
77
to free it. The vector can be freed on cgraph_remove_node call if
78
the particular node is a virtual function present in the cache. */
79
80
inline
vec <cgraph_node *>
81
possible_polymorphic_call_targets
(
struct
cgraph_edge
*e,
82
bool
*
final
=
NULL
,
83
void
**cache_token =
NULL
)
84
{
85
gcc_checking_assert
(e->
indirect_info
->
polymorphic
);
86
return
possible_polymorphic_call_targets
(e->
indirect_info
->
otr_type
,
87
e->
indirect_info
->
otr_token
,
88
final
, cache_token);
89
}
90
91
/* Dump possible targets of a polymorphic call E into F. */
92
93
inline
void
94
dump_possible_polymorphic_call_targets
(FILE *f,
struct
cgraph_edge
*e)
95
{
96
gcc_checking_assert
(e->
indirect_info
->
polymorphic
);
97
dump_possible_polymorphic_call_targets
(f, e->
indirect_info
->
otr_type
,
98
e->
indirect_info
->
otr_token
);
99
}
100
101
/* Return true if N can be possibly target of a polymorphic call of
102
E. */
103
104
inline
bool
105
possible_polymorphic_call_target_p
(
struct
cgraph_edge
*e,
106
struct
cgraph_node
*n)
107
{
108
return
possible_polymorphic_call_target_p
(e->
indirect_info
->
otr_type
,
109
e->
indirect_info
->
otr_token
, n);
110
}
111
112
/* Return true if N can be possibly target of a polymorphic call of
113
OBJ_TYPE_REF expression CALL. */
114
115
inline
bool
116
possible_polymorphic_call_target_p
(
tree
call,
117
struct
cgraph_node
*n)
118
{
119
return
possible_polymorphic_call_target_p
(
obj_type_ref_class
(call),
120
tree_low_cst
121
(
OBJ_TYPE_REF_TOKEN
(call), 1),
122
n);
123
}
124
#endif
/* GCC_IPA_UTILS_H */
125
126
gcc
ipa-utils.h
Generated by
1.8.1.1