summaryrefslogtreecommitdiff
path: root/gcc/cgraphunit.c
diff options
context:
space:
mode:
authormarxin <marxin@138bc75d-0d04-0410-961f-82ee72b054a4>2014-06-04 09:39:24 +0000
committermarxin <marxin@138bc75d-0d04-0410-961f-82ee72b054a4>2014-06-04 09:39:24 +0000
commit46e5ad0c2ccd76be436551653e4ab4680608c86c (patch)
tree9145c7839e56bc45a6609950c9b5e844507d3d03 /gcc/cgraphunit.c
parenta06672d436603b0533c5ff28b30bd64c794cc9eb (diff)
downloadgcc-46e5ad0c2ccd76be436551653e4ab4680608c86c.tar.gz
Enhancement of call graph API
* cgraph.h (expand_thunk): New argument added. (address_taken_from_non_vtable_p): New global function. * ipa-visibility.c (address_taken_from_non_vtable_p): Likewise. * cgraphclones.c (duplicate_thunk_for_node): Argument added to call. * cgraphunit.c (analyze_function): Likewise. (assemble_thunks_and_aliases): Argument added to call. (expand_thunk): New argument forces to produce GIMPLE thunk. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@211218 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cgraphunit.c')
-rw-r--r--gcc/cgraphunit.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/gcc/cgraphunit.c b/gcc/cgraphunit.c
index e19b0a25c1d..55bf37858e1 100644
--- a/gcc/cgraphunit.c
+++ b/gcc/cgraphunit.c
@@ -610,7 +610,7 @@ analyze_function (struct cgraph_node *node)
{
cgraph_create_edge (node, cgraph_get_node (node->thunk.alias),
NULL, 0, CGRAPH_FREQ_BASE);
- if (!expand_thunk (node, false))
+ if (!expand_thunk (node, false, false))
{
node->thunk.alias = NULL;
node->analyzed = true;
@@ -1466,11 +1466,13 @@ thunk_adjust (gimple_stmt_iterator * bsi,
}
/* Expand thunk NODE to gimple if possible.
+ When FORCE_GIMPLE_THUNK is true, gimple thunk is created and
+ no assembler is produced.
When OUTPUT_ASM_THUNK is true, also produce assembler for
thunks that are not lowered. */
bool
-expand_thunk (struct cgraph_node *node, bool output_asm_thunks)
+expand_thunk (struct cgraph_node *node, bool output_asm_thunks, bool force_gimple_thunk)
{
bool this_adjusting = node->thunk.this_adjusting;
HOST_WIDE_INT fixed_offset = node->thunk.fixed_offset;
@@ -1481,7 +1483,7 @@ expand_thunk (struct cgraph_node *node, bool output_asm_thunks)
tree a;
- if (this_adjusting
+ if (!force_gimple_thunk && this_adjusting
&& targetm.asm_out.can_output_mi_thunk (thunk_fndecl, fixed_offset,
virtual_value, alias))
{
@@ -1719,7 +1721,7 @@ assemble_thunks_and_aliases (struct cgraph_node *node)
e = e->next_caller;
assemble_thunks_and_aliases (thunk);
- expand_thunk (thunk, true);
+ expand_thunk (thunk, true, false);
}
else
e = e->next_caller;