aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp
diff options
context:
space:
mode:
authorMark Mitchell <mark@codesourcery.com>1999-10-01 04:34:24 +0000
committerMark Mitchell <mmitchel@gcc.gnu.org>1999-10-01 04:34:24 +0000
commit3b62f224004def4c1dc72fe6096067f47e0e32d9 (patch)
tree136b5e8057777101280144c263bd7434211e3f82 /gcc/cp
parente82d3ca3b99269f1f5cadec45b8b7e0a9de55c90 (diff)
downloadgcc-3b62f224004def4c1dc72fe6096067f47e0e32d9.zip
gcc-3b62f224004def4c1dc72fe6096067f47e0e32d9.tar.gz
gcc-3b62f224004def4c1dc72fe6096067f47e0e32d9.tar.bz2
* method.c (emit_thunk): Don't crash when -fsyntax-only.
From-SVN: r29748
Diffstat (limited to 'gcc/cp')
-rw-r--r--gcc/cp/ChangeLog2
-rw-r--r--gcc/cp/method.c41
2 files changed, 24 insertions, 19 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 85a03fe..4b40f84 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,5 +1,7 @@
1999-09-30 Mark Mitchell <mark@codesourcery.com>
+ * method.c (emit_thunk): Don't crash when -fsyntax-only.
+
* cp-tree.h (lang_decl_flags): Add global_ctor_p and
global_dtor_p. Add init_priority.
(DECL_ACCESS): Adjust accordingly.
diff --git a/gcc/cp/method.c b/gcc/cp/method.c
index f4eb396..b2daeb2 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);
}