summaryrefslogtreecommitdiff
path: root/gcc/cp/method.c
diff options
context:
space:
mode:
authorgeoffk <geoffk@138bc75d-0d04-0410-961f-82ee72b054a4>2006-12-01 23:01:05 +0000
committergeoffk <geoffk@138bc75d-0d04-0410-961f-82ee72b054a4>2006-12-01 23:01:05 +0000
commitddb7a3b073b58c71c94f411c6efe22b2d2a7aacb (patch)
tree6a7205d17e6c8b71f9549fe22d01ac548d72b018 /gcc/cp/method.c
parent993690276f69515ef4d51510ede5c8e8b51c0ba0 (diff)
downloadgcc-ddb7a3b073b58c71c94f411c6efe22b2d2a7aacb.tar.gz
* decl.c (poplevel): Check DECL_INITIAL invariant.
(duplicate_decls): Preserve DECL_INITIAL when eliminating a new definition in favour of an old declaration. (start_preparsed_function): Define and document value of DECL_INITIAL before and after routine. (finish_function): Check DECL_INITIAL invariant. * parser.c (cp_parser_function_definition_from_specifiers_and_declarator): Skip duplicate function definitions. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@119427 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cp/method.c')
-rw-r--r--gcc/cp/method.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/gcc/cp/method.c b/gcc/cp/method.c
index ded0af04716..71e34f064c1 100644
--- a/gcc/cp/method.c
+++ b/gcc/cp/method.c
@@ -407,10 +407,6 @@ use_thunk (tree thunk_fndecl, bool emit_p)
}
}
- /* The back-end expects DECL_INITIAL to contain a BLOCK, so we
- create one. */
- DECL_INITIAL (thunk_fndecl) = make_node (BLOCK);
-
/* Set up cloned argument trees for the thunk. */
t = NULL_TREE;
for (a = DECL_ARGUMENTS (function); a; a = TREE_CHAIN (a))
@@ -424,17 +420,23 @@ use_thunk (tree thunk_fndecl, bool emit_p)
}
a = nreverse (t);
DECL_ARGUMENTS (thunk_fndecl) = a;
- BLOCK_VARS (DECL_INITIAL (thunk_fndecl)) = a;
if (this_adjusting
&& targetm.asm_out.can_output_mi_thunk (thunk_fndecl, fixed_offset,
virtual_value, alias))
{
const char *fnname;
+ tree fn_block;
+
current_function_decl = thunk_fndecl;
DECL_RESULT (thunk_fndecl)
= build_decl (RESULT_DECL, 0, integer_type_node);
fnname = XSTR (XEXP (DECL_RTL (thunk_fndecl), 0), 0);
+ /* The back-end expects DECL_INITIAL to contain a BLOCK, so we
+ create one. */
+ fn_block = make_node (BLOCK);
+ BLOCK_VARS (fn_block) = a;
+ DECL_INITIAL (thunk_fndecl) = fn_block;
init_function_start (thunk_fndecl);
current_function_is_thunk = 1;
assemble_start_function (thunk_fndecl, fnname);