diff options
author | mmitchel <mmitchel@138bc75d-0d04-0410-961f-82ee72b054a4> | 1999-09-29 08:06:21 +0000 |
---|---|---|
committer | mmitchel <mmitchel@138bc75d-0d04-0410-961f-82ee72b054a4> | 1999-09-29 08:06:21 +0000 |
commit | a3d5bae2a5043c2d2b025ec39ba0a4743b90875d (patch) | |
tree | 9fa287cf98288b0c4adce698783d2cc50a491ba6 /gcc/cp/decl2.c | |
parent | c749e3d8ee9416070d3782d8007b1c20a1a635b0 (diff) | |
download | gcc-a3d5bae2a5043c2d2b025ec39ba0a4743b90875d.tar.gz |
* cp-tree.h (UPT_TEMPLATE): Remove.
(UPT_PARMS): Likewise.
(DECL_NEEDED_P): New macro.
* decl2.c (finish_vtable_vardecl): Use it.
(finish_objects): Don't crash with -fsyntax-only.
(finish_file): Use DECL_NEEDED_P. Don't prune vtables when
-fsyntax-only.
* pt.c (tsubst_friend_function): Remove FIXME that talks about
obstacks.
(tsubst_expr): Correct handling of function try-blocks.
* semantics.c: Include flags.h.
(expand_body): Don't do RTL generation if -fsyntax-only.
* Makefile.in (semantics.o): Depends on flags.h.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@29705 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cp/decl2.c')
-rw-r--r-- | gcc/cp/decl2.c | 25 |
1 files changed, 18 insertions, 7 deletions
diff --git a/gcc/cp/decl2.c b/gcc/cp/decl2.c index aed43747a2d..19868c300e5 100644 --- a/gcc/cp/decl2.c +++ b/gcc/cp/decl2.c @@ -2556,7 +2556,7 @@ finish_vtable_vardecl (t, data) if (! DECL_EXTERNAL (vars) && (DECL_INTERFACE_KNOWN (vars) - || TREE_SYMBOL_REFERENCED (DECL_ASSEMBLER_NAME (vars)) + || DECL_NEEDED_P (vars) || (hack_decl_function_context (vars) && TREE_USED (vars))) && ! TREE_ASM_WRITTEN (vars)) { @@ -2600,9 +2600,14 @@ finish_vtable_vardecl (t, data) if (flag_vtable_gc) output_vtable_inherit (vars); + /* Because we're only doing syntax-checking, we'll never end up + actually marking the variable as written. */ + if (flag_syntax_only) + TREE_ASM_WRITTEN (vars) = 1; + return 1; } - else if (! TREE_SYMBOL_REFERENCED (DECL_ASSEMBLER_NAME (vars))) + else if (!DECL_NEEDED_P (vars)) /* We don't know what to do with this one yet. */ return 0; @@ -2827,6 +2832,12 @@ finish_objects (method_type, initp, body) fn = finish_function (lineno, 0); expand_body (fn); + /* When only doing semantic analysis, and no RTL generation, we + can't call functions that directly emit assembly code; there is + no assembly file in which to put the code. */ + if (flag_syntax_only) + return; + fnname = XSTR (XEXP (DECL_RTL (fn), 0), 0); if (initp == DEFAULT_INIT_PRIORITY) { @@ -2835,7 +2846,6 @@ finish_objects (method_type, initp, body) else assemble_destructor (fnname); } - #if defined (ASM_OUTPUT_SECTION_NAME) && defined (ASM_OUTPUT_CONSTRUCTOR) /* If we're using init priority we can't use assemble_*tor, but on ELF targets we can stick the references into named sections for GNU ld @@ -3554,8 +3564,7 @@ finish_file () if (DECL_NOT_REALLY_EXTERN (decl) && DECL_INITIAL (decl) - && (TREE_SYMBOL_REFERENCED (DECL_ASSEMBLER_NAME (decl)) - || !DECL_COMDAT (decl))) + && (DECL_NEEDED_P (decl) || !DECL_COMDAT (decl))) DECL_EXTERNAL (decl) = 0; } @@ -3603,8 +3612,10 @@ finish_file () /* Now delete from the chain of variables all virtual function tables. We output them all ourselves, because each will be treated - specially. */ - walk_globals (vtable_decl_p, prune_vtable_vardecl, /*data=*/0); + specially. We don't do this if we're just doing semantic + analysis, and not code-generation. */ + if (!flag_syntax_only) + walk_globals (vtable_decl_p, prune_vtable_vardecl, /*data=*/0); /* Now, issue warnings about static, but not defined, functions, etc., and emit debugging information. */ |