summaryrefslogtreecommitdiff
path: root/gcc/cp/method.c
diff options
context:
space:
mode:
authormmitchel <mmitchel@138bc75d-0d04-0410-961f-82ee72b054a4>1999-10-01 04:34:24 +0000
committermmitchel <mmitchel@138bc75d-0d04-0410-961f-82ee72b054a4>1999-10-01 04:34:24 +0000
commit14ad1c62dffcce8c6a17f8def1d642e6655b2859 (patch)
tree136b5e8057777101280144c263bd7434211e3f82 /gcc/cp/method.c
parentc916e56609e04669a16a93f79f90f28373da94f5 (diff)
downloadgcc-14ad1c62dffcce8c6a17f8def1d642e6655b2859.tar.gz
* method.c (emit_thunk): Don't crash when -fsyntax-only.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@29748 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cp/method.c')
-rw-r--r--gcc/cp/method.c41
1 files changed, 22 insertions, 19 deletions
diff --git a/gcc/cp/method.c b/gcc/cp/method.c
index f4eb396b94a..b2daeb2f4f6 100644
--- a/gcc/cp/method.c
+++ b/gcc/cp/method.c
@@ -2086,26 +2086,29 @@ emit_thunk (thunk_fndecl)
TREE_SET_CODE (thunk_fndecl, FUNCTION_DECL);
- {
#ifdef ASM_OUTPUT_MI_THUNK
- char *fnname;
- current_function_decl = thunk_fndecl;
- /* Make sure we build up its RTL before we go onto the
- temporary obstack. */
- make_function_rtl (thunk_fndecl);
- temporary_allocation ();
- DECL_RESULT (thunk_fndecl)
- = build_decl (RESULT_DECL, 0, integer_type_node);
- fnname = XSTR (XEXP (DECL_RTL (thunk_fndecl), 0), 0);
- init_function_start (thunk_fndecl, input_filename, lineno);
- current_function_is_thunk = 1;
- assemble_start_function (thunk_fndecl, fnname);
- ASM_OUTPUT_MI_THUNK (asm_out_file, thunk_fndecl, delta, function);
- assemble_end_function (thunk_fndecl, fnname);
- permanent_allocation (1);
- current_function_decl = 0;
- current_function = 0;
+ if (!flag_syntax_only)
+ {
+ char *fnname;
+ current_function_decl = thunk_fndecl;
+ /* Make sure we build up its RTL before we go onto the
+ temporary obstack. */
+ make_function_rtl (thunk_fndecl);
+ temporary_allocation ();
+ DECL_RESULT (thunk_fndecl)
+ = build_decl (RESULT_DECL, 0, integer_type_node);
+ fnname = XSTR (XEXP (DECL_RTL (thunk_fndecl), 0), 0);
+ init_function_start (thunk_fndecl, input_filename, lineno);
+ current_function_is_thunk = 1;
+ assemble_start_function (thunk_fndecl, fnname);
+ ASM_OUTPUT_MI_THUNK (asm_out_file, thunk_fndecl, delta, function);
+ assemble_end_function (thunk_fndecl, fnname);
+ permanent_allocation (1);
+ current_function_decl = 0;
+ current_function = 0;
+ }
#else /* ASM_OUTPUT_MI_THUNK */
+ {
/* If we don't have the necessary macro for efficient thunks, generate a
thunk function that just makes a call to the real function.
Unfortunately, this doesn't work for varargs. */
@@ -2157,8 +2160,8 @@ emit_thunk (thunk_fndecl)
output_inline_function (thunk_fndecl);
permanent_allocation (1);
}
-#endif /* ASM_OUTPUT_MI_THUNK */
}
+#endif /* ASM_OUTPUT_MI_THUNK */
TREE_SET_CODE (thunk_fndecl, THUNK_DECL);
}