2003-01-04 00:13:09 +01:00
|
|
|
|
/* Process declarations and variables for C++ compiler.
|
2000-02-26 21:16:12 +01:00
|
|
|
|
Copyright (C) 1988, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
|
2010-06-01 15:00:50 +02:00
|
|
|
|
1999, 2000, 2001, 2002, 2003, 2004, 2005, 2007, 2008, 2009, 2010
|
2008-06-30 22:41:29 +02:00
|
|
|
|
Free Software Foundation, Inc.
|
1994-02-24 02:02:37 +01:00
|
|
|
|
Hacked by Michael Tiemann (tiemann@cygnus.com)
|
|
|
|
|
|
2002-12-30 17:25:45 +01:00
|
|
|
|
This file is part of GCC.
|
1994-02-24 02:02:37 +01:00
|
|
|
|
|
2002-12-30 17:25:45 +01:00
|
|
|
|
GCC is free software; you can redistribute it and/or modify
|
1994-02-24 02:02:37 +01:00
|
|
|
|
it under the terms of the GNU General Public License as published by
|
typeck.c: Change copyright header to refer to version 3 of the GNU General Public...
* typeck.c: Change copyright header to refer to version 3 of the GNU General
Public License and to point readers at the COPYING3 file and the FSF's license
web page.
* optimize.c, lang-specs.h, init.c, class.c, repo.c, decl.c, config-lang.in,
cp-tree.def, call.c, decl.h, ptree.c, Make-lang.in, method.c, rtti.c,
cp-objcp-common.c, g++spec.c, cp-objcp-common.h, except.c, error.c,
operators.def, cvt.c, tree.c, mangle.c, cp-tree.h, dump.c, search.c,
friend.c, expr.c, cp-gimplify.c, cxx-pretty-print.c, cp-lang.c, typeck2.c,
pt.c, cxx-pretty-print.h, semantics.c, name-lookup.c, lex.c, decl2.c,
name-lookup.h, parser.c: Likewise.
From-SVN: r127154
2007-08-02 12:36:13 +02:00
|
|
|
|
the Free Software Foundation; either version 3, or (at your option)
|
1994-02-24 02:02:37 +01:00
|
|
|
|
any later version.
|
|
|
|
|
|
2002-12-30 17:25:45 +01:00
|
|
|
|
GCC is distributed in the hope that it will be useful,
|
1994-02-24 02:02:37 +01:00
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
|
GNU General Public License for more details.
|
|
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
typeck.c: Change copyright header to refer to version 3 of the GNU General Public...
* typeck.c: Change copyright header to refer to version 3 of the GNU General
Public License and to point readers at the COPYING3 file and the FSF's license
web page.
* optimize.c, lang-specs.h, init.c, class.c, repo.c, decl.c, config-lang.in,
cp-tree.def, call.c, decl.h, ptree.c, Make-lang.in, method.c, rtti.c,
cp-objcp-common.c, g++spec.c, cp-objcp-common.h, except.c, error.c,
operators.def, cvt.c, tree.c, mangle.c, cp-tree.h, dump.c, search.c,
friend.c, expr.c, cp-gimplify.c, cxx-pretty-print.c, cp-lang.c, typeck2.c,
pt.c, cxx-pretty-print.h, semantics.c, name-lookup.c, lex.c, decl2.c,
name-lookup.h, parser.c: Likewise.
From-SVN: r127154
2007-08-02 12:36:13 +02:00
|
|
|
|
along with GCC; see the file COPYING3. If not see
|
|
|
|
|
<http://www.gnu.org/licenses/>. */
|
1994-02-24 02:02:37 +01:00
|
|
|
|
|
|
|
|
|
|
2002-12-30 17:25:45 +01:00
|
|
|
|
/* Process declarations and symbol lookup for C++ front end.
|
1994-02-24 02:02:37 +01:00
|
|
|
|
Also constructs types; the standard scalar types at initialization,
|
|
|
|
|
and structure, union, array and enum types when they are declared. */
|
|
|
|
|
|
|
|
|
|
/* ??? not all decl nodes are given the most useful possible
|
|
|
|
|
line numbers. For example, the CONST_DECLs for enum values. */
|
|
|
|
|
|
|
|
|
|
#include "config.h"
|
call.c: Include system.h.
* call.c: Include system.h. Remove includes, declarations and
defines provided by system.h.
* class.c, cvt.c, decl.c, decl2.c, errfn.c error.c: Likewise.
* except.c, expr.c friend.c, g++spec.c, init.c, input.c: Likewise.
* lex.c, parse.y, pt.c, ptree.c repo.c rtti.c, search.c: Likewise.
* semantics.c, sig.c, spew.c, tree.c, typeck.c: Likewise.
* typeck2.c, xref.c: Likewise.
* Makefile.in: Dependencies updated as appropriate.
* Make-lang.in: Likewise.
system.h cutover from the cp subdir
From-SVN: r18917
1998-03-31 15:25:46 +02:00
|
|
|
|
#include "system.h"
|
2002-12-16 19:23:00 +01:00
|
|
|
|
#include "coretypes.h"
|
|
|
|
|
#include "tm.h"
|
1994-02-24 02:02:37 +01:00
|
|
|
|
#include "tree.h"
|
|
|
|
|
#include "flags.h"
|
|
|
|
|
#include "cp-tree.h"
|
|
|
|
|
#include "decl.h"
|
1995-04-24 19:27:46 +02:00
|
|
|
|
#include "output.h"
|
call.c, [...]: Add include of toplev.h.
Wed May 6 06:36:41 1998 Robert Lipe <robertl@dgii.com>
* cp/call.c, cp/class.c, cp/decl.c, cp/decl2.c,
cp/errfn.c, cp/error.c, cp/except.c, cp/expr.c,
cp/friend.c, cp/init.c, cp/lex.c, cp/method.c,
cp/pt.c, cp/repo.c, cp/rtti.c, cp/search.c,
cp/semantics.c, cp/sig.c, cp/tree.c, cp/typeck.c,
cp/typeck2.c, cp/xref.c: Add include of toplev.h.
From-SVN: r19565
1998-05-06 07:01:35 +02:00
|
|
|
|
#include "toplev.h"
|
Makefile.in (OBJS): Add timevar.o.
hangeLog:
* Makefile.in (OBJS): Add timevar.o.
(toplev.o): Depend on timevar.h.
(ggc-simple.o): Likewise.
(ggc-page.o): Likewise.
(timevar.o): New rule.
(timevar.h): New rule.
* timevar.h: New file.
* timevar.c: Likewise.
* timevar.def: Likewise.
* toplev.h (gc_time, parse_time, varconst_time): Remove.
* toplev.c: Use timevar_push and timevar_pop instead of TIMEVAR
throughout.
(TIMEVAR): Remove macro.
(gc_time, parse_time, varconst_time, integration_time, jump_time,
cse_time, gcse_time, loop_time, cse2_time, branch_prob_time,
flow_time, combine_time, regmove_time, sched_time,
local_alloc_time, global_alloc_time, flow2_time, peephole2_time,
sched2_time, dbr_sched_time, reorder_blocks_time,
rename_registers_time, shorten_branch_time, stack_reg_time,
to_ssa_time, from_ssa_time, final_time, symout_time, dump_time,
all_time): Remove.
(compile_file): Don't initialize time variables. Call
init_timevar and start TV_TOTAL timer. Call timevar_print instead
of many calls to print_time.
(rest_of_compilation): Add timing for reload_cse_regs.
(get_run_time): Removed to timevar.c.
(print_time): Likewise.
(get_run_time): Implement using TV_TOTAL time variable.
(print_time): Get total run time from get_run_time.
* ggc-page.c (ggc_collect): Push and pop TV_GC instead of
computing elapsed time explicitly.
* ggc-simple.c (ggc_collect): Likewise.
(gc_time): Remove declaration.
cp/ChangeLog:
* lex.c (my_get_run_time): Remove.
(init_filename_times): Use get_run_time instead of my_get_run_time.
(check_newline): Likewise.
(dump_time_statistics): Likewise.
* decl2.c (finish_file): Push and pop timevar TV_VARCONST instead
of computing elapsed time explicitly.
From-SVN: r33496
2000-04-28 02:59:40 +02:00
|
|
|
|
#include "timevar.h"
|
1998-06-10 12:16:45 +02:00
|
|
|
|
#include "cpplib.h"
|
Makefile.in (TARGET_H, [...]): New.
* Makefile.in (TARGET_H, TARGET_DEF_H): New.
(c-decl.o, tree.o, c-typeck.o, $(out_object_file)): Update.
* c-decl.c (duplicate_decls): Use function pointer.
* c-typeck.c (common_type): Similarly.
* tree.c (valid_machine_attribute): Similarly.
(merge_machine_type_attributes): Rename merge_type_attributes.
(merge_machine_decl_attributes): Rename merge_decl_attributes.
(merge_dllimport_decl_attributes): New function.
* tree.h (merge_machine_type_attributes): Rename merge_type_attributes.
(merge_machine_decl_attributes): Rename merge_decl_attributes.
(merge_dllimport_decl_attributes): New prototype.
* target.h: New.
* target-def.h: New.
doc: (Joseph Myers)
* doc/gcc.texi, doc/tm.texi: Update documentation.
cp: Make-lang.in: Update dependencies.
* spew.c: Include target.h.
(duplicate_decls): Call target function.
* decl2.c: include target.h
(import_export_class): Use existence of target function pointer.
* typeck.c: Include target.h.
(qualify_type_recursive): Rename variable. Call target function.
(type_after_usual_arithmetic_conversions): Similarly.
(common_type): Similarly.
config: * 1750a/1750a.c, a29k/29k.c, alpha/alpha.c, arc/arc.c, arm/arm.c,
avr/avr.c, c4x/c4x.c, clipper/clipper.c, convex/convex.c,
d30v/d30v.c, dsp16xx/dsp16xx.c, elxsi/elxsi.c, fr30/fr30.c,
i370/i370.c, i386/i386.c, i860/i860.c, i960/i960.c, ia64/ia64.c,
m32r/m32r.c, m68hc11/m68hc11.c, m68k/m68k.c, m88k/m88k.c,
mips/mips.c, mn10200/mn10200.c, mn10300/mn10300.c, ns32k/ns32k.c,
pa/pa.c, pdp11/pdp11.c, pj/pj.c, romp/romp.c, rs6000/rs6000.c,
sh/sh.c, sparc/sparc.c, v850/v850.c, vax/vax.c, we32k/we32k.c)
: Include target.h and target-def.h. Define target.
* arc/arc-protos.h (arc_valid_machine_decl_attribute): Remove.
* arc/arc.c (arc_valid_machine_decl_attribute): Rename
arc_valid_decl_attribute, make static.
* arc/arc.h (VALID_MACHINE_TYPE_ATTRIBUTE): Remove.
* arm/arm-protos.h (arm_valid_machine_decl_attribute,
arm_valid_type_attribute_p, arm_pe_valid_machine_decl_attribute,
arm_pe_merge_machine_decl_attributes): Remove.
* arm/arm.c (arm_valid_machine_decl_attribute_p): Rename
arm_valid_decl_attribute_p, make static.
(arm_pe_valid_decl_attribute_p): Move from pe.c.
* arm/pe.c (arm_pe_valid_machine_decl_attribute_p): Move to arm.c.
(arm_pe_merge_machine_decl_attributes): Move to tree.c.
* arm/arm.h (VALID_MACHINE_TYPE_ATTRIBUTE): Remove.
* arm/coff.h (VALID_MACHINE_DECL_ATTRIBUTE): Remove.
* arm/elf.h (VALID_MACHINE_DECL_ATTRIBUTE): Remove.
* arm/pe.h (TARGET_DLLIMPORT_DECL_ATTRIBUTES): New.
(VALID_MACHINE_TYPE_ATTRIBUTE, VALID_MACHINE_DECL_ATTRIBUTE): Remove.
* avr/avr-protos.h (valid_machine_type_attribute,
valid_machine_decl_attribute): Remove.
* avr/avr.c (valid_machine_type_attribute,
valid_machine_decl_attribute): Rename and make static.
* avr/avr.h (VALID_MACHINE_TYPE_ATTRIBUTE,
VALID_MACHINE_DECL_ATTRIBUTE): Remove.
* c4x/c4x-protos.h (c4x_valid_type_attribute_p): Remove.
* c4x/c4x.c (c4x_valid_type_attribute_p): Make static.
* c4x/c4x.h (VALID_MACHINE_TYPE_ATTRIBUTE): Remove.
* d30v/d30v.h: Remove obsolete comments.
* h8300/h8300-protos.h (h8300_valid_machine_decl_attribute): Remove.
* h8300/h8300.c (h8300_valid_machine_decl_attribute): Rename, make
static.
* h8300/h8300.h (VALID_MACHINE_DECL_ATTRIBUTE): Remove.
* i386/cygwin.h (TARGET_DLLIMPORT_DECL_ATTRIBUTES): Define.
(i386_pe_merge_decl_attributes, MERGE_MACHINE_DECL_ATTRIBUTES,
i386_pe_valid_type_attributes_p): Remove.
* i386/i386-protos.h (ix86_valid_decl_attribute_p,
ix86_valid_type_attribute_p): Remove.
* i386/i386.c (ix86_valid_decl_attribute_p): Remove.
(ix86_valid_type_attribute_p): Make static.
* i386/i386.h (VALID_MACHINE_DECL_ATTRIBUTE,
VALID_MACHINE_TYPE_ATTRIBUTE): Remove.
* i386/winnt.c (i386_pe_merge_decl_attributes): Move to tree.c.
* ia64/ia64-protos.h (ia64_valid_type_attribute): Remove.
* ia64/ia64.c (ia64_valid_type_attribute): Make static.
* ia64/ia64.h (VALID_MACHINE_TYPE_ATTRIBUTE): Remove.
* m32r/m32r-protos.h (m32r_valid_machine_decl_attribute): Remove.
* m32r/m32r.c (m32r_valid_decl_attribute): Make static.
* m32r/m32r.h (VALID_MACHINE_DECL_ATTRIBUTE): Remove.
* m68hc11/m68hc11-protos.h (m68hc11_valid_decl_attribute_p,
m68hc11_valid_type_attribute_p): Remove.
* m68hc11/m68hc11.c (m68hc11_valid_decl_attribute_p): Remove.
(m68hc11_valid_type_attribute_p): Make static.
* m68hc11/m68hc11.h (VALID_MACHINE_DECL_ATTRIBUTE,
VALID_MACHINE_TYPE_ATTRIBUTE): Remove.
* mcore/mcore-protos.h (mcore_valid_machine_decl_attribute,
mcore_merge_machine_decl_attribute): Remove.
* mcore/mcore.c (mcore_valid_machine_decl_attribute): Rename,
make static.
(mcore_merge_machine_decl_attributes): Move to tree.c.
* mcore/mcore.h (VALID_MACHINE_DECL_ATTRIBUTE,
VALID_MACHINE_TYPE_ATTRIBUTE): Remove.
(TARGET_DLLIMPORT_DECL_ATTRIBUTES): Define.
* ns32k/ns32k-protos.h (ns32k_valid_decl_attribute_p,
ns32k_valid_type_attribute_p): Remove.
* ns32k/ns32k.c (ns32k_valid_decl_attribute_p): Remove.
(ns32k_valid_type_attribute_p): Make static.
* ns32k/ns32k.h (VALID_MACHINE_DECL_ATTRIBUTE,
VALID_MACHINE_TYPE_ATTRIBUTE): Remove.
* rs6000/rs6000-protos.h (rs6000_valid_decl_attribute_p,
rs6000_valid_type_attribute_p): Remove.
* rs6000/rs6000.c (rs6000_valid_decl_attribute_p): Remove.
(rs6000_valid_type_attribute_p): Make static.
* rs6000/rs6000.h (VALID_MACHINE_DECL_ATTRIBUTE,
VALID_MACHINE_TYPE_ATTRIBUTE): Remove.
* sh/sh-protos.h (sh_valid_machine_decl_attribute): Remove.
* sh/sh.c (sh_valid_machine_decl_attribute): Rename, make static.
* sh/sh.h (VALID_MACHINE_DECL_ATTRIBUTE): Remove.
* v850/v850-protos.h (v850_valid_machine_decl_attribute): Remove.
* v850/v850.c (v850_valid_machine_decl_attribute): Rename, make static.
* v850/v850.h (VALID_MACHINE_DECL_ATTRIBUTE): Remove.
From-SVN: r43585
2001-06-26 20:09:27 +02:00
|
|
|
|
#include "target.h"
|
2010-06-05 22:33:22 +02:00
|
|
|
|
#include "c-family/c-common.h"
|
2004-05-13 08:41:07 +02:00
|
|
|
|
#include "tree-mudflap.h"
|
2003-07-02 02:12:10 +02:00
|
|
|
|
#include "cgraph.h"
|
|
|
|
|
#include "tree-inline.h"
|
2010-06-05 22:33:22 +02:00
|
|
|
|
#include "c-family/c-pragma.h"
|
Makefile.in: Adjust dependencies.
2005-07-05 Paolo Bonzini <bonzini@gnu.org>
* Makefile.in: Adjust dependencies.
* tree-pass.h: Add new passes and passes formerly in tree-optimize.c.
* basic-block.h (duplicate_computed_gotos): Remove, it is now static.
* alias.c (rest_of_handle_cfg, pass_cfg): New.
* bb-reorder.c (duplicate_computed_gotos): Make it static.
* cfgexpand.c (tree_expand_cfg): Add code formerly at the beginning of
rest_of_compilation.
* bb-reorder.c (gate_duplicate_computed_gotos,
pass_duplicate_computed_gotos, gate_handle_reorder_blocks,
rest_of_handle_reorder_blocks, pass_reorder_blocks,
gate_handle_partition_blocks, rest_of_handle_partition_blocks,
pass_partition_blocks): New.
* bt-load.c (gate_handle_branch_target_load_optimize,
rest_of_handle_branch_target_load_optimize,
pass_branch_target_load_optimize): New.
* cfgcleanup.c (rest_of_handle_jump, pass_jump, rest_of_handle_jump2,
pass_jump2): New.
* cfglayout.c (pass_insn_locators_initialize): New.
* cfgrtl.c (pass_free_cfg): New.
* combine.c (gate_handle_combine, rest_of_handle_combine,
pass_combine): New.
* cse.c (gate_handle_cse, rest_of_handle_cse, pass_cse,
gate_handle_cse2, rest_of_handle_cse2, pass_cse2): New.
* emit-rtl.c (pass_unshare_all_rtl, pass_remove_unnecessary_notes): New.
* except.c (pass_set_nothrow_function_flags,
pass_convert_to_eh_region_ranges, gate_handle_eh, rest_of_handle_eh,
pass_rtl_eh): New.
* final.c (pass_compute_alignments, rest_of_handle_final, pass_final,
rest_of_handle_shorten_branches, pass_shorten_branches,
rest_of_clean_state, pass_clean_state): New.
* flow.c (pass_recompute_reg_usage, gate_remove_death_notes,
rest_of_handle_remove_death_notes, pass_remove_death_notes,
rest_of_handle_life, pass_life, rest_of_handle_flow2,
pass_flow2): New.
* function.c (pass_instantiate_virtual_regs, pass_init_function,
rest_of_handle_check_leaf_regs, pass_leaf_regs): New.
* gcse.c (gate_handle_jump_bypass, rest_of_handle_jump_bypass,
pass_jump_bypass, gate_handle_gcse, rest_of_handle_gcse,
pass_gcse): New.
* global.c (rest_of_handle_global_alloc, pass_global_alloc): New.
* ifcvt.c (gate_handle_if_conversion, rest_of_handle_if_conversion,
pass_rtl_ifcvt, gate_handle_if_after_combine,
rest_of_handle_if_after_combine, pass_if_after_combine,
gate_handle_if_after_reload, rest_of_handle_if_after_reload,
pass_if_after_reload): New.
* integrate.c (pass_initial_value_sets): New.
* jump.c (pass_cleanup_barriers, purge_line_number_notes,
pass_purge_lineno_notes): New.
* mode-switching.c (rest_of_handle_mode_switching,
pass_mode_switching): New.
* local-alloc.c (rest_of_handle_local_alloc, pass_local_alloc): New.
* loop-init.c (gate_handle_loop2, rest_of_handle_loop2,
pass_loop2): New.
* loop.c (gate_handle_loop_optimize, rest_of_handle_loop_optimize,
pass_loop_optimize): New.
* modulo-sched.c (gate_handle_sms, rest_of_handle_sms,
pass_sms): New.
* postreload-gcse.c (gate_handle_gcse2, rest_of_handle_gcse2,
pass_gcse2): New.
* postreload.c (gate_handle_postreload, rest_of_handle_postreload,
pass_postreload_cse): New.
* profile.c (gate_handle_profiling, pass_profiling,
rest_of_handle_branch_prob, pass_branch_prob): New.
* recog.c (pass pass_split_for_shorten_branches, gate_do_final_split,
pass_split_before_regstack, gate_handle_split_before_regstack,
gate_handle_peephole2, rest_of_handle_peephole2, pass_peephole2,
rest_of_handle_split_all_insns, pass_split_all_insns): New.
* reg-stack.c (gate_handle_stack_regs, rest_of_handle_stack_regs,
pass_stack_regs): New.
* regmove.c (gate_handle_regmove, rest_of_handle_regmove, pass_regmove,
gate_handle_stack_adjustments, rest_of_handle_stack_adjustments,
pass_stack_adjustments): New.
* regrename.c (gate_handle_regrename, rest_of_handle_regrename,
pass_regrename): New.
* reorg.c (gate_handle_delay_slots, rest_of_handle_delay_slots,
pass_delay_slots, gate_handle_machine_reorg,
rest_of_handle_machine_reorg, pass_machine_reorg): New.
* rtl.h (extern void purge_line_number_notes): New.
* sched-rgn.c (gate_handle_sched, rest_of_handle_sched,
gate_handle_sched2, rest_of_handle_sched2, pass_sched,
pass_sched2): New.
* tracer.c (gate_handle_tracer, rest_of_handle_tracer,
pass_tracer): New.
* value-prof.c (gate_handle_value_profile_transformations,
rest_of_handle_value_profile_transformations,
pass_value_profile_transformations): New.
* var-tracking.c (gate_handle_var_tracking,
pass_variable_tracking): New.
* web.c (gate_handle_web, rest_of_handle_web, pass_web): New.
* passes.c (open_dump_file, close_dump_file, rest_of_handle_final,
rest_of_handle_delay_slots, rest_of_handle_stack_regs,
rest_of_handle_variable_tracking, rest_of_handle_machine_reorg,
rest_of_handle_old_regalloc, rest_of_handle_regrename,
rest_of_handle_reorder_blocks, rest_of_handle_partition_blocks,
rest_of_handle_sms, rest_of_handle_sched, rest_of_handle_sched2,
rest_of_handle_gcse2, rest_of_handle_regmove,
rest_of_handle_tracer, rest_of_handle_if_conversion,
rest_of_handle_if_after_combine, rest_of_handle_if_after_reload,
rest_of_handle_web, rest_of_handle_branch_prob,
rest_of_handle_value_profile_transformations, rest_of_handle_cfg,
rest_of_handle_jump_bypass, rest_of_handle_combine,
rest_of_handle_life, rest_of_handle_cse, rest_of_handle_cse2,
rest_of_handle_gcse, rest_of_handle_loop_optimize,
rest_of_handle_loop2, rest_of_handle_branch_target_load_optimize,
rest_of_handle_mode_switching, rest_of_handle_jump,
rest_of_handle_eh, rest_of_handle_stack_adjustments,
rest_of_handle_flow2, rest_of_handle_jump2,
rest_of_handle_peephole2, rest_of_handle_postreload,
rest_of_handle_shorten_branches, rest_of_clean_state,
rest_of_compilation): Remove.
* cgraphunit.c (ipa_passes): Moved from tree-optimize.c.
* passes.c (dump_flags, in_gimple_form, all_passes,
all_ipa_passes, all_lowering_passes, register_one_dump_file,
register_dump_files, next_pass_1, last_verified, execute_todo,
execute_one_pass, execute_pass_list, execute_ipa_pass_list): Moved
from tree-optimize.c.
(init_optimization_passes): Moved from tree-optimize.c,
adding the RTL optimizations.
* tree-dump.h (dump_info_p, dump_flag): Moved from tree.h.
* tree-optimize.c (dump_flags, in_gimple_form, all_passes,
all_ipa_passes, all_lowering_passes, register_one_dump_file,
register_dump_files, next_pass_1, last_verified, execute_todo,
execute_one_pass, execute_pass_list, execute_ipa_pass_list,
init_tree_optimization_passes, ipa_passes): Delete.
* tree-pass.h (enum tree_dump_index): Moved from tree.h, removing
the RTL dumps.
(TDF_*, get_dump_file_name, dump_enabled_p, dump_initialized_p,
dump_begin, dump_end, dump_node, dump_switch_p, dump_flag_name): Moved
from tree.h.
(ipa_passes): Remove.
(all_passes, all_ipa_passes, all_lowering_passes): Now extern.
* tree.h (enum tree_dump_index, TDF_*, get_dump_file_name,
dump_enabled_p, dump_initialized_p, dump_begin, dump_end, dump_node,
dump_switch_p, dump_flag_name): Moved to tree-pass.h.
(dump_info_p, dump_flag): Moved to tree-dump.h.
* Makefile.in: Adjust dependencies for tree-pretty-print.c,
cgraph.c, opts.c.
* passes.c (finish_optimization_passes): Use dump_begin
and dump_end, TDI_end.
(gate_rest_of_compilation): New.
(pass_rest_of_compilation): Use it.
(gate_postreload, pass_postreload): New.
* toplev.c (general_init): Rename init_tree_optimization_passes.
* toplev.h (init_tree_optimization_passes): Rename to
init_optimizations_passes.
* tree-dump.c (dump_flag): Make static.
(dump_files): Remove RTL dumps.
* tree-optimize.c (pass_all_optimizations, pass_early_local_passes,
pass_cleanup_cfg, pass_free_cfg_annotations,
pass_cleanup_cfg_post_optimizing, pass_free_datastructures,
pass_init_datastructures, pass_fixup_cfg): Make non-static.
* tree-pretty-print.c: Include tree-pass.h.
* cgraph.c: Include tree-dump.h.
cp:
2005-07-05 Paolo Bonzini <bonzini@gnu.org>
* Makefile.in (class.o, decl2.o): Adjust dependencies.
* class.c: Include tree-dump.h.
* decl2.c: Include tree-dump.h.
java:
2005-07-05 Paolo Bonzini <bonzini@gnu.org>
* Makefile.in (parse.o): Adjust dependencies.
* parse.y: Include tree-dump.h.
From-SVN: r101627
2005-07-05 18:20:53 +02:00
|
|
|
|
#include "tree-dump.h"
|
toplev.c (default_tree_printer): Handle setting location with '+' flag.
2005-07-02 Zack Weinberg <zack@codesourcery.com>
Joseph S. Myers <joseph@codesourcery.com>
* toplev.c (default_tree_printer): Handle setting location with
'+' flag.
* c-objc.common.c (c_tree_printer): Likewise.
* c-format.c (gcc_diag_flag_specs): Add '+'.
(gcc_cdiag_char_table): Allow '+' flag for tree formats.
(format_types_orig): Allow '+' flag for gcc_diag and gcc_cdiag
formats.
* c-common.c, c-decl.c, c-objc-common.c, c-pragma.c,
config/arm/pe.c, config/i386/winnt.c, config/ia64/ia64.c,
config/mcore/mcore.c, config/sh/symbian.c, config/sol2.c,
config/v850/v850.c, function.c, stor-layout.c, toplev.c,
tree-inline.c, tree-optimize.c, tree.c, varasm.c: Use '+' flag
instead of %J or %H. Use 'q' flag for quoting. Avoid '.' at end
of diagnostics. Use %q+D not %s for a decl. Do not pass excess
format arguments where %J is used without %D.
cp:
* error.c (location_of): Add comment.
(locate_error, cp_error_at, cp_warning_at, cp_pedwarn_at): Remove.
* cp-tree.h (cp_error_at, cp_warning_at, cp_pedwarn_at): Remove.
* call.c, class.c, decl.c, decl2.c, friend.c, init.c,
name-lookup.c, parser.c, pt.c, search.c, semantics.c, typeck.c,
typeck2.c: Use '+' flag instead of %J, cp_error_at, cp_warning_at
or cp_pedwarn_at. Mark up some diagnostic strings with N_.
java:
* class.c, decl.c, expr.c: Use '+' flag instead of %J. Use 'q'
flag for quoting.
objc:
* objc-act.c: Use '+' flag instead of %J. Use 'q' flag for
quoting.
testsuite:
* gcc.dg/format/gcc_diag-1.c: Update.
From-SVN: r101532
2005-07-02 12:55:32 +02:00
|
|
|
|
#include "intl.h"
|
2008-07-28 16:33:56 +02:00
|
|
|
|
#include "gimple.h"
|
2009-09-03 06:07:12 +02:00
|
|
|
|
#include "pointer-set.h"
|
Makefile.in (EXCEPT_H): Fix typo.
gcc/ChangeLog:
* Makefile.in (EXCEPT_H): Fix typo.
objc/ChangeLog:
* objc-act.h: Do not include gimple.h.
* objc-act.c: Do not include rtl.h, expr.h, libfuncs.h, and tm_p.h.
Include gimple.h. Explain why except.h has to be included.
* objc-lang.c: Do not include diagnostics.h.
* Make-lang.in: Update dependencies.
objcp/ChangeLog:
* objcp-decl.c: Do not include tm.h, rtl.h, expr.h, c-common.h,
flags.h, input.h, except.h, output.h, toplev.h, cpplib.h, debug.h,
and target.h.
* objcp-lang.c: Do not include tm.h, toplev.h, diagnostics.h,
and debug.h. Explain why except.h has to be included.
* Make-lang.in: Update dependencies.
cp/ChangeLog:
* cp-tree.h: Do not include splay-tree.h.
(struct prtmem_cst): Remove unused field and false comment.
* typeck.c: Do not include rtl.h, expr.h, and tm_p.h.
* optimize.c: Do not inclde rtl.h, insn-config.h, and integrate.h.
* init.c: Do not include rtl.h and expr.h.
* class.c: Do not include rtl.h. Include splay-tree.h.
(build_clone): Use plain NULL instead of NULL_RTX.
* decl.c: Do not include expr.h. Explain why rtl.h has to be
included. Include splay-tree.h.
* method.c: Do not include rtl.h and expr.h.
(use_thunk): Use plain NULL instead of NULL_RTX.
* except.c: Do not include rtl.h, expr.h, and libfuncs.h.
* tree.c: Do not include rtl.h, insn-config.h, integrate.h,
and target.h. Include splay-tree.h.
* expr.c: Do not include rtl.h and expr.h.
* pt.c: Do not include obstack.h and rtl.h.
(tsubst_friend_function): Use plain NULL instead of NULL_RTX.
(tsubst_decl): Likewise.
(instantiate_decl): Likewise.
* semantics.c: Do not include exprt.h and debug.h. Explain why
rtl.h has to be included.
* decl2.c: Do not include rtl.h and expr.h. Include splay-tree.h.
* call.c: Do not include rtl.h and expr.h.
* search.c: Do not include obstack.h and rtl.h.
* friend.c: Do not include rtl.h and expr.h.
* Make-lang.in: Update dependencies.
From-SVN: r159839
2010-05-25 20:14:23 +02:00
|
|
|
|
#include "splay-tree.h"
|
2010-06-01 15:00:50 +02:00
|
|
|
|
#include "langhooks.h"
|
2010-06-05 22:33:22 +02:00
|
|
|
|
#include "c-family/c-ada-spec.h"
|
2004-05-13 08:41:07 +02:00
|
|
|
|
|
2000-11-28 22:13:35 +01:00
|
|
|
|
extern cpp_reader *parse_in;
|
1998-06-10 12:16:45 +02:00
|
|
|
|
|
1999-04-23 01:13:12 +02:00
|
|
|
|
/* This structure contains information about the initializations
|
|
|
|
|
and/or destructions required for a particular priority level. */
|
|
|
|
|
typedef struct priority_info_s {
|
2002-09-21 14:51:56 +02:00
|
|
|
|
/* Nonzero if there have been any initializations at this priority
|
1999-04-30 18:14:58 +02:00
|
|
|
|
throughout the translation unit. */
|
|
|
|
|
int initializations_p;
|
2002-09-21 14:51:56 +02:00
|
|
|
|
/* Nonzero if there have been any destructions at this priority
|
1999-04-30 18:14:58 +02:00
|
|
|
|
throughout the translation unit. */
|
|
|
|
|
int destructions_p;
|
1999-04-23 01:13:12 +02:00
|
|
|
|
} *priority_info;
|
|
|
|
|
|
Remove traditional C constructs 4/n.
* decl2.c (grok_method_quals, warn_if_unknown_interface,
grok_x_components, cp_build_parm_decl, build_artificial_parm,
maybe_retrofit_in_chrg, grokclassfn, grok_array_decl,
delete_sanity, check_member_template, check_java_method,
check_classfn, finish_static_data_member_decl, grokfield,
grokbitfield, grokoptypename, grok_function_init,
cplus_decl_attributes, constructor_name, defer_fn,
build_anon_union_vars, finish_anon_union, coerce_new_type,
coerce_delete_type, comdat_linkage, maybe_make_one_only,
key_method, import_export_vtable, import_export_class,
output_vtable_inherit, import_export_decl, import_export_tinfo,
build_cleanup, get_guard, get_guard_bits, get_guard_cond,
set_guard, start_objects, finish_objects,
start_static_storage_duration_function,
finish_static_storage_duration_function, get_priority_info,
start_static_initialization_or_destruction,
finish_static_initialization_or_destruction,
do_static_initialization, do_static_destruction,
prune_vars_needing_no_initialization, write_out_vars,
reparse_decl_as_expr, finish_decl_parsing, namespace_ancestor,
add_using_namespace, merge_functions, ambiguous_decl,
lookup_using_namespace, lookup_using_namespace,
qualified_lookup_using_namespace, set_decl_namespace,
decl_namespace, current_decl_namespace, push_decl_namespace,
pop_decl_namespace, push_scope, pop_scope, add_function,
arg_assoc_namespace, arg_assoc_template_arg, arg_assoc,
lookup_arg_dependent, do_namespace_alias,
validate_nonmember_using_decl, do_nonmember_using_decl,
do_toplevel_using_decl, do_local_using_decl,
do_class_using_decl, do_using_directive, check_default_args,
mark_used, handle_class_head): Use C90 prototypings. Use booleans.
* parser.c (cp_parser_class_head): Use booleanss.
* decl.c (walk_globals, walk_vtables): Likewise.
* cp-tree.h (walk_globals_pred, walk_globals_fn, walk_vtables,
walk_globals): Change return type from 'int' to 'bool'.
* rtti.c (init_rtti_processing, build_headof, throw_bad_cast
throw_bad_typeid, get_tinfo_decl_dynamic, typeid_ok_p,
build_typeid, tinfo_name, get_tinfo_decl, get_tinfo_ptr,
get_typeid, ifnonnull, build_dynamic_cast_1, build_dynamic_cast,
qualifier_flags, tinfo_base_init, generic_initializer,
ptr_initializer, dfs_class_hint_mark, ptm_initializer,
dfs_class_hint_unmark, class_hint_flags, class_initializer,
typeinfo_in_lib_p, get_pseudo_ti_init, create_pseudo_type_info,
get_pseudo_ti_desc, create_tinfo_types, emit_support_tinfos,
unemitted_tinfo_decl_p, emit_tinfo_decl): Likewise.
* repo.c (repo_compile_flags, repo_template_declared,
repo_template_defined, repo_class_defined, repo_get_id,
repo_template_used, repo_vtable_used, repo_inline_used,
repo_tinfo_used, repo_template_instantiated, extract_string,
open_repo_file, afgets, init_repo, reopen_repo_file_for_write,
finish_repo): Likewise.
* ptree.c (cxx_print_decl, cxx_print_type, cxx_print_identifier,
cxx_print_xnode): Likewise..
* cp-lang.c (ok_to_generate_alias_set_for_type, cxx_get_alias_set,
cxx_warn_unused_global_decl, cp_expr_size): Likewise.
* cxxfilt.c (demangle_it, print_demangler_list, usage,
standard_symbol_characters, hp_symbol_characters, main, fatal):
Likewise.
(strip_underscore): Change type from 'int' to 'bool'.
(main): Use boolean constants.
From-SVN: r60601
2002-12-29 15:53:05 +01:00
|
|
|
|
static void mark_vtable_entries (tree);
|
|
|
|
|
static bool maybe_emit_vtables (tree);
|
|
|
|
|
static bool acceptable_java_type (tree);
|
|
|
|
|
static tree start_objects (int, int);
|
|
|
|
|
static void finish_objects (int, int, tree);
|
2003-04-20 13:57:38 +02:00
|
|
|
|
static tree start_static_storage_duration_function (unsigned);
|
Remove traditional C constructs 4/n.
* decl2.c (grok_method_quals, warn_if_unknown_interface,
grok_x_components, cp_build_parm_decl, build_artificial_parm,
maybe_retrofit_in_chrg, grokclassfn, grok_array_decl,
delete_sanity, check_member_template, check_java_method,
check_classfn, finish_static_data_member_decl, grokfield,
grokbitfield, grokoptypename, grok_function_init,
cplus_decl_attributes, constructor_name, defer_fn,
build_anon_union_vars, finish_anon_union, coerce_new_type,
coerce_delete_type, comdat_linkage, maybe_make_one_only,
key_method, import_export_vtable, import_export_class,
output_vtable_inherit, import_export_decl, import_export_tinfo,
build_cleanup, get_guard, get_guard_bits, get_guard_cond,
set_guard, start_objects, finish_objects,
start_static_storage_duration_function,
finish_static_storage_duration_function, get_priority_info,
start_static_initialization_or_destruction,
finish_static_initialization_or_destruction,
do_static_initialization, do_static_destruction,
prune_vars_needing_no_initialization, write_out_vars,
reparse_decl_as_expr, finish_decl_parsing, namespace_ancestor,
add_using_namespace, merge_functions, ambiguous_decl,
lookup_using_namespace, lookup_using_namespace,
qualified_lookup_using_namespace, set_decl_namespace,
decl_namespace, current_decl_namespace, push_decl_namespace,
pop_decl_namespace, push_scope, pop_scope, add_function,
arg_assoc_namespace, arg_assoc_template_arg, arg_assoc,
lookup_arg_dependent, do_namespace_alias,
validate_nonmember_using_decl, do_nonmember_using_decl,
do_toplevel_using_decl, do_local_using_decl,
do_class_using_decl, do_using_directive, check_default_args,
mark_used, handle_class_head): Use C90 prototypings. Use booleans.
* parser.c (cp_parser_class_head): Use booleanss.
* decl.c (walk_globals, walk_vtables): Likewise.
* cp-tree.h (walk_globals_pred, walk_globals_fn, walk_vtables,
walk_globals): Change return type from 'int' to 'bool'.
* rtti.c (init_rtti_processing, build_headof, throw_bad_cast
throw_bad_typeid, get_tinfo_decl_dynamic, typeid_ok_p,
build_typeid, tinfo_name, get_tinfo_decl, get_tinfo_ptr,
get_typeid, ifnonnull, build_dynamic_cast_1, build_dynamic_cast,
qualifier_flags, tinfo_base_init, generic_initializer,
ptr_initializer, dfs_class_hint_mark, ptm_initializer,
dfs_class_hint_unmark, class_hint_flags, class_initializer,
typeinfo_in_lib_p, get_pseudo_ti_init, create_pseudo_type_info,
get_pseudo_ti_desc, create_tinfo_types, emit_support_tinfos,
unemitted_tinfo_decl_p, emit_tinfo_decl): Likewise.
* repo.c (repo_compile_flags, repo_template_declared,
repo_template_defined, repo_class_defined, repo_get_id,
repo_template_used, repo_vtable_used, repo_inline_used,
repo_tinfo_used, repo_template_instantiated, extract_string,
open_repo_file, afgets, init_repo, reopen_repo_file_for_write,
finish_repo): Likewise.
* ptree.c (cxx_print_decl, cxx_print_type, cxx_print_identifier,
cxx_print_xnode): Likewise..
* cp-lang.c (ok_to_generate_alias_set_for_type, cxx_get_alias_set,
cxx_warn_unused_global_decl, cp_expr_size): Likewise.
* cxxfilt.c (demangle_it, print_demangler_list, usage,
standard_symbol_characters, hp_symbol_characters, main, fatal):
Likewise.
(strip_underscore): Change type from 'int' to 'bool'.
(main): Use boolean constants.
From-SVN: r60601
2002-12-29 15:53:05 +01:00
|
|
|
|
static void finish_static_storage_duration_function (tree);
|
|
|
|
|
static priority_info get_priority_info (int);
|
2005-09-26 10:42:57 +02:00
|
|
|
|
static void do_static_initialization_or_destruction (tree, bool);
|
|
|
|
|
static void one_static_initialization_or_destruction (tree, tree, bool);
|
2003-04-20 13:57:38 +02:00
|
|
|
|
static void generate_ctor_or_dtor_function (bool, int, location_t *);
|
Remove traditional C constructs 4/n.
* decl2.c (grok_method_quals, warn_if_unknown_interface,
grok_x_components, cp_build_parm_decl, build_artificial_parm,
maybe_retrofit_in_chrg, grokclassfn, grok_array_decl,
delete_sanity, check_member_template, check_java_method,
check_classfn, finish_static_data_member_decl, grokfield,
grokbitfield, grokoptypename, grok_function_init,
cplus_decl_attributes, constructor_name, defer_fn,
build_anon_union_vars, finish_anon_union, coerce_new_type,
coerce_delete_type, comdat_linkage, maybe_make_one_only,
key_method, import_export_vtable, import_export_class,
output_vtable_inherit, import_export_decl, import_export_tinfo,
build_cleanup, get_guard, get_guard_bits, get_guard_cond,
set_guard, start_objects, finish_objects,
start_static_storage_duration_function,
finish_static_storage_duration_function, get_priority_info,
start_static_initialization_or_destruction,
finish_static_initialization_or_destruction,
do_static_initialization, do_static_destruction,
prune_vars_needing_no_initialization, write_out_vars,
reparse_decl_as_expr, finish_decl_parsing, namespace_ancestor,
add_using_namespace, merge_functions, ambiguous_decl,
lookup_using_namespace, lookup_using_namespace,
qualified_lookup_using_namespace, set_decl_namespace,
decl_namespace, current_decl_namespace, push_decl_namespace,
pop_decl_namespace, push_scope, pop_scope, add_function,
arg_assoc_namespace, arg_assoc_template_arg, arg_assoc,
lookup_arg_dependent, do_namespace_alias,
validate_nonmember_using_decl, do_nonmember_using_decl,
do_toplevel_using_decl, do_local_using_decl,
do_class_using_decl, do_using_directive, check_default_args,
mark_used, handle_class_head): Use C90 prototypings. Use booleans.
* parser.c (cp_parser_class_head): Use booleanss.
* decl.c (walk_globals, walk_vtables): Likewise.
* cp-tree.h (walk_globals_pred, walk_globals_fn, walk_vtables,
walk_globals): Change return type from 'int' to 'bool'.
* rtti.c (init_rtti_processing, build_headof, throw_bad_cast
throw_bad_typeid, get_tinfo_decl_dynamic, typeid_ok_p,
build_typeid, tinfo_name, get_tinfo_decl, get_tinfo_ptr,
get_typeid, ifnonnull, build_dynamic_cast_1, build_dynamic_cast,
qualifier_flags, tinfo_base_init, generic_initializer,
ptr_initializer, dfs_class_hint_mark, ptm_initializer,
dfs_class_hint_unmark, class_hint_flags, class_initializer,
typeinfo_in_lib_p, get_pseudo_ti_init, create_pseudo_type_info,
get_pseudo_ti_desc, create_tinfo_types, emit_support_tinfos,
unemitted_tinfo_decl_p, emit_tinfo_decl): Likewise.
* repo.c (repo_compile_flags, repo_template_declared,
repo_template_defined, repo_class_defined, repo_get_id,
repo_template_used, repo_vtable_used, repo_inline_used,
repo_tinfo_used, repo_template_instantiated, extract_string,
open_repo_file, afgets, init_repo, reopen_repo_file_for_write,
finish_repo): Likewise.
* ptree.c (cxx_print_decl, cxx_print_type, cxx_print_identifier,
cxx_print_xnode): Likewise..
* cp-lang.c (ok_to_generate_alias_set_for_type, cxx_get_alias_set,
cxx_warn_unused_global_decl, cp_expr_size): Likewise.
* cxxfilt.c (demangle_it, print_demangler_list, usage,
standard_symbol_characters, hp_symbol_characters, main, fatal):
Likewise.
(strip_underscore): Change type from 'int' to 'bool'.
(main): Use boolean constants.
From-SVN: r60601
2002-12-29 15:53:05 +01:00
|
|
|
|
static int generate_ctor_and_dtor_functions_for_priority (splay_tree_node,
|
2005-06-15 02:41:35 +02:00
|
|
|
|
void *);
|
2003-02-26 06:39:01 +01:00
|
|
|
|
static tree prune_vars_needing_no_initialization (tree *);
|
Remove traditional C constructs 4/n.
* decl2.c (grok_method_quals, warn_if_unknown_interface,
grok_x_components, cp_build_parm_decl, build_artificial_parm,
maybe_retrofit_in_chrg, grokclassfn, grok_array_decl,
delete_sanity, check_member_template, check_java_method,
check_classfn, finish_static_data_member_decl, grokfield,
grokbitfield, grokoptypename, grok_function_init,
cplus_decl_attributes, constructor_name, defer_fn,
build_anon_union_vars, finish_anon_union, coerce_new_type,
coerce_delete_type, comdat_linkage, maybe_make_one_only,
key_method, import_export_vtable, import_export_class,
output_vtable_inherit, import_export_decl, import_export_tinfo,
build_cleanup, get_guard, get_guard_bits, get_guard_cond,
set_guard, start_objects, finish_objects,
start_static_storage_duration_function,
finish_static_storage_duration_function, get_priority_info,
start_static_initialization_or_destruction,
finish_static_initialization_or_destruction,
do_static_initialization, do_static_destruction,
prune_vars_needing_no_initialization, write_out_vars,
reparse_decl_as_expr, finish_decl_parsing, namespace_ancestor,
add_using_namespace, merge_functions, ambiguous_decl,
lookup_using_namespace, lookup_using_namespace,
qualified_lookup_using_namespace, set_decl_namespace,
decl_namespace, current_decl_namespace, push_decl_namespace,
pop_decl_namespace, push_scope, pop_scope, add_function,
arg_assoc_namespace, arg_assoc_template_arg, arg_assoc,
lookup_arg_dependent, do_namespace_alias,
validate_nonmember_using_decl, do_nonmember_using_decl,
do_toplevel_using_decl, do_local_using_decl,
do_class_using_decl, do_using_directive, check_default_args,
mark_used, handle_class_head): Use C90 prototypings. Use booleans.
* parser.c (cp_parser_class_head): Use booleanss.
* decl.c (walk_globals, walk_vtables): Likewise.
* cp-tree.h (walk_globals_pred, walk_globals_fn, walk_vtables,
walk_globals): Change return type from 'int' to 'bool'.
* rtti.c (init_rtti_processing, build_headof, throw_bad_cast
throw_bad_typeid, get_tinfo_decl_dynamic, typeid_ok_p,
build_typeid, tinfo_name, get_tinfo_decl, get_tinfo_ptr,
get_typeid, ifnonnull, build_dynamic_cast_1, build_dynamic_cast,
qualifier_flags, tinfo_base_init, generic_initializer,
ptr_initializer, dfs_class_hint_mark, ptm_initializer,
dfs_class_hint_unmark, class_hint_flags, class_initializer,
typeinfo_in_lib_p, get_pseudo_ti_init, create_pseudo_type_info,
get_pseudo_ti_desc, create_tinfo_types, emit_support_tinfos,
unemitted_tinfo_decl_p, emit_tinfo_decl): Likewise.
* repo.c (repo_compile_flags, repo_template_declared,
repo_template_defined, repo_class_defined, repo_get_id,
repo_template_used, repo_vtable_used, repo_inline_used,
repo_tinfo_used, repo_template_instantiated, extract_string,
open_repo_file, afgets, init_repo, reopen_repo_file_for_write,
finish_repo): Likewise.
* ptree.c (cxx_print_decl, cxx_print_type, cxx_print_identifier,
cxx_print_xnode): Likewise..
* cp-lang.c (ok_to_generate_alias_set_for_type, cxx_get_alias_set,
cxx_warn_unused_global_decl, cp_expr_size): Likewise.
* cxxfilt.c (demangle_it, print_demangler_list, usage,
standard_symbol_characters, hp_symbol_characters, main, fatal):
Likewise.
(strip_underscore): Change type from 'int' to 'bool'.
(main): Use boolean constants.
From-SVN: r60601
2002-12-29 15:53:05 +01:00
|
|
|
|
static void write_out_vars (tree);
|
|
|
|
|
static void import_export_class (tree);
|
|
|
|
|
static tree get_guard_bits (tree);
|
2006-03-21 04:19:06 +01:00
|
|
|
|
static void determine_visibility_from_class (tree, tree);
|
2009-08-10 22:47:55 +02:00
|
|
|
|
static bool decl_defined_p (tree);
|
1999-09-30 17:48:19 +02:00
|
|
|
|
|
1994-02-24 02:02:37 +01:00
|
|
|
|
/* A list of static class variables. This is needed, because a
|
|
|
|
|
static class variable can be declared inside the class without
|
2001-10-28 20:25:00 +01:00
|
|
|
|
an initializer, and then initialized, statically, outside the class. */
|
2005-05-06 21:03:35 +02:00
|
|
|
|
static GTY(()) VEC(tree,gc) *pending_statics;
|
1994-02-24 02:02:37 +01:00
|
|
|
|
|
1994-04-08 08:08:43 +02:00
|
|
|
|
/* A list of functions which were declared inline, but which we
|
1996-07-11 03:13:25 +02:00
|
|
|
|
may need to emit outline anyway. */
|
2005-05-05 23:57:46 +02:00
|
|
|
|
static GTY(()) VEC(tree,gc) *deferred_fns;
|
1994-02-24 02:02:37 +01:00
|
|
|
|
|
2009-08-10 22:47:55 +02:00
|
|
|
|
/* A list of decls that use types with no linkage, which we need to make
|
|
|
|
|
sure are defined. */
|
|
|
|
|
static GTY(()) VEC(tree,gc) *no_linkage_decls;
|
|
|
|
|
|
1996-02-28 23:01:56 +01:00
|
|
|
|
/* Nonzero if we're done parsing and into end-of-file activities. */
|
|
|
|
|
|
|
|
|
|
int at_eof;
|
|
|
|
|
|
1994-02-24 02:02:37 +01:00
|
|
|
|
|
2006-04-24 05:50:31 +02:00
|
|
|
|
|
|
|
|
|
/* Return a member function type (a METHOD_TYPE), given FNTYPE (a
|
|
|
|
|
FUNCTION_TYPE), CTYPE (class type), and QUALS (the cv-qualifiers
|
|
|
|
|
that apply to the function). */
|
|
|
|
|
|
|
|
|
|
tree
|
|
|
|
|
build_memfn_type (tree fntype, tree ctype, cp_cv_quals quals)
|
1994-02-24 02:02:37 +01:00
|
|
|
|
{
|
2006-04-24 05:50:31 +02:00
|
|
|
|
tree raises;
|
2009-11-06 22:18:35 +01:00
|
|
|
|
tree attrs;
|
2006-04-24 05:50:31 +02:00
|
|
|
|
int type_quals;
|
1994-02-24 02:02:37 +01:00
|
|
|
|
|
2006-05-08 02:26:08 +02:00
|
|
|
|
if (fntype == error_mark_node || ctype == error_mark_node)
|
|
|
|
|
return error_mark_node;
|
|
|
|
|
|
2009-11-06 22:18:35 +01:00
|
|
|
|
gcc_assert (TREE_CODE (fntype) == FUNCTION_TYPE
|
|
|
|
|
|| TREE_CODE (fntype) == METHOD_TYPE);
|
|
|
|
|
|
2004-06-27 05:03:55 +02:00
|
|
|
|
type_quals = quals & ~TYPE_QUAL_RESTRICT;
|
cplus-dem.c (work_stuff): Replace const_type and volatile_type with type_quals.
* cplus-dem.c (work_stuff): Replace const_type and volatile_type
with type_quals.
(TYPE_UNQUALIFIED): New macro.
(TYPE_QUAL_CONST): Likewise.
(TYPE_QUAL_VOLATILE): Likewise.
(TYPE_QUAL_RESTRICT): Likewise.
(code_for_qualifier): New function.
(qualifier_string): Likewise.
(demangle_qualifier): Likewise.
(internal_cplus_demangle): Use them.
(demangle_signature): Likewise.
(demangle_template_value_parm): Likewise.
(do_type): Likewise.
(demangle_fund_type)): Likewise.
* Makefile.in (hash.h): Run gperf when necessary.
* cp-tree.h (CP_TYPE_READONLY): Remove.
(CP_TYPE_VOLATILE): Likewise.
(CP_TYPE_QUALS): New macro.
(CP_TYPE_CONST_P): Likewise.
(CP_TYPE_VOLATILE_P): Likewise.
(CP_TYPE_RESTRICT_P): Likewise.
(CP_TYPE_CONST_NON_VOLATILE_P): Likewise.
(cp_build_type_variant): Rename to ...
(cp_build_qualified_type): New function.
(c_apply_type_quals_to_decl): Declare.
(SIGNATURE_POINTER_NAME_FORMAT): Modify to allow `restrict'.
(SIGNATURE_REFERENCE_NAME_FORMAT): Likewise.
(cp_type_qual_from_rid): New function.
(compparms): Remove unused parameter. All callers changed.
(cp_type_quals): New function.
(at_least_as_qualified_p): Likewise.
(more_qualified_p): Likewise.
* call.c (standard_conversion): Replace calls to
cp_build_type_variant with cp_build_qualified_type. Use
CP_TYPE_QUALS to get qualifiers and at_least_as_qualified_p to
compare them. Use CP_TYPE_* macros to check qualifiers.
(reference_binding): Likewise.
(implicit_conversion): Likewise.
(add_builtin_candidates): Likewise.
(build_over_call): Likewise.
* class.c (overrides): Compare all qualifiers, not just `const',
on method declarations.
* cvt.c (convert_to_reference): More CP_TYPE_QUALS conversion, etc.
(convert_pointer_to_real): Likewise.
(type_promotes_to): Likewise.
* decl.c (check_for_uninitialized_const_var): New function.
(init_decl_processing): More CP_TYPE_QUALS conversion, etc.
(cp_finish_decl): Use check_for_uninitialized_const_var.
(grokdeclarator): More CP_TYPE_QUALS conversion, etc. Update to
handle `restrict'.
(grok_ctor_properties): Likewise.
(grok_op_properties): Likewise.
(start_function): Likewise.
(rever_static_member_fn): Likewise.
* decl2.c (grok_method_quals): Likewise.
(grokfield): Likewise.
* error.c (dump_readonly_or_volatile): Rename to ...
(dump_qualifiers): New function. Handle `restrict'.
(dump_type_real): Use it.
(dump_aggr_type): Likewise.
(dump_type_prefix): Likewise.
(dump_type_suffix): Likewise.
(dump_function_decl): Likewise.
(cv_as_string): Likewise.
* gxx.gperf: Add __restrict and __restrict__.
* gxxint.texi: Document `u' as used for `__restrict', and a few
other previously undocumented codes.
* hash.h: Regenerated.
* init.c (expand_aggr_init): More CP_TYPE_QUALS conversion, etc.
(build_member_call): Likewise.
(build_new_1): Likewise.
* lex.c (init_parse): Add entry for RID_RESTRICT.
(cons_up_default_function): More CP_TYPE_QUALS conversion, etc.
(cp_type_qual_from_rid): Define.
* lex.h (enum rid): Add RID_RESTRICT.
* method.c (process_modifiers): Deal with `restrict'.
* parse.y (primary): More CP_TYPE_QUALS conversion, etc.
* parse.c: Regenerated.
* pt.c (convert_nontype_argument): More CP_TYPE_QUALS conversion, etc.
(tsubst_aggr_type): Likewise.
(tsubst): Likewise.
(check_cv_quals_for_unify): Likewise.
(unify): Likewise.
* rtti.c (init_rtti_processing): Likewise.
(build_headof): Likewise.
(get_tinfo_var): Likewise.
(buidl_dynamic_cast_1): Likewise. Fix `volatile' handling.
(expand_class_desc): Likewise.
(expand_attr_desc): Likewise.
(synthesize_tinfo_fn): Likewise.
* search.c (covariant_return_p): Likewise. Fix `volatile' handling.
(get_matching_virtual): Likewise.
(expand_upcast_fixups): Likewise.
* sig.c (build_signature_pointer_or_reference_name): Take
type_quals, not constp and volatilep.
(build_signature_pointer_or_reference_type): Likewise.
(match_method_types): More CP_TYPE_QUALS conversion, etc.
(build_signature_pointer_constructor): Likewise.
(build_signature_method_call): Likewise.
* tree.c (build_cplus_array_type): Likewise.
(cp_build_type_variant): Rename to ...
(cp_build_qualified_type): New function. Deal with `__restrict'.
(canonical_type_variant): More CP_TYPE_QUALS conversion, etc.
(build_exception_variant): Likewise.
(mapcar): Likewise.
* typeck.c (qualif_type): Likewise.
(common_type): Likewise.
(comptypes): Likewise.
(comp_cv_target_types): Likewise.
(at_least_as_qualified_p): Define.
(more_qualified_p): Likewise.
(comp_cv_qualification): More CP_TYPE_QUALS conversion, etc.
(compparms): Likewise.
(inline_conversion): Likewise.
(string_conv_p): Likewise.
(build_component_ref): Likewise.
(build_indirect_ref): Likewise.
(build_array_ref): Likewise.
(build_unary_op): Likewise.
(build_conditional_expr): Likewise.
(build_static_cast): Likewise.
(build_c_cast): Likewise.
(build_modify_expr): Likewise.
(convert_For_assignment): Likewise.
(comp_ptr_ttypes_real): Likewise.
(cp_type_quals): New function.
From-SVN: r23258
1998-10-23 16:53:28 +02:00
|
|
|
|
ctype = cp_build_qualified_type (ctype, type_quals);
|
2009-11-06 22:18:35 +01:00
|
|
|
|
raises = TYPE_RAISES_EXCEPTIONS (fntype);
|
|
|
|
|
attrs = TYPE_ATTRIBUTES (fntype);
|
2003-08-25 17:47:43 +02:00
|
|
|
|
fntype = build_method_type_directly (ctype, TREE_TYPE (fntype),
|
|
|
|
|
(TREE_CODE (fntype) == METHOD_TYPE
|
|
|
|
|
? TREE_CHAIN (TYPE_ARG_TYPES (fntype))
|
|
|
|
|
: TYPE_ARG_TYPES (fntype)));
|
1994-02-24 02:02:37 +01:00
|
|
|
|
if (raises)
|
1995-10-12 03:33:51 +01:00
|
|
|
|
fntype = build_exception_variant (fntype, raises);
|
2009-11-06 22:18:35 +01:00
|
|
|
|
if (attrs)
|
|
|
|
|
fntype = cp_build_type_attribute_variant (fntype, attrs);
|
1994-02-24 02:02:37 +01:00
|
|
|
|
|
2006-04-24 05:50:31 +02:00
|
|
|
|
return fntype;
|
1994-02-24 02:02:37 +01:00
|
|
|
|
}
|
|
|
|
|
|
2010-02-09 21:05:51 +01:00
|
|
|
|
/* Return a variant of FNTYPE, a FUNCTION_TYPE or METHOD_TYPE, with its
|
|
|
|
|
return type changed to NEW_RET. */
|
|
|
|
|
|
|
|
|
|
tree
|
|
|
|
|
change_return_type (tree new_ret, tree fntype)
|
|
|
|
|
{
|
|
|
|
|
tree newtype;
|
|
|
|
|
tree args = TYPE_ARG_TYPES (fntype);
|
|
|
|
|
tree raises = TYPE_RAISES_EXCEPTIONS (fntype);
|
|
|
|
|
tree attrs = TYPE_ATTRIBUTES (fntype);
|
|
|
|
|
|
|
|
|
|
if (same_type_p (new_ret, TREE_TYPE (fntype)))
|
|
|
|
|
return fntype;
|
|
|
|
|
|
|
|
|
|
if (TREE_CODE (fntype) == FUNCTION_TYPE)
|
2010-05-19 23:01:50 +02:00
|
|
|
|
{
|
|
|
|
|
newtype = build_function_type (new_ret, args);
|
|
|
|
|
newtype = apply_memfn_quals (newtype, type_memfn_quals (fntype));
|
|
|
|
|
}
|
2010-02-09 21:05:51 +01:00
|
|
|
|
else
|
2010-03-23 23:29:53 +01:00
|
|
|
|
newtype = build_method_type_directly
|
|
|
|
|
(TREE_TYPE (TREE_VALUE (TYPE_ARG_TYPES (fntype))),
|
|
|
|
|
new_ret, TREE_CHAIN (args));
|
2010-02-09 21:05:51 +01:00
|
|
|
|
if (raises)
|
|
|
|
|
newtype = build_exception_variant (newtype, raises);
|
|
|
|
|
if (attrs)
|
|
|
|
|
newtype = cp_build_type_attribute_variant (newtype, attrs);
|
|
|
|
|
|
|
|
|
|
return newtype;
|
|
|
|
|
}
|
|
|
|
|
|
2002-07-26 22:10:43 +02:00
|
|
|
|
/* Build a PARM_DECL with NAME and TYPE, and set DECL_ARG_TYPE
|
|
|
|
|
appropriately. */
|
|
|
|
|
|
|
|
|
|
tree
|
Remove traditional C constructs 4/n.
* decl2.c (grok_method_quals, warn_if_unknown_interface,
grok_x_components, cp_build_parm_decl, build_artificial_parm,
maybe_retrofit_in_chrg, grokclassfn, grok_array_decl,
delete_sanity, check_member_template, check_java_method,
check_classfn, finish_static_data_member_decl, grokfield,
grokbitfield, grokoptypename, grok_function_init,
cplus_decl_attributes, constructor_name, defer_fn,
build_anon_union_vars, finish_anon_union, coerce_new_type,
coerce_delete_type, comdat_linkage, maybe_make_one_only,
key_method, import_export_vtable, import_export_class,
output_vtable_inherit, import_export_decl, import_export_tinfo,
build_cleanup, get_guard, get_guard_bits, get_guard_cond,
set_guard, start_objects, finish_objects,
start_static_storage_duration_function,
finish_static_storage_duration_function, get_priority_info,
start_static_initialization_or_destruction,
finish_static_initialization_or_destruction,
do_static_initialization, do_static_destruction,
prune_vars_needing_no_initialization, write_out_vars,
reparse_decl_as_expr, finish_decl_parsing, namespace_ancestor,
add_using_namespace, merge_functions, ambiguous_decl,
lookup_using_namespace, lookup_using_namespace,
qualified_lookup_using_namespace, set_decl_namespace,
decl_namespace, current_decl_namespace, push_decl_namespace,
pop_decl_namespace, push_scope, pop_scope, add_function,
arg_assoc_namespace, arg_assoc_template_arg, arg_assoc,
lookup_arg_dependent, do_namespace_alias,
validate_nonmember_using_decl, do_nonmember_using_decl,
do_toplevel_using_decl, do_local_using_decl,
do_class_using_decl, do_using_directive, check_default_args,
mark_used, handle_class_head): Use C90 prototypings. Use booleans.
* parser.c (cp_parser_class_head): Use booleanss.
* decl.c (walk_globals, walk_vtables): Likewise.
* cp-tree.h (walk_globals_pred, walk_globals_fn, walk_vtables,
walk_globals): Change return type from 'int' to 'bool'.
* rtti.c (init_rtti_processing, build_headof, throw_bad_cast
throw_bad_typeid, get_tinfo_decl_dynamic, typeid_ok_p,
build_typeid, tinfo_name, get_tinfo_decl, get_tinfo_ptr,
get_typeid, ifnonnull, build_dynamic_cast_1, build_dynamic_cast,
qualifier_flags, tinfo_base_init, generic_initializer,
ptr_initializer, dfs_class_hint_mark, ptm_initializer,
dfs_class_hint_unmark, class_hint_flags, class_initializer,
typeinfo_in_lib_p, get_pseudo_ti_init, create_pseudo_type_info,
get_pseudo_ti_desc, create_tinfo_types, emit_support_tinfos,
unemitted_tinfo_decl_p, emit_tinfo_decl): Likewise.
* repo.c (repo_compile_flags, repo_template_declared,
repo_template_defined, repo_class_defined, repo_get_id,
repo_template_used, repo_vtable_used, repo_inline_used,
repo_tinfo_used, repo_template_instantiated, extract_string,
open_repo_file, afgets, init_repo, reopen_repo_file_for_write,
finish_repo): Likewise.
* ptree.c (cxx_print_decl, cxx_print_type, cxx_print_identifier,
cxx_print_xnode): Likewise..
* cp-lang.c (ok_to_generate_alias_set_for_type, cxx_get_alias_set,
cxx_warn_unused_global_decl, cp_expr_size): Likewise.
* cxxfilt.c (demangle_it, print_demangler_list, usage,
standard_symbol_characters, hp_symbol_characters, main, fatal):
Likewise.
(strip_underscore): Change type from 'int' to 'bool'.
(main): Use boolean constants.
From-SVN: r60601
2002-12-29 15:53:05 +01:00
|
|
|
|
cp_build_parm_decl (tree name, tree type)
|
2002-07-26 22:10:43 +02:00
|
|
|
|
{
|
java-gimplify.c (java_gimplify_block): New argument to build_empty_stmt.
gcc/java/
* java-gimplify.c (java_gimplify_block): New argument to
build_empty_stmt.
* expr.c (force_evaluation_order): Same.
* typeck.c: Add location to build_decl or PUSH_FIELD calls.
* class.c: Same.
* decl.c: Same.
* jcf-parse.c: Same.
* constants.c: Same.
* resource.c: Same.
* except.c: Same.
* builtins.c: Same.
* expr.c: Same.
* java-tree.h (PUSH_FIELD): Add location field.
gcc/objc/
* objc-act.c (finish_var_decl): Pass location to finish_decl.
(objc_get_parm_info): Same.
(get_super_receiver): Same.
* objc-act.c (objc_build_component_ref): Pass location to
build_compound_ref.
(build_module_initializer_routine): Pass location to
c_end_compound_stmt.
(objc_generate_static_init_call): Pass location to build_stmt.
(build_typed_selector_reference): New location argument.
(build_selector_reference): Same.
(objc_substitute_decl): Pass location to build_array_ref.
(next_sjlj_build_try_catch_finally): Pass location to build_stmt.
(objc_begin_catch_clause): Same.
(objc_finish_try_stmt): Same.
(objc_finish_catch_clause): Pass location to c_end_compound_stmt.
(objc_build_throw_stmt): New argument.
(generate_shared_structures): Pass location to build_c_cast.
(objc_build_message_expr): Use local location.
(objc_finish_message_expr): Use input_location.
(build_objc_method_call): New argument.
(objc_build_selector_expr): Same.
(get_super_receiver): Pass location to build_c_cast,
build_modify_expr, build_compound_expr.
* objc-act.c: Add location to all calls to start_struct, build_decl,
finish_struct.
gcc/
* tree-pretty-print.c (dump_generic_node): Dump column numbers.
* gimple-pretty-print.c (dump_gimple_stmt): Same.
* gimplify.c (gimplify_modify_expr): Set location for GIMPLE_ASSIGNs
created.
* c-parser.c (c_parser_binary_expression): Use current column while
building binary operations.
* common.opt (fshow-column): Enable by default.
* tree-vrp.c (check_array_ref): Use warning_at.
(check_array_bounds): Use location from call back if expr has no
location.
* tree.h: Add location argument to maybe_fold_*.
* tree-ssa-ccp.c (ccp_fold): Pass location to maybe_fold_*.
(maybe_fold_offset_to_array_ref): Add location argument and use it.
(maybe_fold_offset_to_component_ref): Same.
(maybe_fold_offset_to_reference): Same.
(maybe_fold_offset_to_address): Same.
(maybe_fold_stmt_indirect): Same.
(maybe_fold_stmt_addition): Same.
(fold_stmt_r): Pass location to maybe_fold_*.
(fold_gimple_assign): Same.
* c-tree.h: Add location argument to finish_decl,
default_function_array_conversion, store_init_value.
* c-decl.c (define_label): Use error_at.
(c_make_fname_decl): Pass location to finish_decl.
(finish_decl): New location argument.
(build_compound_literal): Pass location to store_init_value.
(grokdeclarator): Pass location to finish_decl.
(grokfield): Same.
* c-typeck.c (array_to_pointer_conversion): New location argument.
(function_to_pointer_conversion): Same.
(default_function_array_conversion): Same.
(parser_build_unary_op): Pass location to overflow_warning.
(parser_build_binary_op): Same. Use warning_at.
(build_unary_op): Pass location to array_to_pointer_conversion.
(build_c_cast): Pass location to digest_init.
(build_modify_expr): New location argument.
(convert_for_assignment): Same.
(store_init_value): Same.
(digest_init): Same.
(output_init_element): Pass location to digest_init and
array_to_pointer_conversion.
(c_finish_return): Pass location to convert_for_assignment.
* gimplify.c (gimplify_conversion): Pass location to
maybe_fold_offset_to_address.
* tree-ssa-forwprop.c (forward_propagate_addr_expr_1): Pass location
to maybe_fold_stmt_addition.
* c-omp.c (c_finish_omp_atomic): Pass new location to
build_modify_expr.
(c_finish_omp_for): Same.
* c-common.c (overflow_warning): New argument.
* c-common.h: New argument to build_modify_expr, overflow_warning.
* c-parser.c (c_parser_declaration_or_fndef): Pass location to
finish_decl.
(c_parser_initializer): Pass location to
default_function_array_conversion.
(c_parser_initelt): Same.
(c_parser_initval): Same.
(c_parser_asm_operands): Same.
(c_parser_expr_no_commas): Same. Pass location to build_modify_expr.
(c_parser_conditional_expression): Same.
(c_parser_binary_expression): Add location info to stack. Use it.
(c_parser_unary_expression): Pass location to
default_function_array_conversion, parser_build_unary_op,
build_indirect_ref, c_parser_postfix_expression_after_primary.
(c_parser_postfix_expression_after_primary): New location argument.
Use it.
(c_parser_expression_conv): Pass location to
default_function_array_conversion.
(c_parser_expr_list): Same.
(c_parser_omp_atomic): Same.
(c_parser_omp_for_loop): Same.
* c-tree.h: (struct c_declarator): Add comment to id_loc.
(build_array_declarator): New argument.
* c-decl.c (build_array_declarator): Add location argument.
(grokdeclarator): Set id_loc for cdk_array.
* c-parser.c (c_parser_direct_declarator_inner): Pass location to
build_array_declarator.
* tree.c (build_omp_clause): Add location argument.
* tree.h (OMP_CLAUSE_HAS_LOCATION): New macro.
(OMP_CLAUSE_LOCATION): New macro.
(struct tree_omp_clause): Add location field.
(build_omp_clause): Add argument.
* testsuite/gcc.dg/gomp/for-1.c: Fix column.
* cp/pt.c (tsubst_omp_for_iterator): Pass location to
build_omp_clause.
* cp/parser.c (cp_parser_omp_var_list_no_open): Same.
(cp_parser_omp_clause_collapse): Same.
(cp_parser_omp_clause_default): Same.
(cp_parser_omp_clause_if): Same.
(cp_parser_omp_clause_nowait): Same.
(cp_parser_omp_clause_num_threads): Same.
(cp_parser_omp_clause_ordered): Same.
(cp_parser_omp_clause_schedule): Same.
(cp_parser_omp_clause_untied): Same.
(cp_parser_omp_for_loop): Same.
(cp_parser_omp_parallel): Pass location to c_split_parallel_clauses.
* c-tree.h (c_start_case): Add location argument.
(c_process_expr_stmt): Same.
(c_finish_goto_*): Same.
* tree-parloops.c (initialize_reductions): Pass location to
build_omp_clause.
(create_parallel_loop): Same.
* fortran/trans-openmp.c (gfc_trans_omp_variable_list): Same.
(gfc_trans_omp_reduction_list): Same.
(gfc_trans_omp_clauses): Same.
(gfc_trans_omp_do): Same.
* c-typeck.c (c_finish_goto_label): Same.
(c_finish_goto_ptr): New location argument.
(c_start_case): Same.
(emit_side_effect_warnings): Same.
(c_process_expr_stmt): Same.
(c_finish_stmt_expr): Same.
(c_finish_omp_clauses): Use error_at instead of error.
* gimplify.c (gimplify_adjust_omp_clauses_1): Pass location to
build_omp_clause.
* c-omp.c (c_split_parallel_clauses): New location argument.
* tree-nested.c (convert_nonlocal_reference_stmt): Pass location
to build_omp_clause.
(convert_local_reference_stmt): Same.
(convert_gimple_call): Same.
* c-common.h (c_split_parallel_clauses): New argument.
* c-parser.c (c_parser_statement_after_labels): Pass location to
c_finish_goto_label.
(c_parser_switch_statement): Pass location to c_start_case.
(c_parser_for_statement): Pass location to c_finish_expr_stmt,
and c_process_expr_stmt.
(c_parser_omp_variable_list): Add location argument.
(c_parser_omp_clause_collapse): Pass location to
build_omp_clause.
(c_parser_omp_clause_default): Same.
(c_parser_omp_clause_if): Same.
(c_parser_omp_clause_num_threads): Same.
(-c_parser_omp_clause_ordered): Same.
(c_parser_omp_clause_reduction): Pass location to
c_parser_omp_variable_list.
(c_parser_omp_clause_schedule): Pass location to build_omp_clause.
(c_parser_omp_clause_untied): Same.
(c_parser_omp_for_loop): Pass location to c_process_expr_stmt.
(c_parser_omp_parallel): Pass location to
c_split_parallel_clauses.
* c-tree.h (check_for_loop_decls, undeclared_variable,
build_component_ref, build_array_ref, build_external_ref,
c_expr_sizeof_expr, c_expr_sizeof_type, parser_build_unary_op,
build_conditional_expr, build_compound_expr, c_cast_expr,
build_c_cast, build_asm_expr, c_end_compound_stmt, c_finish_stmt_expr,
c_finish_return, c_finish_omp_parallel, c_finish_omp_task): New
argument.
* c-semantics.c (build_stmt): Same.
(build_case_label): Same.
* c-decl.c (c_finish_incomplete_decl): Pass location on down.
(undeclared_variable): New argument.
(make_label): Same.
(lookup_label): Pass location on down.
(define_label): Same.
(finish_decl): Same.
(build_compound_literal): Same.
(finish_struct): Same.
(finish_function): Do not set location here.
(check_for_loop_decls): New argument.
* tree.c (save_expr): Set location.
(build_empty_stmt): New argument.
* tree.h (build_empty_stmt): New argument to build_empty_stmt.
(CAN_HAVE_LOCATION_P): Make sure we have a non empty node.
* builtins.c (gimplify_va_arg_expr): Use locations.
(expand_builtin_sync_operation): Same.
* c-typeck.c (build_component_ref): New argument.
(build_array_ref): Same.
(build_external_ref): Same.
(c_expr_sizeof_expr): Same.
(c_expr_sizeof_type): Same.
(parser_build_unary_op): Same.
(build_conditional_expr): Same.
(build_compound_expr): Pass location on down.
(build_compound_expr): New argument.
(build_c_cast): Same.
(c_cast_expr): Same.
(build_asm_expr): Same.
(c_finish_return): Same.
(c_process_expr_stmt): Pass location on down.
(c_finish_stmt_expr): New argument.
(push_clenaup): Same.
(c_finish_omp_parallel): Same.
(c_finish_omp_task): Same.
* gimplify.c (gimplify_call_expr): Pass location on down.
* c-omp.c (c_finish_omp_master): New argument.
(c_finish_omp_critical): Same.
(c_finish_omp_ordered): Same.
(c_finish_omp_barrier): Same.
(-c_finish_omp_taskwait): Same.
(c_finish_omp_atomic): Same.
(c_finish_omp_flush): Same.
* tree-inline.c (copy_tree_body_r): Pass location on down.
(inline_forbidden_p): Remove use of input_location.
* c-gimplify.c (c_build_bind_expr): New argument.
* c-common.c (c_common_truthvalue_conversion): Pass location on down.
(c_sizeof_or_alignof_type): New argument.
(c_alignof_expr): Same.
(build_va_arg): Same.
(c_add_case_label): Same.
* c-common.h (c_sizeof_or_alignof_type, c_alignof_expr,
c_sizeof, c_alignof, build_va_arg, build_stmt, build_case_label,
c_build_bind_expr, objc_build_selector_expr, objc_build_throw_stmt,
c_finish_omp_master, c_finish_omp_critical, c_finish_omp_ordered,
c_finish_omp_barrier, c_finish_omp_atomic, c_finish_omp_flush,
c_finish_omp_taskwait, c_finish_omp_for, c_split_parallel_clauses):
New argument.
* stub-objc.c (objc_build_selector_expr): Same.
(objc_build_throw_stmt): Same.
* c-parser.c (c_parser_declaration_or_fndef): Pass location on down.
(c_parser_initelt): Same.
(c_parser_compound_statement): Same.
(c_parser_compound_statement_nostart): Same.
(c_parser_label): Same.
(c_parser_statement_after_labels): Same.
(c_parser_if_body): Same.
(c_parser_else_body): Same.
(c_parser_if_statement): Same.
(c_parser_switch_statement): Same.
(c_parser_while_statement): Same.
(c_parser_do_statement): Same.
(c_parser_for_statement): Same.
(c_parser_asm_statement): Same.
(c_parser_conditional_expression): Same.
(c_parser_binary_expression): Same.
(c_parser_cast_expression): Same.
(c_parser_unary_expression): Same.
(c_parser_sizeof_expression): Same.
(c_parser_alignof_expression): Same.
(c_parser_postfix_expression): Same.
(c_parser_expression): Same.
(c_parser_objc_receiver): Same.
(c_parser_omp_variable_list): Same.
(c_parser_omp_structured_block): Same.
(c_parser_omp_atomic): New argument.
(c_parser_omp_barrier): Same.
(c_parser_omp_critical): Same.
(c_parser_omp_flush): Pass location on down.
(c_parser_omp_for_loop): New argument.
(c_parser_omp_for): Same.
(c_parser_omp_master): Same.
(c_parser_omp_ordered): Same.
(c_parser_omp_sections_scope): Same.
(c_parser_omp_sections): Same.
(c_parser_omp_parallel): Same.
(c_parser_omp_single): Same.
(c_parser_omp_task): Same.
(c_parser_omp_taskwait): Pass location on down.
(c_parser_omp_construct): Same.
(c_parser_omp_threadprivate): Same.
* dwarf2asm.c, targhooks.c, optabs.c, tree.c, tree.h, target.h,
builtins.c, omp-low.c, cgraphunit.c, tree-call-cdce.c,
tree-ssa-alias.c, gimple-low.c, c-tree.h, expr.c, tree-parloops.c,
c-decl.c, tree-eh.c, langhooks.c, function.c, stor-layout.c,
c-typeck.c, gimplify.c, c-pragma.c, expmed.c, except.c, coverage.c,
emit-rtl.c, cfgexpand.c, tree-mudflap.c, varasm.c, tree-nested.c,
rtl.h, tree-inline.c, tree-profile.c, c-common.c, c-common.h,
tree-switch-conversion.c, tree-cfg.c, ipa-struct-reorg.c, c-parser.c,
config/i386/i386.c, stmt.c:
Add location argument to the following function definitions and/or
function calls: build_decl, objcp_start_struct, objcp_finish_struct,
start_struct, finish_struct, PUSH_FIELD, create_artificial_label,
cp_make_fname_decl, pushtag, implicitly_declare, c_make_fname_decl,
build_compound_literal, parser_xref_tag, resolve_overloaded_builtin,
do_case, c_finish_bc_stmt, build_compound_literal,
build_function_call.
* c-decl.c (build_compound_literal): Add location argument.
Make all diagnostic calls use location.
(start_struct): Same.
(finish_struct): Same.
(start_enum): Same.
(build_enumerator): Same.
(start_function): Same.
(grokdeclarator): Make all diagnostic calls use location.
(store_parm_decls_oldstyle): Same.
* c-typeck.c (build_function_call): Add location argument.
Make all diagnostic calls use location.
(do_case): Same.
(c_finish_bc_stmt): Same.
* tree-nested.c (get_trampoline_type): Add argument.
Pass location to build_decl.
(lookup_tramp_for_decl): Pass location to get_trampoline_type.
* rtl.h (RTL_LOCATION): New.
* c-common.c (c_add_case_label): Add location argument.
Make all diagnostic calls use location.
* c-common.h: Add location argument to make_fname_decl, do_case,
c_add_case_label, build_function_call, resolve_overloaded_builtin.
* c-parser.c (c_parser_enum_specifier): Rename ident_loc to enum_loc.
Set it appropriately for every case. Pass enum_loc to start_enum
call. Pass value_loc first to build_enumerator. Pass enum_loc to
parser_xref_tag.
(c_parser_struct_or_union_specifier): Save location. Use it for
start_struct, finish_struct, and parser_xref_tag.
gcc/testsuite/
* gcc.dg/old-style-prom-3.c: Add column info.
* gcc.dg/overflow-warn-1.c
* gcc.dg/gomp/pr27415.c
* gcc.dg/gomp/for-1.c: Same.
* gcc.dg/enum-compat-1.c: Same.
* gcc.dg/c99-tag-3.c: Same.
* gcc.dg/Wredundant-decls-2.c: Same.
* gcc.dg/func-ptr-conv-1.c: Same.
* gcc.dg/asm-wide-1.c: Same.
* gcc.dg/nofixed-point-2.c: Same.
* gcc.dg/cpp/line3.c: Same.
* gcc.dg/array-10.c: Same.
* gcc.dg/c99-vla-jump-1.c: Same.
* gcc.dg/pr20368-1.c: Same.
* gcc.dg/Wshadow-3.c: Same.
* gcc.dg/c90-const-expr-8.c: Same.
* gcc.dg/label-decl-2.c: Same.
* gcc.dg/dremf-type-compat-2.c: Same.
* gcc.dg/c90-const-expr-5.c: Same.
* gcc.dg/builtins-30.c: Same.
* gcc.dg/Warray-bounds.c: Same.
* gcc.dg/Wcxx-compat-2.c: Same.
* gcc.dg/tree-ssa/col-1.c: Same.
* gcc.dg/old-style-prom-2.c: Same.
* gcc.dg/cast-function-1.c: Same.
* gcc.dg/pr15698-1.c: Same.
* gcc.dg/dremf-type-compat-3.c: Same.
* gcc.dg/vla-8.c: Same.
* gcc.dg/gomp/pr27415.c: Move firstprivate diagnostics to correct
line.
* gcc.dg/label-decl-2.c: Move label diagnostic to correct line.
* gcc.dg/old-style-prom-3.c: Check for error on the correct line.
* gcc.dg/enum-compat-1.c: Same.
* gcc.dg/dremf-type-compat-2.c: Same.
* gcc.dg/old-style-prom-2.c: Same.
* gcc.dg/pr15698-1.c: Same.
* gcc.dg/pr20368-1.c: Same.
* gcc.dg/dremf-type-compat-3.c: Same.
* gcc.dg/builtins-30.c: Same. Test for columns.
gcc/objcp/
* objcp-decl.h (c_end_compound_stmt): New argument.
* objcp-decl.c (objcp_start_struct): Add argument.
(objcp_finish_struct): Same.
gcc/cp/
* typeck.c (cp_build_binary_op): Pass location to overflow_warning.
(build_modify_expr): New arg.
* semantics.c (finish_unary_op_expr): Pass location to
overflow_warning.
(handle_omp_for_class_iterator): Pass location to build_modify_expr.
* typeck.c (cxx_sizeof_or_alignof_type): Pass location to
c_sizeof_or_alignof_type.
(build_array_ref): New argument.
(build_compound_expr): Same.
(build_const_cast): Same.
(build_ptrmemfunc): Pass location to build_c_cast.
* init.c (avoid_placement_new_aliasing): Pass location to
build_stmt.
(build_vec_delete_1): Pass location to cp_build_modify_expr,
build_compound_expr.
* class.c (build_vtbl_ref_1): Pass location to build_array_ref.
* decl.c (poplevel): Pass location to c_build_bind_expr.
(finish_case_label): Pass location to build_case_label.
(finish_constructor_body): Same.
(finish_destructor_body): Pass location to build_stmt.
(cxx_maybe_build_cleanup): Same, but to build_compound_expr.
* call.c (build_new_op): Pass location to build_array_ref.
(build_x_va_arg): Pass location to build_va_arg.
* except.c (expand_end_catch_block): Pass location to
build_stmt.
* cp-tree.h (build_array_ref): New argument.
(build_compound_expr): Same.
(build_c_cast): Same.
* cp-gimplify.c (gimplify_if_stmt): Pass location on down.
(gimplify_switch_stmt): Same.
* typeck2.c (split_nonconstant_init_1): Same.
* pt.c (tsubst_copy): Same.
* semantics.c (add_decl_expr): Same.
(do_poplevel): Same.
(push_cleanup): Same.
(finish_goto_stmt): Same.
(finish_expr_stmt): Same.
(begin_if_stmt): Same.
(begin_while_stmt): Same.
(begin_do_stmt): Same.
(finish_return_stmt): Same.
(begin_for_stmt): Same.
(finish_break_stmt): Same.
(finish_continue_stmt): Same.
(begin_switch_stmt): Same.
(begin_try_block): Same.
(begin_handler): Same.
(finish_asm_stmt): Same.
(finish_label_stmt): Same.
(finish_stmt_expr_expr): Same.
(finalize_nrv_r): Same.
(finish_omp_atomic): Same.
* name-lookup.c (do_using_directive): Same.
* decl2.c (grok_array_decl): Same.
* parser.c (cp_parser_cast_expression): Same.
(cp_parser_selection_statement): Same.
(cp_parser_implicitly_scoped_statement): Same.
(cp_parser_objc_selector_expression): Same.
(cp_parser_objc_synchronized_statement): Same.
(cp_parser_objc_throw_statement): Same.
(cp_parser_omp_critical): Same.
(cp_parser_omp_master): Same.
* typeck.c (build_function_call): Add location argument.
* init.c: Add location argument to all build_decl calls.
* class.c: Same.
* method.c: Same.
* rtti.c: Same.
* tree.c: Same.
* pt.c: Same.
* semantics.c: Same.
* lex.c: Same.
* decl2.c: Same.
* cp-gimplify.c: Same.
* decl.c: Same.
(cp_make_fname_decl): Add location argument. Pass location ot
build_decl.
(finish_case_label): Same.
* cp-tree.h (finish_case_label): Add location argument.
* parser.c (cp_parser_label_for_labeled_statement): Pass location to
finish_case_label.
gcc/fortran/
* trans-array.c (gfc_trans_allocate_array_storage): Pass
location on down.
(gfc_trans_array_constructor_value): Same.
(gfc_trans_scalarized_loop_end): Same.
(gfc_conv_ss_startstride): Same.
(gfc_trans_g77_array): Same.
(gfc_trans_dummy_array_bias): Same.
(gfc_conv_array_parameter): Same.
(structure_alloc_comps): Same.
* trans-expr.c (gfc_conv_function_call): Same.
(fill_with_spaces): Same.
(gfc_trans_string_copy): Same.
(gfc_trans_scalar_assign): Same.
* trans-stmt.c (gfc_trans_goto): Same.
(gfc_trans_if_1): Same.
(gfc_trans_simple_do): Same.
(gfc_trans_do): Same.
(gfc_trans_do_while): Same.
(gfc_trans_logical_select): Same.
(gfc_trans_select): Same.
(gfc_trans_forall_loop): Same.
(gfc_trans_nested_forall_loop): Same.
(generate_loop_for_temp_to_lhs): Same.
(generate_loop_for_rhs_to_temp): Same.
(gfc_trans_forall_1): Same.
(gfc_trans_where_assign): Same.
(gfc_trans_where_3): Same.
(gfc_trans_allocate): Same.
* trans.c (gfc_finish_block): Same.
(gfc_trans_runtime_check): Same.
(gfc_call_malloc): Same.
(gfc_allocate_with_status): Same.
(gfc_call_free): Same.
(gfc_deallocate_with_status): Same.
(gfc_call_realloc): Same.
(gfc_trans_code): Same.
* trans-decl.c (gfc_init_default_dt): Same.
(gfc_generate_constructors): Same.
* trans-io.c (gfc_trans_io_runtime_check): Same.
* trans-intrinsic.c (gfc_conv_intrinsic_ctime): Same.
(gfc_conv_intrinsic_fdate): Same.
(gfc_conv_intrinsic_ttynam): Same.
(gfc_conv_intrinsic_minmax): Same.
(gfc_conv_intrinsic_minmax_char): Same.
(gfc_conv_intrinsic_anyall): Same.
(gfc_conv_intrinsic_count): Same.
(gfc_conv_intrinsic_arith): Same.
(gfc_conv_intrinsic_minmaxloc): Same.
(gfc_conv_intrinsic_minmaxval): Same.
(gfc_conv_intrinsic_rrspacing): Same.
(gfc_conv_intrinsic_array_transfer): Same.
(gfc_conv_intrinsic_trim): Same.
(gfc_conv_intrinsic_repeat): Same.
From-SVN: r148442
2009-06-13 00:06:47 +02:00
|
|
|
|
tree parm = build_decl (input_location,
|
|
|
|
|
PARM_DECL, name, type);
|
2003-08-13 00:26:25 +02:00
|
|
|
|
/* DECL_ARG_TYPE is only used by the back end and the back end never
|
|
|
|
|
sees templates. */
|
|
|
|
|
if (!processing_template_decl)
|
|
|
|
|
DECL_ARG_TYPE (parm) = type_passed_as (type);
|
re PR c++/20599 (variadic template support)
2007-03-09 Douglas Gregor <doug.gregor@gmail.com>
PR c++/20599
* typeck.c (check_return_expr): Check for bare parameter packs.
(comptypes): Compare template parameter packs and
type pack expansions.
* decl.c (grokdeclarator): Deal with the declaration of function
parameter packs.
(grokparms): Verify that the (optional) function parameter pack is
at the end of the parameter list.
(xref_basetypes): Handle pack expansions in the base class.
(cp_tree_node_structure): Handle ARGUMENT_PACK_SELECT.
* cp-tree.def (TYPE_ARGUMENT_PACK): New.
(NONTYPE_ARGUMENT_PACK): New.
(TYPE_PACK_EXPANSION): New.
(EXPR_PACK_EXPANSION): New.
(ARGUMENT_PACK_SELECT): New.
* cp-objcp-common.c (cp_tree_size): Compute size of
(NON)TYPE_ARGUMENT_PACK, (TYPE|EXPR)_PACK_EXPANSION, and
ARGUMENT_PACK_SELECT.
* error.c (dump_template_argument): Print template argument packs.
(dump_template_argument_list): Ditto.
(dump_template_parameter): Dump `...' for template type parameter
packs.
(dump_type): Dump TYPE_PACK_EXPANSION nodes.
(dump_parameters): Print function parameter packs.
(dump_template_parms): Print template argument packs.
(dump_expr): Dump EXPR_PACK_EXPANSION nodes.
(maybe_warn_variadic_templates): New.
* operators.def: Add ellipsis operator for EXPR_PACK_EXPANSION.
* tree.c (cp_walk_subtrees): Walk BASELINK, TYPE_ARGUMENT_PACK,
NONTYPE_ARGUMENT_PACK, TYPE_PACK_EXPANSION, EXPR_PACK_EXPANSION,
CAST_EXPR.
* mangle.c (write_type): Mangle TYPE_PACK_EXPANSION.
(write_template_arg): Write argument packs as separate arguments.
* cp-tree.h (struct template_parm_index_s): Add flag that
indicates that the template parameter is actually a parameter
pack.
(struct tree_argument_pack_select): New.
(enum cp_tree_node_structure_enum): Add TS_CP_ARGUMENT_PACK_SELECT.
(union lang_tree_node): Add argument_pack_select.
(FUNCTION_PARAMETER_PACK_P): New.
(PACK_EXPANSION_P): New.
(PACK_EXPANSION_PATTERN): New.
(SET_PACK_EXPANSION_PATTERN): New.
(PACK_EXPANSION_PARAMETER_PACKS): New.
(ARGUMENT_PACK_P): New.
(ARGUMENT_PACK_ARGS): New.
(SET_ARGUMENT_PACK_ARGS): New.
(ARGUMENT_PACK_INCOMPLETE_P): New.
(ARGUMENT_PACK_EXPLICIT_ARGS): New.
(TEMPLATE_PARM_PARAMETER_PACK): New.
(TEMPLATE_TYPE_PARAMETER_PACK): New.
(ARGUMENT_PACK_SELECT_FROM_PACK): New.
(ARGUMENT_PACK_SELECT_INDEX): New.
(ARGUMENT_PACK_SELECT_ARG): New.
(struct cp_declarator): Add parameter_pack_p flag.
(maybe_warn_variadic_templates): Declare.
(process_template_parm): Add bool parameter IS_PARAMETER_PACK, to
indicate a template parameter pack.
(uses_parameter_packs): Declare.
(template_parameter_pack_p): Declare.
(template_parms_variadic_p): Declare.
(make_pack_expansion): Declare.
(check_for_bare_parameter_packs): Declare.
* cxx-pretty-print.c (pp_cxx_unary_expression): Print
sizeof... expressions.
(pp_cxx_expression): Print pack expansions and non-type argument
packs.
(pp_cxx_exception_specification): Print pack expansions.
(pp_cxx_direct_declarator): Print ellipsis for parameter packs.
(pp_cxx_ctor_initializer): Print pack expansions.
(pp_cxx_type_id): Print pack expansions.
(pp_cxx_template_argument_list): Print argument packs.
(pp_cxx_template_parameter): Print ellipsis for template parameter
packs.
* pt.c (comp_template_parms): Compare template parameter packs.
(template_parameter_pack_p): New.
(template_parms_variadic_p): New.
(template_args_variadic_p): New.
(make_ith_pack_parameter_name): New.
(struct find_parameter_pack_data): New.
(find_parameter_packs_r): New.
(uses_parameter_packs): New.
(make_pack_expansion): New.
(check_for_bare_parameter_packs): New.
(expand_template_argument_pack): New.
(reduce_template_parm_level): Propagate parameter pack flag.
(process_template_parm): Add is_parameter_pack parameter to state
when the parameter is actually a parameter pack. Create template
parameter packs when is_parameter_pack is true.
(current_template_args): The argument for a template parameter
pack is an argument pack containing a single pack expansion.
(process_partial_specialization): When checking that non-type
argument expressions do not involve template parameters, loop over
the arguments in argument packs separately.
(push_template_decl_real): Check that the type of the declaration
does not have any bare parameter packs. Check that primary
templates have no more than one parameter pack, and that it comes
at the end of the template parameter list.
(convert_template_argument): Handle coercions for pack expansion
expressions by coercing the pattern then rebuilding the expansion.
(coerce_template_parms): When coercing the arguments for a
variadic template, pack "extra" arguments into an argument pack.
(coerce_template_template_parms): Cannot coerce between parameter
packs and non-pack parameters.
(template_args_equal): Compare PACK_EXPANSION_P expressions.
(comp_template_args): Expand all template arguments packs before
comparing template argument lists.
(mangle_class_name_for_template): Make argument packs as separate
template arguments.
(for_each_template_parm_r): No need to handle BASELINK.
(instantiate_class_template): Handle pack expansions in the base
class list.
(tsubst_pack_expansion): New.
(tsubst_template_args): Handle substitutions of argument packs and
pack expansion into template argument lists.
(tsubst_decl): Expand function parameter packs into separate
function parameters.
(tsubst_arg_types): Expand a type pack expansion into separate
argument types.
(tsubst_exception_specification): Handle pack expansions in
exception specifiers.
(tsubst): See through ARGUMENT_PACK_SELECT arguments when
replacing a template parameter with its argument. If we encounter
a substitution for an argument pack, just return the parameter
itself.
(tsubst_copy): sizeof(X...) returns the number of elements in
parameter pack X. See through ARGUMENT_PACK_SELECT when the
PARM_DECL is a parameter pack.
(tsubst_expr): Expression pack expansions and argument packs
cannot show up here; they will all be handled through function
calls, sizeof, and template argument lists.
(tsubst_copy_and_build): sizeof(X...) returns the number of
elements in parameter pack X. Handle pack expansions in TREE_LIST
and CONSTRUCTOR nodes.
(fn_type_unification): Handle "incomplete" explicit template
argument lists that specify some of the arguments for a template
parameter pack.
(type_unification_real): Unify arguments against pack expansions.
(template_parm_level_and_index): New, helper function.
(unify_pack_expansion): New.
(unify): Unify argument packs on an argument-by-argument basis,
handling variadic argument packs as well.
(more_specialized_fn): Handle unification of function parameter
packs. All things being equal, prefer non-variadic function
templates to variadic function templates.
(more_specialized_class): Prefer the variadic class template
partial specialization that binds fewer arguments to a parameter
pack.
(regenerate_decl_from_template): Expand function parameter packs
into separate parameters.
(instantiate_decl): Ditto.
(tsubst_initializer_list): Handle pack expansions for base-class
initializers.
(dependent_type_p_r): Determine dependent types in argument packs
and pack expansions.
(value_dependent_expression_p): Determine value-dependence of
non-type argument packs.
(dependent_template_arg_p): Handle argument packs.
* semantics.c (finish_cond): Check for bare parameter packs.
(finish_expr_stmt): Ditto.
(finish_for_expr): Ditto.
(finish_switch_cond): Ditto.
(finish_mem_initializers): Ditto.
* name-lookup.c (arg_assoc_type): Handle pack expansions and
argument packs.
* decl2.c (cp_build_parm_decl): Mark function parameter packs.
* parser.c (make_declarator): Declarator is not an expansion.
(make_pointer_declarator): Transfer parameter pack flag to outer
declarator.
(make_reference_declarator): Ditto.
(make_ptrmem_declarator): Ditto.
(make_call_declarator): Ditto.
(make_array_declarator): Ditto.
(cp_parser_postfix_expression): Allow pack expansion expressions
in the argument list for a call expression.
(cp_parser_parenthesized_expression_list): Add new parameter
ALLOW_EXPANSION_P. When true, parse the ellipsis to mean "expand
into separate arguments."
(cp_parser_new_placement): Allow pack expansion expressions.
(cp_parser_new_initializer): Ditto.
(cp_parser_mem_initializer_list): Allow ellipsis to create a
base-class initializer expansion.
(cp_parser_mem_initializer): Ditto.
(cp_parser_template_parameter_list): Keep track of whether the
template parameter is a template parameter pack.
(cp_parser_template_parameter): Parse the ellipsis to indicate a
template parameter pack.
(cp_parser_type_parameter): Ditto.
(cp_parser_template_argument_list): Parse the ellipsis to indicate
a pack expansion.
(cp_parser_direct_declarator): Parse the ellipsis to indicate that
this declarator is a parameter pack.
(cp_parser_parameter_declaration): The ellipsis does not end the
parameter declaration, because it might be a parameter pack. Parse
the ellipsis to indicate a parameter pack.
(cp_parser_initializer): Allow pack expansions.
(cp_parser_initializer_list): Allow ellipsis to create an
initializer expansion.
(cp_parser_base_clause): Allow ellipsis to create a base specifier
expansion.
(cp_parser_type_id_list): Allow ellipsis to create an exception
specifier expansion.
(cp_parser_attribute_list): Don't allow pack expansions.
(cp_parser_functional_cast): Allow pack expansions.
(cp_parser_sizeof_operand): Allow ellipsis following "sizeof" to
compute the length of a parameter pack.
(cp_parser_next_token_ends_template_argument_p): An ellipsis can
end a template argument.
* tree.c (cp_walk_subtrees): Walk BASELINK, TYPE_ARGUMENT_PACK,
NONTYPE_ARGUMENT_PACK, TYPE_PACK_EXPANSION, EXPR_PACK_EXPANSION,
CAST_EXPR.
From-SVN: r122788
2007-03-10 02:58:58 +01:00
|
|
|
|
|
|
|
|
|
/* If the type is a pack expansion, then we have a function
|
|
|
|
|
parameter pack. */
|
|
|
|
|
if (type && TREE_CODE (type) == TYPE_PACK_EXPANSION)
|
|
|
|
|
FUNCTION_PARAMETER_PACK_P (parm) = 1;
|
|
|
|
|
|
2002-07-26 22:10:43 +02:00
|
|
|
|
return parm;
|
|
|
|
|
}
|
|
|
|
|
|
2000-05-26 01:27:18 +02:00
|
|
|
|
/* Returns a PARM_DECL for a parameter of the indicated TYPE, with the
|
|
|
|
|
indicated NAME. */
|
|
|
|
|
|
2006-04-24 05:50:31 +02:00
|
|
|
|
tree
|
Remove traditional C constructs 4/n.
* decl2.c (grok_method_quals, warn_if_unknown_interface,
grok_x_components, cp_build_parm_decl, build_artificial_parm,
maybe_retrofit_in_chrg, grokclassfn, grok_array_decl,
delete_sanity, check_member_template, check_java_method,
check_classfn, finish_static_data_member_decl, grokfield,
grokbitfield, grokoptypename, grok_function_init,
cplus_decl_attributes, constructor_name, defer_fn,
build_anon_union_vars, finish_anon_union, coerce_new_type,
coerce_delete_type, comdat_linkage, maybe_make_one_only,
key_method, import_export_vtable, import_export_class,
output_vtable_inherit, import_export_decl, import_export_tinfo,
build_cleanup, get_guard, get_guard_bits, get_guard_cond,
set_guard, start_objects, finish_objects,
start_static_storage_duration_function,
finish_static_storage_duration_function, get_priority_info,
start_static_initialization_or_destruction,
finish_static_initialization_or_destruction,
do_static_initialization, do_static_destruction,
prune_vars_needing_no_initialization, write_out_vars,
reparse_decl_as_expr, finish_decl_parsing, namespace_ancestor,
add_using_namespace, merge_functions, ambiguous_decl,
lookup_using_namespace, lookup_using_namespace,
qualified_lookup_using_namespace, set_decl_namespace,
decl_namespace, current_decl_namespace, push_decl_namespace,
pop_decl_namespace, push_scope, pop_scope, add_function,
arg_assoc_namespace, arg_assoc_template_arg, arg_assoc,
lookup_arg_dependent, do_namespace_alias,
validate_nonmember_using_decl, do_nonmember_using_decl,
do_toplevel_using_decl, do_local_using_decl,
do_class_using_decl, do_using_directive, check_default_args,
mark_used, handle_class_head): Use C90 prototypings. Use booleans.
* parser.c (cp_parser_class_head): Use booleanss.
* decl.c (walk_globals, walk_vtables): Likewise.
* cp-tree.h (walk_globals_pred, walk_globals_fn, walk_vtables,
walk_globals): Change return type from 'int' to 'bool'.
* rtti.c (init_rtti_processing, build_headof, throw_bad_cast
throw_bad_typeid, get_tinfo_decl_dynamic, typeid_ok_p,
build_typeid, tinfo_name, get_tinfo_decl, get_tinfo_ptr,
get_typeid, ifnonnull, build_dynamic_cast_1, build_dynamic_cast,
qualifier_flags, tinfo_base_init, generic_initializer,
ptr_initializer, dfs_class_hint_mark, ptm_initializer,
dfs_class_hint_unmark, class_hint_flags, class_initializer,
typeinfo_in_lib_p, get_pseudo_ti_init, create_pseudo_type_info,
get_pseudo_ti_desc, create_tinfo_types, emit_support_tinfos,
unemitted_tinfo_decl_p, emit_tinfo_decl): Likewise.
* repo.c (repo_compile_flags, repo_template_declared,
repo_template_defined, repo_class_defined, repo_get_id,
repo_template_used, repo_vtable_used, repo_inline_used,
repo_tinfo_used, repo_template_instantiated, extract_string,
open_repo_file, afgets, init_repo, reopen_repo_file_for_write,
finish_repo): Likewise.
* ptree.c (cxx_print_decl, cxx_print_type, cxx_print_identifier,
cxx_print_xnode): Likewise..
* cp-lang.c (ok_to_generate_alias_set_for_type, cxx_get_alias_set,
cxx_warn_unused_global_decl, cp_expr_size): Likewise.
* cxxfilt.c (demangle_it, print_demangler_list, usage,
standard_symbol_characters, hp_symbol_characters, main, fatal):
Likewise.
(strip_underscore): Change type from 'int' to 'bool'.
(main): Use boolean constants.
From-SVN: r60601
2002-12-29 15:53:05 +01:00
|
|
|
|
build_artificial_parm (tree name, tree type)
|
2000-05-26 01:27:18 +02:00
|
|
|
|
{
|
2002-07-26 22:10:43 +02:00
|
|
|
|
tree parm = cp_build_parm_decl (name, type);
|
2000-06-29 16:03:10 +02:00
|
|
|
|
DECL_ARTIFICIAL (parm) = 1;
|
2001-02-18 01:00:29 +01:00
|
|
|
|
/* All our artificial parms are implicitly `const'; they cannot be
|
|
|
|
|
assigned to. */
|
|
|
|
|
TREE_READONLY (parm) = 1;
|
2000-05-26 01:27:18 +02:00
|
|
|
|
return parm;
|
|
|
|
|
}
|
|
|
|
|
|
1998-05-29 04:33:54 +02:00
|
|
|
|
/* Constructors for types with virtual baseclasses need an "in-charge" flag
|
|
|
|
|
saying whether this constructor is responsible for initialization of
|
|
|
|
|
virtual baseclasses or not. All destructors also need this "in-charge"
|
|
|
|
|
flag, which additionally determines whether or not the destructor should
|
|
|
|
|
free the memory for the object.
|
|
|
|
|
|
|
|
|
|
This function adds the "in-charge" flag to member function FN if
|
|
|
|
|
appropriate. It is called from grokclassfn and tsubst.
|
2001-02-18 20:08:00 +01:00
|
|
|
|
FN must be either a constructor or destructor.
|
|
|
|
|
|
|
|
|
|
The in-charge flag follows the 'this' parameter, and is followed by the
|
|
|
|
|
VTT parm (if any), then the user-written parms. */
|
1998-05-29 04:33:54 +02:00
|
|
|
|
|
|
|
|
|
void
|
Remove traditional C constructs 4/n.
* decl2.c (grok_method_quals, warn_if_unknown_interface,
grok_x_components, cp_build_parm_decl, build_artificial_parm,
maybe_retrofit_in_chrg, grokclassfn, grok_array_decl,
delete_sanity, check_member_template, check_java_method,
check_classfn, finish_static_data_member_decl, grokfield,
grokbitfield, grokoptypename, grok_function_init,
cplus_decl_attributes, constructor_name, defer_fn,
build_anon_union_vars, finish_anon_union, coerce_new_type,
coerce_delete_type, comdat_linkage, maybe_make_one_only,
key_method, import_export_vtable, import_export_class,
output_vtable_inherit, import_export_decl, import_export_tinfo,
build_cleanup, get_guard, get_guard_bits, get_guard_cond,
set_guard, start_objects, finish_objects,
start_static_storage_duration_function,
finish_static_storage_duration_function, get_priority_info,
start_static_initialization_or_destruction,
finish_static_initialization_or_destruction,
do_static_initialization, do_static_destruction,
prune_vars_needing_no_initialization, write_out_vars,
reparse_decl_as_expr, finish_decl_parsing, namespace_ancestor,
add_using_namespace, merge_functions, ambiguous_decl,
lookup_using_namespace, lookup_using_namespace,
qualified_lookup_using_namespace, set_decl_namespace,
decl_namespace, current_decl_namespace, push_decl_namespace,
pop_decl_namespace, push_scope, pop_scope, add_function,
arg_assoc_namespace, arg_assoc_template_arg, arg_assoc,
lookup_arg_dependent, do_namespace_alias,
validate_nonmember_using_decl, do_nonmember_using_decl,
do_toplevel_using_decl, do_local_using_decl,
do_class_using_decl, do_using_directive, check_default_args,
mark_used, handle_class_head): Use C90 prototypings. Use booleans.
* parser.c (cp_parser_class_head): Use booleanss.
* decl.c (walk_globals, walk_vtables): Likewise.
* cp-tree.h (walk_globals_pred, walk_globals_fn, walk_vtables,
walk_globals): Change return type from 'int' to 'bool'.
* rtti.c (init_rtti_processing, build_headof, throw_bad_cast
throw_bad_typeid, get_tinfo_decl_dynamic, typeid_ok_p,
build_typeid, tinfo_name, get_tinfo_decl, get_tinfo_ptr,
get_typeid, ifnonnull, build_dynamic_cast_1, build_dynamic_cast,
qualifier_flags, tinfo_base_init, generic_initializer,
ptr_initializer, dfs_class_hint_mark, ptm_initializer,
dfs_class_hint_unmark, class_hint_flags, class_initializer,
typeinfo_in_lib_p, get_pseudo_ti_init, create_pseudo_type_info,
get_pseudo_ti_desc, create_tinfo_types, emit_support_tinfos,
unemitted_tinfo_decl_p, emit_tinfo_decl): Likewise.
* repo.c (repo_compile_flags, repo_template_declared,
repo_template_defined, repo_class_defined, repo_get_id,
repo_template_used, repo_vtable_used, repo_inline_used,
repo_tinfo_used, repo_template_instantiated, extract_string,
open_repo_file, afgets, init_repo, reopen_repo_file_for_write,
finish_repo): Likewise.
* ptree.c (cxx_print_decl, cxx_print_type, cxx_print_identifier,
cxx_print_xnode): Likewise..
* cp-lang.c (ok_to_generate_alias_set_for_type, cxx_get_alias_set,
cxx_warn_unused_global_decl, cp_expr_size): Likewise.
* cxxfilt.c (demangle_it, print_demangler_list, usage,
standard_symbol_characters, hp_symbol_characters, main, fatal):
Likewise.
(strip_underscore): Change type from 'int' to 'bool'.
(main): Use boolean constants.
From-SVN: r60601
2002-12-29 15:53:05 +01:00
|
|
|
|
maybe_retrofit_in_chrg (tree fn)
|
1998-05-29 04:33:54 +02:00
|
|
|
|
{
|
|
|
|
|
tree basetype, arg_types, parms, parm, fntype;
|
|
|
|
|
|
2000-04-11 18:56:14 +02:00
|
|
|
|
/* If we've already add the in-charge parameter don't do it again. */
|
|
|
|
|
if (DECL_HAS_IN_CHARGE_PARM_P (fn))
|
1998-05-29 04:33:54 +02:00
|
|
|
|
return;
|
|
|
|
|
|
2000-05-24 06:34:38 +02:00
|
|
|
|
/* When processing templates we can't know, in general, whether or
|
|
|
|
|
not we're going to have virtual baseclasses. */
|
2004-01-26 18:41:50 +01:00
|
|
|
|
if (processing_template_decl)
|
2000-05-24 06:34:38 +02:00
|
|
|
|
return;
|
|
|
|
|
|
2000-04-11 18:56:14 +02:00
|
|
|
|
/* We don't need an in-charge parameter for constructors that don't
|
|
|
|
|
have virtual bases. */
|
|
|
|
|
if (DECL_CONSTRUCTOR_P (fn)
|
2004-09-21 17:39:00 +02:00
|
|
|
|
&& !CLASSTYPE_VBASECLASSES (DECL_CONTEXT (fn)))
|
2000-04-11 18:56:14 +02:00
|
|
|
|
return;
|
1998-05-29 04:33:54 +02:00
|
|
|
|
|
|
|
|
|
arg_types = TYPE_ARG_TYPES (TREE_TYPE (fn));
|
|
|
|
|
basetype = TREE_TYPE (TREE_VALUE (arg_types));
|
2001-02-18 20:08:00 +01:00
|
|
|
|
arg_types = TREE_CHAIN (arg_types);
|
|
|
|
|
|
2010-07-15 16:31:28 +02:00
|
|
|
|
parms = DECL_CHAIN (DECL_ARGUMENTS (fn));
|
2001-02-18 20:08:00 +01:00
|
|
|
|
|
|
|
|
|
/* If this is a subobject constructor or destructor, our caller will
|
|
|
|
|
pass us a pointer to our VTT. */
|
2004-09-21 17:39:00 +02:00
|
|
|
|
if (CLASSTYPE_VBASECLASSES (DECL_CONTEXT (fn)))
|
2001-02-18 20:08:00 +01:00
|
|
|
|
{
|
|
|
|
|
parm = build_artificial_parm (vtt_parm_identifier, vtt_parm_type);
|
|
|
|
|
|
|
|
|
|
/* First add it to DECL_ARGUMENTS between 'this' and the real args... */
|
2010-07-15 16:31:28 +02:00
|
|
|
|
DECL_CHAIN (parm) = parms;
|
2001-02-18 20:08:00 +01:00
|
|
|
|
parms = parm;
|
|
|
|
|
|
|
|
|
|
/* ...and then to TYPE_ARG_TYPES. */
|
|
|
|
|
arg_types = hash_tree_chain (vtt_parm_type, arg_types);
|
|
|
|
|
|
|
|
|
|
DECL_HAS_VTT_PARM_P (fn) = 1;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Then add the in-charge parm (before the VTT parm). */
|
|
|
|
|
parm = build_artificial_parm (in_charge_identifier, integer_type_node);
|
2010-07-15 16:31:28 +02:00
|
|
|
|
DECL_CHAIN (parm) = parms;
|
2001-02-18 20:08:00 +01:00
|
|
|
|
parms = parm;
|
|
|
|
|
arg_types = hash_tree_chain (integer_type_node, arg_types);
|
|
|
|
|
|
|
|
|
|
/* Insert our new parameter(s) into the list. */
|
2010-07-15 16:31:28 +02:00
|
|
|
|
DECL_CHAIN (DECL_ARGUMENTS (fn)) = parms;
|
2001-02-18 20:08:00 +01:00
|
|
|
|
|
|
|
|
|
/* And rebuild the function type. */
|
2003-08-25 17:47:43 +02:00
|
|
|
|
fntype = build_method_type_directly (basetype, TREE_TYPE (TREE_TYPE (fn)),
|
|
|
|
|
arg_types);
|
1998-05-29 04:33:54 +02:00
|
|
|
|
if (TYPE_RAISES_EXCEPTIONS (TREE_TYPE (fn)))
|
|
|
|
|
fntype = build_exception_variant (fntype,
|
|
|
|
|
TYPE_RAISES_EXCEPTIONS (TREE_TYPE (fn)));
|
2009-11-06 22:18:35 +01:00
|
|
|
|
if (TYPE_ATTRIBUTES (TREE_TYPE (fn)))
|
|
|
|
|
fntype = (cp_build_type_attribute_variant
|
|
|
|
|
(fntype, TYPE_ATTRIBUTES (TREE_TYPE (fn))));
|
1998-05-29 04:33:54 +02:00
|
|
|
|
TREE_TYPE (fn) = fntype;
|
2000-04-11 18:56:14 +02:00
|
|
|
|
|
|
|
|
|
/* Now we've got the in-charge parameter. */
|
|
|
|
|
DECL_HAS_IN_CHARGE_PARM_P (fn) = 1;
|
1998-05-29 04:33:54 +02:00
|
|
|
|
}
|
|
|
|
|
|
1994-02-24 02:02:37 +01:00
|
|
|
|
/* Classes overload their constituent function names automatically.
|
|
|
|
|
When a function name is declared in a record structure,
|
|
|
|
|
its name is changed to it overloaded name. Since names for
|
|
|
|
|
constructors and destructors can conflict, we place a leading
|
|
|
|
|
'$' for destructors.
|
|
|
|
|
|
|
|
|
|
CNAME is the name of the class we are grokking for.
|
|
|
|
|
|
|
|
|
|
FUNCTION is a FUNCTION_DECL. It was created by `grokdeclarator'.
|
|
|
|
|
|
|
|
|
|
FLAGS contains bits saying what's special about today's
|
2009-09-08 20:12:54 +02:00
|
|
|
|
arguments. DTOR_FLAG == DESTRUCTOR.
|
1994-02-24 02:02:37 +01:00
|
|
|
|
|
|
|
|
|
If FUNCTION is a destructor, then we must add the `auto-delete' field
|
|
|
|
|
as a second parameter. There is some hair associated with the fact
|
|
|
|
|
that we must "declare" this variable in the manner consistent with the
|
|
|
|
|
way the rest of the arguments were declared.
|
|
|
|
|
|
|
|
|
|
QUALS are the qualifiers for the this pointer. */
|
|
|
|
|
|
|
|
|
|
void
|
2006-04-24 05:50:31 +02:00
|
|
|
|
grokclassfn (tree ctype, tree function, enum overload_flags flags)
|
1994-02-24 02:02:37 +01:00
|
|
|
|
{
|
|
|
|
|
tree fn_name = DECL_NAME (function);
|
|
|
|
|
|
2000-05-26 18:54:18 +02:00
|
|
|
|
/* Even within an `extern "C"' block, members get C++ linkage. See
|
|
|
|
|
[dcl.link] for details. */
|
2001-04-20 00:49:48 +02:00
|
|
|
|
SET_DECL_LANGUAGE (function, lang_cplusplus);
|
2000-05-26 18:54:18 +02:00
|
|
|
|
|
1994-02-24 02:02:37 +01:00
|
|
|
|
if (fn_name == NULL_TREE)
|
|
|
|
|
{
|
1998-09-07 16:25:35 +02:00
|
|
|
|
error ("name missing for member function");
|
1994-02-24 02:02:37 +01:00
|
|
|
|
fn_name = get_identifier ("<anonymous>");
|
|
|
|
|
DECL_NAME (function) = fn_name;
|
|
|
|
|
}
|
|
|
|
|
|
1998-05-29 04:33:54 +02:00
|
|
|
|
DECL_CONTEXT (function) = ctype;
|
|
|
|
|
|
Compute DECL_ASSEMBLER_NAME lazily.
* tree.h (DECL_ASSEMBLER_NAME): Compute it lazily.
(DECL_ASSEMBLER_NAME_SET_P): New macro.
(SET_DECL_ASSEMBLER_NAME): Likewise.
(COPY_DECL_ASSEMBLER_NAME): Likewise.
(set_decl_assembler_name): Declare.
(lang_set_decl_assembler_name): Likewise.
* tree.c (lang_set_decl_assembler_name): New variab.e
(set_decl_assembler_name): New function.
(init_obstacks): Set lang_set_decl_assembler_name.
(build_decl): Don't set DECL_ASSEMBLER_NAME.
* c-decl.c (duplicate_decls): Use SET_DECL_ASSEMBLER_NAME,
COPY_DECL_ASSEMBLER_NAME, etc. Don't set DECL_ASSEMBLER_NAME
where it's not necessary.
(builtin_function): Likewise.
(finish_decl): Likewise.
* dbxout.c (dbxout_type_methods): Likewise.
* ggc-common.c (ggc_mark_trees): Likewise.
* profile.c (output_func_start_profiler): Likewise.
* varasm.c (make_decl_rtl): Likewise.
* class.c (get_vtable_decl): Use SET_DECL_ASSEMBLER_NAME,
COPY_DECL_ASSEMBLER_NAME, etc. Don't set DECL_ASSEMBLER_NAME
where it's not necessary.
(add_method): Remove optimization involving comparison of
DECL_ASSEMBLER_NAME.
(build_vtbl_or_vbase_field): Use SET_DECL_ASSEMBLER_NAME,
COPY_DECL_ASSEMBLER_NAME, etc. Don't set DECL_ASSEMBLER_NAME
where it's not necessary.
(check_methods): Likewise.
(build_clone): Likewise.
(built_vtt): Likewise.
* cp-tree.h (DECL_NEEDED_P): Likewise.
* decl.c (pushtag): Likewise.
(duplicate_decls): Likewise.
(pushdecl): Likewise.
(builtin_function): Likewise.
(build_library_fn_1): Set DECL_LANGUAGE for library functions.
(build_cp_library_fn): Likewise.
(maybe_commonize_var): Use SET_DECL_ASSEMBLER_NAME,
COPY_DECL_ASSEMBLER_NAME, etc. Don't set DECL_ASSEMBLER_NAME
where it's not necessary.
(make_rtl_for_nonlocal_decl): Likewise.
(cp_finish_decl): Likewise.
(grokfndecl): Likewise.
(grokvardecl): Likewise.
(grokdeclarator): Likewise.
(start_function): Likewise.
(cp_missing_return_ok_p): Likewise.
* decl2.c (grokclassfn): Likewise.
(check_classfn): Likewise.
(finish_static_data_member_decl): Likewise.
(grokfield): Likewise.
* error.c (GLOBAL_IORD_P): Remove.
(dump_global_iord): Improve output.
(dump_decl): Avoid using DECL_ASSEMBLER_NAME.
* except.c (nothrow_libfn_p): Summarily reject any function not in
namespace-scope.
* init.c (build_java_class_ref): Don't explicitly set
DECL_ASSEMBLER_NAME after calling mangle_decl.
* mangle.c (mangle_decl_string): Handle extern "C" functions.
(mangle_decl): Set the DECL_ASSEMBLER_NAME for the decl.
* method.c (set_mangled_name_for_decl): Don't explicitly set
DECL_ASSEMBLER_NAME after calling mangle_decl.
(make_thunk): Explicitly set the DECL_ASSEMBLER_NAME and
IDENTIFIER_GLOBAL_VALUE for the thunk.
* pt.c (set_mangled_name_for_template_decl): Remove.
(check_explicit_specialization): Don't use it.
(looup_template_class): Don't set DECL_ASSEMBLER_NAME.
(tsubst_friend_function): Likewise.
(tsubst_decl): Likewise.
(regenerate_decl_from_template): Use COPY_DECL_ASSEMBLER_NAME.
* rtti.c (get_tinfo_decl): Use SET_DECL_ASSEMBLER_NAME,
COPY_DECL_ASSEMBLER_NAME, etc. Don't set DECL_ASSEMBLER_NAME
where it's not necessary.
(tinfo_base_init): Likewise.
(create_real_tinfo_var): Likewise.
* search.c (looup_field_1): Likewise.
* semantics.c (finish_named_return_value): Likewise.
* tree.c (init_tree): Set lang_set_decl_assembler_name.
* com.c (builtin_function): Use SET_DECL_ASSEMBLER_NAME.
* class.c (build_class_ref): Use SET_DECL_ASSEMBLER_NAME.
(layout_class): Likewise.
(layout_class_method): Likewise.
(emit_register_classes): Likewise.
* decl.c (builtin_function): Likewise.
(give_name_to_locals): Likewise.
From-SVN: r40642
2001-03-20 00:50:04 +01:00
|
|
|
|
if (flags == DTOR_FLAG)
|
|
|
|
|
DECL_DESTRUCTOR_P (function) = 1;
|
|
|
|
|
|
1998-05-29 04:33:54 +02:00
|
|
|
|
if (flags == DTOR_FLAG || DECL_CONSTRUCTOR_P (function))
|
1999-11-19 14:03:00 +01:00
|
|
|
|
maybe_retrofit_in_chrg (function);
|
1994-02-24 02:02:37 +01:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Create an ARRAY_REF, checking for the user doing things backwards
|
|
|
|
|
along the way. */
|
1996-07-11 03:13:25 +02:00
|
|
|
|
|
1994-02-24 02:02:37 +01:00
|
|
|
|
tree
|
Remove traditional C constructs 4/n.
* decl2.c (grok_method_quals, warn_if_unknown_interface,
grok_x_components, cp_build_parm_decl, build_artificial_parm,
maybe_retrofit_in_chrg, grokclassfn, grok_array_decl,
delete_sanity, check_member_template, check_java_method,
check_classfn, finish_static_data_member_decl, grokfield,
grokbitfield, grokoptypename, grok_function_init,
cplus_decl_attributes, constructor_name, defer_fn,
build_anon_union_vars, finish_anon_union, coerce_new_type,
coerce_delete_type, comdat_linkage, maybe_make_one_only,
key_method, import_export_vtable, import_export_class,
output_vtable_inherit, import_export_decl, import_export_tinfo,
build_cleanup, get_guard, get_guard_bits, get_guard_cond,
set_guard, start_objects, finish_objects,
start_static_storage_duration_function,
finish_static_storage_duration_function, get_priority_info,
start_static_initialization_or_destruction,
finish_static_initialization_or_destruction,
do_static_initialization, do_static_destruction,
prune_vars_needing_no_initialization, write_out_vars,
reparse_decl_as_expr, finish_decl_parsing, namespace_ancestor,
add_using_namespace, merge_functions, ambiguous_decl,
lookup_using_namespace, lookup_using_namespace,
qualified_lookup_using_namespace, set_decl_namespace,
decl_namespace, current_decl_namespace, push_decl_namespace,
pop_decl_namespace, push_scope, pop_scope, add_function,
arg_assoc_namespace, arg_assoc_template_arg, arg_assoc,
lookup_arg_dependent, do_namespace_alias,
validate_nonmember_using_decl, do_nonmember_using_decl,
do_toplevel_using_decl, do_local_using_decl,
do_class_using_decl, do_using_directive, check_default_args,
mark_used, handle_class_head): Use C90 prototypings. Use booleans.
* parser.c (cp_parser_class_head): Use booleanss.
* decl.c (walk_globals, walk_vtables): Likewise.
* cp-tree.h (walk_globals_pred, walk_globals_fn, walk_vtables,
walk_globals): Change return type from 'int' to 'bool'.
* rtti.c (init_rtti_processing, build_headof, throw_bad_cast
throw_bad_typeid, get_tinfo_decl_dynamic, typeid_ok_p,
build_typeid, tinfo_name, get_tinfo_decl, get_tinfo_ptr,
get_typeid, ifnonnull, build_dynamic_cast_1, build_dynamic_cast,
qualifier_flags, tinfo_base_init, generic_initializer,
ptr_initializer, dfs_class_hint_mark, ptm_initializer,
dfs_class_hint_unmark, class_hint_flags, class_initializer,
typeinfo_in_lib_p, get_pseudo_ti_init, create_pseudo_type_info,
get_pseudo_ti_desc, create_tinfo_types, emit_support_tinfos,
unemitted_tinfo_decl_p, emit_tinfo_decl): Likewise.
* repo.c (repo_compile_flags, repo_template_declared,
repo_template_defined, repo_class_defined, repo_get_id,
repo_template_used, repo_vtable_used, repo_inline_used,
repo_tinfo_used, repo_template_instantiated, extract_string,
open_repo_file, afgets, init_repo, reopen_repo_file_for_write,
finish_repo): Likewise.
* ptree.c (cxx_print_decl, cxx_print_type, cxx_print_identifier,
cxx_print_xnode): Likewise..
* cp-lang.c (ok_to_generate_alias_set_for_type, cxx_get_alias_set,
cxx_warn_unused_global_decl, cp_expr_size): Likewise.
* cxxfilt.c (demangle_it, print_demangler_list, usage,
standard_symbol_characters, hp_symbol_characters, main, fatal):
Likewise.
(strip_underscore): Change type from 'int' to 'bool'.
(main): Use boolean constants.
From-SVN: r60601
2002-12-29 15:53:05 +01:00
|
|
|
|
grok_array_decl (tree array_expr, tree index_exp)
|
1994-02-24 02:02:37 +01:00
|
|
|
|
{
|
2003-07-09 10:48:08 +02:00
|
|
|
|
tree type;
|
|
|
|
|
tree expr;
|
|
|
|
|
tree orig_array_expr = array_expr;
|
|
|
|
|
tree orig_index_exp = index_exp;
|
1994-02-24 02:02:37 +01:00
|
|
|
|
|
2003-07-09 10:48:08 +02:00
|
|
|
|
if (error_operand_p (array_expr) || error_operand_p (index_exp))
|
1994-02-24 02:02:37 +01:00
|
|
|
|
return error_mark_node;
|
2003-07-09 10:48:08 +02:00
|
|
|
|
|
1996-09-30 23:34:04 +02:00
|
|
|
|
if (processing_template_decl)
|
2003-07-09 10:48:08 +02:00
|
|
|
|
{
|
|
|
|
|
if (type_dependent_expression_p (array_expr)
|
|
|
|
|
|| type_dependent_expression_p (index_exp))
|
alias.c (adjust_offset_for_component_ref): Use component_ref_field_offset.
* alias.c (adjust_offset_for_component_ref): Use
component_ref_field_offset.
* c-decl.c (build_array_declarator): Add news args for ARRAY_REF.
* c-gimplify.c (gimplify_expr_stmt): Use alloc_stmt_list.
(gimplify_decl_stmt): Call gimplify_type_sizes for type.
For decl, call gimplify_one_sizepos and use statement list.
(gimplify_compound_literal_expr): New arg PRE_P.
Add statement to PRE_P list and return DECL.
(c_gimplify_expr, case COMPOUND_LITERAL_EXPR): Add arg to
gimplify_compound_literal_expr.
* c-tree.h (getdecls): Deleted.
* c-typeck.c (build_component_ref): Add operand for COMPONENT_REF.
(build_array_ref): Add two operands for ARRAY_REF.
(build_unary_op): Set TREE_INVARIANT and TREE_CONSTANT for
COMPOUND_LITERAL_EXPR.
* coverage.c (tree_coverage_counter_ref): Add new operands
for ARRAY_REF.
* emit-rtl.c (component_ref_for_mem_expr): Add new operand
for COMPONENT_REF.
(set_mem_attributes_minus_bitpos): Use array_ref_low_bound
and array_ref_element_size.
(widen_memory_access):Use component_ref_field_offset.
* explow.c (update_nonlocal_goto_save_area): Add two operands
for ARRAY_REF.
* expr.c (array_ref_element_size, array_ref_low_bound): New functions.
(component_ref_field_offset): Likewise.
(get_inner_reference): Use them.
(expand_expr_real_1, case ARRAY_REF): Use array_ref_low_bound.
* fold-const.c (fold, case EQ_EXPR): Properly handle DECL_SIZE.
(fold_read_from_constant_string): Use array_ref_low_bound.
Verify that result is a character type.
(build_fold_indirect_ref): Add two operands for ARRAY_REF.
* function.c (expand_function_start): Likewise.
* gimple-low.c (expand_var_p): Delete duplicated line.
* gimplify.c: Add static decls for local functions.
(cgraph.h): Now included.
(create_tmp_var): Remove check for ARRAY_TYPE.
(copy_if_shared_r): Look at bounds and sizes of types.
(build_and_jump): Return alloc_stmt_list instead of build_empty_stmt.
(gimplify_exit_expr, shortcut_cond_expr): Likewise.
(gimplify_save_expr, gimple_push_cleanup): Likewise.
(gimplify_init_constructor): Likewise.
WANT_VALUE now bool.
If empty list with no result wanted, return GS_UNHANDLED.
Add additional operands for ARRAY_REF and COMPONENT_REF.
(canonicalize_component_ref): Convert to &array[L].
(gimplify_array_ref_to_plus): Use array_ref_element_size and
array_ref_lower_bound.
(build_addr_expr_with_type, build_addr_expr): New functions.
(gimplify_compound_lval): WANT_LVALUE now bool.
Major rework to allow handle_component_p and initialize and
gimplify new operands for ARRAY_REF, ARRAY_RANGE_REF, and
COMPONENT_REF.
(gimplify_array_ref): Deleted.
(gimplify_self_mod_expr): WANT_VALUE now bool.
(gimplify_modify_expr): Gimplify to_p and from_p later.
Factor out code into gimplify_modify_expr_rhs and call twice.
Move variable-size code earlier and handle PLACEHOLDER_EXPR.
(gimplify_modify_expr_rhs, gimplify_variable_sized_compare): New fns.
(gimplify_addr_expr, case VIEW_CONVERT_EXPR): New case.
(gimplify_expr, case ARRAY_REF): Delete special case.
Instead handle like COMPONENT_REF; also do ARRAY_RANGE_REF,
IMAGPART, and REALPART the same way.
(gimplify_expr, case VIEW_CONVERT_EXPR): New case.
(gimplify_expr): Call gimplify_variable_sized_compare if applicable.
Call alloc_stmt_list instead of build_empty_stmt.
Deal with _REF that's volatile.
(gimplify_type_sizes, gimplify_one_sizepos): New functions.
(unshare_body, unvisit_body): New functions.
(gimplify_body): Call them.
* stmt.c (expand_stack_alloc): Don't expand TYPE_MAX_VALUE.
* stor-layout.c (get_pending_sizes): Don't change SAVE_EXPR_CONTEXT.
* tree-alias-common.c (get_alias_var): Also skip ARRAY_RANGE_REF.
* tree-cfg.c (tree_node_can_be_shared): Treat ARRAY_RANGE_REF
like ARRAY_REF.
(verify_expr, case ADDR_EXPR): Use handled_component_p.
* tree-dfa.c (get_virtual_var): Likewise.
* tree-dump.c (dequeue_and_dump, case COMPONENT_REF, ARRAY_REF):
New cases to dump new operands; likewise for ARRAY_RANGE_REF.
* tree-eh.c (tree_could_trap, case ARRAY_RANGE_REF): Like ARRAY_REF.
* tree-gimple.c (is_gimple_addr_expr_arg): Add ARRAY_RANGE_REF
and INDIRECT_REF.
(get_base_address): Use handled_component_p.
* tree-gimple.h (gimplify_type_sizes, gimplify_one_sizepos): New.
* tree-line.c (walk_tree): Walk more things for types and decls.
* tree-mudflap.c (mf_build_check_statement_for): Add new operands
for ARRAY_REF and COMPONENT_REF.
(mx_xform_derefs_1): Clean up usage of decl sizes.
* tree-nested.c (build_addr): Use handled_component_p.
(walk_stmts, case CATCH_EXPR): Add missing "break".
(get_static_chain, get_frame_field): Add new operand for COMPONENT_REF.
(finalize_nesting_tree_1): Likewise.
(convert_nonlocal_reference, case ARRAY_RANGE_REF): Like ARRAY_REF
and process additional operands.
(convert_local_reference): Likewise.
* tree-outof-ssa.c (discover_nonconstant_array_refs_r): Treat
ARRAY_RANGE_REF similarly to ARRAY_REF.
* tree-pretty-print.c (dump_generic_node, case QUAL_UNION_TYPE): Handle
like RECORD_TYPE.
(dump_generic_node, case COMPONENT_REF): Print offset operand.
(dump_generic_node, case ARRAY_RANGE_REF): Treat like ARRAY_REF
and print lower bound and element size for both.
(op_prio, case ARRAY_RANGE_REF): Like ARRAY_REF.
* tree-sra.c (csc_build_component_ref): Add new operand.
(scalarize_call_expr): Use get_base_address.
* tree-ssa-ccp.c (widen_bitfield): Clean up size handling.
(maybe_fold_offset_to_array_ref): Rework to handle input having an
ARRAY_REF, refine handling of lower bound, and add new operands
for ARRAY_REF.
(maybe_fold_to_component_ref): Add new operand for COMPONENT_REF.
(maybe_fold_stmt_indirect): Only fold *&B to B if types match.
(maybe_fold_stmt_addition): Only handle constant lower bound.
* tree-ssa-operands.c (get_expr_operands): Minor rearrangements.
Treat ARRAY_REF and ARRAY_RANGE_REF the same; look at extra operands.
Look at new offset operand of COMPONENT_REF.
* tree-ssa.c (set_is_used): Use handled_component_p.
* tree.c (substitute_in_expr, case COMPONENT_REF): Add new operand.
(stabilize_reference, case COMPONENT_REF): Likewise.
(stabilize_reference, case ARRAY_RANGE_REF, ARRAY_REF): Similarly.
(recompute_tree_invariant_for_addr_expr): Completely rework to
be more precise. Also set TREE_SIDE_EFFECTS.
(build1_stat, case ARRAY_EXPR): Don't handle TREE_SIDE_EFFECTS here.
(build2_stat, build3_stat, build4_stat): For references,
propagate TREE_THIS_VOLATILE.
(get_unwidened): Add new operand for COMPONENT_REF.
(get_narrower): Likewise; use host_integerp for DECL_SIZE.
* tree.def (COMPONENT_REF): Add new operand.
(ARRAY_REF, ARRAY_RANGE_REF): Add two new operands.
* tree.h (array_ref_element_size, array_ref_low_bound): New decls.
(component_ref_field_offset): Likewise.
* config/alpha/alpha.c (alpha_va_start): Add new op for COMPONENT_REF.
(alpha_gimplify_va_arg): Likewise.
* config/i386/i386.c (ix86_va_start, ix86_gimplify_va_arg): Likewise.
* config/i860/i860.c (i860_va_start, i860_va_arg): Likewise.
* config/iq2000/iq2000.c (iq2000_va_arg): Likewise.
* config/mips/mips.c (mips_va_start, mips_va_arg): Likewise.
* config/rs6000/rs6000.c (rs6000_va_start, rs6000_gimplify_va_arg):
Likewise.
* config/s390/s390.c (s390_va_start, s390_gimplify_va_arg): Likewise.
* config/sh/sh.c (sh_va_start, sh_va_arg): Likewise.
* config/stormy16/stormy16.c (xstormy1_expand_builin_va_start):
Likewise.
(xstormy16_expand_builtin_va_arg): Likewise.
* config/xtensa/xtensa.c (xtensa_va_start, xtensa_va_arg): Likewise.
* cp/call.c (build_vfield_ref): Add new operand for COMPONENT_REF.
(build_new_method_call): Likewise.
* cp/decl.c (local_variable_p_walkfn): Don't walk into types.
* cp/decl2.c (grok_array_decl): Add new operands for ARRAY_REF.
(build_anon_union_vars): Add new operand for COMPONENT_REF.
* cp/init.c (buld_new): Add new operand for ARRAY_REF.
* cp/method.c (do_build_copy_constructor): New op for COMPONENT_REF.
(do_build_assign_ref): Likewise.
* cp/parser.c (cp_parser_direct_new_declarator): Add new operands
for ARRAY_REF.
(cp_parser_direct_declarator): Likewise.
* cp/pt.c (tsubst): Likewise.
(tsubst_copy, tsubst_copy_and_build): Likewise; also add new operand
for COMPONENT_REF.
* cp/semantics.c (finish_non_static_data_member): Add new operand
for COMPONENT_REF.
* cp/typeck.c (build_class_member_access_expr): Likewise.
(build_class_member_access_expr, finish_class_member_access_expr):
Likewise.
(build_ptrmemfunc_access_expr): Likewise.
(build_array_ref): Add new operands for ARRAY_REF.
* cp/typeck2.c (split_nonconstant_init_1): Likewise; COMPONENT_REF too.
* cp/tree.c (count_trees_r, no_linkage_helper): Don't walk in types.
* fortran/f95-lang.c (LANG_HOOKS_GIMPLE_BEFORE_INLINING): Deleted.
* fortran/trans-array.c (gfc_conv_descriptor_data): Add operand
for COMPONENT_REF.
(gfc_conv_descriptor_offset, gfc_conv_descriptor_dtype): Likewise.
(gfc_conv_descriptor_dimension, gfc_conv_descriptor_stride): Likewise.
(gfc_conv_descriptor_lbound, gfc_conv_descriptor_ubound): Likewise.
* fortran/trans-common.c (create_common): Likewise.
* fortran/trans-expr.c (gfc_conv_component_ref): Likewise.
* fortran/trans-io.c (set_parameter_value): Likewise.
(set_parameter_ref, set_string, set_flag, io_result): Likewise.
(transfer_expr): Likewise.
* fortran/trans-decl.c (gfc_trans_auto_character_variable):
Set up to get DECL_SIZE and DECL_SIZE_UNIT gimplified.
(gfc_simplify_function): New function.
(gfc_generate_function-code): Properly handle nested functions.
* fortran/trans.c (gfc_build_array_ref): Add two new operands
for ARRAY_REF.
* java/class.c (build_class_ref): Add new operand for COMPONENT_REF.
(build_static_field_ref): Likewise and add new operands for ARRAY_REF.
* java/constants.c (build_ref_from_constant_pool): Likewise.
* java/expr.c (build_java_array_length_access): Likewise.
(build_get_class, build_field_ref, build_known_method_ref): Likewise.
(invoke_build_dtable, build_invokevirtual): Likewise.
(build_invokeinterface, java_expand_expr): Likewise.
(emit_init_test_initialization): Likewise.
* java/java-gimplify.c (java_gimplify_new_array_init): Likewise.
* java/parse.y (make_qualifed_name, build_array_ref): Likewise.
* objc/ojbc-act.c (generate_static_references): Add additional
operands to ARRAY_REF.
(generate_strings, build_method_prototype_list_template): Likewise.
(generate_protocol_list): Likewise.
From-SVN: r83474
2004-06-22 05:07:05 +02:00
|
|
|
|
return build_min_nt (ARRAY_REF, array_expr, index_exp,
|
|
|
|
|
NULL_TREE, NULL_TREE);
|
2003-07-09 10:48:08 +02:00
|
|
|
|
array_expr = build_non_dependent_expr (array_expr);
|
|
|
|
|
index_exp = build_non_dependent_expr (index_exp);
|
|
|
|
|
}
|
1996-02-28 23:01:56 +01:00
|
|
|
|
|
2003-07-09 10:48:08 +02:00
|
|
|
|
type = TREE_TYPE (array_expr);
|
call.c (validate_conversion_obstack): Replace my_friendly_assert with gcc_assert or gcc_unreachable.
* call.c (validate_conversion_obstack): Replace
my_friendly_assert with gcc_assert or gcc_unreachable.
(direct_reference_binding, merge_conversion_sequences,
build_user_type_conversion_1, perform_overload_resolution,
build_op_delete_call, enforce_access, call_builtin_trap,
build_over_call, build_special_member_call, build_new_method_call,
initialize_reference): Likewise.
* class.c (build_base_path, build_primary_vtable, alter_access,
check_bases, update_vtable_entry_for_fn, layout_empty_base,
clone_function_decl, adjust_clone_args,
type_requires_array_cookie, include_empty_classes,
finish_struct_1, resolve_address_of_overloaded_function,
instantiate_type, get_vtbl_decl_for_binfo, build_vtt_inits,
dfs_build_secondary_vptr_vtt_inits, build_ctor_vtbl_group,
accumulate_vtbl_inits, build_vtbl_initializer,
build_vbase_offset_vtbl_entries, build_rtti_vtbl_entries): Likewise.
* cvt.c (build_up_reference, convert_to_reference): Likewise.
* decl.c (poplevel, duplicate_decls, make_typename_type,
cxx_init_decl_processing, reshape_init, check_initializer,
make_rtl_for_nonlocal_decl, initialize_local_var, cp_finish_decl,
expand_static_init, grokfndecl, grokvardecl, build_ptrmem_type,
grokdeclarator, copy_fn_p, grok_op_properties, xref_tag,
xref_basetypes, start_preparsed_function, save_function_data,
finish_function, finish_method, maybe_register_incomplete_var,
complete_vars): Likewise.
* decl2.c (grok_array_decl, check_member_template,
check_classfn, finish_static_data_member_decl, coerce_new_type,
coerce_delete_type, import_export_class, decl_needed_p,
determine_visibility, import_export_decl, build_cleanup,
start_static_initialization_or_destructi, do_static_destruction,
prune_vars_needing_no_initialization,
build_offset_ref_call_from_tree): Likewise.
* error.c (dump_decl, dump_expr): Likewise.
* init.c (finish_init_stmts, build_zero_init,
expand_virtual_init, expand_default_init, expand_aggr_init_1,
build_offset_ref, build_new_1, build_delete, build_vbase_delete):
Likewise.
* mangle.c (write_method_parms, write_template_args,
write_expression, write_template_arg): Likewise.
* method.c (make_thunk, finish_thunk, use_thunk): Likewise.
* name-lookup.c (pop_binding, begin_scope, leave_scope,
resume_scope, push_using_decl, validate_nonmember_using_decl,
is_ancestor, poplevel_class, set_inherited_value_binding_p,
push_class_level_binding, do_class_using_decl, push_namespace,
pop_namespace, add_using_namespace, ambiguous_decl,
lookup_namespace_name, lookup_type_current_level,
maybe_process_template_type_declaration): Likewise.
* parser.c (cp_lexer_peek_nth_token,
cp_parser_parse_and_diagnose_invalid_typ,
cp_parser_translation_unit, cp_parser_template_id,
cp_parser_lookup_name, cp_parser_late_parsing_for_member): Likewise.
* pt.c (push_access_scope, finish_member_template_decl,
push_inline_template_parms_recursive, add_outermost_template_args,
get_innermost_template_args, begin_explicit_instantiation,
end_explicit_instantiation, retrieve_specialization,
is_specialization_of, is_specialization_of_friend,
register_specialization, check_explicit_specialization,
comp_template_parms, process_template_parm,
process_partial_specialization, convert_nontype_argument,
coerce_template_template_parms, coerce_template_parms,
mangle_class_name_for_template, lookup_template_function,
lookup_template_class, instantiate_class_template, tsubst_decl,
tsubst_function_type, tsubst, tsubst_qualified_id, tsubst_copy,
instantiate_template, fn_type_unification, type_unification_real,
get_template_base, regenerate_decl_from_template,
template_for_substitution, instantiate_decl,
get_mostly_instantiated_function_type, dependent_scope_ref_p,
value_dependent_expression_p, resolve_typename_type): Likewise.
* repo.c (repo_emit_p): Likewise.
* rtti.c (build_headof, get_tinfo_decl, get_pseudo_ti_init,
create_tinfo_types, emit_tinfo_decl): Likewise.
* search.c (lookup_base_r, lookup_base, lookup_field_1,
dfs_access_in_type, build_baselink, lookup_member,
adjust_result_of_qualified_name_lookup, copied_binfo): Likewise.
* semantics.c (perform_or_defer_access_check,
finish_non_static_data_member, finish_stmt_expr_expr,
finish_stmt_expr, finish_call_expr, finish_pseudo_destructor_expr,
finish_template_template_parm, finish_member_declaration,
emit_associated_thunks): Likewise.
* tree.c (build_target_expr_with_type, force_target_expr,
copy_binfo, get_first_fn, cp_tree_equal): Likewise.
* typeck.c (type_after_usual_arithmetic_conversions, comptypes,
cxx_sizeof_or_alignof_type, perform_integral_promotions,
build_class_member_access_expr, finish_class_member_access_expr,
build_ptrmemfunc_access_expr, build_unary_op,
unary_complex_lvalue, cxx_mark_addressable, build_modify_expr,
build_ptrmemfunc, expand_ptrmemfunc_cst, check_return_expr
* typeck2.c (complete_type_check_abstract,
abstract_virtuals_error, process_init_constructor,
add_exception_specifier): Likewise.
From-SVN: r86669
2004-08-27 19:59:33 +02:00
|
|
|
|
gcc_assert (type);
|
2003-07-08 03:38:44 +02:00
|
|
|
|
type = non_reference (type);
|
1994-02-24 02:02:37 +01:00
|
|
|
|
|
|
|
|
|
/* If they have an `operator[]', use that. */
|
cp-tree.h (IS_AGGR_TYPE): Rename to MAYBE_CLASS_TYPE_P.
2008-03-21 Paolo Carlini <pcarlini@suse.de>
* cp-tree.h (IS_AGGR_TYPE): Rename to MAYBE_CLASS_TYPE_P.
(SET_IS_AGGR_TYPE): Rename to SET_CLASS_TYPE_P.
(IS_AGGR_TYPE_CODE): Rename to RECORD_OR_UNION_CODE_P.
(PROMOTES_TO_AGGR_TYPE): Remove.
(CLASS_TYPE_P, TYPE_NON_AGGREGATE_CLASS): Adjust.
* typeck.c (unary_complex_lvalue, build_modify_expr,
convert_for_initialization): Adjust.
* init.c (is_aggr_type): Remove.
(is_class_type): Add.
(build_offset_ref, build_new_1, build_vec_delete_1, build_vec_init,
build_delete): Adjust.
* lex.c (make_aggr_type): Remove.
(make_class_type): Add.
(cxx_make_type): Adjust.
* class.c (finish_struct_1, fixed_type_or_null, is_empty_class):
Adjust.
* decl.c (build_typename_type, make_typename_type,
make_unbound_class_template, cxx_init_decl_processing,
check_tag_decl, groktypename, start_decl_1, layout_var_decl,
check_initializer, cp_finish_decl, build_ptrmemfunc_type, grokparms,
grok_op_properties, xref_tag, check_function_type): Adjust.
* call.c (check_dtor_name, standard_conversion, implicit_conversion,
add_builtin_candidate, add_builtin_candidates,
build_user_type_conversion_1, convert_like_real, build_cxx_call,
is_subseq, compare_ics): Adjust.
* method.c (use_thunk): Adjust.
* rtti.c (build_dynamic_cast_1, create_pseudo_type_info,
create_tinfo_types): Adjust.
* cvt.c (cp_convert_to_pointer, convert_to_pointer_force,
build_up_reference, convert_to_reference, convert_from_reference,
ocp_convert, build_expr_type_conversion): Adjust.
* tree.c (bind_template_template_parm, error_type): Adjust.
* dump.c (cp_dump_tree): Adjust.
* search.c (lookup_member): Adjust.
* friend.c (make_friend_class, do_friend): Adjust.
* typeck2.c (store_init_value, process_init_constructor_array,
process_init_constructor_record, build_x_arrow, build_m_component_ref,
build_functional_cast): Adjust.
* pt.c (finish_member_template_decl, process_template_parm,
lookup_template_class, tsubst_function_type, tsubst,
tsubst_copy_and_build, get_template_base, bt_instantiate_type_proc):
Adjust.
* semantics.c (begin_class_definition, finish_base_specifier,
finish_typeof, cxx_omp_predetermined_sharing, finish_decltype_type):
Adjust.
* name-lookup.c (constructor_name_p, push_overloaded_decl,
do_class_using_decl, lookup_qualified_name,
maybe_process_template_type_declaration): Adjust.
* decl2.c (grok_array_decl, check_member_template,
constrain_class_visibility): Adjust.
* parser.c (cp_parser_class_name): Adjust.
From-SVN: r133434
2008-03-21 19:56:51 +01:00
|
|
|
|
if (MAYBE_CLASS_TYPE_P (type) || MAYBE_CLASS_TYPE_P (TREE_TYPE (index_exp)))
|
2003-07-09 10:48:08 +02:00
|
|
|
|
expr = build_new_op (ARRAY_REF, LOOKUP_NORMAL,
|
2004-03-16 23:18:11 +01:00
|
|
|
|
array_expr, index_exp, NULL_TREE,
|
2008-03-25 14:53:58 +01:00
|
|
|
|
/*overloaded_p=*/NULL, tf_warning_or_error);
|
1995-03-16 00:03:59 +01:00
|
|
|
|
else
|
2003-07-09 10:48:08 +02:00
|
|
|
|
{
|
|
|
|
|
tree p1, p2, i1, i2;
|
1994-02-24 02:02:37 +01:00
|
|
|
|
|
2003-07-09 10:48:08 +02:00
|
|
|
|
/* Otherwise, create an ARRAY_REF for a pointer or array type.
|
|
|
|
|
It is a little-known fact that, if `a' is an array and `i' is
|
|
|
|
|
an int, you can write `i[a]', which means the same thing as
|
|
|
|
|
`a[i]'. */
|
|
|
|
|
if (TREE_CODE (type) == ARRAY_TYPE)
|
|
|
|
|
p1 = array_expr;
|
|
|
|
|
else
|
|
|
|
|
p1 = build_expr_type_conversion (WANT_POINTER, array_expr, false);
|
|
|
|
|
|
|
|
|
|
if (TREE_CODE (TREE_TYPE (index_exp)) == ARRAY_TYPE)
|
|
|
|
|
p2 = index_exp;
|
|
|
|
|
else
|
|
|
|
|
p2 = build_expr_type_conversion (WANT_POINTER, index_exp, false);
|
1994-02-24 02:02:37 +01:00
|
|
|
|
|
2005-06-14 22:01:59 +02:00
|
|
|
|
i1 = build_expr_type_conversion (WANT_INT | WANT_ENUM, array_expr,
|
2003-07-09 10:48:08 +02:00
|
|
|
|
false);
|
2005-06-14 22:01:59 +02:00
|
|
|
|
i2 = build_expr_type_conversion (WANT_INT | WANT_ENUM, index_exp,
|
2003-07-09 10:48:08 +02:00
|
|
|
|
false);
|
1994-02-24 02:02:37 +01:00
|
|
|
|
|
2003-07-09 10:48:08 +02:00
|
|
|
|
if ((p1 && i2) && (i1 && p2))
|
|
|
|
|
error ("ambiguous conversion for array subscript");
|
1994-02-24 02:02:37 +01:00
|
|
|
|
|
2003-07-09 10:48:08 +02:00
|
|
|
|
if (p1 && i2)
|
|
|
|
|
array_expr = p1, index_exp = i2;
|
|
|
|
|
else if (i1 && p2)
|
|
|
|
|
array_expr = p2, index_exp = i1;
|
|
|
|
|
else
|
|
|
|
|
{
|
Convert diagnostics to use quoting flag q 3/n
cp/
Convert diagnostics to use quoting flag q 3/n
* decl.c (pop_label, duplicate_decls,
redeclaration_error_message,
redeclaration_error_message, lookup_label, check_goto,
make_typename_type, make_unbound_class_template,
fixup_anonymous_aggr, check_tag_decl, start_decl,
start_decl_1,
grok_reference_init, layout_var_decl, maybe_commonize_var,
check_for_uninitialized_const_var, reshape_init_array,
reshape_init, check_initializer, cp_finish_decl,
member_function_or_else, bad_specifiers, grokfndecl,
grokvardecl,
check_static_variable_definition, compute_array_index_type,
create_array_type_for_decl,
check_special_function_return_type,
grokdeclarator, check_default_argument, grokparms,
grok_ctor_properties, grok_op_properties,
check_elaborated_type_specifier, xref_tag, finish_enum,
build_enumerator, check_function_type,
start_preparsed_function,
store_parm_decls): Use quoting formats.
* decl2.c (grok_array_decl, delete_sanity,
check_member_template,
check_java_method, check_classfn,
finish_static_data_member_decl,
grokfield, grokbitfield, grok_function_init,
build_anon_union_vars, coerce_new_type, coerce_delete_type,
check_default_args): Likewise.
* parser.c (cp_parser_decl_specifier_seq): Likewise.
testsuite/
* g++.dg/template/local1.C: Adjust quoting marks in
testing for diagnostics.
* g++.dg/tls/diag-2.C: Likewise.
* g++.dg/other/error8.C: Likewise.
From-SVN: r88478
2004-10-04 08:04:43 +02:00
|
|
|
|
error ("invalid types %<%T[%T]%> for array subscript",
|
2005-06-15 02:41:35 +02:00
|
|
|
|
type, TREE_TYPE (index_exp));
|
2003-07-09 10:48:08 +02:00
|
|
|
|
return error_mark_node;
|
|
|
|
|
}
|
1995-03-16 00:03:59 +01:00
|
|
|
|
|
2003-07-09 10:48:08 +02:00
|
|
|
|
if (array_expr == error_mark_node || index_exp == error_mark_node)
|
|
|
|
|
error ("ambiguous conversion for array subscript");
|
1995-03-16 00:03:59 +01:00
|
|
|
|
|
2010-05-13 22:53:38 +02:00
|
|
|
|
expr = build_array_ref (input_location, array_expr, index_exp);
|
2003-07-09 10:48:08 +02:00
|
|
|
|
}
|
|
|
|
|
if (processing_template_decl && expr != error_mark_node)
|
alias.c (adjust_offset_for_component_ref): Use component_ref_field_offset.
* alias.c (adjust_offset_for_component_ref): Use
component_ref_field_offset.
* c-decl.c (build_array_declarator): Add news args for ARRAY_REF.
* c-gimplify.c (gimplify_expr_stmt): Use alloc_stmt_list.
(gimplify_decl_stmt): Call gimplify_type_sizes for type.
For decl, call gimplify_one_sizepos and use statement list.
(gimplify_compound_literal_expr): New arg PRE_P.
Add statement to PRE_P list and return DECL.
(c_gimplify_expr, case COMPOUND_LITERAL_EXPR): Add arg to
gimplify_compound_literal_expr.
* c-tree.h (getdecls): Deleted.
* c-typeck.c (build_component_ref): Add operand for COMPONENT_REF.
(build_array_ref): Add two operands for ARRAY_REF.
(build_unary_op): Set TREE_INVARIANT and TREE_CONSTANT for
COMPOUND_LITERAL_EXPR.
* coverage.c (tree_coverage_counter_ref): Add new operands
for ARRAY_REF.
* emit-rtl.c (component_ref_for_mem_expr): Add new operand
for COMPONENT_REF.
(set_mem_attributes_minus_bitpos): Use array_ref_low_bound
and array_ref_element_size.
(widen_memory_access):Use component_ref_field_offset.
* explow.c (update_nonlocal_goto_save_area): Add two operands
for ARRAY_REF.
* expr.c (array_ref_element_size, array_ref_low_bound): New functions.
(component_ref_field_offset): Likewise.
(get_inner_reference): Use them.
(expand_expr_real_1, case ARRAY_REF): Use array_ref_low_bound.
* fold-const.c (fold, case EQ_EXPR): Properly handle DECL_SIZE.
(fold_read_from_constant_string): Use array_ref_low_bound.
Verify that result is a character type.
(build_fold_indirect_ref): Add two operands for ARRAY_REF.
* function.c (expand_function_start): Likewise.
* gimple-low.c (expand_var_p): Delete duplicated line.
* gimplify.c: Add static decls for local functions.
(cgraph.h): Now included.
(create_tmp_var): Remove check for ARRAY_TYPE.
(copy_if_shared_r): Look at bounds and sizes of types.
(build_and_jump): Return alloc_stmt_list instead of build_empty_stmt.
(gimplify_exit_expr, shortcut_cond_expr): Likewise.
(gimplify_save_expr, gimple_push_cleanup): Likewise.
(gimplify_init_constructor): Likewise.
WANT_VALUE now bool.
If empty list with no result wanted, return GS_UNHANDLED.
Add additional operands for ARRAY_REF and COMPONENT_REF.
(canonicalize_component_ref): Convert to &array[L].
(gimplify_array_ref_to_plus): Use array_ref_element_size and
array_ref_lower_bound.
(build_addr_expr_with_type, build_addr_expr): New functions.
(gimplify_compound_lval): WANT_LVALUE now bool.
Major rework to allow handle_component_p and initialize and
gimplify new operands for ARRAY_REF, ARRAY_RANGE_REF, and
COMPONENT_REF.
(gimplify_array_ref): Deleted.
(gimplify_self_mod_expr): WANT_VALUE now bool.
(gimplify_modify_expr): Gimplify to_p and from_p later.
Factor out code into gimplify_modify_expr_rhs and call twice.
Move variable-size code earlier and handle PLACEHOLDER_EXPR.
(gimplify_modify_expr_rhs, gimplify_variable_sized_compare): New fns.
(gimplify_addr_expr, case VIEW_CONVERT_EXPR): New case.
(gimplify_expr, case ARRAY_REF): Delete special case.
Instead handle like COMPONENT_REF; also do ARRAY_RANGE_REF,
IMAGPART, and REALPART the same way.
(gimplify_expr, case VIEW_CONVERT_EXPR): New case.
(gimplify_expr): Call gimplify_variable_sized_compare if applicable.
Call alloc_stmt_list instead of build_empty_stmt.
Deal with _REF that's volatile.
(gimplify_type_sizes, gimplify_one_sizepos): New functions.
(unshare_body, unvisit_body): New functions.
(gimplify_body): Call them.
* stmt.c (expand_stack_alloc): Don't expand TYPE_MAX_VALUE.
* stor-layout.c (get_pending_sizes): Don't change SAVE_EXPR_CONTEXT.
* tree-alias-common.c (get_alias_var): Also skip ARRAY_RANGE_REF.
* tree-cfg.c (tree_node_can_be_shared): Treat ARRAY_RANGE_REF
like ARRAY_REF.
(verify_expr, case ADDR_EXPR): Use handled_component_p.
* tree-dfa.c (get_virtual_var): Likewise.
* tree-dump.c (dequeue_and_dump, case COMPONENT_REF, ARRAY_REF):
New cases to dump new operands; likewise for ARRAY_RANGE_REF.
* tree-eh.c (tree_could_trap, case ARRAY_RANGE_REF): Like ARRAY_REF.
* tree-gimple.c (is_gimple_addr_expr_arg): Add ARRAY_RANGE_REF
and INDIRECT_REF.
(get_base_address): Use handled_component_p.
* tree-gimple.h (gimplify_type_sizes, gimplify_one_sizepos): New.
* tree-line.c (walk_tree): Walk more things for types and decls.
* tree-mudflap.c (mf_build_check_statement_for): Add new operands
for ARRAY_REF and COMPONENT_REF.
(mx_xform_derefs_1): Clean up usage of decl sizes.
* tree-nested.c (build_addr): Use handled_component_p.
(walk_stmts, case CATCH_EXPR): Add missing "break".
(get_static_chain, get_frame_field): Add new operand for COMPONENT_REF.
(finalize_nesting_tree_1): Likewise.
(convert_nonlocal_reference, case ARRAY_RANGE_REF): Like ARRAY_REF
and process additional operands.
(convert_local_reference): Likewise.
* tree-outof-ssa.c (discover_nonconstant_array_refs_r): Treat
ARRAY_RANGE_REF similarly to ARRAY_REF.
* tree-pretty-print.c (dump_generic_node, case QUAL_UNION_TYPE): Handle
like RECORD_TYPE.
(dump_generic_node, case COMPONENT_REF): Print offset operand.
(dump_generic_node, case ARRAY_RANGE_REF): Treat like ARRAY_REF
and print lower bound and element size for both.
(op_prio, case ARRAY_RANGE_REF): Like ARRAY_REF.
* tree-sra.c (csc_build_component_ref): Add new operand.
(scalarize_call_expr): Use get_base_address.
* tree-ssa-ccp.c (widen_bitfield): Clean up size handling.
(maybe_fold_offset_to_array_ref): Rework to handle input having an
ARRAY_REF, refine handling of lower bound, and add new operands
for ARRAY_REF.
(maybe_fold_to_component_ref): Add new operand for COMPONENT_REF.
(maybe_fold_stmt_indirect): Only fold *&B to B if types match.
(maybe_fold_stmt_addition): Only handle constant lower bound.
* tree-ssa-operands.c (get_expr_operands): Minor rearrangements.
Treat ARRAY_REF and ARRAY_RANGE_REF the same; look at extra operands.
Look at new offset operand of COMPONENT_REF.
* tree-ssa.c (set_is_used): Use handled_component_p.
* tree.c (substitute_in_expr, case COMPONENT_REF): Add new operand.
(stabilize_reference, case COMPONENT_REF): Likewise.
(stabilize_reference, case ARRAY_RANGE_REF, ARRAY_REF): Similarly.
(recompute_tree_invariant_for_addr_expr): Completely rework to
be more precise. Also set TREE_SIDE_EFFECTS.
(build1_stat, case ARRAY_EXPR): Don't handle TREE_SIDE_EFFECTS here.
(build2_stat, build3_stat, build4_stat): For references,
propagate TREE_THIS_VOLATILE.
(get_unwidened): Add new operand for COMPONENT_REF.
(get_narrower): Likewise; use host_integerp for DECL_SIZE.
* tree.def (COMPONENT_REF): Add new operand.
(ARRAY_REF, ARRAY_RANGE_REF): Add two new operands.
* tree.h (array_ref_element_size, array_ref_low_bound): New decls.
(component_ref_field_offset): Likewise.
* config/alpha/alpha.c (alpha_va_start): Add new op for COMPONENT_REF.
(alpha_gimplify_va_arg): Likewise.
* config/i386/i386.c (ix86_va_start, ix86_gimplify_va_arg): Likewise.
* config/i860/i860.c (i860_va_start, i860_va_arg): Likewise.
* config/iq2000/iq2000.c (iq2000_va_arg): Likewise.
* config/mips/mips.c (mips_va_start, mips_va_arg): Likewise.
* config/rs6000/rs6000.c (rs6000_va_start, rs6000_gimplify_va_arg):
Likewise.
* config/s390/s390.c (s390_va_start, s390_gimplify_va_arg): Likewise.
* config/sh/sh.c (sh_va_start, sh_va_arg): Likewise.
* config/stormy16/stormy16.c (xstormy1_expand_builin_va_start):
Likewise.
(xstormy16_expand_builtin_va_arg): Likewise.
* config/xtensa/xtensa.c (xtensa_va_start, xtensa_va_arg): Likewise.
* cp/call.c (build_vfield_ref): Add new operand for COMPONENT_REF.
(build_new_method_call): Likewise.
* cp/decl.c (local_variable_p_walkfn): Don't walk into types.
* cp/decl2.c (grok_array_decl): Add new operands for ARRAY_REF.
(build_anon_union_vars): Add new operand for COMPONENT_REF.
* cp/init.c (buld_new): Add new operand for ARRAY_REF.
* cp/method.c (do_build_copy_constructor): New op for COMPONENT_REF.
(do_build_assign_ref): Likewise.
* cp/parser.c (cp_parser_direct_new_declarator): Add new operands
for ARRAY_REF.
(cp_parser_direct_declarator): Likewise.
* cp/pt.c (tsubst): Likewise.
(tsubst_copy, tsubst_copy_and_build): Likewise; also add new operand
for COMPONENT_REF.
* cp/semantics.c (finish_non_static_data_member): Add new operand
for COMPONENT_REF.
* cp/typeck.c (build_class_member_access_expr): Likewise.
(build_class_member_access_expr, finish_class_member_access_expr):
Likewise.
(build_ptrmemfunc_access_expr): Likewise.
(build_array_ref): Add new operands for ARRAY_REF.
* cp/typeck2.c (split_nonconstant_init_1): Likewise; COMPONENT_REF too.
* cp/tree.c (count_trees_r, no_linkage_helper): Don't walk in types.
* fortran/f95-lang.c (LANG_HOOKS_GIMPLE_BEFORE_INLINING): Deleted.
* fortran/trans-array.c (gfc_conv_descriptor_data): Add operand
for COMPONENT_REF.
(gfc_conv_descriptor_offset, gfc_conv_descriptor_dtype): Likewise.
(gfc_conv_descriptor_dimension, gfc_conv_descriptor_stride): Likewise.
(gfc_conv_descriptor_lbound, gfc_conv_descriptor_ubound): Likewise.
* fortran/trans-common.c (create_common): Likewise.
* fortran/trans-expr.c (gfc_conv_component_ref): Likewise.
* fortran/trans-io.c (set_parameter_value): Likewise.
(set_parameter_ref, set_string, set_flag, io_result): Likewise.
(transfer_expr): Likewise.
* fortran/trans-decl.c (gfc_trans_auto_character_variable):
Set up to get DECL_SIZE and DECL_SIZE_UNIT gimplified.
(gfc_simplify_function): New function.
(gfc_generate_function-code): Properly handle nested functions.
* fortran/trans.c (gfc_build_array_ref): Add two new operands
for ARRAY_REF.
* java/class.c (build_class_ref): Add new operand for COMPONENT_REF.
(build_static_field_ref): Likewise and add new operands for ARRAY_REF.
* java/constants.c (build_ref_from_constant_pool): Likewise.
* java/expr.c (build_java_array_length_access): Likewise.
(build_get_class, build_field_ref, build_known_method_ref): Likewise.
(invoke_build_dtable, build_invokevirtual): Likewise.
(build_invokeinterface, java_expand_expr): Likewise.
(emit_init_test_initialization): Likewise.
* java/java-gimplify.c (java_gimplify_new_array_init): Likewise.
* java/parse.y (make_qualifed_name, build_array_ref): Likewise.
* objc/ojbc-act.c (generate_static_references): Add additional
operands to ARRAY_REF.
(generate_strings, build_method_prototype_list_template): Likewise.
(generate_protocol_list): Likewise.
From-SVN: r83474
2004-06-22 05:07:05 +02:00
|
|
|
|
return build_min_non_dep (ARRAY_REF, expr, orig_array_expr, orig_index_exp,
|
|
|
|
|
NULL_TREE, NULL_TREE);
|
2003-07-09 10:48:08 +02:00
|
|
|
|
return expr;
|
1994-02-24 02:02:37 +01:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Given the cast expression EXP, checking out its validity. Either return
|
|
|
|
|
an error_mark_node if there was an unavoidable error, return a cast to
|
|
|
|
|
void for trying to delete a pointer w/ the value 0, or return the
|
2004-02-14 01:49:15 +01:00
|
|
|
|
call to delete. If DOING_VEC is true, we handle things differently
|
|
|
|
|
for doing an array delete.
|
1994-02-24 02:02:37 +01:00
|
|
|
|
Implements ARM $5.3.4. This is called from the parser. */
|
1996-07-11 03:13:25 +02:00
|
|
|
|
|
1994-02-24 02:02:37 +01:00
|
|
|
|
tree
|
2004-02-14 01:49:15 +01:00
|
|
|
|
delete_sanity (tree exp, tree size, bool doing_vec, int use_global_delete)
|
1994-02-24 02:02:37 +01:00
|
|
|
|
{
|
1998-06-10 05:13:19 +02:00
|
|
|
|
tree t, type;
|
1996-02-28 23:01:56 +01:00
|
|
|
|
|
1996-03-23 00:11:55 +01:00
|
|
|
|
if (exp == error_mark_node)
|
|
|
|
|
return exp;
|
|
|
|
|
|
1996-09-30 23:34:04 +02:00
|
|
|
|
if (processing_template_decl)
|
1996-02-28 23:01:56 +01:00
|
|
|
|
{
|
|
|
|
|
t = build_min (DELETE_EXPR, void_type_node, exp, size);
|
|
|
|
|
DELETE_EXPR_USE_GLOBAL (t) = use_global_delete;
|
|
|
|
|
DELETE_EXPR_USE_VEC (t) = doing_vec;
|
2004-05-29 00:35:50 +02:00
|
|
|
|
TREE_SIDE_EFFECTS (t) = 1;
|
1996-02-28 23:01:56 +01:00
|
|
|
|
return t;
|
|
|
|
|
}
|
|
|
|
|
|
2004-02-14 01:49:15 +01:00
|
|
|
|
/* An array can't have been allocated by new, so complain. */
|
|
|
|
|
if (TREE_CODE (exp) == VAR_DECL
|
|
|
|
|
&& TREE_CODE (TREE_TYPE (exp)) == ARRAY_TYPE)
|
diagnostic.c (warning): Accept parameter to classify warning option.
* diagnostic.c (warning): Accept parameter to classify warning option.
(warning0): New, for when a pointer to an error() like function is needed.
* errors.c (warning): Likewise.
* errors.h (warning, warning0): Adjust prototypes.
* toplev.h (warning, warning0): Likewise.
* attribs.c, builtins.c, c-common.c, c-decl.c, c-format.c,
c-gimplify.c, c-lex.c, c-objc-common.c, c-opts.c, c-parser.c,
c-pragma.c, c-typeck.c, calls.c, cgraph.c, coverage.c, emit-rtl.c,
fold-const.c, fortran/trans-decl.c, function.c, gcse.c,
genautomata.c, haifa-sched.c, opts.c, passes.c, regclass.c,
reload1.c, stmt.c, stor-layout.c, toplev.c, tree-cfg.c,
tree-dump.c, tree-inline.c, tree-mudflap.c, tree-optimize.c,
tree-ssa.c, tree.c, varasm.c: Adjust warning() callers.
* config/alpha/alpha.c, config/arc/arc.c, config/arm/arm.c,
config/avr/avr.c, config/bfin/bfin.c, config/c4x/c4x-c.c,
config/c4x/c4x.c, config/cris/cris.c, config/darwin-c.c,
config/darwin.c, config/darwin.h, config/h8300/h8300.c,
config/i386/cygming.h, config/i386/djgpp.h, config/i386/i386.c,
config/i386/winnt.c, config/ia64/ia64-c.c, config/ia64/ia64.c,
config/ip2k/ip2k.c, config/m32r/m32r.c, config/m68hc11/m68hc11.c,
config/m68k/m68k.c, config/mcore/mcore.c, config/mips/mips.c,
config/mmix/mmix.c, config/ns32k/ns32k.c, config/pa/pa-hpux11.h,
config/pa/pa.c, config/rs6000/aix43.h, config/rs6000/aix51.h,
config/rs6000/aix52.h, config/rs6000/darwin.h,
config/rs6000/rs6000-c.c, config/rs6000/rs6000.c,
config/s390/s390.c, config/sh/sh.c, config/sh/sh.h,
config/sh/symbian.c, config/sol2-c.c, config/sol2.c,
config/stormy16/stormy16.c, config/v850/v850-c.c,
config/v850/v850.c, config/xtensa/xtensa.c: Adjust warning()
callers.
* ada/misc.c: Adjust warning() callers.
* cp/call.c, cp/class.c, cp/cvt.c, cp/decl.c, cp/decl2.c,
cp/except.c, cp/friend.c, cp/init.c, cp/lex.c, cp/mangle.c,
cp/method.c, cp/name-lookup.c, cp/parser.c, cp/repo.c, cp/rtti.c,
cp/tree.c, cp/typeck.c, cp/typeck2.c: Adjust warning() callers.
* fortran/trans-decl.c: Adjust warning() callers.
* java/class.c, java/decl.c, java/expr.c, java/jcf-io.c,
java/jcf-parse.c, java/jv-scan.c, java/parse.y: Adjust warning()
callers.
* objc/objc-act.c: Adjust warning() callers.
* treelang/parse.y: Adjust warning() callers.
From-SVN: r98633
2005-04-23 23:29:07 +02:00
|
|
|
|
warning (0, "deleting array %q#D", exp);
|
2004-02-14 01:49:15 +01:00
|
|
|
|
|
2003-05-22 01:27:50 +02:00
|
|
|
|
t = build_expr_type_conversion (WANT_POINTER, exp, true);
|
1994-02-24 02:02:37 +01:00
|
|
|
|
|
1998-06-10 05:13:19 +02:00
|
|
|
|
if (t == NULL_TREE || t == error_mark_node)
|
1994-02-24 02:02:37 +01:00
|
|
|
|
{
|
Convert diagnostics to use quoting flag q 3/n
cp/
Convert diagnostics to use quoting flag q 3/n
* decl.c (pop_label, duplicate_decls,
redeclaration_error_message,
redeclaration_error_message, lookup_label, check_goto,
make_typename_type, make_unbound_class_template,
fixup_anonymous_aggr, check_tag_decl, start_decl,
start_decl_1,
grok_reference_init, layout_var_decl, maybe_commonize_var,
check_for_uninitialized_const_var, reshape_init_array,
reshape_init, check_initializer, cp_finish_decl,
member_function_or_else, bad_specifiers, grokfndecl,
grokvardecl,
check_static_variable_definition, compute_array_index_type,
create_array_type_for_decl,
check_special_function_return_type,
grokdeclarator, check_default_argument, grokparms,
grok_ctor_properties, grok_op_properties,
check_elaborated_type_specifier, xref_tag, finish_enum,
build_enumerator, check_function_type,
start_preparsed_function,
store_parm_decls): Use quoting formats.
* decl2.c (grok_array_decl, delete_sanity,
check_member_template,
check_java_method, check_classfn,
finish_static_data_member_decl,
grokfield, grokbitfield, grok_function_init,
build_anon_union_vars, coerce_new_type, coerce_delete_type,
check_default_args): Likewise.
* parser.c (cp_parser_decl_specifier_seq): Likewise.
testsuite/
* g++.dg/template/local1.C: Adjust quoting marks in
testing for diagnostics.
* g++.dg/tls/diag-2.C: Likewise.
* g++.dg/other/error8.C: Likewise.
From-SVN: r88478
2004-10-04 08:04:43 +02:00
|
|
|
|
error ("type %q#T argument given to %<delete%>, expected pointer",
|
2005-06-15 02:41:35 +02:00
|
|
|
|
TREE_TYPE (exp));
|
1998-06-10 05:13:19 +02:00
|
|
|
|
return error_mark_node;
|
1994-02-24 02:02:37 +01:00
|
|
|
|
}
|
|
|
|
|
|
1998-06-10 05:13:19 +02:00
|
|
|
|
type = TREE_TYPE (t);
|
|
|
|
|
|
|
|
|
|
/* As of Valley Forge, you can delete a pointer to const. */
|
|
|
|
|
|
|
|
|
|
/* You can't delete functions. */
|
|
|
|
|
if (TREE_CODE (TREE_TYPE (type)) == FUNCTION_TYPE)
|
1994-04-08 08:08:43 +02:00
|
|
|
|
{
|
Convert diagnostics to use quoting flag q 3/n
cp/
Convert diagnostics to use quoting flag q 3/n
* decl.c (pop_label, duplicate_decls,
redeclaration_error_message,
redeclaration_error_message, lookup_label, check_goto,
make_typename_type, make_unbound_class_template,
fixup_anonymous_aggr, check_tag_decl, start_decl,
start_decl_1,
grok_reference_init, layout_var_decl, maybe_commonize_var,
check_for_uninitialized_const_var, reshape_init_array,
reshape_init, check_initializer, cp_finish_decl,
member_function_or_else, bad_specifiers, grokfndecl,
grokvardecl,
check_static_variable_definition, compute_array_index_type,
create_array_type_for_decl,
check_special_function_return_type,
grokdeclarator, check_default_argument, grokparms,
grok_ctor_properties, grok_op_properties,
check_elaborated_type_specifier, xref_tag, finish_enum,
build_enumerator, check_function_type,
start_preparsed_function,
store_parm_decls): Use quoting formats.
* decl2.c (grok_array_decl, delete_sanity,
check_member_template,
check_java_method, check_classfn,
finish_static_data_member_decl,
grokfield, grokbitfield, grok_function_init,
build_anon_union_vars, coerce_new_type, coerce_delete_type,
check_default_args): Likewise.
* parser.c (cp_parser_decl_specifier_seq): Likewise.
testsuite/
* g++.dg/template/local1.C: Adjust quoting marks in
testing for diagnostics.
* g++.dg/tls/diag-2.C: Likewise.
* g++.dg/other/error8.C: Likewise.
From-SVN: r88478
2004-10-04 08:04:43 +02:00
|
|
|
|
error ("cannot delete a function. Only pointer-to-objects are "
|
2005-06-15 02:41:35 +02:00
|
|
|
|
"valid arguments to %<delete%>");
|
1998-06-10 05:13:19 +02:00
|
|
|
|
return error_mark_node;
|
1994-04-08 08:08:43 +02:00
|
|
|
|
}
|
1998-06-10 05:13:19 +02:00
|
|
|
|
|
2002-09-21 14:51:56 +02:00
|
|
|
|
/* Deleting ptr to void is undefined behavior [expr.delete/3]. */
|
1999-04-29 10:33:55 +02:00
|
|
|
|
if (TREE_CODE (TREE_TYPE (type)) == VOID_TYPE)
|
2000-06-22 22:54:48 +02:00
|
|
|
|
{
|
diagnostic.c (warning): Accept parameter to classify warning option.
* diagnostic.c (warning): Accept parameter to classify warning option.
(warning0): New, for when a pointer to an error() like function is needed.
* errors.c (warning): Likewise.
* errors.h (warning, warning0): Adjust prototypes.
* toplev.h (warning, warning0): Likewise.
* attribs.c, builtins.c, c-common.c, c-decl.c, c-format.c,
c-gimplify.c, c-lex.c, c-objc-common.c, c-opts.c, c-parser.c,
c-pragma.c, c-typeck.c, calls.c, cgraph.c, coverage.c, emit-rtl.c,
fold-const.c, fortran/trans-decl.c, function.c, gcse.c,
genautomata.c, haifa-sched.c, opts.c, passes.c, regclass.c,
reload1.c, stmt.c, stor-layout.c, toplev.c, tree-cfg.c,
tree-dump.c, tree-inline.c, tree-mudflap.c, tree-optimize.c,
tree-ssa.c, tree.c, varasm.c: Adjust warning() callers.
* config/alpha/alpha.c, config/arc/arc.c, config/arm/arm.c,
config/avr/avr.c, config/bfin/bfin.c, config/c4x/c4x-c.c,
config/c4x/c4x.c, config/cris/cris.c, config/darwin-c.c,
config/darwin.c, config/darwin.h, config/h8300/h8300.c,
config/i386/cygming.h, config/i386/djgpp.h, config/i386/i386.c,
config/i386/winnt.c, config/ia64/ia64-c.c, config/ia64/ia64.c,
config/ip2k/ip2k.c, config/m32r/m32r.c, config/m68hc11/m68hc11.c,
config/m68k/m68k.c, config/mcore/mcore.c, config/mips/mips.c,
config/mmix/mmix.c, config/ns32k/ns32k.c, config/pa/pa-hpux11.h,
config/pa/pa.c, config/rs6000/aix43.h, config/rs6000/aix51.h,
config/rs6000/aix52.h, config/rs6000/darwin.h,
config/rs6000/rs6000-c.c, config/rs6000/rs6000.c,
config/s390/s390.c, config/sh/sh.c, config/sh/sh.h,
config/sh/symbian.c, config/sol2-c.c, config/sol2.c,
config/stormy16/stormy16.c, config/v850/v850-c.c,
config/v850/v850.c, config/xtensa/xtensa.c: Adjust warning()
callers.
* ada/misc.c: Adjust warning() callers.
* cp/call.c, cp/class.c, cp/cvt.c, cp/decl.c, cp/decl2.c,
cp/except.c, cp/friend.c, cp/init.c, cp/lex.c, cp/mangle.c,
cp/method.c, cp/name-lookup.c, cp/parser.c, cp/repo.c, cp/rtti.c,
cp/tree.c, cp/typeck.c, cp/typeck2.c: Adjust warning() callers.
* fortran/trans-decl.c: Adjust warning() callers.
* java/class.c, java/decl.c, java/expr.c, java/jcf-io.c,
java/jcf-parse.c, java/jv-scan.c, java/parse.y: Adjust warning()
callers.
* objc/objc-act.c: Adjust warning() callers.
* treelang/parse.y: Adjust warning() callers.
From-SVN: r98633
2005-04-23 23:29:07 +02:00
|
|
|
|
warning (0, "deleting %qT is undefined", type);
|
2000-06-22 22:54:48 +02:00
|
|
|
|
doing_vec = 0;
|
|
|
|
|
}
|
|
|
|
|
|
1998-06-10 05:13:19 +02:00
|
|
|
|
/* Deleting a pointer with the value zero is valid and has no effect. */
|
|
|
|
|
if (integer_zerop (t))
|
|
|
|
|
return build1 (NOP_EXPR, void_type_node, t);
|
1994-02-24 02:02:37 +01:00
|
|
|
|
|
|
|
|
|
if (doing_vec)
|
2005-06-14 22:01:59 +02:00
|
|
|
|
return build_vec_delete (t, /*maxindex=*/NULL_TREE,
|
2004-02-14 01:49:15 +01:00
|
|
|
|
sfk_deleting_destructor,
|
2000-05-25 00:56:54 +02:00
|
|
|
|
use_global_delete);
|
1994-02-24 02:02:37 +01:00
|
|
|
|
else
|
2002-03-20 20:50:24 +01:00
|
|
|
|
return build_delete (type, t, sfk_deleting_destructor,
|
|
|
|
|
LOOKUP_NORMAL, use_global_delete);
|
1994-02-24 02:02:37 +01:00
|
|
|
|
}
|
|
|
|
|
|
1997-09-06 10:10:07 +02:00
|
|
|
|
/* Report an error if the indicated template declaration is not the
|
|
|
|
|
sort of thing that should be a member template. */
|
|
|
|
|
|
|
|
|
|
void
|
Remove traditional C constructs 4/n.
* decl2.c (grok_method_quals, warn_if_unknown_interface,
grok_x_components, cp_build_parm_decl, build_artificial_parm,
maybe_retrofit_in_chrg, grokclassfn, grok_array_decl,
delete_sanity, check_member_template, check_java_method,
check_classfn, finish_static_data_member_decl, grokfield,
grokbitfield, grokoptypename, grok_function_init,
cplus_decl_attributes, constructor_name, defer_fn,
build_anon_union_vars, finish_anon_union, coerce_new_type,
coerce_delete_type, comdat_linkage, maybe_make_one_only,
key_method, import_export_vtable, import_export_class,
output_vtable_inherit, import_export_decl, import_export_tinfo,
build_cleanup, get_guard, get_guard_bits, get_guard_cond,
set_guard, start_objects, finish_objects,
start_static_storage_duration_function,
finish_static_storage_duration_function, get_priority_info,
start_static_initialization_or_destruction,
finish_static_initialization_or_destruction,
do_static_initialization, do_static_destruction,
prune_vars_needing_no_initialization, write_out_vars,
reparse_decl_as_expr, finish_decl_parsing, namespace_ancestor,
add_using_namespace, merge_functions, ambiguous_decl,
lookup_using_namespace, lookup_using_namespace,
qualified_lookup_using_namespace, set_decl_namespace,
decl_namespace, current_decl_namespace, push_decl_namespace,
pop_decl_namespace, push_scope, pop_scope, add_function,
arg_assoc_namespace, arg_assoc_template_arg, arg_assoc,
lookup_arg_dependent, do_namespace_alias,
validate_nonmember_using_decl, do_nonmember_using_decl,
do_toplevel_using_decl, do_local_using_decl,
do_class_using_decl, do_using_directive, check_default_args,
mark_used, handle_class_head): Use C90 prototypings. Use booleans.
* parser.c (cp_parser_class_head): Use booleanss.
* decl.c (walk_globals, walk_vtables): Likewise.
* cp-tree.h (walk_globals_pred, walk_globals_fn, walk_vtables,
walk_globals): Change return type from 'int' to 'bool'.
* rtti.c (init_rtti_processing, build_headof, throw_bad_cast
throw_bad_typeid, get_tinfo_decl_dynamic, typeid_ok_p,
build_typeid, tinfo_name, get_tinfo_decl, get_tinfo_ptr,
get_typeid, ifnonnull, build_dynamic_cast_1, build_dynamic_cast,
qualifier_flags, tinfo_base_init, generic_initializer,
ptr_initializer, dfs_class_hint_mark, ptm_initializer,
dfs_class_hint_unmark, class_hint_flags, class_initializer,
typeinfo_in_lib_p, get_pseudo_ti_init, create_pseudo_type_info,
get_pseudo_ti_desc, create_tinfo_types, emit_support_tinfos,
unemitted_tinfo_decl_p, emit_tinfo_decl): Likewise.
* repo.c (repo_compile_flags, repo_template_declared,
repo_template_defined, repo_class_defined, repo_get_id,
repo_template_used, repo_vtable_used, repo_inline_used,
repo_tinfo_used, repo_template_instantiated, extract_string,
open_repo_file, afgets, init_repo, reopen_repo_file_for_write,
finish_repo): Likewise.
* ptree.c (cxx_print_decl, cxx_print_type, cxx_print_identifier,
cxx_print_xnode): Likewise..
* cp-lang.c (ok_to_generate_alias_set_for_type, cxx_get_alias_set,
cxx_warn_unused_global_decl, cp_expr_size): Likewise.
* cxxfilt.c (demangle_it, print_demangler_list, usage,
standard_symbol_characters, hp_symbol_characters, main, fatal):
Likewise.
(strip_underscore): Change type from 'int' to 'bool'.
(main): Use boolean constants.
From-SVN: r60601
2002-12-29 15:53:05 +01:00
|
|
|
|
check_member_template (tree tmpl)
|
1997-09-06 10:10:07 +02:00
|
|
|
|
{
|
|
|
|
|
tree decl;
|
|
|
|
|
|
call.c (validate_conversion_obstack): Replace my_friendly_assert with gcc_assert or gcc_unreachable.
* call.c (validate_conversion_obstack): Replace
my_friendly_assert with gcc_assert or gcc_unreachable.
(direct_reference_binding, merge_conversion_sequences,
build_user_type_conversion_1, perform_overload_resolution,
build_op_delete_call, enforce_access, call_builtin_trap,
build_over_call, build_special_member_call, build_new_method_call,
initialize_reference): Likewise.
* class.c (build_base_path, build_primary_vtable, alter_access,
check_bases, update_vtable_entry_for_fn, layout_empty_base,
clone_function_decl, adjust_clone_args,
type_requires_array_cookie, include_empty_classes,
finish_struct_1, resolve_address_of_overloaded_function,
instantiate_type, get_vtbl_decl_for_binfo, build_vtt_inits,
dfs_build_secondary_vptr_vtt_inits, build_ctor_vtbl_group,
accumulate_vtbl_inits, build_vtbl_initializer,
build_vbase_offset_vtbl_entries, build_rtti_vtbl_entries): Likewise.
* cvt.c (build_up_reference, convert_to_reference): Likewise.
* decl.c (poplevel, duplicate_decls, make_typename_type,
cxx_init_decl_processing, reshape_init, check_initializer,
make_rtl_for_nonlocal_decl, initialize_local_var, cp_finish_decl,
expand_static_init, grokfndecl, grokvardecl, build_ptrmem_type,
grokdeclarator, copy_fn_p, grok_op_properties, xref_tag,
xref_basetypes, start_preparsed_function, save_function_data,
finish_function, finish_method, maybe_register_incomplete_var,
complete_vars): Likewise.
* decl2.c (grok_array_decl, check_member_template,
check_classfn, finish_static_data_member_decl, coerce_new_type,
coerce_delete_type, import_export_class, decl_needed_p,
determine_visibility, import_export_decl, build_cleanup,
start_static_initialization_or_destructi, do_static_destruction,
prune_vars_needing_no_initialization,
build_offset_ref_call_from_tree): Likewise.
* error.c (dump_decl, dump_expr): Likewise.
* init.c (finish_init_stmts, build_zero_init,
expand_virtual_init, expand_default_init, expand_aggr_init_1,
build_offset_ref, build_new_1, build_delete, build_vbase_delete):
Likewise.
* mangle.c (write_method_parms, write_template_args,
write_expression, write_template_arg): Likewise.
* method.c (make_thunk, finish_thunk, use_thunk): Likewise.
* name-lookup.c (pop_binding, begin_scope, leave_scope,
resume_scope, push_using_decl, validate_nonmember_using_decl,
is_ancestor, poplevel_class, set_inherited_value_binding_p,
push_class_level_binding, do_class_using_decl, push_namespace,
pop_namespace, add_using_namespace, ambiguous_decl,
lookup_namespace_name, lookup_type_current_level,
maybe_process_template_type_declaration): Likewise.
* parser.c (cp_lexer_peek_nth_token,
cp_parser_parse_and_diagnose_invalid_typ,
cp_parser_translation_unit, cp_parser_template_id,
cp_parser_lookup_name, cp_parser_late_parsing_for_member): Likewise.
* pt.c (push_access_scope, finish_member_template_decl,
push_inline_template_parms_recursive, add_outermost_template_args,
get_innermost_template_args, begin_explicit_instantiation,
end_explicit_instantiation, retrieve_specialization,
is_specialization_of, is_specialization_of_friend,
register_specialization, check_explicit_specialization,
comp_template_parms, process_template_parm,
process_partial_specialization, convert_nontype_argument,
coerce_template_template_parms, coerce_template_parms,
mangle_class_name_for_template, lookup_template_function,
lookup_template_class, instantiate_class_template, tsubst_decl,
tsubst_function_type, tsubst, tsubst_qualified_id, tsubst_copy,
instantiate_template, fn_type_unification, type_unification_real,
get_template_base, regenerate_decl_from_template,
template_for_substitution, instantiate_decl,
get_mostly_instantiated_function_type, dependent_scope_ref_p,
value_dependent_expression_p, resolve_typename_type): Likewise.
* repo.c (repo_emit_p): Likewise.
* rtti.c (build_headof, get_tinfo_decl, get_pseudo_ti_init,
create_tinfo_types, emit_tinfo_decl): Likewise.
* search.c (lookup_base_r, lookup_base, lookup_field_1,
dfs_access_in_type, build_baselink, lookup_member,
adjust_result_of_qualified_name_lookup, copied_binfo): Likewise.
* semantics.c (perform_or_defer_access_check,
finish_non_static_data_member, finish_stmt_expr_expr,
finish_stmt_expr, finish_call_expr, finish_pseudo_destructor_expr,
finish_template_template_parm, finish_member_declaration,
emit_associated_thunks): Likewise.
* tree.c (build_target_expr_with_type, force_target_expr,
copy_binfo, get_first_fn, cp_tree_equal): Likewise.
* typeck.c (type_after_usual_arithmetic_conversions, comptypes,
cxx_sizeof_or_alignof_type, perform_integral_promotions,
build_class_member_access_expr, finish_class_member_access_expr,
build_ptrmemfunc_access_expr, build_unary_op,
unary_complex_lvalue, cxx_mark_addressable, build_modify_expr,
build_ptrmemfunc, expand_ptrmemfunc_cst, check_return_expr
* typeck2.c (complete_type_check_abstract,
abstract_virtuals_error, process_init_constructor,
add_exception_specifier): Likewise.
From-SVN: r86669
2004-08-27 19:59:33 +02:00
|
|
|
|
gcc_assert (TREE_CODE (tmpl) == TEMPLATE_DECL);
|
1997-09-06 10:10:07 +02:00
|
|
|
|
decl = DECL_TEMPLATE_RESULT (tmpl);
|
|
|
|
|
|
1998-04-22 00:03:34 +02:00
|
|
|
|
if (TREE_CODE (decl) == FUNCTION_DECL
|
|
|
|
|
|| (TREE_CODE (decl) == TYPE_DECL
|
cp-tree.h (IS_AGGR_TYPE): Rename to MAYBE_CLASS_TYPE_P.
2008-03-21 Paolo Carlini <pcarlini@suse.de>
* cp-tree.h (IS_AGGR_TYPE): Rename to MAYBE_CLASS_TYPE_P.
(SET_IS_AGGR_TYPE): Rename to SET_CLASS_TYPE_P.
(IS_AGGR_TYPE_CODE): Rename to RECORD_OR_UNION_CODE_P.
(PROMOTES_TO_AGGR_TYPE): Remove.
(CLASS_TYPE_P, TYPE_NON_AGGREGATE_CLASS): Adjust.
* typeck.c (unary_complex_lvalue, build_modify_expr,
convert_for_initialization): Adjust.
* init.c (is_aggr_type): Remove.
(is_class_type): Add.
(build_offset_ref, build_new_1, build_vec_delete_1, build_vec_init,
build_delete): Adjust.
* lex.c (make_aggr_type): Remove.
(make_class_type): Add.
(cxx_make_type): Adjust.
* class.c (finish_struct_1, fixed_type_or_null, is_empty_class):
Adjust.
* decl.c (build_typename_type, make_typename_type,
make_unbound_class_template, cxx_init_decl_processing,
check_tag_decl, groktypename, start_decl_1, layout_var_decl,
check_initializer, cp_finish_decl, build_ptrmemfunc_type, grokparms,
grok_op_properties, xref_tag, check_function_type): Adjust.
* call.c (check_dtor_name, standard_conversion, implicit_conversion,
add_builtin_candidate, add_builtin_candidates,
build_user_type_conversion_1, convert_like_real, build_cxx_call,
is_subseq, compare_ics): Adjust.
* method.c (use_thunk): Adjust.
* rtti.c (build_dynamic_cast_1, create_pseudo_type_info,
create_tinfo_types): Adjust.
* cvt.c (cp_convert_to_pointer, convert_to_pointer_force,
build_up_reference, convert_to_reference, convert_from_reference,
ocp_convert, build_expr_type_conversion): Adjust.
* tree.c (bind_template_template_parm, error_type): Adjust.
* dump.c (cp_dump_tree): Adjust.
* search.c (lookup_member): Adjust.
* friend.c (make_friend_class, do_friend): Adjust.
* typeck2.c (store_init_value, process_init_constructor_array,
process_init_constructor_record, build_x_arrow, build_m_component_ref,
build_functional_cast): Adjust.
* pt.c (finish_member_template_decl, process_template_parm,
lookup_template_class, tsubst_function_type, tsubst,
tsubst_copy_and_build, get_template_base, bt_instantiate_type_proc):
Adjust.
* semantics.c (begin_class_definition, finish_base_specifier,
finish_typeof, cxx_omp_predetermined_sharing, finish_decltype_type):
Adjust.
* name-lookup.c (constructor_name_p, push_overloaded_decl,
do_class_using_decl, lookup_qualified_name,
maybe_process_template_type_declaration): Adjust.
* decl2.c (grok_array_decl, check_member_template,
constrain_class_visibility): Adjust.
* parser.c (cp_parser_class_name): Adjust.
From-SVN: r133434
2008-03-21 19:56:51 +01:00
|
|
|
|
&& MAYBE_CLASS_TYPE_P (TREE_TYPE (decl))))
|
1997-09-06 10:10:07 +02:00
|
|
|
|
{
|
2006-12-06 06:12:46 +01:00
|
|
|
|
/* The parser rejects template declarations in local classes. */
|
|
|
|
|
gcc_assert (!current_function_decl);
|
2006-05-17 23:39:07 +02:00
|
|
|
|
/* The parser rejects any use of virtual in a function template. */
|
|
|
|
|
gcc_assert (!(TREE_CODE (decl) == FUNCTION_DECL
|
|
|
|
|
&& DECL_VIRTUAL_P (decl)));
|
1997-09-06 10:10:07 +02:00
|
|
|
|
|
|
|
|
|
/* The debug-information generating code doesn't know what to do
|
2005-06-14 22:01:59 +02:00
|
|
|
|
with member templates. */
|
1997-09-06 10:10:07 +02:00
|
|
|
|
DECL_IGNORED_P (tmpl) = 1;
|
2005-06-14 22:01:59 +02:00
|
|
|
|
}
|
1997-09-06 10:10:07 +02:00
|
|
|
|
else
|
Convert diagnostics to use quoting flag q 3/n
cp/
Convert diagnostics to use quoting flag q 3/n
* decl.c (pop_label, duplicate_decls,
redeclaration_error_message,
redeclaration_error_message, lookup_label, check_goto,
make_typename_type, make_unbound_class_template,
fixup_anonymous_aggr, check_tag_decl, start_decl,
start_decl_1,
grok_reference_init, layout_var_decl, maybe_commonize_var,
check_for_uninitialized_const_var, reshape_init_array,
reshape_init, check_initializer, cp_finish_decl,
member_function_or_else, bad_specifiers, grokfndecl,
grokvardecl,
check_static_variable_definition, compute_array_index_type,
create_array_type_for_decl,
check_special_function_return_type,
grokdeclarator, check_default_argument, grokparms,
grok_ctor_properties, grok_op_properties,
check_elaborated_type_specifier, xref_tag, finish_enum,
build_enumerator, check_function_type,
start_preparsed_function,
store_parm_decls): Use quoting formats.
* decl2.c (grok_array_decl, delete_sanity,
check_member_template,
check_java_method, check_classfn,
finish_static_data_member_decl,
grokfield, grokbitfield, grok_function_init,
build_anon_union_vars, coerce_new_type, coerce_delete_type,
check_default_args): Likewise.
* parser.c (cp_parser_decl_specifier_seq): Likewise.
testsuite/
* g++.dg/template/local1.C: Adjust quoting marks in
testing for diagnostics.
* g++.dg/tls/diag-2.C: Likewise.
* g++.dg/other/error8.C: Likewise.
From-SVN: r88478
2004-10-04 08:04:43 +02:00
|
|
|
|
error ("template declaration of %q#D", decl);
|
1997-09-06 10:10:07 +02:00
|
|
|
|
}
|
|
|
|
|
|
2002-09-13 13:33:47 +02:00
|
|
|
|
/* Return true iff TYPE is a valid Java parameter or return type. */
|
cp-tree.h (TYPE_FOR_JAVA): New macro.
d
* cp-tree.h (TYPE_FOR_JAVA): New macro.
* decl.c, cp-tree.h (java_byte_type_node, java_short_type_node,
java_int_type_node, java_long_type_node, java_float_type_node,
java_double_type_node, java_char_type_node, java_boolean_type_node):
New "primitive" types, with predefined names __java_byte etc.
(record_builtin_java_type): New function.
(init_decl_processing): Make Java types with record_builtin_java_type.
(pushtag, grokdeclarator): Set TYPE_FOR_JAVA if in extern "JAVA".
(xref_baseypes): If base class was TYPE_FOR_JAVA, so is this class.
(grokfndecl): Call check_java_method for Java classes.
* method.c (is_java_type): Removed. Replaced with TYPE_FOR_JAVA.
(process_overload_item): Match types against specific
java_XX_type_node types, rather than using is_java_type.
* class.c (finish_struct_1): Don't add default copy constructor
or operator= if TYPE_FOR_JAVA.
(pop_lang_conext): Restore strict_prototyp proper if Java.
* decl2.c (acceptable_java_type, check_java_method): New functions.
* pt.c (instantiate_class_template): Copy TYPE_FOR_JAVA from pattern.
(tsubst): Move common statement after if statement.
* typeck.c (comptypes): If strict, TYPE_FOR_JAVA must match.
From-SVN: r20174
1998-06-01 20:25:34 +02:00
|
|
|
|
|
Remove traditional C constructs 4/n.
* decl2.c (grok_method_quals, warn_if_unknown_interface,
grok_x_components, cp_build_parm_decl, build_artificial_parm,
maybe_retrofit_in_chrg, grokclassfn, grok_array_decl,
delete_sanity, check_member_template, check_java_method,
check_classfn, finish_static_data_member_decl, grokfield,
grokbitfield, grokoptypename, grok_function_init,
cplus_decl_attributes, constructor_name, defer_fn,
build_anon_union_vars, finish_anon_union, coerce_new_type,
coerce_delete_type, comdat_linkage, maybe_make_one_only,
key_method, import_export_vtable, import_export_class,
output_vtable_inherit, import_export_decl, import_export_tinfo,
build_cleanup, get_guard, get_guard_bits, get_guard_cond,
set_guard, start_objects, finish_objects,
start_static_storage_duration_function,
finish_static_storage_duration_function, get_priority_info,
start_static_initialization_or_destruction,
finish_static_initialization_or_destruction,
do_static_initialization, do_static_destruction,
prune_vars_needing_no_initialization, write_out_vars,
reparse_decl_as_expr, finish_decl_parsing, namespace_ancestor,
add_using_namespace, merge_functions, ambiguous_decl,
lookup_using_namespace, lookup_using_namespace,
qualified_lookup_using_namespace, set_decl_namespace,
decl_namespace, current_decl_namespace, push_decl_namespace,
pop_decl_namespace, push_scope, pop_scope, add_function,
arg_assoc_namespace, arg_assoc_template_arg, arg_assoc,
lookup_arg_dependent, do_namespace_alias,
validate_nonmember_using_decl, do_nonmember_using_decl,
do_toplevel_using_decl, do_local_using_decl,
do_class_using_decl, do_using_directive, check_default_args,
mark_used, handle_class_head): Use C90 prototypings. Use booleans.
* parser.c (cp_parser_class_head): Use booleanss.
* decl.c (walk_globals, walk_vtables): Likewise.
* cp-tree.h (walk_globals_pred, walk_globals_fn, walk_vtables,
walk_globals): Change return type from 'int' to 'bool'.
* rtti.c (init_rtti_processing, build_headof, throw_bad_cast
throw_bad_typeid, get_tinfo_decl_dynamic, typeid_ok_p,
build_typeid, tinfo_name, get_tinfo_decl, get_tinfo_ptr,
get_typeid, ifnonnull, build_dynamic_cast_1, build_dynamic_cast,
qualifier_flags, tinfo_base_init, generic_initializer,
ptr_initializer, dfs_class_hint_mark, ptm_initializer,
dfs_class_hint_unmark, class_hint_flags, class_initializer,
typeinfo_in_lib_p, get_pseudo_ti_init, create_pseudo_type_info,
get_pseudo_ti_desc, create_tinfo_types, emit_support_tinfos,
unemitted_tinfo_decl_p, emit_tinfo_decl): Likewise.
* repo.c (repo_compile_flags, repo_template_declared,
repo_template_defined, repo_class_defined, repo_get_id,
repo_template_used, repo_vtable_used, repo_inline_used,
repo_tinfo_used, repo_template_instantiated, extract_string,
open_repo_file, afgets, init_repo, reopen_repo_file_for_write,
finish_repo): Likewise.
* ptree.c (cxx_print_decl, cxx_print_type, cxx_print_identifier,
cxx_print_xnode): Likewise..
* cp-lang.c (ok_to_generate_alias_set_for_type, cxx_get_alias_set,
cxx_warn_unused_global_decl, cp_expr_size): Likewise.
* cxxfilt.c (demangle_it, print_demangler_list, usage,
standard_symbol_characters, hp_symbol_characters, main, fatal):
Likewise.
(strip_underscore): Change type from 'int' to 'bool'.
(main): Use boolean constants.
From-SVN: r60601
2002-12-29 15:53:05 +01:00
|
|
|
|
static bool
|
|
|
|
|
acceptable_java_type (tree type)
|
cp-tree.h (TYPE_FOR_JAVA): New macro.
d
* cp-tree.h (TYPE_FOR_JAVA): New macro.
* decl.c, cp-tree.h (java_byte_type_node, java_short_type_node,
java_int_type_node, java_long_type_node, java_float_type_node,
java_double_type_node, java_char_type_node, java_boolean_type_node):
New "primitive" types, with predefined names __java_byte etc.
(record_builtin_java_type): New function.
(init_decl_processing): Make Java types with record_builtin_java_type.
(pushtag, grokdeclarator): Set TYPE_FOR_JAVA if in extern "JAVA".
(xref_baseypes): If base class was TYPE_FOR_JAVA, so is this class.
(grokfndecl): Call check_java_method for Java classes.
* method.c (is_java_type): Removed. Replaced with TYPE_FOR_JAVA.
(process_overload_item): Match types against specific
java_XX_type_node types, rather than using is_java_type.
* class.c (finish_struct_1): Don't add default copy constructor
or operator= if TYPE_FOR_JAVA.
(pop_lang_conext): Restore strict_prototyp proper if Java.
* decl2.c (acceptable_java_type, check_java_method): New functions.
* pt.c (instantiate_class_template): Copy TYPE_FOR_JAVA from pattern.
(tsubst): Move common statement after if statement.
* typeck.c (comptypes): If strict, TYPE_FOR_JAVA must match.
From-SVN: r20174
1998-06-01 20:25:34 +02:00
|
|
|
|
{
|
2006-07-15 16:44:48 +02:00
|
|
|
|
if (type == error_mark_node)
|
|
|
|
|
return false;
|
|
|
|
|
|
cp-tree.h (TYPE_FOR_JAVA): New macro.
d
* cp-tree.h (TYPE_FOR_JAVA): New macro.
* decl.c, cp-tree.h (java_byte_type_node, java_short_type_node,
java_int_type_node, java_long_type_node, java_float_type_node,
java_double_type_node, java_char_type_node, java_boolean_type_node):
New "primitive" types, with predefined names __java_byte etc.
(record_builtin_java_type): New function.
(init_decl_processing): Make Java types with record_builtin_java_type.
(pushtag, grokdeclarator): Set TYPE_FOR_JAVA if in extern "JAVA".
(xref_baseypes): If base class was TYPE_FOR_JAVA, so is this class.
(grokfndecl): Call check_java_method for Java classes.
* method.c (is_java_type): Removed. Replaced with TYPE_FOR_JAVA.
(process_overload_item): Match types against specific
java_XX_type_node types, rather than using is_java_type.
* class.c (finish_struct_1): Don't add default copy constructor
or operator= if TYPE_FOR_JAVA.
(pop_lang_conext): Restore strict_prototyp proper if Java.
* decl2.c (acceptable_java_type, check_java_method): New functions.
* pt.c (instantiate_class_template): Copy TYPE_FOR_JAVA from pattern.
(tsubst): Move common statement after if statement.
* typeck.c (comptypes): If strict, TYPE_FOR_JAVA must match.
From-SVN: r20174
1998-06-01 20:25:34 +02:00
|
|
|
|
if (TREE_CODE (type) == VOID_TYPE || TYPE_FOR_JAVA (type))
|
2006-07-15 16:44:48 +02:00
|
|
|
|
return true;
|
2001-01-10 20:20:52 +01:00
|
|
|
|
if (TREE_CODE (type) == POINTER_TYPE || TREE_CODE (type) == REFERENCE_TYPE)
|
cp-tree.h (TYPE_FOR_JAVA): New macro.
d
* cp-tree.h (TYPE_FOR_JAVA): New macro.
* decl.c, cp-tree.h (java_byte_type_node, java_short_type_node,
java_int_type_node, java_long_type_node, java_float_type_node,
java_double_type_node, java_char_type_node, java_boolean_type_node):
New "primitive" types, with predefined names __java_byte etc.
(record_builtin_java_type): New function.
(init_decl_processing): Make Java types with record_builtin_java_type.
(pushtag, grokdeclarator): Set TYPE_FOR_JAVA if in extern "JAVA".
(xref_baseypes): If base class was TYPE_FOR_JAVA, so is this class.
(grokfndecl): Call check_java_method for Java classes.
* method.c (is_java_type): Removed. Replaced with TYPE_FOR_JAVA.
(process_overload_item): Match types against specific
java_XX_type_node types, rather than using is_java_type.
* class.c (finish_struct_1): Don't add default copy constructor
or operator= if TYPE_FOR_JAVA.
(pop_lang_conext): Restore strict_prototyp proper if Java.
* decl2.c (acceptable_java_type, check_java_method): New functions.
* pt.c (instantiate_class_template): Copy TYPE_FOR_JAVA from pattern.
(tsubst): Move common statement after if statement.
* typeck.c (comptypes): If strict, TYPE_FOR_JAVA must match.
From-SVN: r20174
1998-06-01 20:25:34 +02:00
|
|
|
|
{
|
|
|
|
|
type = TREE_TYPE (type);
|
|
|
|
|
if (TREE_CODE (type) == RECORD_TYPE)
|
|
|
|
|
{
|
1998-08-20 18:44:01 +02:00
|
|
|
|
tree args; int i;
|
|
|
|
|
if (! TYPE_FOR_JAVA (type))
|
Remove traditional C constructs 4/n.
* decl2.c (grok_method_quals, warn_if_unknown_interface,
grok_x_components, cp_build_parm_decl, build_artificial_parm,
maybe_retrofit_in_chrg, grokclassfn, grok_array_decl,
delete_sanity, check_member_template, check_java_method,
check_classfn, finish_static_data_member_decl, grokfield,
grokbitfield, grokoptypename, grok_function_init,
cplus_decl_attributes, constructor_name, defer_fn,
build_anon_union_vars, finish_anon_union, coerce_new_type,
coerce_delete_type, comdat_linkage, maybe_make_one_only,
key_method, import_export_vtable, import_export_class,
output_vtable_inherit, import_export_decl, import_export_tinfo,
build_cleanup, get_guard, get_guard_bits, get_guard_cond,
set_guard, start_objects, finish_objects,
start_static_storage_duration_function,
finish_static_storage_duration_function, get_priority_info,
start_static_initialization_or_destruction,
finish_static_initialization_or_destruction,
do_static_initialization, do_static_destruction,
prune_vars_needing_no_initialization, write_out_vars,
reparse_decl_as_expr, finish_decl_parsing, namespace_ancestor,
add_using_namespace, merge_functions, ambiguous_decl,
lookup_using_namespace, lookup_using_namespace,
qualified_lookup_using_namespace, set_decl_namespace,
decl_namespace, current_decl_namespace, push_decl_namespace,
pop_decl_namespace, push_scope, pop_scope, add_function,
arg_assoc_namespace, arg_assoc_template_arg, arg_assoc,
lookup_arg_dependent, do_namespace_alias,
validate_nonmember_using_decl, do_nonmember_using_decl,
do_toplevel_using_decl, do_local_using_decl,
do_class_using_decl, do_using_directive, check_default_args,
mark_used, handle_class_head): Use C90 prototypings. Use booleans.
* parser.c (cp_parser_class_head): Use booleanss.
* decl.c (walk_globals, walk_vtables): Likewise.
* cp-tree.h (walk_globals_pred, walk_globals_fn, walk_vtables,
walk_globals): Change return type from 'int' to 'bool'.
* rtti.c (init_rtti_processing, build_headof, throw_bad_cast
throw_bad_typeid, get_tinfo_decl_dynamic, typeid_ok_p,
build_typeid, tinfo_name, get_tinfo_decl, get_tinfo_ptr,
get_typeid, ifnonnull, build_dynamic_cast_1, build_dynamic_cast,
qualifier_flags, tinfo_base_init, generic_initializer,
ptr_initializer, dfs_class_hint_mark, ptm_initializer,
dfs_class_hint_unmark, class_hint_flags, class_initializer,
typeinfo_in_lib_p, get_pseudo_ti_init, create_pseudo_type_info,
get_pseudo_ti_desc, create_tinfo_types, emit_support_tinfos,
unemitted_tinfo_decl_p, emit_tinfo_decl): Likewise.
* repo.c (repo_compile_flags, repo_template_declared,
repo_template_defined, repo_class_defined, repo_get_id,
repo_template_used, repo_vtable_used, repo_inline_used,
repo_tinfo_used, repo_template_instantiated, extract_string,
open_repo_file, afgets, init_repo, reopen_repo_file_for_write,
finish_repo): Likewise.
* ptree.c (cxx_print_decl, cxx_print_type, cxx_print_identifier,
cxx_print_xnode): Likewise..
* cp-lang.c (ok_to_generate_alias_set_for_type, cxx_get_alias_set,
cxx_warn_unused_global_decl, cp_expr_size): Likewise.
* cxxfilt.c (demangle_it, print_demangler_list, usage,
standard_symbol_characters, hp_symbol_characters, main, fatal):
Likewise.
(strip_underscore): Change type from 'int' to 'bool'.
(main): Use boolean constants.
From-SVN: r60601
2002-12-29 15:53:05 +01:00
|
|
|
|
return false;
|
1998-08-20 18:44:01 +02:00
|
|
|
|
if (! CLASSTYPE_TEMPLATE_INFO (type))
|
Remove traditional C constructs 4/n.
* decl2.c (grok_method_quals, warn_if_unknown_interface,
grok_x_components, cp_build_parm_decl, build_artificial_parm,
maybe_retrofit_in_chrg, grokclassfn, grok_array_decl,
delete_sanity, check_member_template, check_java_method,
check_classfn, finish_static_data_member_decl, grokfield,
grokbitfield, grokoptypename, grok_function_init,
cplus_decl_attributes, constructor_name, defer_fn,
build_anon_union_vars, finish_anon_union, coerce_new_type,
coerce_delete_type, comdat_linkage, maybe_make_one_only,
key_method, import_export_vtable, import_export_class,
output_vtable_inherit, import_export_decl, import_export_tinfo,
build_cleanup, get_guard, get_guard_bits, get_guard_cond,
set_guard, start_objects, finish_objects,
start_static_storage_duration_function,
finish_static_storage_duration_function, get_priority_info,
start_static_initialization_or_destruction,
finish_static_initialization_or_destruction,
do_static_initialization, do_static_destruction,
prune_vars_needing_no_initialization, write_out_vars,
reparse_decl_as_expr, finish_decl_parsing, namespace_ancestor,
add_using_namespace, merge_functions, ambiguous_decl,
lookup_using_namespace, lookup_using_namespace,
qualified_lookup_using_namespace, set_decl_namespace,
decl_namespace, current_decl_namespace, push_decl_namespace,
pop_decl_namespace, push_scope, pop_scope, add_function,
arg_assoc_namespace, arg_assoc_template_arg, arg_assoc,
lookup_arg_dependent, do_namespace_alias,
validate_nonmember_using_decl, do_nonmember_using_decl,
do_toplevel_using_decl, do_local_using_decl,
do_class_using_decl, do_using_directive, check_default_args,
mark_used, handle_class_head): Use C90 prototypings. Use booleans.
* parser.c (cp_parser_class_head): Use booleanss.
* decl.c (walk_globals, walk_vtables): Likewise.
* cp-tree.h (walk_globals_pred, walk_globals_fn, walk_vtables,
walk_globals): Change return type from 'int' to 'bool'.
* rtti.c (init_rtti_processing, build_headof, throw_bad_cast
throw_bad_typeid, get_tinfo_decl_dynamic, typeid_ok_p,
build_typeid, tinfo_name, get_tinfo_decl, get_tinfo_ptr,
get_typeid, ifnonnull, build_dynamic_cast_1, build_dynamic_cast,
qualifier_flags, tinfo_base_init, generic_initializer,
ptr_initializer, dfs_class_hint_mark, ptm_initializer,
dfs_class_hint_unmark, class_hint_flags, class_initializer,
typeinfo_in_lib_p, get_pseudo_ti_init, create_pseudo_type_info,
get_pseudo_ti_desc, create_tinfo_types, emit_support_tinfos,
unemitted_tinfo_decl_p, emit_tinfo_decl): Likewise.
* repo.c (repo_compile_flags, repo_template_declared,
repo_template_defined, repo_class_defined, repo_get_id,
repo_template_used, repo_vtable_used, repo_inline_used,
repo_tinfo_used, repo_template_instantiated, extract_string,
open_repo_file, afgets, init_repo, reopen_repo_file_for_write,
finish_repo): Likewise.
* ptree.c (cxx_print_decl, cxx_print_type, cxx_print_identifier,
cxx_print_xnode): Likewise..
* cp-lang.c (ok_to_generate_alias_set_for_type, cxx_get_alias_set,
cxx_warn_unused_global_decl, cp_expr_size): Likewise.
* cxxfilt.c (demangle_it, print_demangler_list, usage,
standard_symbol_characters, hp_symbol_characters, main, fatal):
Likewise.
(strip_underscore): Change type from 'int' to 'bool'.
(main): Use boolean constants.
From-SVN: r60601
2002-12-29 15:53:05 +01:00
|
|
|
|
return true;
|
1998-08-20 18:44:01 +02:00
|
|
|
|
args = CLASSTYPE_TI_ARGS (type);
|
|
|
|
|
i = TREE_VEC_LENGTH (args);
|
|
|
|
|
while (--i >= 0)
|
|
|
|
|
{
|
|
|
|
|
type = TREE_VEC_ELT (args, i);
|
|
|
|
|
if (TREE_CODE (type) == POINTER_TYPE)
|
|
|
|
|
type = TREE_TYPE (type);
|
|
|
|
|
if (! TYPE_FOR_JAVA (type))
|
Remove traditional C constructs 4/n.
* decl2.c (grok_method_quals, warn_if_unknown_interface,
grok_x_components, cp_build_parm_decl, build_artificial_parm,
maybe_retrofit_in_chrg, grokclassfn, grok_array_decl,
delete_sanity, check_member_template, check_java_method,
check_classfn, finish_static_data_member_decl, grokfield,
grokbitfield, grokoptypename, grok_function_init,
cplus_decl_attributes, constructor_name, defer_fn,
build_anon_union_vars, finish_anon_union, coerce_new_type,
coerce_delete_type, comdat_linkage, maybe_make_one_only,
key_method, import_export_vtable, import_export_class,
output_vtable_inherit, import_export_decl, import_export_tinfo,
build_cleanup, get_guard, get_guard_bits, get_guard_cond,
set_guard, start_objects, finish_objects,
start_static_storage_duration_function,
finish_static_storage_duration_function, get_priority_info,
start_static_initialization_or_destruction,
finish_static_initialization_or_destruction,
do_static_initialization, do_static_destruction,
prune_vars_needing_no_initialization, write_out_vars,
reparse_decl_as_expr, finish_decl_parsing, namespace_ancestor,
add_using_namespace, merge_functions, ambiguous_decl,
lookup_using_namespace, lookup_using_namespace,
qualified_lookup_using_namespace, set_decl_namespace,
decl_namespace, current_decl_namespace, push_decl_namespace,
pop_decl_namespace, push_scope, pop_scope, add_function,
arg_assoc_namespace, arg_assoc_template_arg, arg_assoc,
lookup_arg_dependent, do_namespace_alias,
validate_nonmember_using_decl, do_nonmember_using_decl,
do_toplevel_using_decl, do_local_using_decl,
do_class_using_decl, do_using_directive, check_default_args,
mark_used, handle_class_head): Use C90 prototypings. Use booleans.
* parser.c (cp_parser_class_head): Use booleanss.
* decl.c (walk_globals, walk_vtables): Likewise.
* cp-tree.h (walk_globals_pred, walk_globals_fn, walk_vtables,
walk_globals): Change return type from 'int' to 'bool'.
* rtti.c (init_rtti_processing, build_headof, throw_bad_cast
throw_bad_typeid, get_tinfo_decl_dynamic, typeid_ok_p,
build_typeid, tinfo_name, get_tinfo_decl, get_tinfo_ptr,
get_typeid, ifnonnull, build_dynamic_cast_1, build_dynamic_cast,
qualifier_flags, tinfo_base_init, generic_initializer,
ptr_initializer, dfs_class_hint_mark, ptm_initializer,
dfs_class_hint_unmark, class_hint_flags, class_initializer,
typeinfo_in_lib_p, get_pseudo_ti_init, create_pseudo_type_info,
get_pseudo_ti_desc, create_tinfo_types, emit_support_tinfos,
unemitted_tinfo_decl_p, emit_tinfo_decl): Likewise.
* repo.c (repo_compile_flags, repo_template_declared,
repo_template_defined, repo_class_defined, repo_get_id,
repo_template_used, repo_vtable_used, repo_inline_used,
repo_tinfo_used, repo_template_instantiated, extract_string,
open_repo_file, afgets, init_repo, reopen_repo_file_for_write,
finish_repo): Likewise.
* ptree.c (cxx_print_decl, cxx_print_type, cxx_print_identifier,
cxx_print_xnode): Likewise..
* cp-lang.c (ok_to_generate_alias_set_for_type, cxx_get_alias_set,
cxx_warn_unused_global_decl, cp_expr_size): Likewise.
* cxxfilt.c (demangle_it, print_demangler_list, usage,
standard_symbol_characters, hp_symbol_characters, main, fatal):
Likewise.
(strip_underscore): Change type from 'int' to 'bool'.
(main): Use boolean constants.
From-SVN: r60601
2002-12-29 15:53:05 +01:00
|
|
|
|
return false;
|
1998-08-20 18:44:01 +02:00
|
|
|
|
}
|
Remove traditional C constructs 4/n.
* decl2.c (grok_method_quals, warn_if_unknown_interface,
grok_x_components, cp_build_parm_decl, build_artificial_parm,
maybe_retrofit_in_chrg, grokclassfn, grok_array_decl,
delete_sanity, check_member_template, check_java_method,
check_classfn, finish_static_data_member_decl, grokfield,
grokbitfield, grokoptypename, grok_function_init,
cplus_decl_attributes, constructor_name, defer_fn,
build_anon_union_vars, finish_anon_union, coerce_new_type,
coerce_delete_type, comdat_linkage, maybe_make_one_only,
key_method, import_export_vtable, import_export_class,
output_vtable_inherit, import_export_decl, import_export_tinfo,
build_cleanup, get_guard, get_guard_bits, get_guard_cond,
set_guard, start_objects, finish_objects,
start_static_storage_duration_function,
finish_static_storage_duration_function, get_priority_info,
start_static_initialization_or_destruction,
finish_static_initialization_or_destruction,
do_static_initialization, do_static_destruction,
prune_vars_needing_no_initialization, write_out_vars,
reparse_decl_as_expr, finish_decl_parsing, namespace_ancestor,
add_using_namespace, merge_functions, ambiguous_decl,
lookup_using_namespace, lookup_using_namespace,
qualified_lookup_using_namespace, set_decl_namespace,
decl_namespace, current_decl_namespace, push_decl_namespace,
pop_decl_namespace, push_scope, pop_scope, add_function,
arg_assoc_namespace, arg_assoc_template_arg, arg_assoc,
lookup_arg_dependent, do_namespace_alias,
validate_nonmember_using_decl, do_nonmember_using_decl,
do_toplevel_using_decl, do_local_using_decl,
do_class_using_decl, do_using_directive, check_default_args,
mark_used, handle_class_head): Use C90 prototypings. Use booleans.
* parser.c (cp_parser_class_head): Use booleanss.
* decl.c (walk_globals, walk_vtables): Likewise.
* cp-tree.h (walk_globals_pred, walk_globals_fn, walk_vtables,
walk_globals): Change return type from 'int' to 'bool'.
* rtti.c (init_rtti_processing, build_headof, throw_bad_cast
throw_bad_typeid, get_tinfo_decl_dynamic, typeid_ok_p,
build_typeid, tinfo_name, get_tinfo_decl, get_tinfo_ptr,
get_typeid, ifnonnull, build_dynamic_cast_1, build_dynamic_cast,
qualifier_flags, tinfo_base_init, generic_initializer,
ptr_initializer, dfs_class_hint_mark, ptm_initializer,
dfs_class_hint_unmark, class_hint_flags, class_initializer,
typeinfo_in_lib_p, get_pseudo_ti_init, create_pseudo_type_info,
get_pseudo_ti_desc, create_tinfo_types, emit_support_tinfos,
unemitted_tinfo_decl_p, emit_tinfo_decl): Likewise.
* repo.c (repo_compile_flags, repo_template_declared,
repo_template_defined, repo_class_defined, repo_get_id,
repo_template_used, repo_vtable_used, repo_inline_used,
repo_tinfo_used, repo_template_instantiated, extract_string,
open_repo_file, afgets, init_repo, reopen_repo_file_for_write,
finish_repo): Likewise.
* ptree.c (cxx_print_decl, cxx_print_type, cxx_print_identifier,
cxx_print_xnode): Likewise..
* cp-lang.c (ok_to_generate_alias_set_for_type, cxx_get_alias_set,
cxx_warn_unused_global_decl, cp_expr_size): Likewise.
* cxxfilt.c (demangle_it, print_demangler_list, usage,
standard_symbol_characters, hp_symbol_characters, main, fatal):
Likewise.
(strip_underscore): Change type from 'int' to 'bool'.
(main): Use boolean constants.
From-SVN: r60601
2002-12-29 15:53:05 +01:00
|
|
|
|
return true;
|
cp-tree.h (TYPE_FOR_JAVA): New macro.
d
* cp-tree.h (TYPE_FOR_JAVA): New macro.
* decl.c, cp-tree.h (java_byte_type_node, java_short_type_node,
java_int_type_node, java_long_type_node, java_float_type_node,
java_double_type_node, java_char_type_node, java_boolean_type_node):
New "primitive" types, with predefined names __java_byte etc.
(record_builtin_java_type): New function.
(init_decl_processing): Make Java types with record_builtin_java_type.
(pushtag, grokdeclarator): Set TYPE_FOR_JAVA if in extern "JAVA".
(xref_baseypes): If base class was TYPE_FOR_JAVA, so is this class.
(grokfndecl): Call check_java_method for Java classes.
* method.c (is_java_type): Removed. Replaced with TYPE_FOR_JAVA.
(process_overload_item): Match types against specific
java_XX_type_node types, rather than using is_java_type.
* class.c (finish_struct_1): Don't add default copy constructor
or operator= if TYPE_FOR_JAVA.
(pop_lang_conext): Restore strict_prototyp proper if Java.
* decl2.c (acceptable_java_type, check_java_method): New functions.
* pt.c (instantiate_class_template): Copy TYPE_FOR_JAVA from pattern.
(tsubst): Move common statement after if statement.
* typeck.c (comptypes): If strict, TYPE_FOR_JAVA must match.
From-SVN: r20174
1998-06-01 20:25:34 +02:00
|
|
|
|
}
|
|
|
|
|
}
|
Remove traditional C constructs 4/n.
* decl2.c (grok_method_quals, warn_if_unknown_interface,
grok_x_components, cp_build_parm_decl, build_artificial_parm,
maybe_retrofit_in_chrg, grokclassfn, grok_array_decl,
delete_sanity, check_member_template, check_java_method,
check_classfn, finish_static_data_member_decl, grokfield,
grokbitfield, grokoptypename, grok_function_init,
cplus_decl_attributes, constructor_name, defer_fn,
build_anon_union_vars, finish_anon_union, coerce_new_type,
coerce_delete_type, comdat_linkage, maybe_make_one_only,
key_method, import_export_vtable, import_export_class,
output_vtable_inherit, import_export_decl, import_export_tinfo,
build_cleanup, get_guard, get_guard_bits, get_guard_cond,
set_guard, start_objects, finish_objects,
start_static_storage_duration_function,
finish_static_storage_duration_function, get_priority_info,
start_static_initialization_or_destruction,
finish_static_initialization_or_destruction,
do_static_initialization, do_static_destruction,
prune_vars_needing_no_initialization, write_out_vars,
reparse_decl_as_expr, finish_decl_parsing, namespace_ancestor,
add_using_namespace, merge_functions, ambiguous_decl,
lookup_using_namespace, lookup_using_namespace,
qualified_lookup_using_namespace, set_decl_namespace,
decl_namespace, current_decl_namespace, push_decl_namespace,
pop_decl_namespace, push_scope, pop_scope, add_function,
arg_assoc_namespace, arg_assoc_template_arg, arg_assoc,
lookup_arg_dependent, do_namespace_alias,
validate_nonmember_using_decl, do_nonmember_using_decl,
do_toplevel_using_decl, do_local_using_decl,
do_class_using_decl, do_using_directive, check_default_args,
mark_used, handle_class_head): Use C90 prototypings. Use booleans.
* parser.c (cp_parser_class_head): Use booleanss.
* decl.c (walk_globals, walk_vtables): Likewise.
* cp-tree.h (walk_globals_pred, walk_globals_fn, walk_vtables,
walk_globals): Change return type from 'int' to 'bool'.
* rtti.c (init_rtti_processing, build_headof, throw_bad_cast
throw_bad_typeid, get_tinfo_decl_dynamic, typeid_ok_p,
build_typeid, tinfo_name, get_tinfo_decl, get_tinfo_ptr,
get_typeid, ifnonnull, build_dynamic_cast_1, build_dynamic_cast,
qualifier_flags, tinfo_base_init, generic_initializer,
ptr_initializer, dfs_class_hint_mark, ptm_initializer,
dfs_class_hint_unmark, class_hint_flags, class_initializer,
typeinfo_in_lib_p, get_pseudo_ti_init, create_pseudo_type_info,
get_pseudo_ti_desc, create_tinfo_types, emit_support_tinfos,
unemitted_tinfo_decl_p, emit_tinfo_decl): Likewise.
* repo.c (repo_compile_flags, repo_template_declared,
repo_template_defined, repo_class_defined, repo_get_id,
repo_template_used, repo_vtable_used, repo_inline_used,
repo_tinfo_used, repo_template_instantiated, extract_string,
open_repo_file, afgets, init_repo, reopen_repo_file_for_write,
finish_repo): Likewise.
* ptree.c (cxx_print_decl, cxx_print_type, cxx_print_identifier,
cxx_print_xnode): Likewise..
* cp-lang.c (ok_to_generate_alias_set_for_type, cxx_get_alias_set,
cxx_warn_unused_global_decl, cp_expr_size): Likewise.
* cxxfilt.c (demangle_it, print_demangler_list, usage,
standard_symbol_characters, hp_symbol_characters, main, fatal):
Likewise.
(strip_underscore): Change type from 'int' to 'bool'.
(main): Use boolean constants.
From-SVN: r60601
2002-12-29 15:53:05 +01:00
|
|
|
|
return false;
|
cp-tree.h (TYPE_FOR_JAVA): New macro.
d
* cp-tree.h (TYPE_FOR_JAVA): New macro.
* decl.c, cp-tree.h (java_byte_type_node, java_short_type_node,
java_int_type_node, java_long_type_node, java_float_type_node,
java_double_type_node, java_char_type_node, java_boolean_type_node):
New "primitive" types, with predefined names __java_byte etc.
(record_builtin_java_type): New function.
(init_decl_processing): Make Java types with record_builtin_java_type.
(pushtag, grokdeclarator): Set TYPE_FOR_JAVA if in extern "JAVA".
(xref_baseypes): If base class was TYPE_FOR_JAVA, so is this class.
(grokfndecl): Call check_java_method for Java classes.
* method.c (is_java_type): Removed. Replaced with TYPE_FOR_JAVA.
(process_overload_item): Match types against specific
java_XX_type_node types, rather than using is_java_type.
* class.c (finish_struct_1): Don't add default copy constructor
or operator= if TYPE_FOR_JAVA.
(pop_lang_conext): Restore strict_prototyp proper if Java.
* decl2.c (acceptable_java_type, check_java_method): New functions.
* pt.c (instantiate_class_template): Copy TYPE_FOR_JAVA from pattern.
(tsubst): Move common statement after if statement.
* typeck.c (comptypes): If strict, TYPE_FOR_JAVA must match.
From-SVN: r20174
1998-06-01 20:25:34 +02:00
|
|
|
|
}
|
|
|
|
|
|
Remove traditional C constructs 4/n.
* decl2.c (grok_method_quals, warn_if_unknown_interface,
grok_x_components, cp_build_parm_decl, build_artificial_parm,
maybe_retrofit_in_chrg, grokclassfn, grok_array_decl,
delete_sanity, check_member_template, check_java_method,
check_classfn, finish_static_data_member_decl, grokfield,
grokbitfield, grokoptypename, grok_function_init,
cplus_decl_attributes, constructor_name, defer_fn,
build_anon_union_vars, finish_anon_union, coerce_new_type,
coerce_delete_type, comdat_linkage, maybe_make_one_only,
key_method, import_export_vtable, import_export_class,
output_vtable_inherit, import_export_decl, import_export_tinfo,
build_cleanup, get_guard, get_guard_bits, get_guard_cond,
set_guard, start_objects, finish_objects,
start_static_storage_duration_function,
finish_static_storage_duration_function, get_priority_info,
start_static_initialization_or_destruction,
finish_static_initialization_or_destruction,
do_static_initialization, do_static_destruction,
prune_vars_needing_no_initialization, write_out_vars,
reparse_decl_as_expr, finish_decl_parsing, namespace_ancestor,
add_using_namespace, merge_functions, ambiguous_decl,
lookup_using_namespace, lookup_using_namespace,
qualified_lookup_using_namespace, set_decl_namespace,
decl_namespace, current_decl_namespace, push_decl_namespace,
pop_decl_namespace, push_scope, pop_scope, add_function,
arg_assoc_namespace, arg_assoc_template_arg, arg_assoc,
lookup_arg_dependent, do_namespace_alias,
validate_nonmember_using_decl, do_nonmember_using_decl,
do_toplevel_using_decl, do_local_using_decl,
do_class_using_decl, do_using_directive, check_default_args,
mark_used, handle_class_head): Use C90 prototypings. Use booleans.
* parser.c (cp_parser_class_head): Use booleanss.
* decl.c (walk_globals, walk_vtables): Likewise.
* cp-tree.h (walk_globals_pred, walk_globals_fn, walk_vtables,
walk_globals): Change return type from 'int' to 'bool'.
* rtti.c (init_rtti_processing, build_headof, throw_bad_cast
throw_bad_typeid, get_tinfo_decl_dynamic, typeid_ok_p,
build_typeid, tinfo_name, get_tinfo_decl, get_tinfo_ptr,
get_typeid, ifnonnull, build_dynamic_cast_1, build_dynamic_cast,
qualifier_flags, tinfo_base_init, generic_initializer,
ptr_initializer, dfs_class_hint_mark, ptm_initializer,
dfs_class_hint_unmark, class_hint_flags, class_initializer,
typeinfo_in_lib_p, get_pseudo_ti_init, create_pseudo_type_info,
get_pseudo_ti_desc, create_tinfo_types, emit_support_tinfos,
unemitted_tinfo_decl_p, emit_tinfo_decl): Likewise.
* repo.c (repo_compile_flags, repo_template_declared,
repo_template_defined, repo_class_defined, repo_get_id,
repo_template_used, repo_vtable_used, repo_inline_used,
repo_tinfo_used, repo_template_instantiated, extract_string,
open_repo_file, afgets, init_repo, reopen_repo_file_for_write,
finish_repo): Likewise.
* ptree.c (cxx_print_decl, cxx_print_type, cxx_print_identifier,
cxx_print_xnode): Likewise..
* cp-lang.c (ok_to_generate_alias_set_for_type, cxx_get_alias_set,
cxx_warn_unused_global_decl, cp_expr_size): Likewise.
* cxxfilt.c (demangle_it, print_demangler_list, usage,
standard_symbol_characters, hp_symbol_characters, main, fatal):
Likewise.
(strip_underscore): Change type from 'int' to 'bool'.
(main): Use boolean constants.
From-SVN: r60601
2002-12-29 15:53:05 +01:00
|
|
|
|
/* For a METHOD in a Java class CTYPE, return true if
|
cp-tree.h (TYPE_FOR_JAVA): New macro.
d
* cp-tree.h (TYPE_FOR_JAVA): New macro.
* decl.c, cp-tree.h (java_byte_type_node, java_short_type_node,
java_int_type_node, java_long_type_node, java_float_type_node,
java_double_type_node, java_char_type_node, java_boolean_type_node):
New "primitive" types, with predefined names __java_byte etc.
(record_builtin_java_type): New function.
(init_decl_processing): Make Java types with record_builtin_java_type.
(pushtag, grokdeclarator): Set TYPE_FOR_JAVA if in extern "JAVA".
(xref_baseypes): If base class was TYPE_FOR_JAVA, so is this class.
(grokfndecl): Call check_java_method for Java classes.
* method.c (is_java_type): Removed. Replaced with TYPE_FOR_JAVA.
(process_overload_item): Match types against specific
java_XX_type_node types, rather than using is_java_type.
* class.c (finish_struct_1): Don't add default copy constructor
or operator= if TYPE_FOR_JAVA.
(pop_lang_conext): Restore strict_prototyp proper if Java.
* decl2.c (acceptable_java_type, check_java_method): New functions.
* pt.c (instantiate_class_template): Copy TYPE_FOR_JAVA from pattern.
(tsubst): Move common statement after if statement.
* typeck.c (comptypes): If strict, TYPE_FOR_JAVA must match.
From-SVN: r20174
1998-06-01 20:25:34 +02:00
|
|
|
|
the parameter and return types are valid Java types.
|
Remove traditional C constructs 4/n.
* decl2.c (grok_method_quals, warn_if_unknown_interface,
grok_x_components, cp_build_parm_decl, build_artificial_parm,
maybe_retrofit_in_chrg, grokclassfn, grok_array_decl,
delete_sanity, check_member_template, check_java_method,
check_classfn, finish_static_data_member_decl, grokfield,
grokbitfield, grokoptypename, grok_function_init,
cplus_decl_attributes, constructor_name, defer_fn,
build_anon_union_vars, finish_anon_union, coerce_new_type,
coerce_delete_type, comdat_linkage, maybe_make_one_only,
key_method, import_export_vtable, import_export_class,
output_vtable_inherit, import_export_decl, import_export_tinfo,
build_cleanup, get_guard, get_guard_bits, get_guard_cond,
set_guard, start_objects, finish_objects,
start_static_storage_duration_function,
finish_static_storage_duration_function, get_priority_info,
start_static_initialization_or_destruction,
finish_static_initialization_or_destruction,
do_static_initialization, do_static_destruction,
prune_vars_needing_no_initialization, write_out_vars,
reparse_decl_as_expr, finish_decl_parsing, namespace_ancestor,
add_using_namespace, merge_functions, ambiguous_decl,
lookup_using_namespace, lookup_using_namespace,
qualified_lookup_using_namespace, set_decl_namespace,
decl_namespace, current_decl_namespace, push_decl_namespace,
pop_decl_namespace, push_scope, pop_scope, add_function,
arg_assoc_namespace, arg_assoc_template_arg, arg_assoc,
lookup_arg_dependent, do_namespace_alias,
validate_nonmember_using_decl, do_nonmember_using_decl,
do_toplevel_using_decl, do_local_using_decl,
do_class_using_decl, do_using_directive, check_default_args,
mark_used, handle_class_head): Use C90 prototypings. Use booleans.
* parser.c (cp_parser_class_head): Use booleanss.
* decl.c (walk_globals, walk_vtables): Likewise.
* cp-tree.h (walk_globals_pred, walk_globals_fn, walk_vtables,
walk_globals): Change return type from 'int' to 'bool'.
* rtti.c (init_rtti_processing, build_headof, throw_bad_cast
throw_bad_typeid, get_tinfo_decl_dynamic, typeid_ok_p,
build_typeid, tinfo_name, get_tinfo_decl, get_tinfo_ptr,
get_typeid, ifnonnull, build_dynamic_cast_1, build_dynamic_cast,
qualifier_flags, tinfo_base_init, generic_initializer,
ptr_initializer, dfs_class_hint_mark, ptm_initializer,
dfs_class_hint_unmark, class_hint_flags, class_initializer,
typeinfo_in_lib_p, get_pseudo_ti_init, create_pseudo_type_info,
get_pseudo_ti_desc, create_tinfo_types, emit_support_tinfos,
unemitted_tinfo_decl_p, emit_tinfo_decl): Likewise.
* repo.c (repo_compile_flags, repo_template_declared,
repo_template_defined, repo_class_defined, repo_get_id,
repo_template_used, repo_vtable_used, repo_inline_used,
repo_tinfo_used, repo_template_instantiated, extract_string,
open_repo_file, afgets, init_repo, reopen_repo_file_for_write,
finish_repo): Likewise.
* ptree.c (cxx_print_decl, cxx_print_type, cxx_print_identifier,
cxx_print_xnode): Likewise..
* cp-lang.c (ok_to_generate_alias_set_for_type, cxx_get_alias_set,
cxx_warn_unused_global_decl, cp_expr_size): Likewise.
* cxxfilt.c (demangle_it, print_demangler_list, usage,
standard_symbol_characters, hp_symbol_characters, main, fatal):
Likewise.
(strip_underscore): Change type from 'int' to 'bool'.
(main): Use boolean constants.
From-SVN: r60601
2002-12-29 15:53:05 +01:00
|
|
|
|
Otherwise, print appropriate error messages, and return false. */
|
cp-tree.h (TYPE_FOR_JAVA): New macro.
d
* cp-tree.h (TYPE_FOR_JAVA): New macro.
* decl.c, cp-tree.h (java_byte_type_node, java_short_type_node,
java_int_type_node, java_long_type_node, java_float_type_node,
java_double_type_node, java_char_type_node, java_boolean_type_node):
New "primitive" types, with predefined names __java_byte etc.
(record_builtin_java_type): New function.
(init_decl_processing): Make Java types with record_builtin_java_type.
(pushtag, grokdeclarator): Set TYPE_FOR_JAVA if in extern "JAVA".
(xref_baseypes): If base class was TYPE_FOR_JAVA, so is this class.
(grokfndecl): Call check_java_method for Java classes.
* method.c (is_java_type): Removed. Replaced with TYPE_FOR_JAVA.
(process_overload_item): Match types against specific
java_XX_type_node types, rather than using is_java_type.
* class.c (finish_struct_1): Don't add default copy constructor
or operator= if TYPE_FOR_JAVA.
(pop_lang_conext): Restore strict_prototyp proper if Java.
* decl2.c (acceptable_java_type, check_java_method): New functions.
* pt.c (instantiate_class_template): Copy TYPE_FOR_JAVA from pattern.
(tsubst): Move common statement after if statement.
* typeck.c (comptypes): If strict, TYPE_FOR_JAVA must match.
From-SVN: r20174
1998-06-01 20:25:34 +02:00
|
|
|
|
|
Remove traditional C constructs 4/n.
* decl2.c (grok_method_quals, warn_if_unknown_interface,
grok_x_components, cp_build_parm_decl, build_artificial_parm,
maybe_retrofit_in_chrg, grokclassfn, grok_array_decl,
delete_sanity, check_member_template, check_java_method,
check_classfn, finish_static_data_member_decl, grokfield,
grokbitfield, grokoptypename, grok_function_init,
cplus_decl_attributes, constructor_name, defer_fn,
build_anon_union_vars, finish_anon_union, coerce_new_type,
coerce_delete_type, comdat_linkage, maybe_make_one_only,
key_method, import_export_vtable, import_export_class,
output_vtable_inherit, import_export_decl, import_export_tinfo,
build_cleanup, get_guard, get_guard_bits, get_guard_cond,
set_guard, start_objects, finish_objects,
start_static_storage_duration_function,
finish_static_storage_duration_function, get_priority_info,
start_static_initialization_or_destruction,
finish_static_initialization_or_destruction,
do_static_initialization, do_static_destruction,
prune_vars_needing_no_initialization, write_out_vars,
reparse_decl_as_expr, finish_decl_parsing, namespace_ancestor,
add_using_namespace, merge_functions, ambiguous_decl,
lookup_using_namespace, lookup_using_namespace,
qualified_lookup_using_namespace, set_decl_namespace,
decl_namespace, current_decl_namespace, push_decl_namespace,
pop_decl_namespace, push_scope, pop_scope, add_function,
arg_assoc_namespace, arg_assoc_template_arg, arg_assoc,
lookup_arg_dependent, do_namespace_alias,
validate_nonmember_using_decl, do_nonmember_using_decl,
do_toplevel_using_decl, do_local_using_decl,
do_class_using_decl, do_using_directive, check_default_args,
mark_used, handle_class_head): Use C90 prototypings. Use booleans.
* parser.c (cp_parser_class_head): Use booleanss.
* decl.c (walk_globals, walk_vtables): Likewise.
* cp-tree.h (walk_globals_pred, walk_globals_fn, walk_vtables,
walk_globals): Change return type from 'int' to 'bool'.
* rtti.c (init_rtti_processing, build_headof, throw_bad_cast
throw_bad_typeid, get_tinfo_decl_dynamic, typeid_ok_p,
build_typeid, tinfo_name, get_tinfo_decl, get_tinfo_ptr,
get_typeid, ifnonnull, build_dynamic_cast_1, build_dynamic_cast,
qualifier_flags, tinfo_base_init, generic_initializer,
ptr_initializer, dfs_class_hint_mark, ptm_initializer,
dfs_class_hint_unmark, class_hint_flags, class_initializer,
typeinfo_in_lib_p, get_pseudo_ti_init, create_pseudo_type_info,
get_pseudo_ti_desc, create_tinfo_types, emit_support_tinfos,
unemitted_tinfo_decl_p, emit_tinfo_decl): Likewise.
* repo.c (repo_compile_flags, repo_template_declared,
repo_template_defined, repo_class_defined, repo_get_id,
repo_template_used, repo_vtable_used, repo_inline_used,
repo_tinfo_used, repo_template_instantiated, extract_string,
open_repo_file, afgets, init_repo, reopen_repo_file_for_write,
finish_repo): Likewise.
* ptree.c (cxx_print_decl, cxx_print_type, cxx_print_identifier,
cxx_print_xnode): Likewise..
* cp-lang.c (ok_to_generate_alias_set_for_type, cxx_get_alias_set,
cxx_warn_unused_global_decl, cp_expr_size): Likewise.
* cxxfilt.c (demangle_it, print_demangler_list, usage,
standard_symbol_characters, hp_symbol_characters, main, fatal):
Likewise.
(strip_underscore): Change type from 'int' to 'bool'.
(main): Use boolean constants.
From-SVN: r60601
2002-12-29 15:53:05 +01:00
|
|
|
|
bool
|
|
|
|
|
check_java_method (tree method)
|
cp-tree.h (TYPE_FOR_JAVA): New macro.
d
* cp-tree.h (TYPE_FOR_JAVA): New macro.
* decl.c, cp-tree.h (java_byte_type_node, java_short_type_node,
java_int_type_node, java_long_type_node, java_float_type_node,
java_double_type_node, java_char_type_node, java_boolean_type_node):
New "primitive" types, with predefined names __java_byte etc.
(record_builtin_java_type): New function.
(init_decl_processing): Make Java types with record_builtin_java_type.
(pushtag, grokdeclarator): Set TYPE_FOR_JAVA if in extern "JAVA".
(xref_baseypes): If base class was TYPE_FOR_JAVA, so is this class.
(grokfndecl): Call check_java_method for Java classes.
* method.c (is_java_type): Removed. Replaced with TYPE_FOR_JAVA.
(process_overload_item): Match types against specific
java_XX_type_node types, rather than using is_java_type.
* class.c (finish_struct_1): Don't add default copy constructor
or operator= if TYPE_FOR_JAVA.
(pop_lang_conext): Restore strict_prototyp proper if Java.
* decl2.c (acceptable_java_type, check_java_method): New functions.
* pt.c (instantiate_class_template): Copy TYPE_FOR_JAVA from pattern.
(tsubst): Move common statement after if statement.
* typeck.c (comptypes): If strict, TYPE_FOR_JAVA must match.
From-SVN: r20174
1998-06-01 20:25:34 +02:00
|
|
|
|
{
|
Remove traditional C constructs 4/n.
* decl2.c (grok_method_quals, warn_if_unknown_interface,
grok_x_components, cp_build_parm_decl, build_artificial_parm,
maybe_retrofit_in_chrg, grokclassfn, grok_array_decl,
delete_sanity, check_member_template, check_java_method,
check_classfn, finish_static_data_member_decl, grokfield,
grokbitfield, grokoptypename, grok_function_init,
cplus_decl_attributes, constructor_name, defer_fn,
build_anon_union_vars, finish_anon_union, coerce_new_type,
coerce_delete_type, comdat_linkage, maybe_make_one_only,
key_method, import_export_vtable, import_export_class,
output_vtable_inherit, import_export_decl, import_export_tinfo,
build_cleanup, get_guard, get_guard_bits, get_guard_cond,
set_guard, start_objects, finish_objects,
start_static_storage_duration_function,
finish_static_storage_duration_function, get_priority_info,
start_static_initialization_or_destruction,
finish_static_initialization_or_destruction,
do_static_initialization, do_static_destruction,
prune_vars_needing_no_initialization, write_out_vars,
reparse_decl_as_expr, finish_decl_parsing, namespace_ancestor,
add_using_namespace, merge_functions, ambiguous_decl,
lookup_using_namespace, lookup_using_namespace,
qualified_lookup_using_namespace, set_decl_namespace,
decl_namespace, current_decl_namespace, push_decl_namespace,
pop_decl_namespace, push_scope, pop_scope, add_function,
arg_assoc_namespace, arg_assoc_template_arg, arg_assoc,
lookup_arg_dependent, do_namespace_alias,
validate_nonmember_using_decl, do_nonmember_using_decl,
do_toplevel_using_decl, do_local_using_decl,
do_class_using_decl, do_using_directive, check_default_args,
mark_used, handle_class_head): Use C90 prototypings. Use booleans.
* parser.c (cp_parser_class_head): Use booleanss.
* decl.c (walk_globals, walk_vtables): Likewise.
* cp-tree.h (walk_globals_pred, walk_globals_fn, walk_vtables,
walk_globals): Change return type from 'int' to 'bool'.
* rtti.c (init_rtti_processing, build_headof, throw_bad_cast
throw_bad_typeid, get_tinfo_decl_dynamic, typeid_ok_p,
build_typeid, tinfo_name, get_tinfo_decl, get_tinfo_ptr,
get_typeid, ifnonnull, build_dynamic_cast_1, build_dynamic_cast,
qualifier_flags, tinfo_base_init, generic_initializer,
ptr_initializer, dfs_class_hint_mark, ptm_initializer,
dfs_class_hint_unmark, class_hint_flags, class_initializer,
typeinfo_in_lib_p, get_pseudo_ti_init, create_pseudo_type_info,
get_pseudo_ti_desc, create_tinfo_types, emit_support_tinfos,
unemitted_tinfo_decl_p, emit_tinfo_decl): Likewise.
* repo.c (repo_compile_flags, repo_template_declared,
repo_template_defined, repo_class_defined, repo_get_id,
repo_template_used, repo_vtable_used, repo_inline_used,
repo_tinfo_used, repo_template_instantiated, extract_string,
open_repo_file, afgets, init_repo, reopen_repo_file_for_write,
finish_repo): Likewise.
* ptree.c (cxx_print_decl, cxx_print_type, cxx_print_identifier,
cxx_print_xnode): Likewise..
* cp-lang.c (ok_to_generate_alias_set_for_type, cxx_get_alias_set,
cxx_warn_unused_global_decl, cp_expr_size): Likewise.
* cxxfilt.c (demangle_it, print_demangler_list, usage,
standard_symbol_characters, hp_symbol_characters, main, fatal):
Likewise.
(strip_underscore): Change type from 'int' to 'bool'.
(main): Use boolean constants.
From-SVN: r60601
2002-12-29 15:53:05 +01:00
|
|
|
|
bool jerr = false;
|
cp-tree.h (TYPE_FOR_JAVA): New macro.
d
* cp-tree.h (TYPE_FOR_JAVA): New macro.
* decl.c, cp-tree.h (java_byte_type_node, java_short_type_node,
java_int_type_node, java_long_type_node, java_float_type_node,
java_double_type_node, java_char_type_node, java_boolean_type_node):
New "primitive" types, with predefined names __java_byte etc.
(record_builtin_java_type): New function.
(init_decl_processing): Make Java types with record_builtin_java_type.
(pushtag, grokdeclarator): Set TYPE_FOR_JAVA if in extern "JAVA".
(xref_baseypes): If base class was TYPE_FOR_JAVA, so is this class.
(grokfndecl): Call check_java_method for Java classes.
* method.c (is_java_type): Removed. Replaced with TYPE_FOR_JAVA.
(process_overload_item): Match types against specific
java_XX_type_node types, rather than using is_java_type.
* class.c (finish_struct_1): Don't add default copy constructor
or operator= if TYPE_FOR_JAVA.
(pop_lang_conext): Restore strict_prototyp proper if Java.
* decl2.c (acceptable_java_type, check_java_method): New functions.
* pt.c (instantiate_class_template): Copy TYPE_FOR_JAVA from pattern.
(tsubst): Move common statement after if statement.
* typeck.c (comptypes): If strict, TYPE_FOR_JAVA must match.
From-SVN: r20174
1998-06-01 20:25:34 +02:00
|
|
|
|
tree arg_types = TYPE_ARG_TYPES (TREE_TYPE (method));
|
|
|
|
|
tree ret_type = TREE_TYPE (TREE_TYPE (method));
|
2003-12-15 15:19:10 +01:00
|
|
|
|
|
Remove traditional C constructs 4/n.
* decl2.c (grok_method_quals, warn_if_unknown_interface,
grok_x_components, cp_build_parm_decl, build_artificial_parm,
maybe_retrofit_in_chrg, grokclassfn, grok_array_decl,
delete_sanity, check_member_template, check_java_method,
check_classfn, finish_static_data_member_decl, grokfield,
grokbitfield, grokoptypename, grok_function_init,
cplus_decl_attributes, constructor_name, defer_fn,
build_anon_union_vars, finish_anon_union, coerce_new_type,
coerce_delete_type, comdat_linkage, maybe_make_one_only,
key_method, import_export_vtable, import_export_class,
output_vtable_inherit, import_export_decl, import_export_tinfo,
build_cleanup, get_guard, get_guard_bits, get_guard_cond,
set_guard, start_objects, finish_objects,
start_static_storage_duration_function,
finish_static_storage_duration_function, get_priority_info,
start_static_initialization_or_destruction,
finish_static_initialization_or_destruction,
do_static_initialization, do_static_destruction,
prune_vars_needing_no_initialization, write_out_vars,
reparse_decl_as_expr, finish_decl_parsing, namespace_ancestor,
add_using_namespace, merge_functions, ambiguous_decl,
lookup_using_namespace, lookup_using_namespace,
qualified_lookup_using_namespace, set_decl_namespace,
decl_namespace, current_decl_namespace, push_decl_namespace,
pop_decl_namespace, push_scope, pop_scope, add_function,
arg_assoc_namespace, arg_assoc_template_arg, arg_assoc,
lookup_arg_dependent, do_namespace_alias,
validate_nonmember_using_decl, do_nonmember_using_decl,
do_toplevel_using_decl, do_local_using_decl,
do_class_using_decl, do_using_directive, check_default_args,
mark_used, handle_class_head): Use C90 prototypings. Use booleans.
* parser.c (cp_parser_class_head): Use booleanss.
* decl.c (walk_globals, walk_vtables): Likewise.
* cp-tree.h (walk_globals_pred, walk_globals_fn, walk_vtables,
walk_globals): Change return type from 'int' to 'bool'.
* rtti.c (init_rtti_processing, build_headof, throw_bad_cast
throw_bad_typeid, get_tinfo_decl_dynamic, typeid_ok_p,
build_typeid, tinfo_name, get_tinfo_decl, get_tinfo_ptr,
get_typeid, ifnonnull, build_dynamic_cast_1, build_dynamic_cast,
qualifier_flags, tinfo_base_init, generic_initializer,
ptr_initializer, dfs_class_hint_mark, ptm_initializer,
dfs_class_hint_unmark, class_hint_flags, class_initializer,
typeinfo_in_lib_p, get_pseudo_ti_init, create_pseudo_type_info,
get_pseudo_ti_desc, create_tinfo_types, emit_support_tinfos,
unemitted_tinfo_decl_p, emit_tinfo_decl): Likewise.
* repo.c (repo_compile_flags, repo_template_declared,
repo_template_defined, repo_class_defined, repo_get_id,
repo_template_used, repo_vtable_used, repo_inline_used,
repo_tinfo_used, repo_template_instantiated, extract_string,
open_repo_file, afgets, init_repo, reopen_repo_file_for_write,
finish_repo): Likewise.
* ptree.c (cxx_print_decl, cxx_print_type, cxx_print_identifier,
cxx_print_xnode): Likewise..
* cp-lang.c (ok_to_generate_alias_set_for_type, cxx_get_alias_set,
cxx_warn_unused_global_decl, cp_expr_size): Likewise.
* cxxfilt.c (demangle_it, print_demangler_list, usage,
standard_symbol_characters, hp_symbol_characters, main, fatal):
Likewise.
(strip_underscore): Change type from 'int' to 'bool'.
(main): Use boolean constants.
From-SVN: r60601
2002-12-29 15:53:05 +01:00
|
|
|
|
if (!acceptable_java_type (ret_type))
|
cp-tree.h (TYPE_FOR_JAVA): New macro.
d
* cp-tree.h (TYPE_FOR_JAVA): New macro.
* decl.c, cp-tree.h (java_byte_type_node, java_short_type_node,
java_int_type_node, java_long_type_node, java_float_type_node,
java_double_type_node, java_char_type_node, java_boolean_type_node):
New "primitive" types, with predefined names __java_byte etc.
(record_builtin_java_type): New function.
(init_decl_processing): Make Java types with record_builtin_java_type.
(pushtag, grokdeclarator): Set TYPE_FOR_JAVA if in extern "JAVA".
(xref_baseypes): If base class was TYPE_FOR_JAVA, so is this class.
(grokfndecl): Call check_java_method for Java classes.
* method.c (is_java_type): Removed. Replaced with TYPE_FOR_JAVA.
(process_overload_item): Match types against specific
java_XX_type_node types, rather than using is_java_type.
* class.c (finish_struct_1): Don't add default copy constructor
or operator= if TYPE_FOR_JAVA.
(pop_lang_conext): Restore strict_prototyp proper if Java.
* decl2.c (acceptable_java_type, check_java_method): New functions.
* pt.c (instantiate_class_template): Copy TYPE_FOR_JAVA from pattern.
(tsubst): Move common statement after if statement.
* typeck.c (comptypes): If strict, TYPE_FOR_JAVA must match.
From-SVN: r20174
1998-06-01 20:25:34 +02:00
|
|
|
|
{
|
Convert diagnostics to use quoting flag q 3/n
cp/
Convert diagnostics to use quoting flag q 3/n
* decl.c (pop_label, duplicate_decls,
redeclaration_error_message,
redeclaration_error_message, lookup_label, check_goto,
make_typename_type, make_unbound_class_template,
fixup_anonymous_aggr, check_tag_decl, start_decl,
start_decl_1,
grok_reference_init, layout_var_decl, maybe_commonize_var,
check_for_uninitialized_const_var, reshape_init_array,
reshape_init, check_initializer, cp_finish_decl,
member_function_or_else, bad_specifiers, grokfndecl,
grokvardecl,
check_static_variable_definition, compute_array_index_type,
create_array_type_for_decl,
check_special_function_return_type,
grokdeclarator, check_default_argument, grokparms,
grok_ctor_properties, grok_op_properties,
check_elaborated_type_specifier, xref_tag, finish_enum,
build_enumerator, check_function_type,
start_preparsed_function,
store_parm_decls): Use quoting formats.
* decl2.c (grok_array_decl, delete_sanity,
check_member_template,
check_java_method, check_classfn,
finish_static_data_member_decl,
grokfield, grokbitfield, grok_function_init,
build_anon_union_vars, coerce_new_type, coerce_delete_type,
check_default_args): Likewise.
* parser.c (cp_parser_decl_specifier_seq): Likewise.
testsuite/
* g++.dg/template/local1.C: Adjust quoting marks in
testing for diagnostics.
* g++.dg/tls/diag-2.C: Likewise.
* g++.dg/other/error8.C: Likewise.
From-SVN: r88478
2004-10-04 08:04:43 +02:00
|
|
|
|
error ("Java method %qD has non-Java return type %qT",
|
2005-06-15 02:41:35 +02:00
|
|
|
|
method, ret_type);
|
Remove traditional C constructs 4/n.
* decl2.c (grok_method_quals, warn_if_unknown_interface,
grok_x_components, cp_build_parm_decl, build_artificial_parm,
maybe_retrofit_in_chrg, grokclassfn, grok_array_decl,
delete_sanity, check_member_template, check_java_method,
check_classfn, finish_static_data_member_decl, grokfield,
grokbitfield, grokoptypename, grok_function_init,
cplus_decl_attributes, constructor_name, defer_fn,
build_anon_union_vars, finish_anon_union, coerce_new_type,
coerce_delete_type, comdat_linkage, maybe_make_one_only,
key_method, import_export_vtable, import_export_class,
output_vtable_inherit, import_export_decl, import_export_tinfo,
build_cleanup, get_guard, get_guard_bits, get_guard_cond,
set_guard, start_objects, finish_objects,
start_static_storage_duration_function,
finish_static_storage_duration_function, get_priority_info,
start_static_initialization_or_destruction,
finish_static_initialization_or_destruction,
do_static_initialization, do_static_destruction,
prune_vars_needing_no_initialization, write_out_vars,
reparse_decl_as_expr, finish_decl_parsing, namespace_ancestor,
add_using_namespace, merge_functions, ambiguous_decl,
lookup_using_namespace, lookup_using_namespace,
qualified_lookup_using_namespace, set_decl_namespace,
decl_namespace, current_decl_namespace, push_decl_namespace,
pop_decl_namespace, push_scope, pop_scope, add_function,
arg_assoc_namespace, arg_assoc_template_arg, arg_assoc,
lookup_arg_dependent, do_namespace_alias,
validate_nonmember_using_decl, do_nonmember_using_decl,
do_toplevel_using_decl, do_local_using_decl,
do_class_using_decl, do_using_directive, check_default_args,
mark_used, handle_class_head): Use C90 prototypings. Use booleans.
* parser.c (cp_parser_class_head): Use booleanss.
* decl.c (walk_globals, walk_vtables): Likewise.
* cp-tree.h (walk_globals_pred, walk_globals_fn, walk_vtables,
walk_globals): Change return type from 'int' to 'bool'.
* rtti.c (init_rtti_processing, build_headof, throw_bad_cast
throw_bad_typeid, get_tinfo_decl_dynamic, typeid_ok_p,
build_typeid, tinfo_name, get_tinfo_decl, get_tinfo_ptr,
get_typeid, ifnonnull, build_dynamic_cast_1, build_dynamic_cast,
qualifier_flags, tinfo_base_init, generic_initializer,
ptr_initializer, dfs_class_hint_mark, ptm_initializer,
dfs_class_hint_unmark, class_hint_flags, class_initializer,
typeinfo_in_lib_p, get_pseudo_ti_init, create_pseudo_type_info,
get_pseudo_ti_desc, create_tinfo_types, emit_support_tinfos,
unemitted_tinfo_decl_p, emit_tinfo_decl): Likewise.
* repo.c (repo_compile_flags, repo_template_declared,
repo_template_defined, repo_class_defined, repo_get_id,
repo_template_used, repo_vtable_used, repo_inline_used,
repo_tinfo_used, repo_template_instantiated, extract_string,
open_repo_file, afgets, init_repo, reopen_repo_file_for_write,
finish_repo): Likewise.
* ptree.c (cxx_print_decl, cxx_print_type, cxx_print_identifier,
cxx_print_xnode): Likewise..
* cp-lang.c (ok_to_generate_alias_set_for_type, cxx_get_alias_set,
cxx_warn_unused_global_decl, cp_expr_size): Likewise.
* cxxfilt.c (demangle_it, print_demangler_list, usage,
standard_symbol_characters, hp_symbol_characters, main, fatal):
Likewise.
(strip_underscore): Change type from 'int' to 'bool'.
(main): Use boolean constants.
From-SVN: r60601
2002-12-29 15:53:05 +01:00
|
|
|
|
jerr = true;
|
cp-tree.h (TYPE_FOR_JAVA): New macro.
d
* cp-tree.h (TYPE_FOR_JAVA): New macro.
* decl.c, cp-tree.h (java_byte_type_node, java_short_type_node,
java_int_type_node, java_long_type_node, java_float_type_node,
java_double_type_node, java_char_type_node, java_boolean_type_node):
New "primitive" types, with predefined names __java_byte etc.
(record_builtin_java_type): New function.
(init_decl_processing): Make Java types with record_builtin_java_type.
(pushtag, grokdeclarator): Set TYPE_FOR_JAVA if in extern "JAVA".
(xref_baseypes): If base class was TYPE_FOR_JAVA, so is this class.
(grokfndecl): Call check_java_method for Java classes.
* method.c (is_java_type): Removed. Replaced with TYPE_FOR_JAVA.
(process_overload_item): Match types against specific
java_XX_type_node types, rather than using is_java_type.
* class.c (finish_struct_1): Don't add default copy constructor
or operator= if TYPE_FOR_JAVA.
(pop_lang_conext): Restore strict_prototyp proper if Java.
* decl2.c (acceptable_java_type, check_java_method): New functions.
* pt.c (instantiate_class_template): Copy TYPE_FOR_JAVA from pattern.
(tsubst): Move common statement after if statement.
* typeck.c (comptypes): If strict, TYPE_FOR_JAVA must match.
From-SVN: r20174
1998-06-01 20:25:34 +02:00
|
|
|
|
}
|
2003-12-15 15:19:10 +01:00
|
|
|
|
|
|
|
|
|
arg_types = TREE_CHAIN (arg_types);
|
|
|
|
|
if (DECL_HAS_IN_CHARGE_PARM_P (method))
|
|
|
|
|
arg_types = TREE_CHAIN (arg_types);
|
|
|
|
|
if (DECL_HAS_VTT_PARM_P (method))
|
|
|
|
|
arg_types = TREE_CHAIN (arg_types);
|
2005-06-14 22:01:59 +02:00
|
|
|
|
|
cp-tree.h (TYPE_FOR_JAVA): New macro.
d
* cp-tree.h (TYPE_FOR_JAVA): New macro.
* decl.c, cp-tree.h (java_byte_type_node, java_short_type_node,
java_int_type_node, java_long_type_node, java_float_type_node,
java_double_type_node, java_char_type_node, java_boolean_type_node):
New "primitive" types, with predefined names __java_byte etc.
(record_builtin_java_type): New function.
(init_decl_processing): Make Java types with record_builtin_java_type.
(pushtag, grokdeclarator): Set TYPE_FOR_JAVA if in extern "JAVA".
(xref_baseypes): If base class was TYPE_FOR_JAVA, so is this class.
(grokfndecl): Call check_java_method for Java classes.
* method.c (is_java_type): Removed. Replaced with TYPE_FOR_JAVA.
(process_overload_item): Match types against specific
java_XX_type_node types, rather than using is_java_type.
* class.c (finish_struct_1): Don't add default copy constructor
or operator= if TYPE_FOR_JAVA.
(pop_lang_conext): Restore strict_prototyp proper if Java.
* decl2.c (acceptable_java_type, check_java_method): New functions.
* pt.c (instantiate_class_template): Copy TYPE_FOR_JAVA from pattern.
(tsubst): Move common statement after if statement.
* typeck.c (comptypes): If strict, TYPE_FOR_JAVA must match.
From-SVN: r20174
1998-06-01 20:25:34 +02:00
|
|
|
|
for (; arg_types != NULL_TREE; arg_types = TREE_CHAIN (arg_types))
|
|
|
|
|
{
|
|
|
|
|
tree type = TREE_VALUE (arg_types);
|
Remove traditional C constructs 4/n.
* decl2.c (grok_method_quals, warn_if_unknown_interface,
grok_x_components, cp_build_parm_decl, build_artificial_parm,
maybe_retrofit_in_chrg, grokclassfn, grok_array_decl,
delete_sanity, check_member_template, check_java_method,
check_classfn, finish_static_data_member_decl, grokfield,
grokbitfield, grokoptypename, grok_function_init,
cplus_decl_attributes, constructor_name, defer_fn,
build_anon_union_vars, finish_anon_union, coerce_new_type,
coerce_delete_type, comdat_linkage, maybe_make_one_only,
key_method, import_export_vtable, import_export_class,
output_vtable_inherit, import_export_decl, import_export_tinfo,
build_cleanup, get_guard, get_guard_bits, get_guard_cond,
set_guard, start_objects, finish_objects,
start_static_storage_duration_function,
finish_static_storage_duration_function, get_priority_info,
start_static_initialization_or_destruction,
finish_static_initialization_or_destruction,
do_static_initialization, do_static_destruction,
prune_vars_needing_no_initialization, write_out_vars,
reparse_decl_as_expr, finish_decl_parsing, namespace_ancestor,
add_using_namespace, merge_functions, ambiguous_decl,
lookup_using_namespace, lookup_using_namespace,
qualified_lookup_using_namespace, set_decl_namespace,
decl_namespace, current_decl_namespace, push_decl_namespace,
pop_decl_namespace, push_scope, pop_scope, add_function,
arg_assoc_namespace, arg_assoc_template_arg, arg_assoc,
lookup_arg_dependent, do_namespace_alias,
validate_nonmember_using_decl, do_nonmember_using_decl,
do_toplevel_using_decl, do_local_using_decl,
do_class_using_decl, do_using_directive, check_default_args,
mark_used, handle_class_head): Use C90 prototypings. Use booleans.
* parser.c (cp_parser_class_head): Use booleanss.
* decl.c (walk_globals, walk_vtables): Likewise.
* cp-tree.h (walk_globals_pred, walk_globals_fn, walk_vtables,
walk_globals): Change return type from 'int' to 'bool'.
* rtti.c (init_rtti_processing, build_headof, throw_bad_cast
throw_bad_typeid, get_tinfo_decl_dynamic, typeid_ok_p,
build_typeid, tinfo_name, get_tinfo_decl, get_tinfo_ptr,
get_typeid, ifnonnull, build_dynamic_cast_1, build_dynamic_cast,
qualifier_flags, tinfo_base_init, generic_initializer,
ptr_initializer, dfs_class_hint_mark, ptm_initializer,
dfs_class_hint_unmark, class_hint_flags, class_initializer,
typeinfo_in_lib_p, get_pseudo_ti_init, create_pseudo_type_info,
get_pseudo_ti_desc, create_tinfo_types, emit_support_tinfos,
unemitted_tinfo_decl_p, emit_tinfo_decl): Likewise.
* repo.c (repo_compile_flags, repo_template_declared,
repo_template_defined, repo_class_defined, repo_get_id,
repo_template_used, repo_vtable_used, repo_inline_used,
repo_tinfo_used, repo_template_instantiated, extract_string,
open_repo_file, afgets, init_repo, reopen_repo_file_for_write,
finish_repo): Likewise.
* ptree.c (cxx_print_decl, cxx_print_type, cxx_print_identifier,
cxx_print_xnode): Likewise..
* cp-lang.c (ok_to_generate_alias_set_for_type, cxx_get_alias_set,
cxx_warn_unused_global_decl, cp_expr_size): Likewise.
* cxxfilt.c (demangle_it, print_demangler_list, usage,
standard_symbol_characters, hp_symbol_characters, main, fatal):
Likewise.
(strip_underscore): Change type from 'int' to 'bool'.
(main): Use boolean constants.
From-SVN: r60601
2002-12-29 15:53:05 +01:00
|
|
|
|
if (!acceptable_java_type (type))
|
cp-tree.h (TYPE_FOR_JAVA): New macro.
d
* cp-tree.h (TYPE_FOR_JAVA): New macro.
* decl.c, cp-tree.h (java_byte_type_node, java_short_type_node,
java_int_type_node, java_long_type_node, java_float_type_node,
java_double_type_node, java_char_type_node, java_boolean_type_node):
New "primitive" types, with predefined names __java_byte etc.
(record_builtin_java_type): New function.
(init_decl_processing): Make Java types with record_builtin_java_type.
(pushtag, grokdeclarator): Set TYPE_FOR_JAVA if in extern "JAVA".
(xref_baseypes): If base class was TYPE_FOR_JAVA, so is this class.
(grokfndecl): Call check_java_method for Java classes.
* method.c (is_java_type): Removed. Replaced with TYPE_FOR_JAVA.
(process_overload_item): Match types against specific
java_XX_type_node types, rather than using is_java_type.
* class.c (finish_struct_1): Don't add default copy constructor
or operator= if TYPE_FOR_JAVA.
(pop_lang_conext): Restore strict_prototyp proper if Java.
* decl2.c (acceptable_java_type, check_java_method): New functions.
* pt.c (instantiate_class_template): Copy TYPE_FOR_JAVA from pattern.
(tsubst): Move common statement after if statement.
* typeck.c (comptypes): If strict, TYPE_FOR_JAVA must match.
From-SVN: r20174
1998-06-01 20:25:34 +02:00
|
|
|
|
{
|
2006-07-15 16:44:48 +02:00
|
|
|
|
if (type != error_mark_node)
|
|
|
|
|
error ("Java method %qD has non-Java parameter type %qT",
|
|
|
|
|
method, type);
|
Remove traditional C constructs 4/n.
* decl2.c (grok_method_quals, warn_if_unknown_interface,
grok_x_components, cp_build_parm_decl, build_artificial_parm,
maybe_retrofit_in_chrg, grokclassfn, grok_array_decl,
delete_sanity, check_member_template, check_java_method,
check_classfn, finish_static_data_member_decl, grokfield,
grokbitfield, grokoptypename, grok_function_init,
cplus_decl_attributes, constructor_name, defer_fn,
build_anon_union_vars, finish_anon_union, coerce_new_type,
coerce_delete_type, comdat_linkage, maybe_make_one_only,
key_method, import_export_vtable, import_export_class,
output_vtable_inherit, import_export_decl, import_export_tinfo,
build_cleanup, get_guard, get_guard_bits, get_guard_cond,
set_guard, start_objects, finish_objects,
start_static_storage_duration_function,
finish_static_storage_duration_function, get_priority_info,
start_static_initialization_or_destruction,
finish_static_initialization_or_destruction,
do_static_initialization, do_static_destruction,
prune_vars_needing_no_initialization, write_out_vars,
reparse_decl_as_expr, finish_decl_parsing, namespace_ancestor,
add_using_namespace, merge_functions, ambiguous_decl,
lookup_using_namespace, lookup_using_namespace,
qualified_lookup_using_namespace, set_decl_namespace,
decl_namespace, current_decl_namespace, push_decl_namespace,
pop_decl_namespace, push_scope, pop_scope, add_function,
arg_assoc_namespace, arg_assoc_template_arg, arg_assoc,
lookup_arg_dependent, do_namespace_alias,
validate_nonmember_using_decl, do_nonmember_using_decl,
do_toplevel_using_decl, do_local_using_decl,
do_class_using_decl, do_using_directive, check_default_args,
mark_used, handle_class_head): Use C90 prototypings. Use booleans.
* parser.c (cp_parser_class_head): Use booleanss.
* decl.c (walk_globals, walk_vtables): Likewise.
* cp-tree.h (walk_globals_pred, walk_globals_fn, walk_vtables,
walk_globals): Change return type from 'int' to 'bool'.
* rtti.c (init_rtti_processing, build_headof, throw_bad_cast
throw_bad_typeid, get_tinfo_decl_dynamic, typeid_ok_p,
build_typeid, tinfo_name, get_tinfo_decl, get_tinfo_ptr,
get_typeid, ifnonnull, build_dynamic_cast_1, build_dynamic_cast,
qualifier_flags, tinfo_base_init, generic_initializer,
ptr_initializer, dfs_class_hint_mark, ptm_initializer,
dfs_class_hint_unmark, class_hint_flags, class_initializer,
typeinfo_in_lib_p, get_pseudo_ti_init, create_pseudo_type_info,
get_pseudo_ti_desc, create_tinfo_types, emit_support_tinfos,
unemitted_tinfo_decl_p, emit_tinfo_decl): Likewise.
* repo.c (repo_compile_flags, repo_template_declared,
repo_template_defined, repo_class_defined, repo_get_id,
repo_template_used, repo_vtable_used, repo_inline_used,
repo_tinfo_used, repo_template_instantiated, extract_string,
open_repo_file, afgets, init_repo, reopen_repo_file_for_write,
finish_repo): Likewise.
* ptree.c (cxx_print_decl, cxx_print_type, cxx_print_identifier,
cxx_print_xnode): Likewise..
* cp-lang.c (ok_to_generate_alias_set_for_type, cxx_get_alias_set,
cxx_warn_unused_global_decl, cp_expr_size): Likewise.
* cxxfilt.c (demangle_it, print_demangler_list, usage,
standard_symbol_characters, hp_symbol_characters, main, fatal):
Likewise.
(strip_underscore): Change type from 'int' to 'bool'.
(main): Use boolean constants.
From-SVN: r60601
2002-12-29 15:53:05 +01:00
|
|
|
|
jerr = true;
|
cp-tree.h (TYPE_FOR_JAVA): New macro.
d
* cp-tree.h (TYPE_FOR_JAVA): New macro.
* decl.c, cp-tree.h (java_byte_type_node, java_short_type_node,
java_int_type_node, java_long_type_node, java_float_type_node,
java_double_type_node, java_char_type_node, java_boolean_type_node):
New "primitive" types, with predefined names __java_byte etc.
(record_builtin_java_type): New function.
(init_decl_processing): Make Java types with record_builtin_java_type.
(pushtag, grokdeclarator): Set TYPE_FOR_JAVA if in extern "JAVA".
(xref_baseypes): If base class was TYPE_FOR_JAVA, so is this class.
(grokfndecl): Call check_java_method for Java classes.
* method.c (is_java_type): Removed. Replaced with TYPE_FOR_JAVA.
(process_overload_item): Match types against specific
java_XX_type_node types, rather than using is_java_type.
* class.c (finish_struct_1): Don't add default copy constructor
or operator= if TYPE_FOR_JAVA.
(pop_lang_conext): Restore strict_prototyp proper if Java.
* decl2.c (acceptable_java_type, check_java_method): New functions.
* pt.c (instantiate_class_template): Copy TYPE_FOR_JAVA from pattern.
(tsubst): Move common statement after if statement.
* typeck.c (comptypes): If strict, TYPE_FOR_JAVA must match.
From-SVN: r20174
1998-06-01 20:25:34 +02:00
|
|
|
|
}
|
|
|
|
|
}
|
Remove traditional C constructs 4/n.
* decl2.c (grok_method_quals, warn_if_unknown_interface,
grok_x_components, cp_build_parm_decl, build_artificial_parm,
maybe_retrofit_in_chrg, grokclassfn, grok_array_decl,
delete_sanity, check_member_template, check_java_method,
check_classfn, finish_static_data_member_decl, grokfield,
grokbitfield, grokoptypename, grok_function_init,
cplus_decl_attributes, constructor_name, defer_fn,
build_anon_union_vars, finish_anon_union, coerce_new_type,
coerce_delete_type, comdat_linkage, maybe_make_one_only,
key_method, import_export_vtable, import_export_class,
output_vtable_inherit, import_export_decl, import_export_tinfo,
build_cleanup, get_guard, get_guard_bits, get_guard_cond,
set_guard, start_objects, finish_objects,
start_static_storage_duration_function,
finish_static_storage_duration_function, get_priority_info,
start_static_initialization_or_destruction,
finish_static_initialization_or_destruction,
do_static_initialization, do_static_destruction,
prune_vars_needing_no_initialization, write_out_vars,
reparse_decl_as_expr, finish_decl_parsing, namespace_ancestor,
add_using_namespace, merge_functions, ambiguous_decl,
lookup_using_namespace, lookup_using_namespace,
qualified_lookup_using_namespace, set_decl_namespace,
decl_namespace, current_decl_namespace, push_decl_namespace,
pop_decl_namespace, push_scope, pop_scope, add_function,
arg_assoc_namespace, arg_assoc_template_arg, arg_assoc,
lookup_arg_dependent, do_namespace_alias,
validate_nonmember_using_decl, do_nonmember_using_decl,
do_toplevel_using_decl, do_local_using_decl,
do_class_using_decl, do_using_directive, check_default_args,
mark_used, handle_class_head): Use C90 prototypings. Use booleans.
* parser.c (cp_parser_class_head): Use booleanss.
* decl.c (walk_globals, walk_vtables): Likewise.
* cp-tree.h (walk_globals_pred, walk_globals_fn, walk_vtables,
walk_globals): Change return type from 'int' to 'bool'.
* rtti.c (init_rtti_processing, build_headof, throw_bad_cast
throw_bad_typeid, get_tinfo_decl_dynamic, typeid_ok_p,
build_typeid, tinfo_name, get_tinfo_decl, get_tinfo_ptr,
get_typeid, ifnonnull, build_dynamic_cast_1, build_dynamic_cast,
qualifier_flags, tinfo_base_init, generic_initializer,
ptr_initializer, dfs_class_hint_mark, ptm_initializer,
dfs_class_hint_unmark, class_hint_flags, class_initializer,
typeinfo_in_lib_p, get_pseudo_ti_init, create_pseudo_type_info,
get_pseudo_ti_desc, create_tinfo_types, emit_support_tinfos,
unemitted_tinfo_decl_p, emit_tinfo_decl): Likewise.
* repo.c (repo_compile_flags, repo_template_declared,
repo_template_defined, repo_class_defined, repo_get_id,
repo_template_used, repo_vtable_used, repo_inline_used,
repo_tinfo_used, repo_template_instantiated, extract_string,
open_repo_file, afgets, init_repo, reopen_repo_file_for_write,
finish_repo): Likewise.
* ptree.c (cxx_print_decl, cxx_print_type, cxx_print_identifier,
cxx_print_xnode): Likewise..
* cp-lang.c (ok_to_generate_alias_set_for_type, cxx_get_alias_set,
cxx_warn_unused_global_decl, cp_expr_size): Likewise.
* cxxfilt.c (demangle_it, print_demangler_list, usage,
standard_symbol_characters, hp_symbol_characters, main, fatal):
Likewise.
(strip_underscore): Change type from 'int' to 'bool'.
(main): Use boolean constants.
From-SVN: r60601
2002-12-29 15:53:05 +01:00
|
|
|
|
return !jerr;
|
cp-tree.h (TYPE_FOR_JAVA): New macro.
d
* cp-tree.h (TYPE_FOR_JAVA): New macro.
* decl.c, cp-tree.h (java_byte_type_node, java_short_type_node,
java_int_type_node, java_long_type_node, java_float_type_node,
java_double_type_node, java_char_type_node, java_boolean_type_node):
New "primitive" types, with predefined names __java_byte etc.
(record_builtin_java_type): New function.
(init_decl_processing): Make Java types with record_builtin_java_type.
(pushtag, grokdeclarator): Set TYPE_FOR_JAVA if in extern "JAVA".
(xref_baseypes): If base class was TYPE_FOR_JAVA, so is this class.
(grokfndecl): Call check_java_method for Java classes.
* method.c (is_java_type): Removed. Replaced with TYPE_FOR_JAVA.
(process_overload_item): Match types against specific
java_XX_type_node types, rather than using is_java_type.
* class.c (finish_struct_1): Don't add default copy constructor
or operator= if TYPE_FOR_JAVA.
(pop_lang_conext): Restore strict_prototyp proper if Java.
* decl2.c (acceptable_java_type, check_java_method): New functions.
* pt.c (instantiate_class_template): Copy TYPE_FOR_JAVA from pattern.
(tsubst): Move common statement after if statement.
* typeck.c (comptypes): If strict, TYPE_FOR_JAVA must match.
From-SVN: r20174
1998-06-01 20:25:34 +02:00
|
|
|
|
}
|
|
|
|
|
|
1994-02-24 02:02:37 +01:00
|
|
|
|
/* Sanity check: report error if this function FUNCTION is not
|
|
|
|
|
really a member of the class (CTYPE) it is supposed to belong to.
|
class.c, [...]: Fix comment typos.
* class.c, cp-tree.h, decl.c, decl2.c, mangle.c,
name-lookup.h, parser.c, search.c, semantics.c, typeck2.c: Fix
comment typos.
From-SVN: r87292
2004-09-10 13:12:15 +02:00
|
|
|
|
TEMPLATE_PARMS is used to specify the template parameters of a member
|
2005-06-14 22:01:59 +02:00
|
|
|
|
template passed as FUNCTION_DECL. If the member template is passed as a
|
2004-05-03 12:11:19 +02:00
|
|
|
|
TEMPLATE_DECL, it can be NULL since the parameters can be extracted
|
|
|
|
|
from the declaration. If the function is not a function template, it
|
|
|
|
|
must be NULL.
|
2007-08-15 00:07:31 +02:00
|
|
|
|
It returns the original declaration for the function, NULL_TREE if
|
|
|
|
|
no declaration was found, error_mark_node if an error was emitted. */
|
1994-02-24 02:02:37 +01:00
|
|
|
|
|
1995-10-12 03:33:51 +01:00
|
|
|
|
tree
|
2004-05-03 12:11:19 +02:00
|
|
|
|
check_classfn (tree ctype, tree function, tree template_parms)
|
1994-02-24 02:02:37 +01:00
|
|
|
|
{
|
2002-12-24 23:12:17 +01:00
|
|
|
|
int ix;
|
2004-05-03 12:11:19 +02:00
|
|
|
|
bool is_template;
|
2006-08-25 18:56:07 +02:00
|
|
|
|
tree pushed_scope;
|
|
|
|
|
|
1999-02-21 17:38:23 +01:00
|
|
|
|
if (DECL_USE_TEMPLATE (function)
|
2000-03-12 19:47:52 +01:00
|
|
|
|
&& !(TREE_CODE (function) == TEMPLATE_DECL
|
|
|
|
|
&& DECL_TEMPLATE_SPECIALIZATION (function))
|
2004-10-07 19:48:36 +02:00
|
|
|
|
&& DECL_MEMBER_TEMPLATE_P (DECL_TI_TEMPLATE (function)))
|
1999-02-21 17:38:23 +01:00
|
|
|
|
/* Since this is a specialization of a member template,
|
|
|
|
|
we're not going to find the declaration in the class.
|
|
|
|
|
For example, in:
|
2005-06-14 22:01:59 +02:00
|
|
|
|
|
2005-06-15 02:41:35 +02:00
|
|
|
|
struct S { template <typename T> void f(T); };
|
|
|
|
|
template <> void S::f(int);
|
2005-06-14 22:01:59 +02:00
|
|
|
|
|
1999-02-21 17:38:23 +01:00
|
|
|
|
we're not going to find `S::f(int)', but there's no
|
|
|
|
|
reason we should, either. We let our callers know we didn't
|
|
|
|
|
find the method, but we don't complain. */
|
|
|
|
|
return NULL_TREE;
|
2002-12-24 23:12:17 +01:00
|
|
|
|
|
2004-05-03 12:11:19 +02:00
|
|
|
|
/* Basic sanity check: for a template function, the template parameters
|
|
|
|
|
either were not passed, or they are the same of DECL_TEMPLATE_PARMS. */
|
|
|
|
|
if (TREE_CODE (function) == TEMPLATE_DECL)
|
|
|
|
|
{
|
2008-11-26 04:51:40 +01:00
|
|
|
|
if (template_parms
|
|
|
|
|
&& !comp_template_parms (template_parms,
|
|
|
|
|
DECL_TEMPLATE_PARMS (function)))
|
|
|
|
|
{
|
|
|
|
|
error ("template parameter lists provided don't match the "
|
|
|
|
|
"template parameters of %qD", function);
|
|
|
|
|
return error_mark_node;
|
|
|
|
|
}
|
2004-05-03 12:11:19 +02:00
|
|
|
|
template_parms = DECL_TEMPLATE_PARMS (function);
|
|
|
|
|
}
|
|
|
|
|
|
2003-03-11 11:33:28 +01:00
|
|
|
|
/* OK, is this a definition of a member template? */
|
2004-05-03 12:11:19 +02:00
|
|
|
|
is_template = (template_parms != NULL_TREE);
|
2003-03-11 11:33:28 +01:00
|
|
|
|
|
2006-08-25 18:56:07 +02:00
|
|
|
|
/* We must enter the scope here, because conversion operators are
|
|
|
|
|
named by target type, and type equivalence relies on typenames
|
|
|
|
|
resolving within the scope of CTYPE. */
|
|
|
|
|
pushed_scope = push_scope (ctype);
|
2004-10-07 19:48:36 +02:00
|
|
|
|
ix = class_method_index_for_fn (complete_type (ctype), function);
|
2002-12-24 23:12:17 +01:00
|
|
|
|
if (ix >= 0)
|
1994-02-24 02:02:37 +01:00
|
|
|
|
{
|
vec.h: Update API to separate allocation mechanism from type.
* vec.h: Update API to separate allocation mechanism from type.
(VEC_safe_grow): New.
* vec.c (calculate_allocation): New.
(vec_gc_o_reserve, vec_heap_o_reserve): Adjust.
(vec_gc_free, vec_heap_free): Remove.
* gengtype-lex.l (DEF_VEC_): Process mult-argument macros. Adjust.
(VEC): Likewise.
(mangle_macro_name): New.
(struct macro_def): New.
(struct macro): Add multiple argument values.
(macro_expans_end): New.
(push_macro_expansion): Chain on new macro. Process multiple
args, create follow on expansion. Return follow on argument.
(macro_input): Deal with multiple arguments.
* tree.h: Define VEC(tree,heap) and VEC(tree,gc).
(struct tree_binfo): Adjust.
* basic-block.h: Define VEC(edge,gc).
(struct edge_def): Adjust.
(struct basic_block_def, struct edge_iterator): Likewise.
(ei_container, ei_start_1, ei_last_1): Likewise.
* cfg.c (connect_src, connect_dest): Likewise.
* cfgrtl.c (force_nonfallthru_and_redirect)
* dbxout.c (dbxout_type)
* dwarf2out.c (gen_member_die)
* lambda-code.c: Define VEC(int,gc), VEC(lambda_loop,gc).
(gcc_tree_to_linear_expression): Adjust.
(gcc_loop_to_lambda_loop, gcc_loopnest_to_lambda_loopnest,
lbv_to_gcc_expression, lle_to_gcc_expression,
lambda_loopnest_to_gcc_loopnest, can_convert_to_perfect_nest,
perfect_nestify): Likewise.
* lambda.h (gcc_loopnest_to_lambda_loopnest,
lambda_loopnest_to_gcc_loopnest): Adjust prototypes.
* profile.c (instrument_values): Adjust.
* tree-cfg.c (modified_noreturn_calls): Adjust.
(remove_fallthru_edge): Likewise.
* tree-dump.c (dequeue_and_dump): Adjust.
* tree-flow-inline.h (mark_stmt_modified): Adjust.
* tree-flow.h (modified_noreturn_calls): Adjust.
(tree_on_heap): Remove. (yay!)
(register_new_def): Adjust.
* tree-into-ssa.c: Define VEC(int,heap).
(block_defs_stack): Adjust.
(find_idf, insert_phi_nodes, register_new_def,
rewrite_initialize_block, rewrite_finalize_block,
register_new_update_single, rewrite_update_init_block,
rewrite_update_fini_block, rewrite_blocks,
ssa_rewrite_finalize_block, ssa_register_new_def,
ssa_rewrite_initialize_block, rewrite_ssa_into_ssa): Likewise.
* tree-loop-linear.c (linear_transform_loops): Adjust.
* tree-ssa-alias.c: Define VEC(fieldoff_t,heap).
(push_fields_onto_fieldstack, create_overlap_variables_for): Adjust.
* tree-ssa-dom.c (avail_exprs_stack, block_defs_stack,
stmts_to_rescan, const_and_copies_stack, nonzero_vars_stack,
vrp_variables_stack): Adjust declarations.
(tree_ssa_dominator_optimize): Adjust.
(dom_opt_initialize_block, remove_local_expressions_from_table,
restore_nonzero_vars_to_original_value,
restore_vars_to_original_value,
restore_currdefs_to_original_value, dom_opt_finalize_block,
record_var_is_nonzero, record_cond, record_const_or_copy_1,
optimize_stmt, update_rhs_and_lookup_avail_expr,
lookup_avail_expr, record_range): Likewise.
* tree-ssa-pre.c: Define VEC(basic_block,heap).
(compute_antic_aux): Adjust.
(inserted_exprs, create_expression_by_pieces,
insert_into_preds_of_block, eliminate, mark_operand_necessary,
remove_dead_inserted_code, fini_pre): Likewise.
* tree-ssa-propagate.c (interesting_ssa_edges): Adjust.
(varying_ssa_edges, add_ssa_edge, process_ssa_edge_worklist.
ssa_prop_init): Likewise.
* tree-ssa.c: Define VEC(bitmap,heap).
(verify_name_tags): Adjust.
* value-prof.c (rtl_divmod_values_to_profile): Adjust.
(insn_prefetch_values_to_profile, rtl_find_values_to_profile,
tree_divmod_values_to_profile, tree_find_values_to_profile,
value_profile_transformations): Likewise.
* value-prof.h: Define VEC(histogram_value,heap).
* varasm.c: Remove alias_pair pointer typedef, define
VEC(alias_pair,gc).
(finish_aliases_1, finish_aliases_2, assemble_alias): Adjust.
* config/pa/pa.c (typedef extern_symbol): Typedef the structure,
not a pointer to it. Create an object vector.
(extern_symbols): Turn into an object vector.
(pa_hpux_asm_output_external, pa_hpux_file_end): Adjust.
* cp/cp-tree.h: Adjust for new VEC API.
Define VEC(tree_pair_s,gc).
(struct save_scope): Adjust.
(struct lang_type_class): Adjust.
(unemitted_tinfo_decls): Adjust.
* cp/class.c (add_method, resort_type_method_vec,
finish_struct_methods, struct find_final_overrider_data,
dfs_find_final_overrider_pre, find_final_overrider,
get_vcall_index, warn_hidden, walk_subobject_offsets,
check_methods, fixup_inline_methods, end_of_class,
warn_about_ambiguous_bases, finish_struct, build_vtbl_initializer,
add_vcall_offset): Adjust.
* cp/decl.c (xref_basetypes, finish_method): Adjust.
* cp/decl2.c (check_classfn): Adjust.
* cp/init.c (sort_mem_initializers, push_base_cleanups): Adjust.
* cp/method.c (do_build_copy_constructor): Adjust.
* cp/name-lookup.c (new_class_binding, store_binding,
store_bindings, store_class_bindings): Adjust.
* cp/name-lookup.h: Define VEC(cxx_saved_binding,gc),
VEC(cp_class_binding,gc).
(struct cp_binding_level): Adjust.
* cp/parser.c: Define VEC(cp_token_position,heap).
(struct cp_lexer): Adjust.
(cp_lexer_new_main, cp_lexer_new_from_tokens, cp_lexer_destroy,
cp_lexer_save_tokens): Adjust.
* cp/pt.c (retrieve_specialization,
check_explicit_specialization): Adjust.
* cp/rtti.c (unemitted_tinfo_decls): Adjust.
(init_rtti_processing, get_tinfo_decl, get_pseudo_ti_init,
get_pseudo_ti_desc): Adjust.
* cp/search.c (dfs_access_in_type, lookup_conversion_operator,
lookup_fnfields_1, dfs_walk_once, dfs_walk_once_accessible,
dfs_get_pure_virtuals, lookup_conversions_r, binfo_for_vbase): Adjust.
* cp/semantics.c: Define VEC(deferred_access,gc).
(push_deferring_access_checks): Adjust.
* cp/typeck2.c (abstract_virtuals_error): Adjust.
From-SVN: r98498
2005-04-21 11:18:28 +02:00
|
|
|
|
VEC(tree,gc) *methods = CLASSTYPE_METHOD_VEC (ctype);
|
2003-01-15 02:21:46 +01:00
|
|
|
|
tree fndecls, fndecl = 0;
|
2002-12-24 23:12:17 +01:00
|
|
|
|
bool is_conv_op;
|
|
|
|
|
const char *format = NULL;
|
2005-06-14 22:01:59 +02:00
|
|
|
|
|
2004-07-16 03:15:43 +02:00
|
|
|
|
for (fndecls = VEC_index (tree, methods, ix);
|
2002-12-24 23:12:17 +01:00
|
|
|
|
fndecls; fndecls = OVL_NEXT (fndecls))
|
|
|
|
|
{
|
|
|
|
|
tree p1, p2;
|
2005-06-14 22:01:59 +02:00
|
|
|
|
|
2002-12-24 23:12:17 +01:00
|
|
|
|
fndecl = OVL_CURRENT (fndecls);
|
|
|
|
|
p1 = TYPE_ARG_TYPES (TREE_TYPE (function));
|
|
|
|
|
p2 = TYPE_ARG_TYPES (TREE_TYPE (fndecl));
|
|
|
|
|
|
|
|
|
|
/* We cannot simply call decls_match because this doesn't
|
|
|
|
|
work for static member functions that are pretending to
|
|
|
|
|
be methods, and because the name may have been changed by
|
2005-06-14 22:01:59 +02:00
|
|
|
|
asm("new_name"). */
|
|
|
|
|
|
2002-12-24 23:12:17 +01:00
|
|
|
|
/* Get rid of the this parameter on functions that become
|
|
|
|
|
static. */
|
|
|
|
|
if (DECL_STATIC_FUNCTION_P (fndecl)
|
|
|
|
|
&& TREE_CODE (TREE_TYPE (function)) == METHOD_TYPE)
|
|
|
|
|
p1 = TREE_CHAIN (p1);
|
2003-03-11 11:33:28 +01:00
|
|
|
|
|
|
|
|
|
/* A member template definition only matches a member template
|
|
|
|
|
declaration. */
|
|
|
|
|
if (is_template != (TREE_CODE (fndecl) == TEMPLATE_DECL))
|
|
|
|
|
continue;
|
2005-06-14 22:01:59 +02:00
|
|
|
|
|
2002-12-24 23:12:17 +01:00
|
|
|
|
if (same_type_p (TREE_TYPE (TREE_TYPE (function)),
|
|
|
|
|
TREE_TYPE (TREE_TYPE (fndecl)))
|
|
|
|
|
&& compparms (p1, p2)
|
2004-05-03 12:11:19 +02:00
|
|
|
|
&& (!is_template
|
2005-06-14 22:01:59 +02:00
|
|
|
|
|| comp_template_parms (template_parms,
|
2004-05-03 12:11:19 +02:00
|
|
|
|
DECL_TEMPLATE_PARMS (fndecl)))
|
2002-12-24 23:12:17 +01:00
|
|
|
|
&& (DECL_TEMPLATE_SPECIALIZATION (function)
|
|
|
|
|
== DECL_TEMPLATE_SPECIALIZATION (fndecl))
|
|
|
|
|
&& (!DECL_TEMPLATE_SPECIALIZATION (function)
|
2005-06-14 22:01:59 +02:00
|
|
|
|
|| (DECL_TI_TEMPLATE (function)
|
2002-12-24 23:12:17 +01:00
|
|
|
|
== DECL_TI_TEMPLATE (fndecl))))
|
c-common.c (builtin_define_float_constants): Define __<TYPE>_HAS_INFINITY__ and __<TYPE>_HAS_QUIET_NAN__.
* c-common.c (builtin_define_float_constants): Define
__<TYPE>_HAS_INFINITY__ and __<TYPE>_HAS_QUIET_NAN__.
* call.c (build_field_call): Use build_new_op, not build_opfncall.
(prep_operand): New function.
(build_new_op): Use it. Remove dead code.
* class.c (pushclass): Change "modify" parameter type from int to
bool.
(currently_open_class): Use same_type_p, not pointer equality.
(push_nested_class): Adjust calls to pushclass, remove modify
parameter.
* cp-tree.h (INTEGRAL_OR_ENUMERATION_TYPE_P): New macro.
(pushclass): Change prototype.
(push_nested_class): Likewise.
(grokoptypename): Remove.
(build_opfncall): Remove.
(value_dependent_expression_p): Declare.
(resolve_typename_type): Likewise.
(resolve_typename_type_in_current_instantiation): Likewise.
(enter_scope_of): Remove.
(tsubst): Remove.
(tsubst_expr): Likewise.
(tsubst_copy): Likewise.
(tsubst_copy_and_build): Likewise.
* decl.c (warn_about_implicit_typename_lookup): Remove.
(finish_case_label): Return error_mark_node for erroneous labels.
(start_decl): Adjust calls to push_nested_class.
(grokfndecl): Call push_scope/pop_scope around call to
duplicate_decls.
(grokdeclarator): Do not call tsubst.
(start_function): Adjust calls to push_nested_class.
* decl2.c (grok_array_decl): Use build_new_op, not build_opfncall.
(check_classfn): Use push_scope/pop_scope around type comparisions.
(grokoptypename): Remove.
(push_sscope): Adjust call to push_nested_class.
* error.c (dump_type): Show cv-qualification of typename types.
* init.c (build_member_call): Use build_new_op, not
build_opfncall.
* method.c (build_opfncall): Remove.
* parser.c (cp_parser): Add allow_non_constant_expression_p and
non_constant_expression_p.
(cp_parser_constant_expression): Adjust prototype.
(cp_parser_resolve_typename_type): Remove.
(cp_parser_non_constant_expression): New function.
(cp_parser_non_constant_id_expression): Likewise.
(cp_parser_new): Set allow_non_constant_expression_p and
non_constant_expression_p.
(cp_parser_primary_expression): Reject `this' and `va_arg' in
constant-expressions. Note that dependent names aren't really
constant.
(cp_parser_postfix_expression): Reject conversions to non-integral
types in constant-expressions. Neither are increments or
decrements.
(cp_parser_unary_expression): Reject increments and decrements in
constant-expressions.
(cp_parser_direct_new_declarator): Adjust call to
cp_parser_constant_expression.
(cp_parser_cast_expression): Reject conversions to non-integral
types in constant-expressions.
(cp_parser_assignment_expression): Rejects assignments in
constant-expressions.
(cp_parser_expression): Reject commas in constant-expressions.
(cp_parser_labeled_statement): Adjust call to
cp_parser_constant_expression.
(cp_parser_direct_declarator): Simplify array bounds, even in
templates, when they are non-dependent. Use
resolve_typename_type, not cp_parser_resolve_typename_type.
(cp_parser_class_head): Use resolve_typename_type, not
cp_parser_resolve_typename_type.
(cp_parser_member_declaration): Adjust call to
cp_parser_constant_expression.
(cp_parser_constant_initializer): Likewise.
(cp_parser_constructor_declarator): Use resolve_typename_type, not
cp_parser_resolve_typename_type.
(cp_parser_late_parsing_default_args): Adjust call to
push_nested_class.
* pt.c (tsubst): Give it internal linkage.
(tsubst_expr): Likewise.
(tsubst_copy): Likewise.
(tsubst_copy_and_build): Likewise.
(push_access_scope_real): Likewise.
(tsubst_friend_class): Likewise.
(instantiate_class_template): Adjust call to pushclass.
(value_dependent_expression_p): Give it external linkage.
Robustify.
(resolve_typename_type): New function.
* semantics.c (finish_call_expr): Use build_new_op, not
build_opfncall.
(begin_constructor_declarator): Remove.
(begin_class_definition): Adjust call to pushclass.
(enter_scope_of): Remove.
* typeck.c (comptypes): Resolve typename types as appropriate.
(build_x_indirect_ref): Use build_new_op, not build_opfncall.
(build_x_compound_expr): Likewise.
(build_modify_expr): Likewise.
(build_x_modify_expr): Likewise.
* typeck2.c (build_x_arrow): Likewise.
* g++.dg/parser/constant1.C: New test.
* include/std/std_limits.h (numeric_limits<float>::has_infinity):
Use __FLT_HAS_INIFINITY__ to initialize.
(numeric_limits<float>::has_quiet_NaN): Likewise.
(numeric_limits<double>::has_infinity): Use __DBL_HAS_INIFINITY__
to initialize.
(numeric_limits<double>::has_quiet_NaN): Likewise.
(numeric_limits<long double>::has_infinity): Use
__LDBL_HAS_INIFINITY__ to initialize.
(numeric_limits<long_double>::has_quiet_NaN): Likewise.
From-SVN: r62130
2003-01-30 08:24:02 +01:00
|
|
|
|
break;
|
2002-12-24 23:12:17 +01:00
|
|
|
|
}
|
c-common.c (builtin_define_float_constants): Define __<TYPE>_HAS_INFINITY__ and __<TYPE>_HAS_QUIET_NAN__.
* c-common.c (builtin_define_float_constants): Define
__<TYPE>_HAS_INFINITY__ and __<TYPE>_HAS_QUIET_NAN__.
* call.c (build_field_call): Use build_new_op, not build_opfncall.
(prep_operand): New function.
(build_new_op): Use it. Remove dead code.
* class.c (pushclass): Change "modify" parameter type from int to
bool.
(currently_open_class): Use same_type_p, not pointer equality.
(push_nested_class): Adjust calls to pushclass, remove modify
parameter.
* cp-tree.h (INTEGRAL_OR_ENUMERATION_TYPE_P): New macro.
(pushclass): Change prototype.
(push_nested_class): Likewise.
(grokoptypename): Remove.
(build_opfncall): Remove.
(value_dependent_expression_p): Declare.
(resolve_typename_type): Likewise.
(resolve_typename_type_in_current_instantiation): Likewise.
(enter_scope_of): Remove.
(tsubst): Remove.
(tsubst_expr): Likewise.
(tsubst_copy): Likewise.
(tsubst_copy_and_build): Likewise.
* decl.c (warn_about_implicit_typename_lookup): Remove.
(finish_case_label): Return error_mark_node for erroneous labels.
(start_decl): Adjust calls to push_nested_class.
(grokfndecl): Call push_scope/pop_scope around call to
duplicate_decls.
(grokdeclarator): Do not call tsubst.
(start_function): Adjust calls to push_nested_class.
* decl2.c (grok_array_decl): Use build_new_op, not build_opfncall.
(check_classfn): Use push_scope/pop_scope around type comparisions.
(grokoptypename): Remove.
(push_sscope): Adjust call to push_nested_class.
* error.c (dump_type): Show cv-qualification of typename types.
* init.c (build_member_call): Use build_new_op, not
build_opfncall.
* method.c (build_opfncall): Remove.
* parser.c (cp_parser): Add allow_non_constant_expression_p and
non_constant_expression_p.
(cp_parser_constant_expression): Adjust prototype.
(cp_parser_resolve_typename_type): Remove.
(cp_parser_non_constant_expression): New function.
(cp_parser_non_constant_id_expression): Likewise.
(cp_parser_new): Set allow_non_constant_expression_p and
non_constant_expression_p.
(cp_parser_primary_expression): Reject `this' and `va_arg' in
constant-expressions. Note that dependent names aren't really
constant.
(cp_parser_postfix_expression): Reject conversions to non-integral
types in constant-expressions. Neither are increments or
decrements.
(cp_parser_unary_expression): Reject increments and decrements in
constant-expressions.
(cp_parser_direct_new_declarator): Adjust call to
cp_parser_constant_expression.
(cp_parser_cast_expression): Reject conversions to non-integral
types in constant-expressions.
(cp_parser_assignment_expression): Rejects assignments in
constant-expressions.
(cp_parser_expression): Reject commas in constant-expressions.
(cp_parser_labeled_statement): Adjust call to
cp_parser_constant_expression.
(cp_parser_direct_declarator): Simplify array bounds, even in
templates, when they are non-dependent. Use
resolve_typename_type, not cp_parser_resolve_typename_type.
(cp_parser_class_head): Use resolve_typename_type, not
cp_parser_resolve_typename_type.
(cp_parser_member_declaration): Adjust call to
cp_parser_constant_expression.
(cp_parser_constant_initializer): Likewise.
(cp_parser_constructor_declarator): Use resolve_typename_type, not
cp_parser_resolve_typename_type.
(cp_parser_late_parsing_default_args): Adjust call to
push_nested_class.
* pt.c (tsubst): Give it internal linkage.
(tsubst_expr): Likewise.
(tsubst_copy): Likewise.
(tsubst_copy_and_build): Likewise.
(push_access_scope_real): Likewise.
(tsubst_friend_class): Likewise.
(instantiate_class_template): Adjust call to pushclass.
(value_dependent_expression_p): Give it external linkage.
Robustify.
(resolve_typename_type): New function.
* semantics.c (finish_call_expr): Use build_new_op, not
build_opfncall.
(begin_constructor_declarator): Remove.
(begin_class_definition): Adjust call to pushclass.
(enter_scope_of): Remove.
* typeck.c (comptypes): Resolve typename types as appropriate.
(build_x_indirect_ref): Use build_new_op, not build_opfncall.
(build_x_compound_expr): Likewise.
(build_modify_expr): Likewise.
(build_x_modify_expr): Likewise.
* typeck2.c (build_x_arrow): Likewise.
* g++.dg/parser/constant1.C: New test.
* include/std/std_limits.h (numeric_limits<float>::has_infinity):
Use __FLT_HAS_INIFINITY__ to initialize.
(numeric_limits<float>::has_quiet_NaN): Likewise.
(numeric_limits<double>::has_infinity): Use __DBL_HAS_INIFINITY__
to initialize.
(numeric_limits<double>::has_quiet_NaN): Likewise.
(numeric_limits<long double>::has_infinity): Use
__LDBL_HAS_INIFINITY__ to initialize.
(numeric_limits<long_double>::has_quiet_NaN): Likewise.
From-SVN: r62130
2003-01-30 08:24:02 +01:00
|
|
|
|
if (fndecls)
|
2006-08-25 18:56:07 +02:00
|
|
|
|
{
|
|
|
|
|
if (pushed_scope)
|
|
|
|
|
pop_scope (pushed_scope);
|
|
|
|
|
return OVL_CURRENT (fndecls);
|
|
|
|
|
}
|
|
|
|
|
|
2008-09-16 00:24:18 +02:00
|
|
|
|
error_at (DECL_SOURCE_LOCATION (function),
|
|
|
|
|
"prototype for %q#D does not match any in class %qT",
|
|
|
|
|
function, ctype);
|
2002-12-24 23:12:17 +01:00
|
|
|
|
is_conv_op = DECL_CONV_FN_P (fndecl);
|
|
|
|
|
|
|
|
|
|
if (is_conv_op)
|
|
|
|
|
ix = CLASSTYPE_FIRST_CONVERSION_SLOT;
|
2004-07-16 03:15:43 +02:00
|
|
|
|
fndecls = VEC_index (tree, methods, ix);
|
2002-12-24 23:12:17 +01:00
|
|
|
|
while (fndecls)
|
1994-02-24 02:02:37 +01:00
|
|
|
|
{
|
2002-12-24 23:12:17 +01:00
|
|
|
|
fndecl = OVL_CURRENT (fndecls);
|
|
|
|
|
fndecls = OVL_NEXT (fndecls);
|
|
|
|
|
|
|
|
|
|
if (!fndecls && is_conv_op)
|
1994-02-24 02:02:37 +01:00
|
|
|
|
{
|
2004-07-17 09:31:08 +02:00
|
|
|
|
if (VEC_length (tree, methods) > (size_t) ++ix)
|
1994-02-24 02:02:37 +01:00
|
|
|
|
{
|
2004-07-16 03:15:43 +02:00
|
|
|
|
fndecls = VEC_index (tree, methods, ix);
|
2002-12-24 23:12:17 +01:00
|
|
|
|
if (!DECL_CONV_FN_P (OVL_CURRENT (fndecls)))
|
1994-12-30 22:03:40 +01:00
|
|
|
|
{
|
2002-12-24 23:12:17 +01:00
|
|
|
|
fndecls = NULL_TREE;
|
|
|
|
|
is_conv_op = false;
|
1994-12-30 22:03:40 +01:00
|
|
|
|
}
|
1994-02-24 02:02:37 +01:00
|
|
|
|
}
|
2002-12-24 23:12:17 +01:00
|
|
|
|
else
|
|
|
|
|
is_conv_op = false;
|
1994-02-24 02:02:37 +01:00
|
|
|
|
}
|
2002-12-24 23:12:17 +01:00
|
|
|
|
if (format)
|
toplev.c (default_tree_printer): Handle setting location with '+' flag.
2005-07-02 Zack Weinberg <zack@codesourcery.com>
Joseph S. Myers <joseph@codesourcery.com>
* toplev.c (default_tree_printer): Handle setting location with
'+' flag.
* c-objc.common.c (c_tree_printer): Likewise.
* c-format.c (gcc_diag_flag_specs): Add '+'.
(gcc_cdiag_char_table): Allow '+' flag for tree formats.
(format_types_orig): Allow '+' flag for gcc_diag and gcc_cdiag
formats.
* c-common.c, c-decl.c, c-objc-common.c, c-pragma.c,
config/arm/pe.c, config/i386/winnt.c, config/ia64/ia64.c,
config/mcore/mcore.c, config/sh/symbian.c, config/sol2.c,
config/v850/v850.c, function.c, stor-layout.c, toplev.c,
tree-inline.c, tree-optimize.c, tree.c, varasm.c: Use '+' flag
instead of %J or %H. Use 'q' flag for quoting. Avoid '.' at end
of diagnostics. Use %q+D not %s for a decl. Do not pass excess
format arguments where %J is used without %D.
cp:
* error.c (location_of): Add comment.
(locate_error, cp_error_at, cp_warning_at, cp_pedwarn_at): Remove.
* cp-tree.h (cp_error_at, cp_warning_at, cp_pedwarn_at): Remove.
* call.c, class.c, decl.c, decl2.c, friend.c, init.c,
name-lookup.c, parser.c, pt.c, search.c, semantics.c, typeck.c,
typeck2.c: Use '+' flag instead of %J, cp_error_at, cp_warning_at
or cp_pedwarn_at. Mark up some diagnostic strings with N_.
java:
* class.c, decl.c, expr.c: Use '+' flag instead of %J. Use 'q'
flag for quoting.
objc:
* objc-act.c: Use '+' flag instead of %J. Use 'q' flag for
quoting.
testsuite:
* gcc.dg/format/gcc_diag-1.c: Update.
From-SVN: r101532
2005-07-02 12:55:32 +02:00
|
|
|
|
format = " %+#D";
|
2002-12-24 23:12:17 +01:00
|
|
|
|
else if (fndecls)
|
toplev.c (default_tree_printer): Handle setting location with '+' flag.
2005-07-02 Zack Weinberg <zack@codesourcery.com>
Joseph S. Myers <joseph@codesourcery.com>
* toplev.c (default_tree_printer): Handle setting location with
'+' flag.
* c-objc.common.c (c_tree_printer): Likewise.
* c-format.c (gcc_diag_flag_specs): Add '+'.
(gcc_cdiag_char_table): Allow '+' flag for tree formats.
(format_types_orig): Allow '+' flag for gcc_diag and gcc_cdiag
formats.
* c-common.c, c-decl.c, c-objc-common.c, c-pragma.c,
config/arm/pe.c, config/i386/winnt.c, config/ia64/ia64.c,
config/mcore/mcore.c, config/sh/symbian.c, config/sol2.c,
config/v850/v850.c, function.c, stor-layout.c, toplev.c,
tree-inline.c, tree-optimize.c, tree.c, varasm.c: Use '+' flag
instead of %J or %H. Use 'q' flag for quoting. Avoid '.' at end
of diagnostics. Use %q+D not %s for a decl. Do not pass excess
format arguments where %J is used without %D.
cp:
* error.c (location_of): Add comment.
(locate_error, cp_error_at, cp_warning_at, cp_pedwarn_at): Remove.
* cp-tree.h (cp_error_at, cp_warning_at, cp_pedwarn_at): Remove.
* call.c, class.c, decl.c, decl2.c, friend.c, init.c,
name-lookup.c, parser.c, pt.c, search.c, semantics.c, typeck.c,
typeck2.c: Use '+' flag instead of %J, cp_error_at, cp_warning_at
or cp_pedwarn_at. Mark up some diagnostic strings with N_.
java:
* class.c, decl.c, expr.c: Use '+' flag instead of %J. Use 'q'
flag for quoting.
objc:
* objc-act.c: Use '+' flag instead of %J. Use 'q' flag for
quoting.
testsuite:
* gcc.dg/format/gcc_diag-1.c: Update.
From-SVN: r101532
2005-07-02 12:55:32 +02:00
|
|
|
|
format = N_("candidates are: %+#D");
|
2002-12-24 23:12:17 +01:00
|
|
|
|
else
|
toplev.c (default_tree_printer): Handle setting location with '+' flag.
2005-07-02 Zack Weinberg <zack@codesourcery.com>
Joseph S. Myers <joseph@codesourcery.com>
* toplev.c (default_tree_printer): Handle setting location with
'+' flag.
* c-objc.common.c (c_tree_printer): Likewise.
* c-format.c (gcc_diag_flag_specs): Add '+'.
(gcc_cdiag_char_table): Allow '+' flag for tree formats.
(format_types_orig): Allow '+' flag for gcc_diag and gcc_cdiag
formats.
* c-common.c, c-decl.c, c-objc-common.c, c-pragma.c,
config/arm/pe.c, config/i386/winnt.c, config/ia64/ia64.c,
config/mcore/mcore.c, config/sh/symbian.c, config/sol2.c,
config/v850/v850.c, function.c, stor-layout.c, toplev.c,
tree-inline.c, tree-optimize.c, tree.c, varasm.c: Use '+' flag
instead of %J or %H. Use 'q' flag for quoting. Avoid '.' at end
of diagnostics. Use %q+D not %s for a decl. Do not pass excess
format arguments where %J is used without %D.
cp:
* error.c (location_of): Add comment.
(locate_error, cp_error_at, cp_warning_at, cp_pedwarn_at): Remove.
* cp-tree.h (cp_error_at, cp_warning_at, cp_pedwarn_at): Remove.
* call.c, class.c, decl.c, decl2.c, friend.c, init.c,
name-lookup.c, parser.c, pt.c, search.c, semantics.c, typeck.c,
typeck2.c: Use '+' flag instead of %J, cp_error_at, cp_warning_at
or cp_pedwarn_at. Mark up some diagnostic strings with N_.
java:
* class.c, decl.c, expr.c: Use '+' flag instead of %J. Use 'q'
flag for quoting.
objc:
* objc-act.c: Use '+' flag instead of %J. Use 'q' flag for
quoting.
testsuite:
* gcc.dg/format/gcc_diag-1.c: Update.
From-SVN: r101532
2005-07-02 12:55:32 +02:00
|
|
|
|
format = N_("candidate is: %+#D");
|
|
|
|
|
error (format, fndecl);
|
1994-02-24 02:02:37 +01:00
|
|
|
|
}
|
|
|
|
|
}
|
2002-12-24 23:12:17 +01:00
|
|
|
|
else if (!COMPLETE_TYPE_P (ctype))
|
|
|
|
|
cxx_incomplete_type_error (function, ctype);
|
1994-02-24 02:02:37 +01:00
|
|
|
|
else
|
2006-08-01 18:45:14 +02:00
|
|
|
|
error ("no %q#D member function declared in class %qT",
|
|
|
|
|
function, ctype);
|
1994-02-24 02:02:37 +01:00
|
|
|
|
|
2006-08-25 18:56:07 +02:00
|
|
|
|
if (pushed_scope)
|
|
|
|
|
pop_scope (pushed_scope);
|
2007-08-15 00:07:31 +02:00
|
|
|
|
return error_mark_node;
|
1994-02-24 02:02:37 +01:00
|
|
|
|
}
|
|
|
|
|
|
2004-07-29 19:59:31 +02:00
|
|
|
|
/* DECL is a function with vague linkage. Remember it so that at the
|
|
|
|
|
end of the translation unit we can decide whether or not to emit
|
|
|
|
|
it. */
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
|
note_vague_linkage_fn (tree decl)
|
|
|
|
|
{
|
2009-08-24 23:32:24 +02:00
|
|
|
|
DECL_DEFER_OUTPUT (decl) = 1;
|
|
|
|
|
VEC_safe_push (tree, gc, deferred_fns, decl);
|
2004-07-29 19:59:31 +02:00
|
|
|
|
}
|
|
|
|
|
|
1999-04-19 14:23:55 +02:00
|
|
|
|
/* We have just processed the DECL, which is a static data member.
|
2006-02-18 09:36:11 +01:00
|
|
|
|
The other parameters are as for cp_finish_decl. */
|
1999-04-19 14:23:55 +02:00
|
|
|
|
|
|
|
|
|
void
|
2006-06-06 13:44:09 +02:00
|
|
|
|
finish_static_data_member_decl (tree decl,
|
2006-02-18 09:36:11 +01:00
|
|
|
|
tree init, bool init_const_expr_p,
|
|
|
|
|
tree asmspec_tree,
|
2005-06-15 02:41:35 +02:00
|
|
|
|
int flags)
|
1999-04-19 14:23:55 +02:00
|
|
|
|
{
|
2000-06-04 23:12:27 +02:00
|
|
|
|
DECL_CONTEXT (decl) = current_class_type;
|
|
|
|
|
|
1999-04-19 14:23:55 +02:00
|
|
|
|
/* We cannot call pushdecl here, because that would fill in the
|
2001-03-22 01:55:13 +01:00
|
|
|
|
TREE_CHAIN of our decl. Instead, we modify cp_finish_decl to do
|
1999-04-19 14:23:55 +02:00
|
|
|
|
the right thing, namely, to put this decl out straight away. */
|
Compute DECL_ASSEMBLER_NAME lazily.
* tree.h (DECL_ASSEMBLER_NAME): Compute it lazily.
(DECL_ASSEMBLER_NAME_SET_P): New macro.
(SET_DECL_ASSEMBLER_NAME): Likewise.
(COPY_DECL_ASSEMBLER_NAME): Likewise.
(set_decl_assembler_name): Declare.
(lang_set_decl_assembler_name): Likewise.
* tree.c (lang_set_decl_assembler_name): New variab.e
(set_decl_assembler_name): New function.
(init_obstacks): Set lang_set_decl_assembler_name.
(build_decl): Don't set DECL_ASSEMBLER_NAME.
* c-decl.c (duplicate_decls): Use SET_DECL_ASSEMBLER_NAME,
COPY_DECL_ASSEMBLER_NAME, etc. Don't set DECL_ASSEMBLER_NAME
where it's not necessary.
(builtin_function): Likewise.
(finish_decl): Likewise.
* dbxout.c (dbxout_type_methods): Likewise.
* ggc-common.c (ggc_mark_trees): Likewise.
* profile.c (output_func_start_profiler): Likewise.
* varasm.c (make_decl_rtl): Likewise.
* class.c (get_vtable_decl): Use SET_DECL_ASSEMBLER_NAME,
COPY_DECL_ASSEMBLER_NAME, etc. Don't set DECL_ASSEMBLER_NAME
where it's not necessary.
(add_method): Remove optimization involving comparison of
DECL_ASSEMBLER_NAME.
(build_vtbl_or_vbase_field): Use SET_DECL_ASSEMBLER_NAME,
COPY_DECL_ASSEMBLER_NAME, etc. Don't set DECL_ASSEMBLER_NAME
where it's not necessary.
(check_methods): Likewise.
(build_clone): Likewise.
(built_vtt): Likewise.
* cp-tree.h (DECL_NEEDED_P): Likewise.
* decl.c (pushtag): Likewise.
(duplicate_decls): Likewise.
(pushdecl): Likewise.
(builtin_function): Likewise.
(build_library_fn_1): Set DECL_LANGUAGE for library functions.
(build_cp_library_fn): Likewise.
(maybe_commonize_var): Use SET_DECL_ASSEMBLER_NAME,
COPY_DECL_ASSEMBLER_NAME, etc. Don't set DECL_ASSEMBLER_NAME
where it's not necessary.
(make_rtl_for_nonlocal_decl): Likewise.
(cp_finish_decl): Likewise.
(grokfndecl): Likewise.
(grokvardecl): Likewise.
(grokdeclarator): Likewise.
(start_function): Likewise.
(cp_missing_return_ok_p): Likewise.
* decl2.c (grokclassfn): Likewise.
(check_classfn): Likewise.
(finish_static_data_member_decl): Likewise.
(grokfield): Likewise.
* error.c (GLOBAL_IORD_P): Remove.
(dump_global_iord): Improve output.
(dump_decl): Avoid using DECL_ASSEMBLER_NAME.
* except.c (nothrow_libfn_p): Summarily reject any function not in
namespace-scope.
* init.c (build_java_class_ref): Don't explicitly set
DECL_ASSEMBLER_NAME after calling mangle_decl.
* mangle.c (mangle_decl_string): Handle extern "C" functions.
(mangle_decl): Set the DECL_ASSEMBLER_NAME for the decl.
* method.c (set_mangled_name_for_decl): Don't explicitly set
DECL_ASSEMBLER_NAME after calling mangle_decl.
(make_thunk): Explicitly set the DECL_ASSEMBLER_NAME and
IDENTIFIER_GLOBAL_VALUE for the thunk.
* pt.c (set_mangled_name_for_template_decl): Remove.
(check_explicit_specialization): Don't use it.
(looup_template_class): Don't set DECL_ASSEMBLER_NAME.
(tsubst_friend_function): Likewise.
(tsubst_decl): Likewise.
(regenerate_decl_from_template): Use COPY_DECL_ASSEMBLER_NAME.
* rtti.c (get_tinfo_decl): Use SET_DECL_ASSEMBLER_NAME,
COPY_DECL_ASSEMBLER_NAME, etc. Don't set DECL_ASSEMBLER_NAME
where it's not necessary.
(tinfo_base_init): Likewise.
(create_real_tinfo_var): Likewise.
* search.c (looup_field_1): Likewise.
* semantics.c (finish_named_return_value): Likewise.
* tree.c (init_tree): Set lang_set_decl_assembler_name.
* com.c (builtin_function): Use SET_DECL_ASSEMBLER_NAME.
* class.c (build_class_ref): Use SET_DECL_ASSEMBLER_NAME.
(layout_class): Likewise.
(layout_class_method): Likewise.
(emit_register_classes): Likewise.
* decl.c (builtin_function): Likewise.
(give_name_to_locals): Likewise.
From-SVN: r40642
2001-03-20 00:50:04 +01:00
|
|
|
|
|
2006-07-16 22:17:20 +02:00
|
|
|
|
if (! processing_template_decl)
|
|
|
|
|
VEC_safe_push (tree, gc, pending_statics, decl);
|
1999-04-23 01:13:12 +02:00
|
|
|
|
|
2002-02-01 16:50:01 +01:00
|
|
|
|
if (LOCAL_CLASS_P (current_class_type))
|
2008-08-18 13:17:52 +02:00
|
|
|
|
permerror (input_location, "local class %q#T shall not have static data member %q#D",
|
typeck.c (composite_pointer_type_r, [...]): Change pedwarn to permerror.
* typeck.c (composite_pointer_type_r, cxx_sizeof_expr,
cxx_alignof_expr, check_template_keyword, cp_build_binary_op,
pointer_diff, cp_build_unary_op, build_x_compound_expr_from_list,
build_reinterpret_cast_1, cp_build_c_cast, check_return_expr): Change
pedwarn to permerror.
* init.c (perform_member_init, build_new_1, build_new): Likewise.
* decl.c (warn_extern_redeclared_static, duplicate_decls,
* identify_goto, check_previous_goto_1, check_goto, define_label,
check_tag_decl, start_decl, check_class_member_definition_namespace,
grokfndecl, grokdeclarator): Likewise.
* except.c (check_handlers): Likewise.
* typeck2.c (digest_init): Likewise.
* pt.c (check_specialization_namespace,
check_explicit_instantiation_namespace,
maybe_process_partial_specialization, check_explicit_specialization,
convert_template_argument, do_decl_instantiation,
do_type_instantiation, instantiate_decl): Likewise.
* semantics.c (finish_template_type_parm): Likewise.
* name-lookup.c (pushdecl_maybe_friend,
check_for_out_of_scope_variable): Likewise.
* decl2.c (finish_static_data_member_decl, build_anon_union_vars,
coerce_new_type): Likewise.
* parser.c (cp_parser_nested_name_specifier_opt,
cp_parser_mem_initializer, cp_parser_elaborated_type_specifier,
cp_parser_class_head, cp_parser_check_class_key): Likewise.
(cp_parser_parameter_declaration): Check flag_permissive instead of
flag_pedantic_errors.
* call.c (joust): Change pedwarn to warning.
* friend.c (make_friend_class): Likewise.
From-SVN: r136999
2008-06-21 12:36:27 +02:00
|
|
|
|
current_class_type, decl);
|
2002-02-01 16:50:01 +01:00
|
|
|
|
|
1999-04-19 14:23:55 +02:00
|
|
|
|
DECL_IN_AGGR_P (decl) = 1;
|
|
|
|
|
|
2010-04-07 17:55:20 +02:00
|
|
|
|
if (TREE_CODE (TREE_TYPE (decl)) == ARRAY_TYPE
|
|
|
|
|
&& TYPE_DOMAIN (TREE_TYPE (decl)) == NULL_TREE)
|
|
|
|
|
SET_VAR_HAD_UNKNOWN_BOUND (decl);
|
|
|
|
|
|
2006-02-18 09:36:11 +01:00
|
|
|
|
cp_finish_decl (decl, init, init_const_expr_p, asmspec_tree, flags);
|
1999-04-19 14:23:55 +02:00
|
|
|
|
}
|
|
|
|
|
|
2006-04-08 16:15:44 +02:00
|
|
|
|
/* DECLARATOR and DECLSPECS correspond to a class member. The other
|
2006-02-18 09:36:11 +01:00
|
|
|
|
parameters are as for cp_finish_decl. Return the DECL for the
|
2006-06-06 13:44:09 +02:00
|
|
|
|
class member declared. */
|
1994-02-24 02:02:37 +01:00
|
|
|
|
|
|
|
|
|
tree
|
2005-06-14 22:01:59 +02:00
|
|
|
|
grokfield (const cp_declarator *declarator,
|
|
|
|
|
cp_decl_specifier_seq *declspecs,
|
2006-02-18 09:36:11 +01:00
|
|
|
|
tree init, bool init_const_expr_p,
|
|
|
|
|
tree asmspec_tree,
|
2005-06-15 02:41:35 +02:00
|
|
|
|
tree attrlist)
|
1994-02-24 02:02:37 +01:00
|
|
|
|
{
|
c-common.c (decl_attributes): Take a pointer to the node to which attributes are to be attached...
* c-common.c (decl_attributes): Take a pointer to the node to
which attributes are to be attached, and a flags argument.
* c-common.h (enum attribute_flags): New.
(decl_attributes): Update prototype.
* c-decl.c (start_decl, push_parm_decl, finish_struct,
finish_enum, start_function): Update calls to decl_attributes.
* c-parse.in (component_declarator, component_notype_declarator,
label): Update calls to decl_attributes.
cp:
* decl2.c (cplus_decl_attributes): Take a pointer to the node to
which attributes are to be attached, and a flags argument. Update
call to decl_attributes.
(grokfield): Update call to decl_attributes.
* class.c (finish_struct): Update call to cplus_decl_attributes.
* cp-tree.h (cplus_decl_attributes): Update prototype.
* decl.c (start_decl, grokdeclarator, start_function): Update
calls to decl_attributes and cplus_decl_attributes.
* friend.c (do_friend): Update call to cplus_decl_attributes.
* parse.y (parse_bitfield): Update call to cplus_decl_attributes.
From-SVN: r43995
2001-07-13 22:40:43 +02:00
|
|
|
|
tree value;
|
class.c (count_fields, [...]): Add static prototype.
* class.c (count_fields, add_fields_to_vec): Add static prototype.
* cp-tree.h (opname_tab, assignop_tab, operator_name_string,
get_id_2, composite_pointer_type, dump_node_to_file): Constify a
char*.
* decl.c (named_label_list, cp_finish_decl, grokdeclarator):
Constify a char*.
* decl2.c (finish_static_data_member_decl, grokfield): Constify a
char*.
* dump.c (queue_and_dump_index, dump_int, dump_string,
dump_string_field, dequeue_and_dump, dump_node_to_file): Constify
a char*.
(dump_stmt): Add static prototype.
* errfn.c (cp_thing): Constify a char*.
* error.c (dump_unary_op, dump_binary_op, aggr_variety,
dump_aggr_type, dump_global_iord, dump_decl, dump_function_name,
dump_expr): Constify a char*.
* lex.c (extend_token_buffer_to, pragma_getc, pragma_ungetc,
read_line_number): Add static prototype.
(opname_tab, assignop_tab, operator_name_string): Constify a char*.
(real_yylex): Move label `letter' into the scope where it is used.
* method.c (build_mangled_template_parm_index, build_overload_int,
build_decl_overload_real, get_id_2): Constify a char*.
* search.c (check_final_overrider): Make static.
* typeck.c (composite_pointer_type): Constify a char*.
From-SVN: r28588
1999-08-08 00:28:52 +02:00
|
|
|
|
const char *asmspec = 0;
|
1994-12-16 03:07:31 +01:00
|
|
|
|
int flags = LOOKUP_ONLYCONVERTING;
|
2009-09-10 01:33:38 +02:00
|
|
|
|
tree name;
|
1994-02-24 02:02:37 +01:00
|
|
|
|
|
|
|
|
|
if (init
|
|
|
|
|
&& TREE_CODE (init) == TREE_LIST
|
|
|
|
|
&& TREE_VALUE (init) == error_mark_node
|
|
|
|
|
&& TREE_CHAIN (init) == NULL_TREE)
|
1996-02-20 21:35:10 +01:00
|
|
|
|
init = NULL_TREE;
|
1994-02-24 02:02:37 +01:00
|
|
|
|
|
Table-driven attributes.
* c-decl.c, config/alpha/alpha.c, config/arc/arc.c,
config/arm/arm.c, config/arm/pe.c, config/avr/avr.c,
config/avr/avr.h, config/d30v/d30v.h, config/fr30/fr30.h,
config/h8300/h8300.c, config/i386/cygwin.h, config/i386/winnt.c,
config/m32r/m32r.c, config/mcore/mcore.c, config/sh/sh.c,
config/stormy16/stormy16.h, config/v850/v850.c, doc/c-tree.texi,
doc/tm.texi, ggc-common.c, integrate.c, print-tree.c, tree.c,
tree.h: Rename DECL_MACHINE_ATTRIBUTES to DECL_ATTRIBUTES.
* tree.h (struct tree_decl): Change machine_attributes to
attributes.
* doc/c-tree.texi: Document that all attributes are now attached
to decls and types.
* c-common.c (add_attribute, attrtab, attrtab_idx,
default_valid_lang_attribute, valid_lang_attribute): Remove.
(attribute_tables, attributes_initialized,
c_common_attribute_table, default_lang_attribute_table): New
variables.
(handle_packed_attribute, handle_nocommon_attribute,
handle_common_attribute, handle_noreturn_attribute,
handle_unused_attribute, handle_const_attribute,
handle_transparent_union_attribute, handle_constructor_attribute,
handle_destructor_attribute, handle_mode_attribute,
handle_section_attribute, handle_aligned_attribute,
handle_weak_attribute, handle_alias_attribute,
handle_no_instrument_function_attribute,
handle_no_check_memory_usage_attribute, handle_malloc_attribute,
handle_no_limit_stack_attribute, handle_pure_attribute): New
functions.
(init_attributes, decl_attributes): Rewrite to implement
table-driven attributes.
* c-common.h (enum attribute_flags): Move to tree.h.
* c-format.c (decl_handle_format_attribute,
decl_handle_format_arg_attribute): Rename to
handle_format_attribute and handle_format_arg_attribute. Update
for table-driven attributes.
* c-common.h (decl_handle_format_attribute,
decl_handle_format_arg_attribute): Remove prototypes.
(handle_format_attribute, handle_format_arg_attribute): Add
prototypes.
* c-decl.c (grokdeclarator): Handle attributes nested inside
declarators.
* c-parse.in (setattrs, maybe_setattrs): Remove.
(maybe_type_quals_setattrs): Rename to maybe_type_quals_attrs.
Update to handle nested attributes properly.
(maybe_resetattrs, after_type_declarator,
parm_declarator_nostarttypename, notype_declarator, absdcl1_noea,
absdcl1_ea, direct_absdcl1): Update to handle nested attributes
properly.
(make_pointer_declarator): Update to handle nested attributes
properly.
* doc/extend.texi: Update documentation of limits of attributes
syntax. Warn about problems with attribute semantics in C++.
* target.h (struct target): Remove valid_decl_attribute and
valid_type_attribute. Add attribute_table and
function_attribute_inlinable_p.
* target-def.h (TARGET_VALID_DECL_ATTRIBUTE,
TARGET_VALID_TYPE_ATTRIBUTE): Remove.
(TARGET_ATTRIBUTE_TABLE, TARGET_FUNCTION_ATTRIBUTE_INLINABLE_P):
Add.
(TARGET_INITIALIZER): Update.
* integrate.c (FUNCTION_ATTRIBUTE_INLINABLE_P): Remove default
definition.
(function_attribute_inlinable_p): New function. Check for the
presence of any machine attributes before using
targetm.function_attribute_inlinable_p.
(function_cannot_inline_p): Update.
* Makefile.in (integrate.o): Update dependencies.
* doc/tm.texi: Update documentation of target attributes and
example definition of TARGET_VALID_TYPE_ATTRIBUTE.
* tree.c (default_valid_attribute_p, valid_machine_attribute):
Remove.
(default_target_attribute_table,
default_function_attribute_inlinable_p): New.
(lookup_attribute): Update comment to clarify handling of multiple
attributes with the same name.
(merge_attributes, attribute_list_contained): Allow multiple
attributes with the same name but different arguments to appear in
the same attribute list.
* tree.h (default_valid_attribute_p): Remove prototype.
(struct attribute_spec): New.
(default_target_attribute_table): Declare.
(enum attribute_flags): Move from c-common.h. Add
ATTR_FLAG_TYPE_IN_PLACE.
(default_function_attribute_inlinable_p): Declare.
* config/alpha/alpha.c (vms_valid_decl_attribute_p): Remove.
(TARGET_VALID_DECL_ATTRIBUTE): Don't define.
(TARGET_ATTRIBUTE_TABLE): Define.
(vms_attribute_table): New.
* config/arc/arc.c (arc_valid_decl_attribute): Remove.
(TARGET_VALID_DECL_ATTRIBUTE): Don't define.
(TARGET_ATTRIBUTE_TABLE): Define.
(arc_attribute_table, arc_handle_interrupt_attribute): New.
* config/arm/arm.c (arm_valid_type_attribute_p,
arm_valid_decl_attribute_p, arm_pe_valid_decl_attribute_p):
Remove.
(TARGET_VALID_TYPE_ATTRIBUTE, TARGET_VALID_DECL_ATTRIBUTE): Don't
define.
(TARGET_ATTRIBUTE_TABLE): Define.
(arm_attribute_table, arm_handle_fndecl_attribute,
arm_handle_isr_attribute): New.
* config/avr/avr.c (avr_valid_type_attribute,
avr_valid_decl_attribute): Remove.
(TARGET_VALID_DECL_ATTRIBUTE, TARGET_VALID_TYPE_ATTRIBUTE): Don't
define.
(TARGET_ATTRIBUTE_TABLE): Define.
(avr_attribute_table, avr_handle_progmem_attribute,
avr_handle_fndecl_attribute): New.
* config/c4x/c4x.c (c4x_valid_type_attribute_p): Remove.
(TARGET_VALID_TYPE_ATTRIBUTE): Don't define.
(TARGET_ATTRIBUTE_TABLE): Define.
(c4x_attribute_table, c4x_handle_fntype_attribute): New.
* config/h8300/h8300.c (h8300_valid_decl_attribute): Remove.
(TARGET_VALID_DECL_ATTRIBUTE): Don't define.
(TARGET_ATTRIBUTE_TABLE): Define.
(h8300_attribute_table, h8300_handle_fndecl_attribute,
h8300_handle_eightbit_data_attribute,
h8300_handle_tiny_data_attribute): New.
* config/i386/i386-protos.h (ix86_valid_type_attribute_p,
i386_pe_valid_decl_attribute_p, i386_pe_valid_type_attribute_p):
Remove prototypes.
(ix86_handle_dll_attribute, ix86_handle_shared_attribute): New
declarations.
* config/i386/i386.c (ix86_valid_type_attribute_p: Remove.
(TARGET_VALID_TYPE_ATTRIBUTE, TARGET_VALID_DECL_ATTRIBUTE): Don't
define.
(TARGET_ATTRIBUTE_TABLE): Define.
(ix86_attribute_table, ix86_handle_cdecl_attribute,
ix86_handle_regparm_attribute): New.
* config/i386/winnt.c (i386_pe_valid_decl_attribute_p,
i386_pe_valid_type_attribute_p): Remove.
(ix86_handle_dll_attribute, ix86_handle_shared_attribute): New.
* config/ia64/ia64.c (ia64_valid_type_attribute): Remove.
(TARGET_VALID_TYPE_ATTRIBUTE): Don't define.
(TARGET_ATTRIBUTE_TABLE): Define.
(ia64_attribute_table): New.
* config/m32r/m32r.c (m32r_valid_decl_attribute, interrupt_ident1,
interrupt_ident2, model_ident1, model_ident2): Remove.
(TARGET_VALID_DECL_ATTRIBUTE): Don't define.
(TARGET_ATTRIBUTE_TABLE): Define.
(init_idents): Update.
(m32r_attribute_table, m32r_handle_model_attribute): New.
* config/m68hc11/m68hc11.c (m68hc11_valid_type_attribute_p):
Remove.
(TARGET_VALID_TYPE_ATTRIBUTE): Don't define.
(TARGET_ATTRIBUTE_TABLE): Define.
(m68hc11_attribute_table, m68hc11_handle_fntype_attribute): New.
* config/mcore/mcore.c (mcore_valid_decl_attribute): Remove.
(TARGET_VALID_DECL_ATTRIBUTE): Don't define.
(TARGET_ATTRIBUTE_TABLE): Define.
(mcore_attribute_table, mcore_handle_naked_attribute): New.
* config/ns32k/ns32k.c (ns32k_valid_type_attribute_p): Remove.
(TARGET_VALID_TYPE_ATTRIBUTE): Don't define.
(TARGET_ATTRIBUTE_TABLE): Define.
(ns32k_attribute_table, ns32k_handle_fntype_attribute): New.
* config/rs6000/rs6000.c (rs6000_valid_type_attribute_p): Remove.
(TARGET_VALID_TYPE_ATTRIBUTE): Don't define.
(TARGET_ATTRIBUTE_TABLE): Define.
(rs6000_attribute_table, rs6000_handle_longcall_attribute): New.
* config/sh/sh.c (sh_valid_decl_attribute): Remove.
(TARGET_VALID_DECL_ATTRIBUTE): Don't define.
(TARGET_ATTRIBUTE_TABLE): Define.
(sh_attribute_table, sh_handle_interrupt_handler_attribute,
sh_handle_sp_switch_attribute, sh_handle_trap_exit_attribute):
New.
* config/stormy16/stormy16.c (stormy16_valid_type_attribute):
Remove.
(TARGET_VALID_TYPE_ATTRIBUTE): Don't define
(TARGET_ATTRIBUTE_TABLE): Define.
(stormy16_attribute_table, stormy16_handle_interrupt_attribute):
New.
* config/v850/v850.c (v850_valid_decl_attribute): Remove.
(TARGET_VALID_DECL_ATTRIBUTE): Don't define.
(TARGET_ATTRIBUTE_TABLE): Define.
(v850_attribute_table, v850_handle_interrupt_attribute,
v850_handle_data_area_attribute): New.
* config/v850/v850-c.c (mark_current_function_as_interrupt):
Return void. Call decl_attributes instead of
valid_machine_attribute.
cp:
Table-driven attributes.
* decl.c: Rename DECL_MACHINE_ATTRIBUTES to DECL_ATTRIBUTES.
* decl2.c (cplus_decl_attributes): Only take one attributes
parameter.
* cp-tree.c (cplus_decl_attributes): Update prototype.
* class.c (finish_struct), decl.c (start_decl, start_function),
decl2.c (grokfield), friend.c (do_friend), parse.y
(parse_bitfield): Update calls to cplus_decl_attributes.
* decl.c (grokdeclarator): Take a pointer to a single ordinary
attribute list.
* decl.h (grokdeclarator): Update prototype.
* decl2.c (grokfield): Take a single ordinary attribute list.
* friend.c (do_friend): Likewise.
* decl.c (shadow_tag, groktypename, start_decl,
start_handler_parms, grokdeclarator, grokparms, start_function,
start_method), decl2.c (grokfield, grokbitfield, grokoptypename),
parse.y (parse_field, parse_bitfield, component_decl_1), pt.c
(process_template_parm, do_decl_instantiation): Pass single
ordinary attribute lists around.
* decl.c (grokdeclarator): Correct handling of nested attributes.
Revert the patch
1998-10-18 Jason Merrill <jason@yorick.cygnus.com>
* decl.c (grokdeclarator): Embedded attrs bind to the right,
not the left.
.
* cp-tree.h (cp_valid_lang_attribute): Remove declaration
(cp_attribute_table): Declare.
* decl.c (valid_lang_attribute): Don't define.
(lang_attribute_table): Define.
(init_decl_processing): Initialize lang_attribute_table instead of
valid_lang_attribute.
* tree.c (cp_valid_lang_attribute): Remove.
(handle_java_interface_attribute, handle_com_interface_attribute,
handle_init_priority_attribute): New functions.
(cp_attribute_table): New array.
* decl2.c (import_export_class): Don't use
targetm.valid_type_attribute.
testsuite:
Table-driven attributes.
* g++.dg/ext/attrib1.C: New test.
From-SVN: r45718
2001-09-21 03:27:06 +02:00
|
|
|
|
value = grokdeclarator (declarator, declspecs, FIELD, init != 0, &attrlist);
|
2003-12-16 03:46:31 +01:00
|
|
|
|
if (! value || error_operand_p (value))
|
1998-09-22 13:58:41 +02:00
|
|
|
|
/* friend or constructor went bad. */
|
2002-11-02 03:17:41 +01:00
|
|
|
|
return error_mark_node;
|
|
|
|
|
|
|
|
|
|
if (TREE_CODE (value) == TYPE_DECL && init)
|
|
|
|
|
{
|
2009-11-08 04:47:36 +01:00
|
|
|
|
error ("typedef %qD is initialized (use decltype instead)", value);
|
2002-11-02 03:17:41 +01:00
|
|
|
|
init = NULL_TREE;
|
|
|
|
|
}
|
1994-02-24 02:02:37 +01:00
|
|
|
|
|
|
|
|
|
/* Pass friendly classes back. */
|
2003-07-03 18:10:52 +02:00
|
|
|
|
if (value == void_type_node)
|
|
|
|
|
return value;
|
|
|
|
|
|
2003-07-07 01:23:46 +02:00
|
|
|
|
/* Pass friend decls back. */
|
2003-07-03 18:10:52 +02:00
|
|
|
|
if ((TREE_CODE (value) == FUNCTION_DECL
|
|
|
|
|
|| TREE_CODE (value) == TEMPLATE_DECL)
|
|
|
|
|
&& DECL_CONTEXT (value) != current_class_type)
|
|
|
|
|
return value;
|
1994-02-24 02:02:37 +01:00
|
|
|
|
|
2009-09-10 01:33:38 +02:00
|
|
|
|
name = DECL_NAME (value);
|
|
|
|
|
|
|
|
|
|
if (name != NULL_TREE)
|
|
|
|
|
{
|
|
|
|
|
if (TREE_CODE (name) == TEMPLATE_ID_EXPR)
|
|
|
|
|
{
|
|
|
|
|
error ("explicit template argument list not allowed");
|
|
|
|
|
return error_mark_node;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (IDENTIFIER_POINTER (name)[0] == '_'
|
|
|
|
|
&& ! strcmp (IDENTIFIER_POINTER (name), "_vptr"))
|
|
|
|
|
error ("member %qD conflicts with virtual function table field name",
|
|
|
|
|
value);
|
|
|
|
|
}
|
1994-02-24 02:02:37 +01:00
|
|
|
|
|
|
|
|
|
/* Stash away type declarations. */
|
|
|
|
|
if (TREE_CODE (value) == TYPE_DECL)
|
|
|
|
|
{
|
|
|
|
|
DECL_NONLOCAL (value) = 1;
|
1994-05-06 00:19:26 +02:00
|
|
|
|
DECL_CONTEXT (value) = current_class_type;
|
1994-12-30 22:03:40 +01:00
|
|
|
|
|
1999-08-14 11:23:49 +02:00
|
|
|
|
if (processing_template_decl)
|
|
|
|
|
value = push_template_decl (value);
|
|
|
|
|
|
2004-10-17 06:39:46 +02:00
|
|
|
|
if (attrlist)
|
2008-11-19 22:35:27 +01:00
|
|
|
|
{
|
|
|
|
|
int attrflags = 0;
|
|
|
|
|
|
|
|
|
|
/* If this is a typedef that names the class for linkage purposes
|
|
|
|
|
(7.1.3p8), apply any attributes directly to the type. */
|
|
|
|
|
if (TAGGED_TYPE_P (TREE_TYPE (value))
|
|
|
|
|
&& value == TYPE_NAME (TYPE_MAIN_VARIANT (TREE_TYPE (value))))
|
|
|
|
|
attrflags = ATTR_FLAG_TYPE_IN_PLACE;
|
|
|
|
|
|
|
|
|
|
cplus_decl_attributes (&value, attrlist, attrflags);
|
|
|
|
|
}
|
2004-10-17 06:39:46 +02:00
|
|
|
|
|
2009-07-14 17:01:55 +02:00
|
|
|
|
if (declspecs->specs[(int)ds_typedef]
|
|
|
|
|
&& TREE_TYPE (value) != error_mark_node
|
|
|
|
|
&& TYPE_NAME (TYPE_MAIN_VARIANT (TREE_TYPE (value))) != value)
|
2009-12-11 15:36:05 +01:00
|
|
|
|
cp_set_underlying_type (value);
|
2009-04-02 11:24:19 +02:00
|
|
|
|
|
1994-02-24 02:02:37 +01:00
|
|
|
|
return value;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (DECL_IN_AGGR_P (value))
|
|
|
|
|
{
|
Convert diagnostics to use quoting flag q 3/n
cp/
Convert diagnostics to use quoting flag q 3/n
* decl.c (pop_label, duplicate_decls,
redeclaration_error_message,
redeclaration_error_message, lookup_label, check_goto,
make_typename_type, make_unbound_class_template,
fixup_anonymous_aggr, check_tag_decl, start_decl,
start_decl_1,
grok_reference_init, layout_var_decl, maybe_commonize_var,
check_for_uninitialized_const_var, reshape_init_array,
reshape_init, check_initializer, cp_finish_decl,
member_function_or_else, bad_specifiers, grokfndecl,
grokvardecl,
check_static_variable_definition, compute_array_index_type,
create_array_type_for_decl,
check_special_function_return_type,
grokdeclarator, check_default_argument, grokparms,
grok_ctor_properties, grok_op_properties,
check_elaborated_type_specifier, xref_tag, finish_enum,
build_enumerator, check_function_type,
start_preparsed_function,
store_parm_decls): Use quoting formats.
* decl2.c (grok_array_decl, delete_sanity,
check_member_template,
check_java_method, check_classfn,
finish_static_data_member_decl,
grokfield, grokbitfield, grok_function_init,
build_anon_union_vars, coerce_new_type, coerce_delete_type,
check_default_args): Likewise.
* parser.c (cp_parser_decl_specifier_seq): Likewise.
testsuite/
* g++.dg/template/local1.C: Adjust quoting marks in
testing for diagnostics.
* g++.dg/tls/diag-2.C: Likewise.
* g++.dg/other/error8.C: Likewise.
From-SVN: r88478
2004-10-04 08:04:43 +02:00
|
|
|
|
error ("%qD is already defined in %qT", value, DECL_CONTEXT (value));
|
1994-02-24 02:02:37 +01:00
|
|
|
|
return void_type_node;
|
|
|
|
|
}
|
|
|
|
|
|
2006-07-14 11:43:23 +02:00
|
|
|
|
if (asmspec_tree && asmspec_tree != error_mark_node)
|
1994-02-24 02:02:37 +01:00
|
|
|
|
asmspec = TREE_STRING_POINTER (asmspec_tree);
|
|
|
|
|
|
|
|
|
|
if (init)
|
|
|
|
|
{
|
extend.texi (C++ Signatures): Remove node.
* extend.texi (C++ Signatures): Remove node.
* invoke.texi: Remove discussion of -fhandle-signatures,
signature, sigof, __signature__, and __sigof__.
* Make-lang.in (CXX_SRCS): Remove sig.c.
* Makefile.in (CXX_OBJS): Remove sig.o.
(sig.o): Remove.
* cp-tree.h (CPTI_OPAQUE_TYPE): Remove.
(CPTI_SIGNATURE_TYPE): Likewise.
(CPTI_SIGTABLE_ENTRY_TYPE): Likewise.
(opaque_type_node): Likewise.
(signature_type_node): Likewise.
(sigtable_entry_type): Likewise.
(flag_handle_signatures): Likewise.
(lang_type): Remove is_signature, is_signature_pointer,
is_signature_reference, has_opaque_typedecls,
sigtables_has_been_generated. Adjust dummy. Remove signature,
signature_pointer_to, signature_reference_to.
(IS_SIGNATURE): Remove.
(SET_SIGNATURE): Remove.
(CLEAR_SIGNATURE): Remove.
(IS_SIGNATURE_POINTER): Remove.
(IS_SIGNATURE_REFERENCE): Remove.
(SIGNATURE_HAS_OPAQUE_TYPEDECLS): Remove.
(SIGTABLE_HAS_BEEN_GENERATED): Remove.
(CLASSTYPE_SIGNATURE): Remove.
(SIGNATURE_TYPE): Remove.
(SIGNATURE_METHOD_VEC): Remove.
(SIGNATURE_POINTER_TO): Remove.
(SIGNATURE_REFERENCE_TO): Remove.
(lang_decl_flags): Remove is_default_implementation. Rename
memfunc_pointer_to to saved_tree.
(IS_DEFAULT_IMPLEMENTATION): Remove.
(DECL_MEMFUNC_POINTER_TO): Remove.
(DECL_MEMFUNC_POINTING_TO): Remove.
(DECL_SAVED_TREE): Adjust definition.
(tag_types): Remove signature_type_node.
(SIGNATURE_FIELD_NAME): Remove.
(SIGNATURE_FIELD_NAME_FORMAT): Likewise.
(SIGNATURE_OPTR_NAME): Likewise.
(SIGNATURE_SPTR_NAME): Likewise.
(SIGNATURE_POINTER_NAME): Likewise.
(SIGNATURE_POINTER_NAME_FORMAT): Likewise.
(SIGNATURE_REFERENCE_NAME): Likewise.
(SIGNATURE_REFERNECE_NAME_FORMAT): Likewise.
(SIGTABLE_PTR_TYPE): Likewise.
(SIGTABLE_NAME_FORMAT): Likewise.
(SIGTABLE_NAME_FORMAT_LONG): Likewise.
(SIGTABLE_TAG_NAME): Likewise.
(SIGTABLE_VB_OFF_NAME): Likewise.
(SIGTABLE_VT_OFF_NAME): Likewise.
(finish_base_specifiers): Change prototype.
(build_signature_pointer_type): Remove.
(build_signature_reference_type): Remove.
(build_signature_pointer_constructor): Remove.
(build_signature_method_call): Remove.
(build_optr_ref): Likewise.
(append_signature_fields): Likewise.
(signature_error): Likewise.
* call.c (build_this): Remove signature support.
(build_over_call): Likewise.
(build_new_method_call): Likewise.
* class.c (add_implicitly_declared_members): Likewise.
(finish_struct_1): Likewise.
(finish_struct): Likewise.
* cvt.c (cp_convert_to_pointer): Likewise.
(convert_to_pointer_force): Likewise.
(ocp_convert): Likewise.
* decl.c (sigtable_decl_p): Remove.
(init_decl_processing): Remove support for signatures.
(cp_finish_decl): Likewise.
(grokdeclarator): Likewise.
(grokparms): Likewise.
(xref_tag): Likewise.
(start_function): Likewise.
(start_method): Likewise.
* decl2.c (finish_sigtable_vardecl): Remove.
(flag_handle_signatures): Remove.
(lang_f_options): Remove handle-signatures.
(grokfield): Remove support for signatures.
(grokbitfield): Likewise.
(finish_file): Likewise.
(reparse_absdcl_as_casts): Likewise.
* error.c (dump_type_real): Likewise.
(dump_function_decl): Likewise.
* friend.c (make_friend_class): Likewise.
* gxx.gperf: Remove __signature__, signature, __sigof__, sigof.
* hash.h: Regenerated.
* init.c (build_new_1): Remove support for signatures.
* lang-options.h: Remove -fhandle-signatures,
-fno-handle-signatures.
* lex.c (init_parse): Remove support for signatures.
(yyprint): Likewise.
* lex.h (rid): Remove RID_SIGNATURE.
* method.c (build_decl_overload_real): Remove support for
signatures.
(hack_identifier): Likewise.
* parse.y (base_class): Likewise.
(base_class.1): Likewise.
(access_specifier): Likewise.
* search.c (lookup_member): Likewise.
* semantics.c (finish_qualified_object_call_expr): Likewise.
(finish_template_type_parm): Likewise.
(begin_class_definition): Likewise.
(finish_base_specifier): Likewise.
* sig.c: Remove.
* tree.c (build_cplus_method_type): Remove support for signatures.
* typeck.c (require_complete_type): Likewise.
(c_sizeof): Likewise.
(c_alignof): Likewise.
(build_object_ref): Likewise.
(build_component_ref): Likewise.
(build_indirect_ref): Likewise.
(build_c_cast): Likewise.
(build_modify_expr): Likewise.
(convert_for_initialization): Likewise.
* typeck2.c (signature_error): Remove.
(store_init_value): Remove support for signatures.
(digest_init): Likewise.
(build_x_arrow): Likewise.
(build_functional_cast): Likewise.
* xref.c (GNU_xref_decl): Likewise.
From-SVN: r28677
1999-08-11 22:22:41 +02:00
|
|
|
|
if (TREE_CODE (value) == FUNCTION_DECL)
|
1994-02-24 02:02:37 +01:00
|
|
|
|
{
|
2005-02-03 11:26:22 +01:00
|
|
|
|
/* Initializers for functions are rejected early in the parser.
|
|
|
|
|
If we get here, it must be a pure specifier for a method. */
|
2008-07-24 21:15:00 +02:00
|
|
|
|
if (init == ridpointers[(int)RID_DELETE])
|
|
|
|
|
{
|
|
|
|
|
DECL_DELETED_FN (value) = 1;
|
|
|
|
|
DECL_DECLARED_INLINE_P (value) = 1;
|
|
|
|
|
DECL_INITIAL (value) = error_mark_node;
|
|
|
|
|
}
|
|
|
|
|
else if (init == ridpointers[(int)RID_DEFAULT])
|
|
|
|
|
{
|
2009-10-26 20:07:14 +01:00
|
|
|
|
if (defaultable_fn_check (value))
|
2008-07-24 21:15:00 +02:00
|
|
|
|
{
|
|
|
|
|
DECL_DEFAULTED_FN (value) = 1;
|
|
|
|
|
DECL_INITIALIZED_IN_CLASS_P (value) = 1;
|
|
|
|
|
DECL_DECLARED_INLINE_P (value) = 1;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else if (TREE_CODE (TREE_TYPE (value)) == METHOD_TYPE)
|
2005-08-12 00:46:29 +02:00
|
|
|
|
{
|
2010-03-20 19:01:18 +01:00
|
|
|
|
if (integer_zerop (init))
|
|
|
|
|
DECL_PURE_VIRTUAL_P (value) = 1;
|
|
|
|
|
else if (error_operand_p (init))
|
|
|
|
|
; /* An error has already been reported. */
|
|
|
|
|
else
|
|
|
|
|
error ("invalid initializer for member function %qD",
|
|
|
|
|
value);
|
2005-08-12 00:46:29 +02:00
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
gcc_assert (TREE_CODE (TREE_TYPE (value)) == FUNCTION_TYPE);
|
|
|
|
|
error ("initializer specified for static member function %qD",
|
|
|
|
|
value);
|
|
|
|
|
}
|
1994-02-24 02:02:37 +01:00
|
|
|
|
}
|
1994-07-09 09:13:10 +02:00
|
|
|
|
else if (pedantic && TREE_CODE (value) != VAR_DECL)
|
1994-06-03 23:42:31 +02:00
|
|
|
|
/* Already complained in grokdeclarator. */
|
|
|
|
|
init = NULL_TREE;
|
Make CONSTRUCTOR use VEC to store initializers.
* c-common.c (complete_array_type): Update to cope with VEC in
CONSTRUCTOR_ELTS.
* c-pretty-print.c (pp_c_initializer_list): Use pp_c_constructor_elts.
(pp_c_constructor_elts): New function.
* c-pretty-print.h (pp_c_constructor_elts): Declare.
* c-typeck.c (build_function_call, build_c_cast, digest_init,
struct constructor_stack, struct initializer_stack,
constructor_elements, push_init_level, pop_init_level,
add_pending_init, find_init_member, output_init_element): Update to
cope with VEC in CONSTRUCTOR_ELTS.
* coverage.c (build_fn_info_value, build_ctr_info_value,
build_gcov_info): Likewise.
* expr.c (categorize_ctor_elements_1, store_constructor,
expand_expr_real_1): Likewise.
* fold-const.c (fold_ternary): Likewise.
* gimplify.c (gimplify_init_ctor_preeval, zero_sized_field_decl,
gimplify_init_constructor, gimplify_expr): Likewise.
* tree-dump.c (dequeue_and_dump): Likewise.
* tree-inline.c (copy_tree_r): Add code to duplicate a CONSTRUCTOR
node.
* tree-pretty-print.c (dump_generic_node): Update to cope with VEC in
CONSTRUCTOR_ELTS.
* tree-sra.c (generate_element_init_1): Likewise.
* tree-ssa-ccp.c (fold_const_aggregate_ref): Likewise.
* tree-ssa-operands.c (get_expr_operands): Likewise.
* tree-vect-generic.c (expand_vector_piecewise): Likewise.
* tree-vect-transform.c (vect_get_vec_def_for_operand):
(get_initial_def_for_reduction): Likewise.
* tree-vn.c (set_value_handle, get_value_handle): CONSTURCTOR uses
value handle in annotations.
* tree.c (tree_node_kind, tree_code_size, make_node_stat,
tree_node_structure): Add support for constr_kind.
(build_vector_from_ctor, build_constructor_single,
build_constructor_from_list): New functions.
(build_constructor): Update to take a VEC instead of a TREE_LIST.
(simple_cst_equal, iterative_hash_expr, initializer_zerop, walk_tree):
Update to cope with VEC in CONSTRUCTOR_ELTS.
* tree.def (CONSTRUCTOR): Make it a tcc_exceptional node.
* tree.h (FOR_EACH_CONSTRUCTOR_VALUE, FOR_EACH_CONSTRUCTOR_ELT,
CONSTRUCTOR_APPEND_ELT): New macros.
(struct constructor_elt, struct tree_constructor): New data types.
(union tree_node): Add tree_constructor field.
* treestruct.def: Define TS_CONSTRUCTOR.
* varasm.c (const_hash_1, compare_constant, copy_constant,
compute_reloc_for_constant, output_addressed_constants,
initializer_constant_valid_p, output_constant,
array_size_for_constructor, output_constructor): Update to cope with
VEC in CONSTRUCTOR_ELTS.
* vec.h (VEC_empty, VEC_copy): New macros.
ada/
Make CONSTRUCTOR use VEC to store initializers.
* decl.c (gnat_to_gnu_entity): Update to cope with VEC in
CONSTRUCTOR_ELTS.
* trans.c (extract_values): Likewise.
* utils.c (convert, remove_conversions): Likewise.
* utils2.c (contains_save_expr_p, build_binary_op, build_unary_op,
gnat_build_constructor): Likewise.
cp/
Make CONSTRUCTOR use VEC to store initializers.
* call.c (convert_default_arg): Update call to digest_init.
* class.c (dump_class_hierarchy, dump_array): Update to cope with
VEC in CONSTRUCTOR_ELTS.
* cp-tree.h (EMPTY_CONSTRUCTOR_P): Likewise.
(finish_compound_literal, digest_init): Update declaration.
* decl.c (struct reshape_iter): New data type.
(reshape_init_array): Rename to...
(reshape_init_array_1): Update to cope with VEC in CONSTRUCTOR_ELTS.
(reshape_init): Rewrite from scratch. Split parts into...
(reshape_init_array, reshape_init_vector, reshape_init_class,
reshape_init_r): New functions.
(check_initializer): Update call to reshape_init. Remove obsolete
code.
(initialize_artificial_var, cp_complete_array_type): Update to cope
with VEC in CONSTRUCTOR_ELTS.
* decl2.c (grokfield): Update calls to digest_init.
(mark_vtable_entries): Update to cope with VEC in CONSTRUCTOR_ELTS.
* error.c (dump_expr_init_vec): New function.
(dump_expr): Use dump_expr_init_vec.
* init.c (build_zero_init, build_vec_init): Update to cope with VEC
in CONSTRUCTOR_ELTS.
(expand_default_init): Update call to digest_init.
* parser.c (cp_parser_postfix_expression): Use a VEC for the
initializers.
(cp_parser_initializer_list): Build a VEC of initializers.
* pt.c (tsubst_copy, tsubst_copy_and_build): Update to cope with VEC
in CONSTRUCTOR_ELTS.
* rtti.c (tinfo_base_init, generic_initializer, ptr_initializer,
ptm_initializer, class_initializer, get_pseudo_ti_init): Use
build_constructor_from_list instead of build_constructor.
* semantics.c (finish_compound_literal): Update call to digest_init.
* tree.c (stabilize_init): Update to cope with VEC in
CONSTRUCTOR_ELTS.
* typeck.c (build_ptrmemfunc1): Likewise.
* typeck2.c: (cxx_incomplete_type_error, split_nonconstant_init_1):
Likewise.
(store_init_value): Use build_constructor_from_list and update call
to digest_init.
(digest_init): Rewrite.
(process_init_constructor): Rewrite from scratch. Split into...
(process_init_constructor_array, picflag_from_initializer,
process_init_constructor_record, process_init_constructor_union):
New functions.
(PICFLAG_ERRONEOUS, PICFLAG_NOT_ALL_CONSTANT, PICFLAG_NOT_ALL_SIMPLE):
New macros.
(build_functional_cast): Use build_constructor_from_list instead of
build_constructor.
fortran/
Make CONSTRUCTOR use VEC to store initializers.
* trans-array.c (gfc_build_null_descriptor,
gfc_trans_array_constructor_value, gfc_conv_array_initializer):
Update to cope with VEC in CONSTRUCTOR_ELTS.
* trans-common.c (create_common): Likewise.
* trans-expr.c (gfc_conv_structure): Likewise.
* trans-stmt.c (gfc_trans_character_select): Use
build_constructor_from_list instead of build_constructor.
java/
Make CONSTRUCTOR use VEC to store initializers.
* check-init.c (check_init): Update to cope with VEC in
CONSTRUCTOR_ELTS.
* class.c (make_field_value, make_method_value, get_dispatch_table,
make_class_data, emit_symbol_table, emit_catch_table,
emit_assertion_table): Use build_constructor_from_list instead of
build_constructor.
* constants.c (build_constants_constructor): Likewise.
* java-gimplify.c (java_gimplify_new_array_init): Update to cope with
VEC in CONSTRUCTOR_ELTS.
* java-tree.h (START_RECORD_CONSTRUCTOR, PUSH_SUPER_VALUE,
PUSH_FIELD_VALUE, FINISH_RECORD_CONSTRUCTOR): Create a VEC instead
of a TREE_LIST.
* jcf-write.c (generate_bytecode_insns): Update to cope with VEC in
CONSTRUCTOR_ELTS.
* parse.y (build_new_array_init): Use build_constructor_from_list
instead of build_constructor.
(patch_new_array_init): Update to cope with VEC in
CONSTRUCTOR_ELTS.
(array_constructor_check_entry): Likewise.
objc/
Make CONSTRUCTOR use VEC to store initializers.
* objc-act.c (objc_build_constructor): Use build_constructor_from_list
instead of build_constructor.
testsuite/
Make CONSTRUCTOR use VEC to store initializers.
* g++.dg/ext/complit3.C: Check for specific error messages.
* g++.dg/init/brace2.C: Update error message.
* g++.dg/warn/Wbraces2.C: Likewise.
From-SVN: r102182
2005-07-20 03:19:59 +02:00
|
|
|
|
else if (!processing_template_decl)
|
1994-02-24 02:02:37 +01:00
|
|
|
|
{
|
Make CONSTRUCTOR use VEC to store initializers.
* c-common.c (complete_array_type): Update to cope with VEC in
CONSTRUCTOR_ELTS.
* c-pretty-print.c (pp_c_initializer_list): Use pp_c_constructor_elts.
(pp_c_constructor_elts): New function.
* c-pretty-print.h (pp_c_constructor_elts): Declare.
* c-typeck.c (build_function_call, build_c_cast, digest_init,
struct constructor_stack, struct initializer_stack,
constructor_elements, push_init_level, pop_init_level,
add_pending_init, find_init_member, output_init_element): Update to
cope with VEC in CONSTRUCTOR_ELTS.
* coverage.c (build_fn_info_value, build_ctr_info_value,
build_gcov_info): Likewise.
* expr.c (categorize_ctor_elements_1, store_constructor,
expand_expr_real_1): Likewise.
* fold-const.c (fold_ternary): Likewise.
* gimplify.c (gimplify_init_ctor_preeval, zero_sized_field_decl,
gimplify_init_constructor, gimplify_expr): Likewise.
* tree-dump.c (dequeue_and_dump): Likewise.
* tree-inline.c (copy_tree_r): Add code to duplicate a CONSTRUCTOR
node.
* tree-pretty-print.c (dump_generic_node): Update to cope with VEC in
CONSTRUCTOR_ELTS.
* tree-sra.c (generate_element_init_1): Likewise.
* tree-ssa-ccp.c (fold_const_aggregate_ref): Likewise.
* tree-ssa-operands.c (get_expr_operands): Likewise.
* tree-vect-generic.c (expand_vector_piecewise): Likewise.
* tree-vect-transform.c (vect_get_vec_def_for_operand):
(get_initial_def_for_reduction): Likewise.
* tree-vn.c (set_value_handle, get_value_handle): CONSTURCTOR uses
value handle in annotations.
* tree.c (tree_node_kind, tree_code_size, make_node_stat,
tree_node_structure): Add support for constr_kind.
(build_vector_from_ctor, build_constructor_single,
build_constructor_from_list): New functions.
(build_constructor): Update to take a VEC instead of a TREE_LIST.
(simple_cst_equal, iterative_hash_expr, initializer_zerop, walk_tree):
Update to cope with VEC in CONSTRUCTOR_ELTS.
* tree.def (CONSTRUCTOR): Make it a tcc_exceptional node.
* tree.h (FOR_EACH_CONSTRUCTOR_VALUE, FOR_EACH_CONSTRUCTOR_ELT,
CONSTRUCTOR_APPEND_ELT): New macros.
(struct constructor_elt, struct tree_constructor): New data types.
(union tree_node): Add tree_constructor field.
* treestruct.def: Define TS_CONSTRUCTOR.
* varasm.c (const_hash_1, compare_constant, copy_constant,
compute_reloc_for_constant, output_addressed_constants,
initializer_constant_valid_p, output_constant,
array_size_for_constructor, output_constructor): Update to cope with
VEC in CONSTRUCTOR_ELTS.
* vec.h (VEC_empty, VEC_copy): New macros.
ada/
Make CONSTRUCTOR use VEC to store initializers.
* decl.c (gnat_to_gnu_entity): Update to cope with VEC in
CONSTRUCTOR_ELTS.
* trans.c (extract_values): Likewise.
* utils.c (convert, remove_conversions): Likewise.
* utils2.c (contains_save_expr_p, build_binary_op, build_unary_op,
gnat_build_constructor): Likewise.
cp/
Make CONSTRUCTOR use VEC to store initializers.
* call.c (convert_default_arg): Update call to digest_init.
* class.c (dump_class_hierarchy, dump_array): Update to cope with
VEC in CONSTRUCTOR_ELTS.
* cp-tree.h (EMPTY_CONSTRUCTOR_P): Likewise.
(finish_compound_literal, digest_init): Update declaration.
* decl.c (struct reshape_iter): New data type.
(reshape_init_array): Rename to...
(reshape_init_array_1): Update to cope with VEC in CONSTRUCTOR_ELTS.
(reshape_init): Rewrite from scratch. Split parts into...
(reshape_init_array, reshape_init_vector, reshape_init_class,
reshape_init_r): New functions.
(check_initializer): Update call to reshape_init. Remove obsolete
code.
(initialize_artificial_var, cp_complete_array_type): Update to cope
with VEC in CONSTRUCTOR_ELTS.
* decl2.c (grokfield): Update calls to digest_init.
(mark_vtable_entries): Update to cope with VEC in CONSTRUCTOR_ELTS.
* error.c (dump_expr_init_vec): New function.
(dump_expr): Use dump_expr_init_vec.
* init.c (build_zero_init, build_vec_init): Update to cope with VEC
in CONSTRUCTOR_ELTS.
(expand_default_init): Update call to digest_init.
* parser.c (cp_parser_postfix_expression): Use a VEC for the
initializers.
(cp_parser_initializer_list): Build a VEC of initializers.
* pt.c (tsubst_copy, tsubst_copy_and_build): Update to cope with VEC
in CONSTRUCTOR_ELTS.
* rtti.c (tinfo_base_init, generic_initializer, ptr_initializer,
ptm_initializer, class_initializer, get_pseudo_ti_init): Use
build_constructor_from_list instead of build_constructor.
* semantics.c (finish_compound_literal): Update call to digest_init.
* tree.c (stabilize_init): Update to cope with VEC in
CONSTRUCTOR_ELTS.
* typeck.c (build_ptrmemfunc1): Likewise.
* typeck2.c: (cxx_incomplete_type_error, split_nonconstant_init_1):
Likewise.
(store_init_value): Use build_constructor_from_list and update call
to digest_init.
(digest_init): Rewrite.
(process_init_constructor): Rewrite from scratch. Split into...
(process_init_constructor_array, picflag_from_initializer,
process_init_constructor_record, process_init_constructor_union):
New functions.
(PICFLAG_ERRONEOUS, PICFLAG_NOT_ALL_CONSTANT, PICFLAG_NOT_ALL_SIMPLE):
New macros.
(build_functional_cast): Use build_constructor_from_list instead of
build_constructor.
fortran/
Make CONSTRUCTOR use VEC to store initializers.
* trans-array.c (gfc_build_null_descriptor,
gfc_trans_array_constructor_value, gfc_conv_array_initializer):
Update to cope with VEC in CONSTRUCTOR_ELTS.
* trans-common.c (create_common): Likewise.
* trans-expr.c (gfc_conv_structure): Likewise.
* trans-stmt.c (gfc_trans_character_select): Use
build_constructor_from_list instead of build_constructor.
java/
Make CONSTRUCTOR use VEC to store initializers.
* check-init.c (check_init): Update to cope with VEC in
CONSTRUCTOR_ELTS.
* class.c (make_field_value, make_method_value, get_dispatch_table,
make_class_data, emit_symbol_table, emit_catch_table,
emit_assertion_table): Use build_constructor_from_list instead of
build_constructor.
* constants.c (build_constants_constructor): Likewise.
* java-gimplify.c (java_gimplify_new_array_init): Update to cope with
VEC in CONSTRUCTOR_ELTS.
* java-tree.h (START_RECORD_CONSTRUCTOR, PUSH_SUPER_VALUE,
PUSH_FIELD_VALUE, FINISH_RECORD_CONSTRUCTOR): Create a VEC instead
of a TREE_LIST.
* jcf-write.c (generate_bytecode_insns): Update to cope with VEC in
CONSTRUCTOR_ELTS.
* parse.y (build_new_array_init): Use build_constructor_from_list
instead of build_constructor.
(patch_new_array_init): Update to cope with VEC in
CONSTRUCTOR_ELTS.
(array_constructor_check_entry): Likewise.
objc/
Make CONSTRUCTOR use VEC to store initializers.
* objc-act.c (objc_build_constructor): Use build_constructor_from_list
instead of build_constructor.
testsuite/
Make CONSTRUCTOR use VEC to store initializers.
* g++.dg/ext/complit3.C: Check for specific error messages.
* g++.dg/init/brace2.C: Update error message.
* g++.dg/warn/Wbraces2.C: Likewise.
From-SVN: r102182
2005-07-20 03:19:59 +02:00
|
|
|
|
if (TREE_CODE (init) == CONSTRUCTOR)
|
|
|
|
|
init = digest_init (TREE_TYPE (value), init);
|
2010-11-02 02:31:18 +01:00
|
|
|
|
init = maybe_constant_init (init);
|
2002-12-10 08:11:46 +01:00
|
|
|
|
|
Make CONSTRUCTOR use VEC to store initializers.
* c-common.c (complete_array_type): Update to cope with VEC in
CONSTRUCTOR_ELTS.
* c-pretty-print.c (pp_c_initializer_list): Use pp_c_constructor_elts.
(pp_c_constructor_elts): New function.
* c-pretty-print.h (pp_c_constructor_elts): Declare.
* c-typeck.c (build_function_call, build_c_cast, digest_init,
struct constructor_stack, struct initializer_stack,
constructor_elements, push_init_level, pop_init_level,
add_pending_init, find_init_member, output_init_element): Update to
cope with VEC in CONSTRUCTOR_ELTS.
* coverage.c (build_fn_info_value, build_ctr_info_value,
build_gcov_info): Likewise.
* expr.c (categorize_ctor_elements_1, store_constructor,
expand_expr_real_1): Likewise.
* fold-const.c (fold_ternary): Likewise.
* gimplify.c (gimplify_init_ctor_preeval, zero_sized_field_decl,
gimplify_init_constructor, gimplify_expr): Likewise.
* tree-dump.c (dequeue_and_dump): Likewise.
* tree-inline.c (copy_tree_r): Add code to duplicate a CONSTRUCTOR
node.
* tree-pretty-print.c (dump_generic_node): Update to cope with VEC in
CONSTRUCTOR_ELTS.
* tree-sra.c (generate_element_init_1): Likewise.
* tree-ssa-ccp.c (fold_const_aggregate_ref): Likewise.
* tree-ssa-operands.c (get_expr_operands): Likewise.
* tree-vect-generic.c (expand_vector_piecewise): Likewise.
* tree-vect-transform.c (vect_get_vec_def_for_operand):
(get_initial_def_for_reduction): Likewise.
* tree-vn.c (set_value_handle, get_value_handle): CONSTURCTOR uses
value handle in annotations.
* tree.c (tree_node_kind, tree_code_size, make_node_stat,
tree_node_structure): Add support for constr_kind.
(build_vector_from_ctor, build_constructor_single,
build_constructor_from_list): New functions.
(build_constructor): Update to take a VEC instead of a TREE_LIST.
(simple_cst_equal, iterative_hash_expr, initializer_zerop, walk_tree):
Update to cope with VEC in CONSTRUCTOR_ELTS.
* tree.def (CONSTRUCTOR): Make it a tcc_exceptional node.
* tree.h (FOR_EACH_CONSTRUCTOR_VALUE, FOR_EACH_CONSTRUCTOR_ELT,
CONSTRUCTOR_APPEND_ELT): New macros.
(struct constructor_elt, struct tree_constructor): New data types.
(union tree_node): Add tree_constructor field.
* treestruct.def: Define TS_CONSTRUCTOR.
* varasm.c (const_hash_1, compare_constant, copy_constant,
compute_reloc_for_constant, output_addressed_constants,
initializer_constant_valid_p, output_constant,
array_size_for_constructor, output_constructor): Update to cope with
VEC in CONSTRUCTOR_ELTS.
* vec.h (VEC_empty, VEC_copy): New macros.
ada/
Make CONSTRUCTOR use VEC to store initializers.
* decl.c (gnat_to_gnu_entity): Update to cope with VEC in
CONSTRUCTOR_ELTS.
* trans.c (extract_values): Likewise.
* utils.c (convert, remove_conversions): Likewise.
* utils2.c (contains_save_expr_p, build_binary_op, build_unary_op,
gnat_build_constructor): Likewise.
cp/
Make CONSTRUCTOR use VEC to store initializers.
* call.c (convert_default_arg): Update call to digest_init.
* class.c (dump_class_hierarchy, dump_array): Update to cope with
VEC in CONSTRUCTOR_ELTS.
* cp-tree.h (EMPTY_CONSTRUCTOR_P): Likewise.
(finish_compound_literal, digest_init): Update declaration.
* decl.c (struct reshape_iter): New data type.
(reshape_init_array): Rename to...
(reshape_init_array_1): Update to cope with VEC in CONSTRUCTOR_ELTS.
(reshape_init): Rewrite from scratch. Split parts into...
(reshape_init_array, reshape_init_vector, reshape_init_class,
reshape_init_r): New functions.
(check_initializer): Update call to reshape_init. Remove obsolete
code.
(initialize_artificial_var, cp_complete_array_type): Update to cope
with VEC in CONSTRUCTOR_ELTS.
* decl2.c (grokfield): Update calls to digest_init.
(mark_vtable_entries): Update to cope with VEC in CONSTRUCTOR_ELTS.
* error.c (dump_expr_init_vec): New function.
(dump_expr): Use dump_expr_init_vec.
* init.c (build_zero_init, build_vec_init): Update to cope with VEC
in CONSTRUCTOR_ELTS.
(expand_default_init): Update call to digest_init.
* parser.c (cp_parser_postfix_expression): Use a VEC for the
initializers.
(cp_parser_initializer_list): Build a VEC of initializers.
* pt.c (tsubst_copy, tsubst_copy_and_build): Update to cope with VEC
in CONSTRUCTOR_ELTS.
* rtti.c (tinfo_base_init, generic_initializer, ptr_initializer,
ptm_initializer, class_initializer, get_pseudo_ti_init): Use
build_constructor_from_list instead of build_constructor.
* semantics.c (finish_compound_literal): Update call to digest_init.
* tree.c (stabilize_init): Update to cope with VEC in
CONSTRUCTOR_ELTS.
* typeck.c (build_ptrmemfunc1): Likewise.
* typeck2.c: (cxx_incomplete_type_error, split_nonconstant_init_1):
Likewise.
(store_init_value): Use build_constructor_from_list and update call
to digest_init.
(digest_init): Rewrite.
(process_init_constructor): Rewrite from scratch. Split into...
(process_init_constructor_array, picflag_from_initializer,
process_init_constructor_record, process_init_constructor_union):
New functions.
(PICFLAG_ERRONEOUS, PICFLAG_NOT_ALL_CONSTANT, PICFLAG_NOT_ALL_SIMPLE):
New macros.
(build_functional_cast): Use build_constructor_from_list instead of
build_constructor.
fortran/
Make CONSTRUCTOR use VEC to store initializers.
* trans-array.c (gfc_build_null_descriptor,
gfc_trans_array_constructor_value, gfc_conv_array_initializer):
Update to cope with VEC in CONSTRUCTOR_ELTS.
* trans-common.c (create_common): Likewise.
* trans-expr.c (gfc_conv_structure): Likewise.
* trans-stmt.c (gfc_trans_character_select): Use
build_constructor_from_list instead of build_constructor.
java/
Make CONSTRUCTOR use VEC to store initializers.
* check-init.c (check_init): Update to cope with VEC in
CONSTRUCTOR_ELTS.
* class.c (make_field_value, make_method_value, get_dispatch_table,
make_class_data, emit_symbol_table, emit_catch_table,
emit_assertion_table): Use build_constructor_from_list instead of
build_constructor.
* constants.c (build_constants_constructor): Likewise.
* java-gimplify.c (java_gimplify_new_array_init): Update to cope with
VEC in CONSTRUCTOR_ELTS.
* java-tree.h (START_RECORD_CONSTRUCTOR, PUSH_SUPER_VALUE,
PUSH_FIELD_VALUE, FINISH_RECORD_CONSTRUCTOR): Create a VEC instead
of a TREE_LIST.
* jcf-write.c (generate_bytecode_insns): Update to cope with VEC in
CONSTRUCTOR_ELTS.
* parse.y (build_new_array_init): Use build_constructor_from_list
instead of build_constructor.
(patch_new_array_init): Update to cope with VEC in
CONSTRUCTOR_ELTS.
(array_constructor_check_entry): Likewise.
objc/
Make CONSTRUCTOR use VEC to store initializers.
* objc-act.c (objc_build_constructor): Use build_constructor_from_list
instead of build_constructor.
testsuite/
Make CONSTRUCTOR use VEC to store initializers.
* g++.dg/ext/complit3.C: Check for specific error messages.
* g++.dg/init/brace2.C: Update error message.
* g++.dg/warn/Wbraces2.C: Likewise.
From-SVN: r102182
2005-07-20 03:19:59 +02:00
|
|
|
|
if (init != error_mark_node && !TREE_CONSTANT (init))
|
1994-02-24 02:02:37 +01:00
|
|
|
|
{
|
Make CONSTRUCTOR use VEC to store initializers.
* c-common.c (complete_array_type): Update to cope with VEC in
CONSTRUCTOR_ELTS.
* c-pretty-print.c (pp_c_initializer_list): Use pp_c_constructor_elts.
(pp_c_constructor_elts): New function.
* c-pretty-print.h (pp_c_constructor_elts): Declare.
* c-typeck.c (build_function_call, build_c_cast, digest_init,
struct constructor_stack, struct initializer_stack,
constructor_elements, push_init_level, pop_init_level,
add_pending_init, find_init_member, output_init_element): Update to
cope with VEC in CONSTRUCTOR_ELTS.
* coverage.c (build_fn_info_value, build_ctr_info_value,
build_gcov_info): Likewise.
* expr.c (categorize_ctor_elements_1, store_constructor,
expand_expr_real_1): Likewise.
* fold-const.c (fold_ternary): Likewise.
* gimplify.c (gimplify_init_ctor_preeval, zero_sized_field_decl,
gimplify_init_constructor, gimplify_expr): Likewise.
* tree-dump.c (dequeue_and_dump): Likewise.
* tree-inline.c (copy_tree_r): Add code to duplicate a CONSTRUCTOR
node.
* tree-pretty-print.c (dump_generic_node): Update to cope with VEC in
CONSTRUCTOR_ELTS.
* tree-sra.c (generate_element_init_1): Likewise.
* tree-ssa-ccp.c (fold_const_aggregate_ref): Likewise.
* tree-ssa-operands.c (get_expr_operands): Likewise.
* tree-vect-generic.c (expand_vector_piecewise): Likewise.
* tree-vect-transform.c (vect_get_vec_def_for_operand):
(get_initial_def_for_reduction): Likewise.
* tree-vn.c (set_value_handle, get_value_handle): CONSTURCTOR uses
value handle in annotations.
* tree.c (tree_node_kind, tree_code_size, make_node_stat,
tree_node_structure): Add support for constr_kind.
(build_vector_from_ctor, build_constructor_single,
build_constructor_from_list): New functions.
(build_constructor): Update to take a VEC instead of a TREE_LIST.
(simple_cst_equal, iterative_hash_expr, initializer_zerop, walk_tree):
Update to cope with VEC in CONSTRUCTOR_ELTS.
* tree.def (CONSTRUCTOR): Make it a tcc_exceptional node.
* tree.h (FOR_EACH_CONSTRUCTOR_VALUE, FOR_EACH_CONSTRUCTOR_ELT,
CONSTRUCTOR_APPEND_ELT): New macros.
(struct constructor_elt, struct tree_constructor): New data types.
(union tree_node): Add tree_constructor field.
* treestruct.def: Define TS_CONSTRUCTOR.
* varasm.c (const_hash_1, compare_constant, copy_constant,
compute_reloc_for_constant, output_addressed_constants,
initializer_constant_valid_p, output_constant,
array_size_for_constructor, output_constructor): Update to cope with
VEC in CONSTRUCTOR_ELTS.
* vec.h (VEC_empty, VEC_copy): New macros.
ada/
Make CONSTRUCTOR use VEC to store initializers.
* decl.c (gnat_to_gnu_entity): Update to cope with VEC in
CONSTRUCTOR_ELTS.
* trans.c (extract_values): Likewise.
* utils.c (convert, remove_conversions): Likewise.
* utils2.c (contains_save_expr_p, build_binary_op, build_unary_op,
gnat_build_constructor): Likewise.
cp/
Make CONSTRUCTOR use VEC to store initializers.
* call.c (convert_default_arg): Update call to digest_init.
* class.c (dump_class_hierarchy, dump_array): Update to cope with
VEC in CONSTRUCTOR_ELTS.
* cp-tree.h (EMPTY_CONSTRUCTOR_P): Likewise.
(finish_compound_literal, digest_init): Update declaration.
* decl.c (struct reshape_iter): New data type.
(reshape_init_array): Rename to...
(reshape_init_array_1): Update to cope with VEC in CONSTRUCTOR_ELTS.
(reshape_init): Rewrite from scratch. Split parts into...
(reshape_init_array, reshape_init_vector, reshape_init_class,
reshape_init_r): New functions.
(check_initializer): Update call to reshape_init. Remove obsolete
code.
(initialize_artificial_var, cp_complete_array_type): Update to cope
with VEC in CONSTRUCTOR_ELTS.
* decl2.c (grokfield): Update calls to digest_init.
(mark_vtable_entries): Update to cope with VEC in CONSTRUCTOR_ELTS.
* error.c (dump_expr_init_vec): New function.
(dump_expr): Use dump_expr_init_vec.
* init.c (build_zero_init, build_vec_init): Update to cope with VEC
in CONSTRUCTOR_ELTS.
(expand_default_init): Update call to digest_init.
* parser.c (cp_parser_postfix_expression): Use a VEC for the
initializers.
(cp_parser_initializer_list): Build a VEC of initializers.
* pt.c (tsubst_copy, tsubst_copy_and_build): Update to cope with VEC
in CONSTRUCTOR_ELTS.
* rtti.c (tinfo_base_init, generic_initializer, ptr_initializer,
ptm_initializer, class_initializer, get_pseudo_ti_init): Use
build_constructor_from_list instead of build_constructor.
* semantics.c (finish_compound_literal): Update call to digest_init.
* tree.c (stabilize_init): Update to cope with VEC in
CONSTRUCTOR_ELTS.
* typeck.c (build_ptrmemfunc1): Likewise.
* typeck2.c: (cxx_incomplete_type_error, split_nonconstant_init_1):
Likewise.
(store_init_value): Use build_constructor_from_list and update call
to digest_init.
(digest_init): Rewrite.
(process_init_constructor): Rewrite from scratch. Split into...
(process_init_constructor_array, picflag_from_initializer,
process_init_constructor_record, process_init_constructor_union):
New functions.
(PICFLAG_ERRONEOUS, PICFLAG_NOT_ALL_CONSTANT, PICFLAG_NOT_ALL_SIMPLE):
New macros.
(build_functional_cast): Use build_constructor_from_list instead of
build_constructor.
fortran/
Make CONSTRUCTOR use VEC to store initializers.
* trans-array.c (gfc_build_null_descriptor,
gfc_trans_array_constructor_value, gfc_conv_array_initializer):
Update to cope with VEC in CONSTRUCTOR_ELTS.
* trans-common.c (create_common): Likewise.
* trans-expr.c (gfc_conv_structure): Likewise.
* trans-stmt.c (gfc_trans_character_select): Use
build_constructor_from_list instead of build_constructor.
java/
Make CONSTRUCTOR use VEC to store initializers.
* check-init.c (check_init): Update to cope with VEC in
CONSTRUCTOR_ELTS.
* class.c (make_field_value, make_method_value, get_dispatch_table,
make_class_data, emit_symbol_table, emit_catch_table,
emit_assertion_table): Use build_constructor_from_list instead of
build_constructor.
* constants.c (build_constants_constructor): Likewise.
* java-gimplify.c (java_gimplify_new_array_init): Update to cope with
VEC in CONSTRUCTOR_ELTS.
* java-tree.h (START_RECORD_CONSTRUCTOR, PUSH_SUPER_VALUE,
PUSH_FIELD_VALUE, FINISH_RECORD_CONSTRUCTOR): Create a VEC instead
of a TREE_LIST.
* jcf-write.c (generate_bytecode_insns): Update to cope with VEC in
CONSTRUCTOR_ELTS.
* parse.y (build_new_array_init): Use build_constructor_from_list
instead of build_constructor.
(patch_new_array_init): Update to cope with VEC in
CONSTRUCTOR_ELTS.
(array_constructor_check_entry): Likewise.
objc/
Make CONSTRUCTOR use VEC to store initializers.
* objc-act.c (objc_build_constructor): Use build_constructor_from_list
instead of build_constructor.
testsuite/
Make CONSTRUCTOR use VEC to store initializers.
* g++.dg/ext/complit3.C: Check for specific error messages.
* g++.dg/init/brace2.C: Update error message.
* g++.dg/warn/Wbraces2.C: Likewise.
From-SVN: r102182
2005-07-20 03:19:59 +02:00
|
|
|
|
/* We can allow references to things that are effectively
|
|
|
|
|
static, since references are initialized with the
|
|
|
|
|
address. */
|
|
|
|
|
if (TREE_CODE (TREE_TYPE (value)) != REFERENCE_TYPE
|
|
|
|
|
|| (TREE_STATIC (init) == 0
|
|
|
|
|
&& (!DECL_P (init) || DECL_EXTERNAL (init) == 0)))
|
1994-02-24 02:02:37 +01:00
|
|
|
|
{
|
Make CONSTRUCTOR use VEC to store initializers.
* c-common.c (complete_array_type): Update to cope with VEC in
CONSTRUCTOR_ELTS.
* c-pretty-print.c (pp_c_initializer_list): Use pp_c_constructor_elts.
(pp_c_constructor_elts): New function.
* c-pretty-print.h (pp_c_constructor_elts): Declare.
* c-typeck.c (build_function_call, build_c_cast, digest_init,
struct constructor_stack, struct initializer_stack,
constructor_elements, push_init_level, pop_init_level,
add_pending_init, find_init_member, output_init_element): Update to
cope with VEC in CONSTRUCTOR_ELTS.
* coverage.c (build_fn_info_value, build_ctr_info_value,
build_gcov_info): Likewise.
* expr.c (categorize_ctor_elements_1, store_constructor,
expand_expr_real_1): Likewise.
* fold-const.c (fold_ternary): Likewise.
* gimplify.c (gimplify_init_ctor_preeval, zero_sized_field_decl,
gimplify_init_constructor, gimplify_expr): Likewise.
* tree-dump.c (dequeue_and_dump): Likewise.
* tree-inline.c (copy_tree_r): Add code to duplicate a CONSTRUCTOR
node.
* tree-pretty-print.c (dump_generic_node): Update to cope with VEC in
CONSTRUCTOR_ELTS.
* tree-sra.c (generate_element_init_1): Likewise.
* tree-ssa-ccp.c (fold_const_aggregate_ref): Likewise.
* tree-ssa-operands.c (get_expr_operands): Likewise.
* tree-vect-generic.c (expand_vector_piecewise): Likewise.
* tree-vect-transform.c (vect_get_vec_def_for_operand):
(get_initial_def_for_reduction): Likewise.
* tree-vn.c (set_value_handle, get_value_handle): CONSTURCTOR uses
value handle in annotations.
* tree.c (tree_node_kind, tree_code_size, make_node_stat,
tree_node_structure): Add support for constr_kind.
(build_vector_from_ctor, build_constructor_single,
build_constructor_from_list): New functions.
(build_constructor): Update to take a VEC instead of a TREE_LIST.
(simple_cst_equal, iterative_hash_expr, initializer_zerop, walk_tree):
Update to cope with VEC in CONSTRUCTOR_ELTS.
* tree.def (CONSTRUCTOR): Make it a tcc_exceptional node.
* tree.h (FOR_EACH_CONSTRUCTOR_VALUE, FOR_EACH_CONSTRUCTOR_ELT,
CONSTRUCTOR_APPEND_ELT): New macros.
(struct constructor_elt, struct tree_constructor): New data types.
(union tree_node): Add tree_constructor field.
* treestruct.def: Define TS_CONSTRUCTOR.
* varasm.c (const_hash_1, compare_constant, copy_constant,
compute_reloc_for_constant, output_addressed_constants,
initializer_constant_valid_p, output_constant,
array_size_for_constructor, output_constructor): Update to cope with
VEC in CONSTRUCTOR_ELTS.
* vec.h (VEC_empty, VEC_copy): New macros.
ada/
Make CONSTRUCTOR use VEC to store initializers.
* decl.c (gnat_to_gnu_entity): Update to cope with VEC in
CONSTRUCTOR_ELTS.
* trans.c (extract_values): Likewise.
* utils.c (convert, remove_conversions): Likewise.
* utils2.c (contains_save_expr_p, build_binary_op, build_unary_op,
gnat_build_constructor): Likewise.
cp/
Make CONSTRUCTOR use VEC to store initializers.
* call.c (convert_default_arg): Update call to digest_init.
* class.c (dump_class_hierarchy, dump_array): Update to cope with
VEC in CONSTRUCTOR_ELTS.
* cp-tree.h (EMPTY_CONSTRUCTOR_P): Likewise.
(finish_compound_literal, digest_init): Update declaration.
* decl.c (struct reshape_iter): New data type.
(reshape_init_array): Rename to...
(reshape_init_array_1): Update to cope with VEC in CONSTRUCTOR_ELTS.
(reshape_init): Rewrite from scratch. Split parts into...
(reshape_init_array, reshape_init_vector, reshape_init_class,
reshape_init_r): New functions.
(check_initializer): Update call to reshape_init. Remove obsolete
code.
(initialize_artificial_var, cp_complete_array_type): Update to cope
with VEC in CONSTRUCTOR_ELTS.
* decl2.c (grokfield): Update calls to digest_init.
(mark_vtable_entries): Update to cope with VEC in CONSTRUCTOR_ELTS.
* error.c (dump_expr_init_vec): New function.
(dump_expr): Use dump_expr_init_vec.
* init.c (build_zero_init, build_vec_init): Update to cope with VEC
in CONSTRUCTOR_ELTS.
(expand_default_init): Update call to digest_init.
* parser.c (cp_parser_postfix_expression): Use a VEC for the
initializers.
(cp_parser_initializer_list): Build a VEC of initializers.
* pt.c (tsubst_copy, tsubst_copy_and_build): Update to cope with VEC
in CONSTRUCTOR_ELTS.
* rtti.c (tinfo_base_init, generic_initializer, ptr_initializer,
ptm_initializer, class_initializer, get_pseudo_ti_init): Use
build_constructor_from_list instead of build_constructor.
* semantics.c (finish_compound_literal): Update call to digest_init.
* tree.c (stabilize_init): Update to cope with VEC in
CONSTRUCTOR_ELTS.
* typeck.c (build_ptrmemfunc1): Likewise.
* typeck2.c: (cxx_incomplete_type_error, split_nonconstant_init_1):
Likewise.
(store_init_value): Use build_constructor_from_list and update call
to digest_init.
(digest_init): Rewrite.
(process_init_constructor): Rewrite from scratch. Split into...
(process_init_constructor_array, picflag_from_initializer,
process_init_constructor_record, process_init_constructor_union):
New functions.
(PICFLAG_ERRONEOUS, PICFLAG_NOT_ALL_CONSTANT, PICFLAG_NOT_ALL_SIMPLE):
New macros.
(build_functional_cast): Use build_constructor_from_list instead of
build_constructor.
fortran/
Make CONSTRUCTOR use VEC to store initializers.
* trans-array.c (gfc_build_null_descriptor,
gfc_trans_array_constructor_value, gfc_conv_array_initializer):
Update to cope with VEC in CONSTRUCTOR_ELTS.
* trans-common.c (create_common): Likewise.
* trans-expr.c (gfc_conv_structure): Likewise.
* trans-stmt.c (gfc_trans_character_select): Use
build_constructor_from_list instead of build_constructor.
java/
Make CONSTRUCTOR use VEC to store initializers.
* check-init.c (check_init): Update to cope with VEC in
CONSTRUCTOR_ELTS.
* class.c (make_field_value, make_method_value, get_dispatch_table,
make_class_data, emit_symbol_table, emit_catch_table,
emit_assertion_table): Use build_constructor_from_list instead of
build_constructor.
* constants.c (build_constants_constructor): Likewise.
* java-gimplify.c (java_gimplify_new_array_init): Update to cope with
VEC in CONSTRUCTOR_ELTS.
* java-tree.h (START_RECORD_CONSTRUCTOR, PUSH_SUPER_VALUE,
PUSH_FIELD_VALUE, FINISH_RECORD_CONSTRUCTOR): Create a VEC instead
of a TREE_LIST.
* jcf-write.c (generate_bytecode_insns): Update to cope with VEC in
CONSTRUCTOR_ELTS.
* parse.y (build_new_array_init): Use build_constructor_from_list
instead of build_constructor.
(patch_new_array_init): Update to cope with VEC in
CONSTRUCTOR_ELTS.
(array_constructor_check_entry): Likewise.
objc/
Make CONSTRUCTOR use VEC to store initializers.
* objc-act.c (objc_build_constructor): Use build_constructor_from_list
instead of build_constructor.
testsuite/
Make CONSTRUCTOR use VEC to store initializers.
* g++.dg/ext/complit3.C: Check for specific error messages.
* g++.dg/init/brace2.C: Update error message.
* g++.dg/warn/Wbraces2.C: Likewise.
From-SVN: r102182
2005-07-20 03:19:59 +02:00
|
|
|
|
error ("field initializer is not constant");
|
|
|
|
|
init = error_mark_node;
|
1994-02-24 02:02:37 +01:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2003-07-02 06:11:30 +02:00
|
|
|
|
if (processing_template_decl
|
1996-02-28 23:01:56 +01:00
|
|
|
|
&& (TREE_CODE (value) == VAR_DECL || TREE_CODE (value) == FUNCTION_DECL))
|
2003-12-16 03:46:31 +01:00
|
|
|
|
{
|
|
|
|
|
value = push_template_decl (value);
|
|
|
|
|
if (error_operand_p (value))
|
|
|
|
|
return error_mark_node;
|
|
|
|
|
}
|
1996-02-28 23:01:56 +01:00
|
|
|
|
|
1996-01-22 20:49:02 +01:00
|
|
|
|
if (attrlist)
|
Table-driven attributes.
* c-decl.c, config/alpha/alpha.c, config/arc/arc.c,
config/arm/arm.c, config/arm/pe.c, config/avr/avr.c,
config/avr/avr.h, config/d30v/d30v.h, config/fr30/fr30.h,
config/h8300/h8300.c, config/i386/cygwin.h, config/i386/winnt.c,
config/m32r/m32r.c, config/mcore/mcore.c, config/sh/sh.c,
config/stormy16/stormy16.h, config/v850/v850.c, doc/c-tree.texi,
doc/tm.texi, ggc-common.c, integrate.c, print-tree.c, tree.c,
tree.h: Rename DECL_MACHINE_ATTRIBUTES to DECL_ATTRIBUTES.
* tree.h (struct tree_decl): Change machine_attributes to
attributes.
* doc/c-tree.texi: Document that all attributes are now attached
to decls and types.
* c-common.c (add_attribute, attrtab, attrtab_idx,
default_valid_lang_attribute, valid_lang_attribute): Remove.
(attribute_tables, attributes_initialized,
c_common_attribute_table, default_lang_attribute_table): New
variables.
(handle_packed_attribute, handle_nocommon_attribute,
handle_common_attribute, handle_noreturn_attribute,
handle_unused_attribute, handle_const_attribute,
handle_transparent_union_attribute, handle_constructor_attribute,
handle_destructor_attribute, handle_mode_attribute,
handle_section_attribute, handle_aligned_attribute,
handle_weak_attribute, handle_alias_attribute,
handle_no_instrument_function_attribute,
handle_no_check_memory_usage_attribute, handle_malloc_attribute,
handle_no_limit_stack_attribute, handle_pure_attribute): New
functions.
(init_attributes, decl_attributes): Rewrite to implement
table-driven attributes.
* c-common.h (enum attribute_flags): Move to tree.h.
* c-format.c (decl_handle_format_attribute,
decl_handle_format_arg_attribute): Rename to
handle_format_attribute and handle_format_arg_attribute. Update
for table-driven attributes.
* c-common.h (decl_handle_format_attribute,
decl_handle_format_arg_attribute): Remove prototypes.
(handle_format_attribute, handle_format_arg_attribute): Add
prototypes.
* c-decl.c (grokdeclarator): Handle attributes nested inside
declarators.
* c-parse.in (setattrs, maybe_setattrs): Remove.
(maybe_type_quals_setattrs): Rename to maybe_type_quals_attrs.
Update to handle nested attributes properly.
(maybe_resetattrs, after_type_declarator,
parm_declarator_nostarttypename, notype_declarator, absdcl1_noea,
absdcl1_ea, direct_absdcl1): Update to handle nested attributes
properly.
(make_pointer_declarator): Update to handle nested attributes
properly.
* doc/extend.texi: Update documentation of limits of attributes
syntax. Warn about problems with attribute semantics in C++.
* target.h (struct target): Remove valid_decl_attribute and
valid_type_attribute. Add attribute_table and
function_attribute_inlinable_p.
* target-def.h (TARGET_VALID_DECL_ATTRIBUTE,
TARGET_VALID_TYPE_ATTRIBUTE): Remove.
(TARGET_ATTRIBUTE_TABLE, TARGET_FUNCTION_ATTRIBUTE_INLINABLE_P):
Add.
(TARGET_INITIALIZER): Update.
* integrate.c (FUNCTION_ATTRIBUTE_INLINABLE_P): Remove default
definition.
(function_attribute_inlinable_p): New function. Check for the
presence of any machine attributes before using
targetm.function_attribute_inlinable_p.
(function_cannot_inline_p): Update.
* Makefile.in (integrate.o): Update dependencies.
* doc/tm.texi: Update documentation of target attributes and
example definition of TARGET_VALID_TYPE_ATTRIBUTE.
* tree.c (default_valid_attribute_p, valid_machine_attribute):
Remove.
(default_target_attribute_table,
default_function_attribute_inlinable_p): New.
(lookup_attribute): Update comment to clarify handling of multiple
attributes with the same name.
(merge_attributes, attribute_list_contained): Allow multiple
attributes with the same name but different arguments to appear in
the same attribute list.
* tree.h (default_valid_attribute_p): Remove prototype.
(struct attribute_spec): New.
(default_target_attribute_table): Declare.
(enum attribute_flags): Move from c-common.h. Add
ATTR_FLAG_TYPE_IN_PLACE.
(default_function_attribute_inlinable_p): Declare.
* config/alpha/alpha.c (vms_valid_decl_attribute_p): Remove.
(TARGET_VALID_DECL_ATTRIBUTE): Don't define.
(TARGET_ATTRIBUTE_TABLE): Define.
(vms_attribute_table): New.
* config/arc/arc.c (arc_valid_decl_attribute): Remove.
(TARGET_VALID_DECL_ATTRIBUTE): Don't define.
(TARGET_ATTRIBUTE_TABLE): Define.
(arc_attribute_table, arc_handle_interrupt_attribute): New.
* config/arm/arm.c (arm_valid_type_attribute_p,
arm_valid_decl_attribute_p, arm_pe_valid_decl_attribute_p):
Remove.
(TARGET_VALID_TYPE_ATTRIBUTE, TARGET_VALID_DECL_ATTRIBUTE): Don't
define.
(TARGET_ATTRIBUTE_TABLE): Define.
(arm_attribute_table, arm_handle_fndecl_attribute,
arm_handle_isr_attribute): New.
* config/avr/avr.c (avr_valid_type_attribute,
avr_valid_decl_attribute): Remove.
(TARGET_VALID_DECL_ATTRIBUTE, TARGET_VALID_TYPE_ATTRIBUTE): Don't
define.
(TARGET_ATTRIBUTE_TABLE): Define.
(avr_attribute_table, avr_handle_progmem_attribute,
avr_handle_fndecl_attribute): New.
* config/c4x/c4x.c (c4x_valid_type_attribute_p): Remove.
(TARGET_VALID_TYPE_ATTRIBUTE): Don't define.
(TARGET_ATTRIBUTE_TABLE): Define.
(c4x_attribute_table, c4x_handle_fntype_attribute): New.
* config/h8300/h8300.c (h8300_valid_decl_attribute): Remove.
(TARGET_VALID_DECL_ATTRIBUTE): Don't define.
(TARGET_ATTRIBUTE_TABLE): Define.
(h8300_attribute_table, h8300_handle_fndecl_attribute,
h8300_handle_eightbit_data_attribute,
h8300_handle_tiny_data_attribute): New.
* config/i386/i386-protos.h (ix86_valid_type_attribute_p,
i386_pe_valid_decl_attribute_p, i386_pe_valid_type_attribute_p):
Remove prototypes.
(ix86_handle_dll_attribute, ix86_handle_shared_attribute): New
declarations.
* config/i386/i386.c (ix86_valid_type_attribute_p: Remove.
(TARGET_VALID_TYPE_ATTRIBUTE, TARGET_VALID_DECL_ATTRIBUTE): Don't
define.
(TARGET_ATTRIBUTE_TABLE): Define.
(ix86_attribute_table, ix86_handle_cdecl_attribute,
ix86_handle_regparm_attribute): New.
* config/i386/winnt.c (i386_pe_valid_decl_attribute_p,
i386_pe_valid_type_attribute_p): Remove.
(ix86_handle_dll_attribute, ix86_handle_shared_attribute): New.
* config/ia64/ia64.c (ia64_valid_type_attribute): Remove.
(TARGET_VALID_TYPE_ATTRIBUTE): Don't define.
(TARGET_ATTRIBUTE_TABLE): Define.
(ia64_attribute_table): New.
* config/m32r/m32r.c (m32r_valid_decl_attribute, interrupt_ident1,
interrupt_ident2, model_ident1, model_ident2): Remove.
(TARGET_VALID_DECL_ATTRIBUTE): Don't define.
(TARGET_ATTRIBUTE_TABLE): Define.
(init_idents): Update.
(m32r_attribute_table, m32r_handle_model_attribute): New.
* config/m68hc11/m68hc11.c (m68hc11_valid_type_attribute_p):
Remove.
(TARGET_VALID_TYPE_ATTRIBUTE): Don't define.
(TARGET_ATTRIBUTE_TABLE): Define.
(m68hc11_attribute_table, m68hc11_handle_fntype_attribute): New.
* config/mcore/mcore.c (mcore_valid_decl_attribute): Remove.
(TARGET_VALID_DECL_ATTRIBUTE): Don't define.
(TARGET_ATTRIBUTE_TABLE): Define.
(mcore_attribute_table, mcore_handle_naked_attribute): New.
* config/ns32k/ns32k.c (ns32k_valid_type_attribute_p): Remove.
(TARGET_VALID_TYPE_ATTRIBUTE): Don't define.
(TARGET_ATTRIBUTE_TABLE): Define.
(ns32k_attribute_table, ns32k_handle_fntype_attribute): New.
* config/rs6000/rs6000.c (rs6000_valid_type_attribute_p): Remove.
(TARGET_VALID_TYPE_ATTRIBUTE): Don't define.
(TARGET_ATTRIBUTE_TABLE): Define.
(rs6000_attribute_table, rs6000_handle_longcall_attribute): New.
* config/sh/sh.c (sh_valid_decl_attribute): Remove.
(TARGET_VALID_DECL_ATTRIBUTE): Don't define.
(TARGET_ATTRIBUTE_TABLE): Define.
(sh_attribute_table, sh_handle_interrupt_handler_attribute,
sh_handle_sp_switch_attribute, sh_handle_trap_exit_attribute):
New.
* config/stormy16/stormy16.c (stormy16_valid_type_attribute):
Remove.
(TARGET_VALID_TYPE_ATTRIBUTE): Don't define
(TARGET_ATTRIBUTE_TABLE): Define.
(stormy16_attribute_table, stormy16_handle_interrupt_attribute):
New.
* config/v850/v850.c (v850_valid_decl_attribute): Remove.
(TARGET_VALID_DECL_ATTRIBUTE): Don't define.
(TARGET_ATTRIBUTE_TABLE): Define.
(v850_attribute_table, v850_handle_interrupt_attribute,
v850_handle_data_area_attribute): New.
* config/v850/v850-c.c (mark_current_function_as_interrupt):
Return void. Call decl_attributes instead of
valid_machine_attribute.
cp:
Table-driven attributes.
* decl.c: Rename DECL_MACHINE_ATTRIBUTES to DECL_ATTRIBUTES.
* decl2.c (cplus_decl_attributes): Only take one attributes
parameter.
* cp-tree.c (cplus_decl_attributes): Update prototype.
* class.c (finish_struct), decl.c (start_decl, start_function),
decl2.c (grokfield), friend.c (do_friend), parse.y
(parse_bitfield): Update calls to cplus_decl_attributes.
* decl.c (grokdeclarator): Take a pointer to a single ordinary
attribute list.
* decl.h (grokdeclarator): Update prototype.
* decl2.c (grokfield): Take a single ordinary attribute list.
* friend.c (do_friend): Likewise.
* decl.c (shadow_tag, groktypename, start_decl,
start_handler_parms, grokdeclarator, grokparms, start_function,
start_method), decl2.c (grokfield, grokbitfield, grokoptypename),
parse.y (parse_field, parse_bitfield, component_decl_1), pt.c
(process_template_parm, do_decl_instantiation): Pass single
ordinary attribute lists around.
* decl.c (grokdeclarator): Correct handling of nested attributes.
Revert the patch
1998-10-18 Jason Merrill <jason@yorick.cygnus.com>
* decl.c (grokdeclarator): Embedded attrs bind to the right,
not the left.
.
* cp-tree.h (cp_valid_lang_attribute): Remove declaration
(cp_attribute_table): Declare.
* decl.c (valid_lang_attribute): Don't define.
(lang_attribute_table): Define.
(init_decl_processing): Initialize lang_attribute_table instead of
valid_lang_attribute.
* tree.c (cp_valid_lang_attribute): Remove.
(handle_java_interface_attribute, handle_com_interface_attribute,
handle_init_priority_attribute): New functions.
(cp_attribute_table): New array.
* decl2.c (import_export_class): Don't use
targetm.valid_type_attribute.
testsuite:
Table-driven attributes.
* g++.dg/ext/attrib1.C: New test.
From-SVN: r45718
2001-09-21 03:27:06 +02:00
|
|
|
|
cplus_decl_attributes (&value, attrlist, 0);
|
1996-01-22 20:49:02 +01:00
|
|
|
|
|
call.c (check_dtor_name): Replace abort with gcc_assert or gcc_unreachable.
* call.c (check_dtor_name): Replace abort with gcc_assert or
gcc_unreachable.
(build_call, add_builtin_candidate, build_new_op,
convert_like_real, build_over_call, in_charge_arg_for_name,
source_type, joust): Likewise.
* class.c (build_simple_base_path, get_vcall_index,
finish_struct_1, instantiate_type, get_enclosing_class,
add_vcall_offset_vtbl_entries_1, cp_fold_obj_type_ref): Likewise.
* cp-gimplify.c (cp_genericize): Likewise.
* cp-lang.c (cp_expr_size, cp_tree_size): Likewise.
* cvt.c (cp_convert_to_pointer, ocp_convert): Likewise.
* decl.c (poplevel, make_unbound_class_template, reshape_init,
check_special_function_return_type, grokdeclarator,
grok_op_properties, tag_name, xref_tag, start_preparsed_function,
finish_function): Likewise.
* decl2.c (grokfield, maybe_emit_vtables):Likewise.
* error.c (dump_global_iord, dump_decl, dump_template_decl,
language_to_string): Likewise.
* except.c (choose_personality_routine): Likewise.
* friend.c (do_friend): Likewise.
* g++spec.c (lang_specific_driver): Likewise.
* init.c (build_zero_init, expand_default_init, build_new_1,
build_vec_delete_1, build_vec_init, build_dtor_call): Likewise.
* lex.c (retrofit_lang_decl, cp_type_qual_from_rid): Likewise.
* mangle.c (add_substitution, write_unscoped_name,
write_template_prefix, write_identifier,
write_special_name_destructor, write_type, write_builtin_type,
write_expression, write_template_param,
write_java_integer_type_codes): Likewise.
* method.c (implicitly_declare_fn): Likewise.
From-SVN: r86778
2004-08-30 17:28:48 +02:00
|
|
|
|
switch (TREE_CODE (value))
|
1994-02-24 02:02:37 +01:00
|
|
|
|
{
|
call.c (check_dtor_name): Replace abort with gcc_assert or gcc_unreachable.
* call.c (check_dtor_name): Replace abort with gcc_assert or
gcc_unreachable.
(build_call, add_builtin_candidate, build_new_op,
convert_like_real, build_over_call, in_charge_arg_for_name,
source_type, joust): Likewise.
* class.c (build_simple_base_path, get_vcall_index,
finish_struct_1, instantiate_type, get_enclosing_class,
add_vcall_offset_vtbl_entries_1, cp_fold_obj_type_ref): Likewise.
* cp-gimplify.c (cp_genericize): Likewise.
* cp-lang.c (cp_expr_size, cp_tree_size): Likewise.
* cvt.c (cp_convert_to_pointer, ocp_convert): Likewise.
* decl.c (poplevel, make_unbound_class_template, reshape_init,
check_special_function_return_type, grokdeclarator,
grok_op_properties, tag_name, xref_tag, start_preparsed_function,
finish_function): Likewise.
* decl2.c (grokfield, maybe_emit_vtables):Likewise.
* error.c (dump_global_iord, dump_decl, dump_template_decl,
language_to_string): Likewise.
* except.c (choose_personality_routine): Likewise.
* friend.c (do_friend): Likewise.
* g++spec.c (lang_specific_driver): Likewise.
* init.c (build_zero_init, expand_default_init, build_new_1,
build_vec_delete_1, build_vec_init, build_dtor_call): Likewise.
* lex.c (retrofit_lang_decl, cp_type_qual_from_rid): Likewise.
* mangle.c (add_substitution, write_unscoped_name,
write_template_prefix, write_identifier,
write_special_name_destructor, write_type, write_builtin_type,
write_expression, write_template_param,
write_java_integer_type_codes): Likewise.
* method.c (implicitly_declare_fn): Likewise.
From-SVN: r86778
2004-08-30 17:28:48 +02:00
|
|
|
|
case VAR_DECL:
|
2006-02-18 09:36:11 +01:00
|
|
|
|
finish_static_data_member_decl (value, init, init_const_expr_p,
|
|
|
|
|
asmspec_tree, flags);
|
1994-02-24 02:02:37 +01:00
|
|
|
|
return value;
|
call.c (check_dtor_name): Replace abort with gcc_assert or gcc_unreachable.
* call.c (check_dtor_name): Replace abort with gcc_assert or
gcc_unreachable.
(build_call, add_builtin_candidate, build_new_op,
convert_like_real, build_over_call, in_charge_arg_for_name,
source_type, joust): Likewise.
* class.c (build_simple_base_path, get_vcall_index,
finish_struct_1, instantiate_type, get_enclosing_class,
add_vcall_offset_vtbl_entries_1, cp_fold_obj_type_ref): Likewise.
* cp-gimplify.c (cp_genericize): Likewise.
* cp-lang.c (cp_expr_size, cp_tree_size): Likewise.
* cvt.c (cp_convert_to_pointer, ocp_convert): Likewise.
* decl.c (poplevel, make_unbound_class_template, reshape_init,
check_special_function_return_type, grokdeclarator,
grok_op_properties, tag_name, xref_tag, start_preparsed_function,
finish_function): Likewise.
* decl2.c (grokfield, maybe_emit_vtables):Likewise.
* error.c (dump_global_iord, dump_decl, dump_template_decl,
language_to_string): Likewise.
* except.c (choose_personality_routine): Likewise.
* friend.c (do_friend): Likewise.
* g++spec.c (lang_specific_driver): Likewise.
* init.c (build_zero_init, expand_default_init, build_new_1,
build_vec_delete_1, build_vec_init, build_dtor_call): Likewise.
* lex.c (retrofit_lang_decl, cp_type_qual_from_rid): Likewise.
* mangle.c (add_substitution, write_unscoped_name,
write_template_prefix, write_identifier,
write_special_name_destructor, write_type, write_builtin_type,
write_expression, write_template_param,
write_java_integer_type_codes): Likewise.
* method.c (implicitly_declare_fn): Likewise.
From-SVN: r86778
2004-08-30 17:28:48 +02:00
|
|
|
|
|
|
|
|
|
case FIELD_DECL:
|
1994-02-24 02:02:37 +01:00
|
|
|
|
if (asmspec)
|
builtins.c, [...]: Avoid "`" as left quote, using "'" or %q, %< and %> as appropriate.
* builtins.c, c-common.c, c-decl.c, c-format.c, c-format.h,
c-parse.in, c-pch.c, c-pragma.c, collect2.c, final.c, gcc.c,
gcov.c, opts.c, pretty-print.h, protoize.c, reg-stack.c, rtl.c,
tlink.c, config/alpha/alpha.c, config/arc/arc.c, config/arm/arm.c,
config/avr/avr.c, config/c4x/c4x.c, config/darwin.c,
config/frv/frv.c, config/h8300/h8300.c, config/i386/i386.c,
config/i386/winnt.c, config/ia64/ia64.c, config/ip2k/ip2k.c,
config/iq2000/iq2000.c, config/m32r/m32r.c,
config/m68hc11/m68hc11.c, config/m68k/m68k.c, config/m68k/m68k.h,
config/mcore/mcore.c, config/mips/mips.c, config/mmix/mmix.c,
config/ns32k/ns32k.c, config/rs6000/host-darwin.c,
config/rs6000/rs6000.c, config/s390/s390.c, config/sh/sh.c,
config/sh/symbian.c, config/stormy16/stormy16.c,
config/v850/v850.c: Avoid "`" as left quote, using "'" or %q, %<
and %> as appropriate. Use %' as apostrophe in diagnostics where
applicable. Use %< and %> in place of '' quotes where applicable.
Use %qs in place of %<%s%>. Consistently quote __builtin function
names.
ada:
* misc.c (gnat_handle_option): Use %< and %> for quoting in
warning message.
cp:
* call.c, class.c, decl.c, decl2.c, error.c, mangle.c, parser.c,
pt.c, search.c, semantics.c, typeck.c: Use %q, %< and %> for
quoting in diagnostics.
* parser.c (cp_parser_sizeof_operand): Use '' instead of `' for
quoting in printf format.
* decl.c (duplicate_decls, start_decl): Use %qD instead of
unquoted %D.
objc:
* objc-act.c: Use %q, %< and %> for quoting in diagnostics.
testsuite:
* gcc.dg/builtin-prefetch-1.c: Adjust expected messages.
From-SVN: r90337
2004-11-09 11:13:30 +01:00
|
|
|
|
error ("%<asm%> specifiers are not permitted on non-static data members");
|
1994-02-24 02:02:37 +01:00
|
|
|
|
if (DECL_INITIAL (value) == error_mark_node)
|
|
|
|
|
init = error_mark_node;
|
2006-06-06 13:44:09 +02:00
|
|
|
|
cp_finish_decl (value, init, /*init_const_expr_p=*/false,
|
2006-02-18 09:36:11 +01:00
|
|
|
|
NULL_TREE, flags);
|
1994-02-24 02:02:37 +01:00
|
|
|
|
DECL_INITIAL (value) = init;
|
|
|
|
|
DECL_IN_AGGR_P (value) = 1;
|
|
|
|
|
return value;
|
call.c (check_dtor_name): Replace abort with gcc_assert or gcc_unreachable.
* call.c (check_dtor_name): Replace abort with gcc_assert or
gcc_unreachable.
(build_call, add_builtin_candidate, build_new_op,
convert_like_real, build_over_call, in_charge_arg_for_name,
source_type, joust): Likewise.
* class.c (build_simple_base_path, get_vcall_index,
finish_struct_1, instantiate_type, get_enclosing_class,
add_vcall_offset_vtbl_entries_1, cp_fold_obj_type_ref): Likewise.
* cp-gimplify.c (cp_genericize): Likewise.
* cp-lang.c (cp_expr_size, cp_tree_size): Likewise.
* cvt.c (cp_convert_to_pointer, ocp_convert): Likewise.
* decl.c (poplevel, make_unbound_class_template, reshape_init,
check_special_function_return_type, grokdeclarator,
grok_op_properties, tag_name, xref_tag, start_preparsed_function,
finish_function): Likewise.
* decl2.c (grokfield, maybe_emit_vtables):Likewise.
* error.c (dump_global_iord, dump_decl, dump_template_decl,
language_to_string): Likewise.
* except.c (choose_personality_routine): Likewise.
* friend.c (do_friend): Likewise.
* g++spec.c (lang_specific_driver): Likewise.
* init.c (build_zero_init, expand_default_init, build_new_1,
build_vec_delete_1, build_vec_init, build_dtor_call): Likewise.
* lex.c (retrofit_lang_decl, cp_type_qual_from_rid): Likewise.
* mangle.c (add_substitution, write_unscoped_name,
write_template_prefix, write_identifier,
write_special_name_destructor, write_type, write_builtin_type,
write_expression, write_template_param,
write_java_integer_type_codes): Likewise.
* method.c (implicitly_declare_fn): Likewise.
From-SVN: r86778
2004-08-30 17:28:48 +02:00
|
|
|
|
|
|
|
|
|
case FUNCTION_DECL:
|
1994-12-16 03:07:31 +01:00
|
|
|
|
if (asmspec)
|
2004-08-05 07:52:01 +02:00
|
|
|
|
set_user_assembler_name (value, asmspec);
|
2005-06-14 22:01:59 +02:00
|
|
|
|
|
2006-06-06 13:44:09 +02:00
|
|
|
|
cp_finish_decl (value,
|
|
|
|
|
/*init=*/NULL_TREE,
|
|
|
|
|
/*init_const_expr_p=*/false,
|
2006-02-18 09:36:11 +01:00
|
|
|
|
asmspec_tree, flags);
|
1994-02-24 02:02:37 +01:00
|
|
|
|
|
|
|
|
|
/* Pass friends back this way. */
|
|
|
|
|
if (DECL_FRIEND_P (value))
|
|
|
|
|
return void_type_node;
|
|
|
|
|
|
|
|
|
|
DECL_IN_AGGR_P (value) = 1;
|
|
|
|
|
return value;
|
2005-06-14 22:01:59 +02:00
|
|
|
|
|
call.c (check_dtor_name): Replace abort with gcc_assert or gcc_unreachable.
* call.c (check_dtor_name): Replace abort with gcc_assert or
gcc_unreachable.
(build_call, add_builtin_candidate, build_new_op,
convert_like_real, build_over_call, in_charge_arg_for_name,
source_type, joust): Likewise.
* class.c (build_simple_base_path, get_vcall_index,
finish_struct_1, instantiate_type, get_enclosing_class,
add_vcall_offset_vtbl_entries_1, cp_fold_obj_type_ref): Likewise.
* cp-gimplify.c (cp_genericize): Likewise.
* cp-lang.c (cp_expr_size, cp_tree_size): Likewise.
* cvt.c (cp_convert_to_pointer, ocp_convert): Likewise.
* decl.c (poplevel, make_unbound_class_template, reshape_init,
check_special_function_return_type, grokdeclarator,
grok_op_properties, tag_name, xref_tag, start_preparsed_function,
finish_function): Likewise.
* decl2.c (grokfield, maybe_emit_vtables):Likewise.
* error.c (dump_global_iord, dump_decl, dump_template_decl,
language_to_string): Likewise.
* except.c (choose_personality_routine): Likewise.
* friend.c (do_friend): Likewise.
* g++spec.c (lang_specific_driver): Likewise.
* init.c (build_zero_init, expand_default_init, build_new_1,
build_vec_delete_1, build_vec_init, build_dtor_call): Likewise.
* lex.c (retrofit_lang_decl, cp_type_qual_from_rid): Likewise.
* mangle.c (add_substitution, write_unscoped_name,
write_template_prefix, write_identifier,
write_special_name_destructor, write_type, write_builtin_type,
write_expression, write_template_param,
write_java_integer_type_codes): Likewise.
* method.c (implicitly_declare_fn): Likewise.
From-SVN: r86778
2004-08-30 17:28:48 +02:00
|
|
|
|
default:
|
|
|
|
|
gcc_unreachable ();
|
1994-02-24 02:02:37 +01:00
|
|
|
|
}
|
|
|
|
|
return NULL_TREE;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Like `grokfield', but for bitfields.
|
|
|
|
|
WIDTH is non-NULL for bit fields only, and is an INTEGER_CST node. */
|
|
|
|
|
|
|
|
|
|
tree
|
2005-06-14 22:01:59 +02:00
|
|
|
|
grokbitfield (const cp_declarator *declarator,
|
2008-06-14 07:21:30 +02:00
|
|
|
|
cp_decl_specifier_seq *declspecs, tree width,
|
|
|
|
|
tree attrlist)
|
1994-02-24 02:02:37 +01:00
|
|
|
|
{
|
2008-06-14 07:21:30 +02:00
|
|
|
|
tree value = grokdeclarator (declarator, declspecs, BITFIELD, 0, &attrlist);
|
1994-02-24 02:02:37 +01:00
|
|
|
|
|
2006-06-25 13:28:01 +02:00
|
|
|
|
if (value == error_mark_node)
|
|
|
|
|
return NULL_TREE; /* friends went bad. */
|
1994-02-24 02:02:37 +01:00
|
|
|
|
|
|
|
|
|
/* Pass friendly classes back. */
|
|
|
|
|
if (TREE_CODE (value) == VOID_TYPE)
|
|
|
|
|
return void_type_node;
|
|
|
|
|
|
2009-05-26 01:01:02 +02:00
|
|
|
|
if (!INTEGRAL_OR_UNSCOPED_ENUMERATION_TYPE_P (TREE_TYPE (value))
|
2006-10-20 22:13:42 +02:00
|
|
|
|
&& (POINTER_TYPE_P (value)
|
|
|
|
|
|| !dependent_type_p (TREE_TYPE (value))))
|
|
|
|
|
{
|
|
|
|
|
error ("bit-field %qD with non-integral type", value);
|
|
|
|
|
return error_mark_node;
|
|
|
|
|
}
|
|
|
|
|
|
1994-02-24 02:02:37 +01:00
|
|
|
|
if (TREE_CODE (value) == TYPE_DECL)
|
|
|
|
|
{
|
Convert diagnostics to use quoting flag q 3/n
cp/
Convert diagnostics to use quoting flag q 3/n
* decl.c (pop_label, duplicate_decls,
redeclaration_error_message,
redeclaration_error_message, lookup_label, check_goto,
make_typename_type, make_unbound_class_template,
fixup_anonymous_aggr, check_tag_decl, start_decl,
start_decl_1,
grok_reference_init, layout_var_decl, maybe_commonize_var,
check_for_uninitialized_const_var, reshape_init_array,
reshape_init, check_initializer, cp_finish_decl,
member_function_or_else, bad_specifiers, grokfndecl,
grokvardecl,
check_static_variable_definition, compute_array_index_type,
create_array_type_for_decl,
check_special_function_return_type,
grokdeclarator, check_default_argument, grokparms,
grok_ctor_properties, grok_op_properties,
check_elaborated_type_specifier, xref_tag, finish_enum,
build_enumerator, check_function_type,
start_preparsed_function,
store_parm_decls): Use quoting formats.
* decl2.c (grok_array_decl, delete_sanity,
check_member_template,
check_java_method, check_classfn,
finish_static_data_member_decl,
grokfield, grokbitfield, grok_function_init,
build_anon_union_vars, coerce_new_type, coerce_delete_type,
check_default_args): Likewise.
* parser.c (cp_parser_decl_specifier_seq): Likewise.
testsuite/
* g++.dg/template/local1.C: Adjust quoting marks in
testing for diagnostics.
* g++.dg/tls/diag-2.C: Likewise.
* g++.dg/other/error8.C: Likewise.
From-SVN: r88478
2004-10-04 08:04:43 +02:00
|
|
|
|
error ("cannot declare %qD to be a bit-field type", value);
|
1994-02-24 02:02:37 +01:00
|
|
|
|
return NULL_TREE;
|
|
|
|
|
}
|
|
|
|
|
|
cp-tree.h: Delete #defines for cp_error, cp_warning, cp_pedwarn, and cp_compiler_error.
* cp-tree.h: Delete #defines for cp_error, cp_warning,
cp_pedwarn, and cp_compiler_error.
* call.c, class.c, cp-tree.h, cvt.c, decl.c, decl2.c, error.c,
except.c, friend.c, init.c, lex.c, method.c, parse.y, pt.c,
rtti.c, search.c, semantics.c, spew.c, tree.c, typeck.c,
typeck2.c: Change calls to the above macros to use their
language-independent equivalents: error, warning, pedwarn, and
internal_error respectively.
From-SVN: r48140
2001-12-18 04:35:42 +01:00
|
|
|
|
/* Usually, finish_struct_1 catches bitfields with invalid types.
|
1998-08-07 18:33:34 +02:00
|
|
|
|
But, in the case of bitfields with function type, we confuse
|
|
|
|
|
ourselves into thinking they are member functions, so we must
|
|
|
|
|
check here. */
|
|
|
|
|
if (TREE_CODE (value) == FUNCTION_DECL)
|
|
|
|
|
{
|
Convert diagnostics to use quoting flag q 3/n
cp/
Convert diagnostics to use quoting flag q 3/n
* decl.c (pop_label, duplicate_decls,
redeclaration_error_message,
redeclaration_error_message, lookup_label, check_goto,
make_typename_type, make_unbound_class_template,
fixup_anonymous_aggr, check_tag_decl, start_decl,
start_decl_1,
grok_reference_init, layout_var_decl, maybe_commonize_var,
check_for_uninitialized_const_var, reshape_init_array,
reshape_init, check_initializer, cp_finish_decl,
member_function_or_else, bad_specifiers, grokfndecl,
grokvardecl,
check_static_variable_definition, compute_array_index_type,
create_array_type_for_decl,
check_special_function_return_type,
grokdeclarator, check_default_argument, grokparms,
grok_ctor_properties, grok_op_properties,
check_elaborated_type_specifier, xref_tag, finish_enum,
build_enumerator, check_function_type,
start_preparsed_function,
store_parm_decls): Use quoting formats.
* decl2.c (grok_array_decl, delete_sanity,
check_member_template,
check_java_method, check_classfn,
finish_static_data_member_decl,
grokfield, grokbitfield, grok_function_init,
build_anon_union_vars, coerce_new_type, coerce_delete_type,
check_default_args): Likewise.
* parser.c (cp_parser_decl_specifier_seq): Likewise.
testsuite/
* g++.dg/template/local1.C: Adjust quoting marks in
testing for diagnostics.
* g++.dg/tls/diag-2.C: Likewise.
* g++.dg/other/error8.C: Likewise.
From-SVN: r88478
2004-10-04 08:04:43 +02:00
|
|
|
|
error ("cannot declare bit-field %qD with function type",
|
cp-tree.h: Delete #defines for cp_error, cp_warning, cp_pedwarn, and cp_compiler_error.
* cp-tree.h: Delete #defines for cp_error, cp_warning,
cp_pedwarn, and cp_compiler_error.
* call.c, class.c, cp-tree.h, cvt.c, decl.c, decl2.c, error.c,
except.c, friend.c, init.c, lex.c, method.c, parse.y, pt.c,
rtti.c, search.c, semantics.c, spew.c, tree.c, typeck.c,
typeck2.c: Change calls to the above macros to use their
language-independent equivalents: error, warning, pedwarn, and
internal_error respectively.
From-SVN: r48140
2001-12-18 04:35:42 +01:00
|
|
|
|
DECL_NAME (value));
|
1998-08-07 18:33:34 +02:00
|
|
|
|
return NULL_TREE;
|
|
|
|
|
}
|
|
|
|
|
|
1994-02-24 02:02:37 +01:00
|
|
|
|
if (DECL_IN_AGGR_P (value))
|
|
|
|
|
{
|
Convert diagnostics to use quoting flag q 3/n
cp/
Convert diagnostics to use quoting flag q 3/n
* decl.c (pop_label, duplicate_decls,
redeclaration_error_message,
redeclaration_error_message, lookup_label, check_goto,
make_typename_type, make_unbound_class_template,
fixup_anonymous_aggr, check_tag_decl, start_decl,
start_decl_1,
grok_reference_init, layout_var_decl, maybe_commonize_var,
check_for_uninitialized_const_var, reshape_init_array,
reshape_init, check_initializer, cp_finish_decl,
member_function_or_else, bad_specifiers, grokfndecl,
grokvardecl,
check_static_variable_definition, compute_array_index_type,
create_array_type_for_decl,
check_special_function_return_type,
grokdeclarator, check_default_argument, grokparms,
grok_ctor_properties, grok_op_properties,
check_elaborated_type_specifier, xref_tag, finish_enum,
build_enumerator, check_function_type,
start_preparsed_function,
store_parm_decls): Use quoting formats.
* decl2.c (grok_array_decl, delete_sanity,
check_member_template,
check_java_method, check_classfn,
finish_static_data_member_decl,
grokfield, grokbitfield, grok_function_init,
build_anon_union_vars, coerce_new_type, coerce_delete_type,
check_default_args): Likewise.
* parser.c (cp_parser_decl_specifier_seq): Likewise.
testsuite/
* g++.dg/template/local1.C: Adjust quoting marks in
testing for diagnostics.
* g++.dg/tls/diag-2.C: Likewise.
* g++.dg/other/error8.C: Likewise.
From-SVN: r88478
2004-10-04 08:04:43 +02:00
|
|
|
|
error ("%qD is already defined in the class %qT", value,
|
2005-06-15 02:41:35 +02:00
|
|
|
|
DECL_CONTEXT (value));
|
1994-02-24 02:02:37 +01:00
|
|
|
|
return void_type_node;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (TREE_STATIC (value))
|
|
|
|
|
{
|
Convert diagnostics to use quoting flag q 3/n
cp/
Convert diagnostics to use quoting flag q 3/n
* decl.c (pop_label, duplicate_decls,
redeclaration_error_message,
redeclaration_error_message, lookup_label, check_goto,
make_typename_type, make_unbound_class_template,
fixup_anonymous_aggr, check_tag_decl, start_decl,
start_decl_1,
grok_reference_init, layout_var_decl, maybe_commonize_var,
check_for_uninitialized_const_var, reshape_init_array,
reshape_init, check_initializer, cp_finish_decl,
member_function_or_else, bad_specifiers, grokfndecl,
grokvardecl,
check_static_variable_definition, compute_array_index_type,
create_array_type_for_decl,
check_special_function_return_type,
grokdeclarator, check_default_argument, grokparms,
grok_ctor_properties, grok_op_properties,
check_elaborated_type_specifier, xref_tag, finish_enum,
build_enumerator, check_function_type,
start_preparsed_function,
store_parm_decls): Use quoting formats.
* decl2.c (grok_array_decl, delete_sanity,
check_member_template,
check_java_method, check_classfn,
finish_static_data_member_decl,
grokfield, grokbitfield, grok_function_init,
build_anon_union_vars, coerce_new_type, coerce_delete_type,
check_default_args): Likewise.
* parser.c (cp_parser_decl_specifier_seq): Likewise.
testsuite/
* g++.dg/template/local1.C: Adjust quoting marks in
testing for diagnostics.
* g++.dg/tls/diag-2.C: Likewise.
* g++.dg/other/error8.C: Likewise.
From-SVN: r88478
2004-10-04 08:04:43 +02:00
|
|
|
|
error ("static member %qD cannot be a bit-field", value);
|
1994-02-24 02:02:37 +01:00
|
|
|
|
return NULL_TREE;
|
|
|
|
|
}
|
2009-06-18 20:09:12 +02:00
|
|
|
|
cp_finish_decl (value, NULL_TREE, false, NULL_TREE, 0);
|
1994-02-24 02:02:37 +01:00
|
|
|
|
|
|
|
|
|
if (width != error_mark_node)
|
|
|
|
|
{
|
2010-09-16 01:55:43 +02:00
|
|
|
|
/* The width must be an integer type. */
|
|
|
|
|
if (!INTEGRAL_OR_UNSCOPED_ENUMERATION_TYPE_P (TREE_TYPE (width)))
|
|
|
|
|
error ("width of bit-field %qD has non-integral type %qT", value,
|
|
|
|
|
TREE_TYPE (width));
|
1996-02-28 23:01:56 +01:00
|
|
|
|
constant_expression_warning (width);
|
|
|
|
|
DECL_INITIAL (value) = width;
|
1998-10-16 05:37:43 +02:00
|
|
|
|
SET_DECL_C_BIT_FIELD (value);
|
1994-02-24 02:02:37 +01:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
DECL_IN_AGGR_P (value) = 1;
|
2008-06-14 07:21:30 +02:00
|
|
|
|
|
|
|
|
|
if (attrlist)
|
|
|
|
|
cplus_decl_attributes (&value, attrlist, /*flags=*/0);
|
|
|
|
|
|
1994-02-24 02:02:37 +01:00
|
|
|
|
return value;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2007-09-14 08:07:25 +02:00
|
|
|
|
/* Returns true iff ATTR is an attribute which needs to be applied at
|
|
|
|
|
instantiation time rather than template definition time. */
|
|
|
|
|
|
2007-09-23 04:36:34 +02:00
|
|
|
|
static bool
|
|
|
|
|
is_late_template_attribute (tree attr, tree decl)
|
2007-09-14 08:07:25 +02:00
|
|
|
|
{
|
|
|
|
|
tree name = TREE_PURPOSE (attr);
|
2007-09-19 00:50:03 +02:00
|
|
|
|
tree args = TREE_VALUE (attr);
|
2007-09-23 04:36:34 +02:00
|
|
|
|
const struct attribute_spec *spec = lookup_attribute_spec (name);
|
2008-01-24 15:41:32 +01:00
|
|
|
|
tree arg;
|
2007-09-23 04:36:34 +02:00
|
|
|
|
|
2007-09-27 20:54:06 +02:00
|
|
|
|
if (!spec)
|
|
|
|
|
/* Unknown attribute. */
|
|
|
|
|
return false;
|
|
|
|
|
|
2008-04-24 18:29:40 +02:00
|
|
|
|
/* Attribute weak handling wants to write out assembly right away. */
|
|
|
|
|
if (is_attribute_p ("weak", name))
|
2008-02-13 22:27:16 +01:00
|
|
|
|
return true;
|
|
|
|
|
|
2008-01-24 15:41:32 +01:00
|
|
|
|
/* If any of the arguments are dependent expressions, we can't evaluate
|
|
|
|
|
the attribute until instantiation time. */
|
|
|
|
|
for (arg = args; arg; arg = TREE_CHAIN (arg))
|
|
|
|
|
{
|
|
|
|
|
tree t = TREE_VALUE (arg);
|
2008-06-30 22:41:29 +02:00
|
|
|
|
|
|
|
|
|
/* If the first attribute argument is an identifier, only consider
|
|
|
|
|
second and following arguments. Attributes like mode, format,
|
|
|
|
|
cleanup and several target specific attributes aren't late
|
|
|
|
|
just because they have an IDENTIFIER_NODE as first argument. */
|
|
|
|
|
if (arg == args && TREE_CODE (t) == IDENTIFIER_NODE)
|
|
|
|
|
continue;
|
|
|
|
|
|
2008-01-24 15:41:32 +01:00
|
|
|
|
if (value_dependent_expression_p (t)
|
|
|
|
|
|| type_dependent_expression_p (t))
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (TREE_CODE (decl) == TYPE_DECL
|
|
|
|
|
|| TYPE_P (decl)
|
|
|
|
|
|| spec->type_required)
|
2007-09-23 04:36:34 +02:00
|
|
|
|
{
|
|
|
|
|
tree type = TYPE_P (decl) ? decl : TREE_TYPE (decl);
|
|
|
|
|
|
|
|
|
|
/* We can't apply any attributes to a completely unknown type until
|
|
|
|
|
instantiation time. */
|
|
|
|
|
enum tree_code code = TREE_CODE (type);
|
|
|
|
|
if (code == TEMPLATE_TYPE_PARM
|
|
|
|
|
|| code == BOUND_TEMPLATE_TEMPLATE_PARM
|
|
|
|
|
|| code == TYPENAME_TYPE)
|
|
|
|
|
return true;
|
2008-01-25 20:47:28 +01:00
|
|
|
|
/* Also defer most attributes on dependent types. This is not
|
|
|
|
|
necessary in all cases, but is the better default. */
|
|
|
|
|
else if (dependent_type_p (type)
|
|
|
|
|
/* But attribute visibility specifically works on
|
|
|
|
|
templates. */
|
|
|
|
|
&& !is_attribute_p ("visibility", name))
|
2008-01-24 15:41:32 +01:00
|
|
|
|
return true;
|
2007-09-23 04:36:34 +02:00
|
|
|
|
else
|
|
|
|
|
return false;
|
|
|
|
|
}
|
2007-09-14 08:07:25 +02:00
|
|
|
|
else
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* ATTR_P is a list of attributes. Remove any attributes which need to be
|
2007-09-23 04:36:34 +02:00
|
|
|
|
applied at instantiation time and return them. If IS_DEPENDENT is true,
|
|
|
|
|
the declaration itself is dependent, so all attributes should be applied
|
|
|
|
|
at instantiation time. */
|
2007-09-14 08:07:25 +02:00
|
|
|
|
|
|
|
|
|
static tree
|
2007-09-23 04:36:34 +02:00
|
|
|
|
splice_template_attributes (tree *attr_p, tree decl)
|
2007-09-14 08:07:25 +02:00
|
|
|
|
{
|
|
|
|
|
tree *p = attr_p;
|
|
|
|
|
tree late_attrs = NULL_TREE;
|
|
|
|
|
tree *q = &late_attrs;
|
|
|
|
|
|
|
|
|
|
if (!p)
|
|
|
|
|
return NULL_TREE;
|
|
|
|
|
|
|
|
|
|
for (; *p; )
|
|
|
|
|
{
|
2007-09-23 04:36:34 +02:00
|
|
|
|
if (is_late_template_attribute (*p, decl))
|
2007-09-14 08:07:25 +02:00
|
|
|
|
{
|
2007-09-23 04:36:34 +02:00
|
|
|
|
ATTR_IS_DEPENDENT (*p) = 1;
|
2007-09-14 08:07:25 +02:00
|
|
|
|
*q = *p;
|
|
|
|
|
*p = TREE_CHAIN (*p);
|
|
|
|
|
q = &TREE_CHAIN (*q);
|
|
|
|
|
*q = NULL_TREE;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
p = &TREE_CHAIN (*p);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return late_attrs;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Remove any late attributes from the list in ATTR_P and attach them to
|
|
|
|
|
DECL_P. */
|
|
|
|
|
|
|
|
|
|
static void
|
|
|
|
|
save_template_attributes (tree *attr_p, tree *decl_p)
|
|
|
|
|
{
|
2007-09-23 04:36:34 +02:00
|
|
|
|
tree late_attrs = splice_template_attributes (attr_p, *decl_p);
|
2007-09-14 08:07:25 +02:00
|
|
|
|
tree *q;
|
2008-02-05 14:29:43 +01:00
|
|
|
|
tree old_attrs = NULL_TREE;
|
2007-09-14 08:07:25 +02:00
|
|
|
|
|
|
|
|
|
if (!late_attrs)
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
if (DECL_P (*decl_p))
|
|
|
|
|
q = &DECL_ATTRIBUTES (*decl_p);
|
|
|
|
|
else
|
|
|
|
|
q = &TYPE_ATTRIBUTES (*decl_p);
|
|
|
|
|
|
2008-02-05 14:29:43 +01:00
|
|
|
|
old_attrs = *q;
|
|
|
|
|
|
|
|
|
|
/* Place the late attributes at the beginning of the attribute
|
|
|
|
|
list. */
|
|
|
|
|
TREE_CHAIN (tree_last (late_attrs)) = *q;
|
2007-09-14 08:07:25 +02:00
|
|
|
|
*q = late_attrs;
|
2008-02-05 14:29:43 +01:00
|
|
|
|
|
|
|
|
|
if (!DECL_P (*decl_p) && *decl_p == TYPE_MAIN_VARIANT (*decl_p))
|
|
|
|
|
{
|
|
|
|
|
/* We've added new attributes directly to the main variant, so
|
|
|
|
|
now we need to update all of the other variants to include
|
|
|
|
|
these new attributes. */
|
|
|
|
|
tree variant;
|
|
|
|
|
for (variant = TYPE_NEXT_VARIANT (*decl_p); variant;
|
|
|
|
|
variant = TYPE_NEXT_VARIANT (variant))
|
|
|
|
|
{
|
|
|
|
|
gcc_assert (TYPE_ATTRIBUTES (variant) == old_attrs);
|
|
|
|
|
TYPE_ATTRIBUTES (variant) = TYPE_ATTRIBUTES (*decl_p);
|
|
|
|
|
}
|
|
|
|
|
}
|
2007-09-14 08:07:25 +02:00
|
|
|
|
}
|
|
|
|
|
|
2008-04-24 18:29:40 +02:00
|
|
|
|
/* Like reconstruct_complex_type, but handle also template trees. */
|
|
|
|
|
|
|
|
|
|
tree
|
|
|
|
|
cp_reconstruct_complex_type (tree type, tree bottom)
|
|
|
|
|
{
|
|
|
|
|
tree inner, outer;
|
|
|
|
|
|
|
|
|
|
if (TREE_CODE (type) == POINTER_TYPE)
|
|
|
|
|
{
|
|
|
|
|
inner = cp_reconstruct_complex_type (TREE_TYPE (type), bottom);
|
|
|
|
|
outer = build_pointer_type_for_mode (inner, TYPE_MODE (type),
|
|
|
|
|
TYPE_REF_CAN_ALIAS_ALL (type));
|
|
|
|
|
}
|
|
|
|
|
else if (TREE_CODE (type) == REFERENCE_TYPE)
|
|
|
|
|
{
|
|
|
|
|
inner = cp_reconstruct_complex_type (TREE_TYPE (type), bottom);
|
|
|
|
|
outer = build_reference_type_for_mode (inner, TYPE_MODE (type),
|
|
|
|
|
TYPE_REF_CAN_ALIAS_ALL (type));
|
|
|
|
|
}
|
|
|
|
|
else if (TREE_CODE (type) == ARRAY_TYPE)
|
|
|
|
|
{
|
|
|
|
|
inner = cp_reconstruct_complex_type (TREE_TYPE (type), bottom);
|
|
|
|
|
outer = build_cplus_array_type (inner, TYPE_DOMAIN (type));
|
|
|
|
|
/* Don't call cp_build_qualified_type on ARRAY_TYPEs, the
|
|
|
|
|
element type qualification will be handled by the recursive
|
|
|
|
|
cp_reconstruct_complex_type call and cp_build_qualified_type
|
|
|
|
|
for ARRAY_TYPEs changes the element type. */
|
|
|
|
|
return outer;
|
|
|
|
|
}
|
|
|
|
|
else if (TREE_CODE (type) == FUNCTION_TYPE)
|
|
|
|
|
{
|
|
|
|
|
inner = cp_reconstruct_complex_type (TREE_TYPE (type), bottom);
|
|
|
|
|
outer = build_function_type (inner, TYPE_ARG_TYPES (type));
|
2010-05-19 23:01:50 +02:00
|
|
|
|
outer = apply_memfn_quals (outer, type_memfn_quals (type));
|
2008-04-24 18:29:40 +02:00
|
|
|
|
}
|
|
|
|
|
else if (TREE_CODE (type) == METHOD_TYPE)
|
|
|
|
|
{
|
|
|
|
|
inner = cp_reconstruct_complex_type (TREE_TYPE (type), bottom);
|
|
|
|
|
/* The build_method_type_directly() routine prepends 'this' to argument list,
|
|
|
|
|
so we must compensate by getting rid of it. */
|
|
|
|
|
outer
|
|
|
|
|
= build_method_type_directly
|
|
|
|
|
(TREE_TYPE (TREE_VALUE (TYPE_ARG_TYPES (type))),
|
|
|
|
|
inner,
|
|
|
|
|
TREE_CHAIN (TYPE_ARG_TYPES (type)));
|
|
|
|
|
}
|
|
|
|
|
else if (TREE_CODE (type) == OFFSET_TYPE)
|
|
|
|
|
{
|
|
|
|
|
inner = cp_reconstruct_complex_type (TREE_TYPE (type), bottom);
|
|
|
|
|
outer = build_offset_type (TYPE_OFFSET_BASETYPE (type), inner);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
return bottom;
|
|
|
|
|
|
2009-11-06 22:18:35 +01:00
|
|
|
|
if (TYPE_ATTRIBUTES (type))
|
|
|
|
|
outer = cp_build_type_attribute_variant (outer, TYPE_ATTRIBUTES (type));
|
2010-05-19 23:02:27 +02:00
|
|
|
|
return cp_build_qualified_type (outer, cp_type_quals (type));
|
2008-04-24 18:29:40 +02:00
|
|
|
|
}
|
|
|
|
|
|
2007-09-14 08:07:25 +02:00
|
|
|
|
/* Like decl_attributes, but handle C++ complexity. */
|
|
|
|
|
|
1995-03-23 01:44:31 +01:00
|
|
|
|
void
|
Remove traditional C constructs 4/n.
* decl2.c (grok_method_quals, warn_if_unknown_interface,
grok_x_components, cp_build_parm_decl, build_artificial_parm,
maybe_retrofit_in_chrg, grokclassfn, grok_array_decl,
delete_sanity, check_member_template, check_java_method,
check_classfn, finish_static_data_member_decl, grokfield,
grokbitfield, grokoptypename, grok_function_init,
cplus_decl_attributes, constructor_name, defer_fn,
build_anon_union_vars, finish_anon_union, coerce_new_type,
coerce_delete_type, comdat_linkage, maybe_make_one_only,
key_method, import_export_vtable, import_export_class,
output_vtable_inherit, import_export_decl, import_export_tinfo,
build_cleanup, get_guard, get_guard_bits, get_guard_cond,
set_guard, start_objects, finish_objects,
start_static_storage_duration_function,
finish_static_storage_duration_function, get_priority_info,
start_static_initialization_or_destruction,
finish_static_initialization_or_destruction,
do_static_initialization, do_static_destruction,
prune_vars_needing_no_initialization, write_out_vars,
reparse_decl_as_expr, finish_decl_parsing, namespace_ancestor,
add_using_namespace, merge_functions, ambiguous_decl,
lookup_using_namespace, lookup_using_namespace,
qualified_lookup_using_namespace, set_decl_namespace,
decl_namespace, current_decl_namespace, push_decl_namespace,
pop_decl_namespace, push_scope, pop_scope, add_function,
arg_assoc_namespace, arg_assoc_template_arg, arg_assoc,
lookup_arg_dependent, do_namespace_alias,
validate_nonmember_using_decl, do_nonmember_using_decl,
do_toplevel_using_decl, do_local_using_decl,
do_class_using_decl, do_using_directive, check_default_args,
mark_used, handle_class_head): Use C90 prototypings. Use booleans.
* parser.c (cp_parser_class_head): Use booleanss.
* decl.c (walk_globals, walk_vtables): Likewise.
* cp-tree.h (walk_globals_pred, walk_globals_fn, walk_vtables,
walk_globals): Change return type from 'int' to 'bool'.
* rtti.c (init_rtti_processing, build_headof, throw_bad_cast
throw_bad_typeid, get_tinfo_decl_dynamic, typeid_ok_p,
build_typeid, tinfo_name, get_tinfo_decl, get_tinfo_ptr,
get_typeid, ifnonnull, build_dynamic_cast_1, build_dynamic_cast,
qualifier_flags, tinfo_base_init, generic_initializer,
ptr_initializer, dfs_class_hint_mark, ptm_initializer,
dfs_class_hint_unmark, class_hint_flags, class_initializer,
typeinfo_in_lib_p, get_pseudo_ti_init, create_pseudo_type_info,
get_pseudo_ti_desc, create_tinfo_types, emit_support_tinfos,
unemitted_tinfo_decl_p, emit_tinfo_decl): Likewise.
* repo.c (repo_compile_flags, repo_template_declared,
repo_template_defined, repo_class_defined, repo_get_id,
repo_template_used, repo_vtable_used, repo_inline_used,
repo_tinfo_used, repo_template_instantiated, extract_string,
open_repo_file, afgets, init_repo, reopen_repo_file_for_write,
finish_repo): Likewise.
* ptree.c (cxx_print_decl, cxx_print_type, cxx_print_identifier,
cxx_print_xnode): Likewise..
* cp-lang.c (ok_to_generate_alias_set_for_type, cxx_get_alias_set,
cxx_warn_unused_global_decl, cp_expr_size): Likewise.
* cxxfilt.c (demangle_it, print_demangler_list, usage,
standard_symbol_characters, hp_symbol_characters, main, fatal):
Likewise.
(strip_underscore): Change type from 'int' to 'bool'.
(main): Use boolean constants.
From-SVN: r60601
2002-12-29 15:53:05 +01:00
|
|
|
|
cplus_decl_attributes (tree *decl, tree attributes, int flags)
|
1994-02-24 02:02:37 +01:00
|
|
|
|
{
|
2006-07-15 11:22:17 +02:00
|
|
|
|
if (*decl == NULL_TREE || *decl == void_type_node
|
2007-09-14 08:07:25 +02:00
|
|
|
|
|| *decl == error_mark_node
|
|
|
|
|
|| attributes == NULL_TREE)
|
1995-04-24 19:27:46 +02:00
|
|
|
|
return;
|
|
|
|
|
|
2007-09-14 08:07:25 +02:00
|
|
|
|
if (processing_template_decl)
|
|
|
|
|
{
|
2008-01-29 14:59:59 +01:00
|
|
|
|
if (check_for_bare_parameter_packs (attributes))
|
|
|
|
|
return;
|
|
|
|
|
|
2007-09-14 08:07:25 +02:00
|
|
|
|
save_template_attributes (&attributes, decl);
|
|
|
|
|
if (attributes == NULL_TREE)
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
c-common.c (decl_attributes): Take a pointer to the node to which attributes are to be attached...
* c-common.c (decl_attributes): Take a pointer to the node to
which attributes are to be attached, and a flags argument.
* c-common.h (enum attribute_flags): New.
(decl_attributes): Update prototype.
* c-decl.c (start_decl, push_parm_decl, finish_struct,
finish_enum, start_function): Update calls to decl_attributes.
* c-parse.in (component_declarator, component_notype_declarator,
label): Update calls to decl_attributes.
cp:
* decl2.c (cplus_decl_attributes): Take a pointer to the node to
which attributes are to be attached, and a flags argument. Update
call to decl_attributes.
(grokfield): Update call to decl_attributes.
* class.c (finish_struct): Update call to cplus_decl_attributes.
* cp-tree.h (cplus_decl_attributes): Update prototype.
* decl.c (start_decl, grokdeclarator, start_function): Update
calls to decl_attributes and cplus_decl_attributes.
* friend.c (do_friend): Update call to cplus_decl_attributes.
* parse.y (parse_bitfield): Update call to cplus_decl_attributes.
From-SVN: r43995
2001-07-13 22:40:43 +02:00
|
|
|
|
if (TREE_CODE (*decl) == TEMPLATE_DECL)
|
|
|
|
|
decl = &DECL_TEMPLATE_RESULT (*decl);
|
1995-04-24 19:27:46 +02:00
|
|
|
|
|
Table-driven attributes.
* c-decl.c, config/alpha/alpha.c, config/arc/arc.c,
config/arm/arm.c, config/arm/pe.c, config/avr/avr.c,
config/avr/avr.h, config/d30v/d30v.h, config/fr30/fr30.h,
config/h8300/h8300.c, config/i386/cygwin.h, config/i386/winnt.c,
config/m32r/m32r.c, config/mcore/mcore.c, config/sh/sh.c,
config/stormy16/stormy16.h, config/v850/v850.c, doc/c-tree.texi,
doc/tm.texi, ggc-common.c, integrate.c, print-tree.c, tree.c,
tree.h: Rename DECL_MACHINE_ATTRIBUTES to DECL_ATTRIBUTES.
* tree.h (struct tree_decl): Change machine_attributes to
attributes.
* doc/c-tree.texi: Document that all attributes are now attached
to decls and types.
* c-common.c (add_attribute, attrtab, attrtab_idx,
default_valid_lang_attribute, valid_lang_attribute): Remove.
(attribute_tables, attributes_initialized,
c_common_attribute_table, default_lang_attribute_table): New
variables.
(handle_packed_attribute, handle_nocommon_attribute,
handle_common_attribute, handle_noreturn_attribute,
handle_unused_attribute, handle_const_attribute,
handle_transparent_union_attribute, handle_constructor_attribute,
handle_destructor_attribute, handle_mode_attribute,
handle_section_attribute, handle_aligned_attribute,
handle_weak_attribute, handle_alias_attribute,
handle_no_instrument_function_attribute,
handle_no_check_memory_usage_attribute, handle_malloc_attribute,
handle_no_limit_stack_attribute, handle_pure_attribute): New
functions.
(init_attributes, decl_attributes): Rewrite to implement
table-driven attributes.
* c-common.h (enum attribute_flags): Move to tree.h.
* c-format.c (decl_handle_format_attribute,
decl_handle_format_arg_attribute): Rename to
handle_format_attribute and handle_format_arg_attribute. Update
for table-driven attributes.
* c-common.h (decl_handle_format_attribute,
decl_handle_format_arg_attribute): Remove prototypes.
(handle_format_attribute, handle_format_arg_attribute): Add
prototypes.
* c-decl.c (grokdeclarator): Handle attributes nested inside
declarators.
* c-parse.in (setattrs, maybe_setattrs): Remove.
(maybe_type_quals_setattrs): Rename to maybe_type_quals_attrs.
Update to handle nested attributes properly.
(maybe_resetattrs, after_type_declarator,
parm_declarator_nostarttypename, notype_declarator, absdcl1_noea,
absdcl1_ea, direct_absdcl1): Update to handle nested attributes
properly.
(make_pointer_declarator): Update to handle nested attributes
properly.
* doc/extend.texi: Update documentation of limits of attributes
syntax. Warn about problems with attribute semantics in C++.
* target.h (struct target): Remove valid_decl_attribute and
valid_type_attribute. Add attribute_table and
function_attribute_inlinable_p.
* target-def.h (TARGET_VALID_DECL_ATTRIBUTE,
TARGET_VALID_TYPE_ATTRIBUTE): Remove.
(TARGET_ATTRIBUTE_TABLE, TARGET_FUNCTION_ATTRIBUTE_INLINABLE_P):
Add.
(TARGET_INITIALIZER): Update.
* integrate.c (FUNCTION_ATTRIBUTE_INLINABLE_P): Remove default
definition.
(function_attribute_inlinable_p): New function. Check for the
presence of any machine attributes before using
targetm.function_attribute_inlinable_p.
(function_cannot_inline_p): Update.
* Makefile.in (integrate.o): Update dependencies.
* doc/tm.texi: Update documentation of target attributes and
example definition of TARGET_VALID_TYPE_ATTRIBUTE.
* tree.c (default_valid_attribute_p, valid_machine_attribute):
Remove.
(default_target_attribute_table,
default_function_attribute_inlinable_p): New.
(lookup_attribute): Update comment to clarify handling of multiple
attributes with the same name.
(merge_attributes, attribute_list_contained): Allow multiple
attributes with the same name but different arguments to appear in
the same attribute list.
* tree.h (default_valid_attribute_p): Remove prototype.
(struct attribute_spec): New.
(default_target_attribute_table): Declare.
(enum attribute_flags): Move from c-common.h. Add
ATTR_FLAG_TYPE_IN_PLACE.
(default_function_attribute_inlinable_p): Declare.
* config/alpha/alpha.c (vms_valid_decl_attribute_p): Remove.
(TARGET_VALID_DECL_ATTRIBUTE): Don't define.
(TARGET_ATTRIBUTE_TABLE): Define.
(vms_attribute_table): New.
* config/arc/arc.c (arc_valid_decl_attribute): Remove.
(TARGET_VALID_DECL_ATTRIBUTE): Don't define.
(TARGET_ATTRIBUTE_TABLE): Define.
(arc_attribute_table, arc_handle_interrupt_attribute): New.
* config/arm/arm.c (arm_valid_type_attribute_p,
arm_valid_decl_attribute_p, arm_pe_valid_decl_attribute_p):
Remove.
(TARGET_VALID_TYPE_ATTRIBUTE, TARGET_VALID_DECL_ATTRIBUTE): Don't
define.
(TARGET_ATTRIBUTE_TABLE): Define.
(arm_attribute_table, arm_handle_fndecl_attribute,
arm_handle_isr_attribute): New.
* config/avr/avr.c (avr_valid_type_attribute,
avr_valid_decl_attribute): Remove.
(TARGET_VALID_DECL_ATTRIBUTE, TARGET_VALID_TYPE_ATTRIBUTE): Don't
define.
(TARGET_ATTRIBUTE_TABLE): Define.
(avr_attribute_table, avr_handle_progmem_attribute,
avr_handle_fndecl_attribute): New.
* config/c4x/c4x.c (c4x_valid_type_attribute_p): Remove.
(TARGET_VALID_TYPE_ATTRIBUTE): Don't define.
(TARGET_ATTRIBUTE_TABLE): Define.
(c4x_attribute_table, c4x_handle_fntype_attribute): New.
* config/h8300/h8300.c (h8300_valid_decl_attribute): Remove.
(TARGET_VALID_DECL_ATTRIBUTE): Don't define.
(TARGET_ATTRIBUTE_TABLE): Define.
(h8300_attribute_table, h8300_handle_fndecl_attribute,
h8300_handle_eightbit_data_attribute,
h8300_handle_tiny_data_attribute): New.
* config/i386/i386-protos.h (ix86_valid_type_attribute_p,
i386_pe_valid_decl_attribute_p, i386_pe_valid_type_attribute_p):
Remove prototypes.
(ix86_handle_dll_attribute, ix86_handle_shared_attribute): New
declarations.
* config/i386/i386.c (ix86_valid_type_attribute_p: Remove.
(TARGET_VALID_TYPE_ATTRIBUTE, TARGET_VALID_DECL_ATTRIBUTE): Don't
define.
(TARGET_ATTRIBUTE_TABLE): Define.
(ix86_attribute_table, ix86_handle_cdecl_attribute,
ix86_handle_regparm_attribute): New.
* config/i386/winnt.c (i386_pe_valid_decl_attribute_p,
i386_pe_valid_type_attribute_p): Remove.
(ix86_handle_dll_attribute, ix86_handle_shared_attribute): New.
* config/ia64/ia64.c (ia64_valid_type_attribute): Remove.
(TARGET_VALID_TYPE_ATTRIBUTE): Don't define.
(TARGET_ATTRIBUTE_TABLE): Define.
(ia64_attribute_table): New.
* config/m32r/m32r.c (m32r_valid_decl_attribute, interrupt_ident1,
interrupt_ident2, model_ident1, model_ident2): Remove.
(TARGET_VALID_DECL_ATTRIBUTE): Don't define.
(TARGET_ATTRIBUTE_TABLE): Define.
(init_idents): Update.
(m32r_attribute_table, m32r_handle_model_attribute): New.
* config/m68hc11/m68hc11.c (m68hc11_valid_type_attribute_p):
Remove.
(TARGET_VALID_TYPE_ATTRIBUTE): Don't define.
(TARGET_ATTRIBUTE_TABLE): Define.
(m68hc11_attribute_table, m68hc11_handle_fntype_attribute): New.
* config/mcore/mcore.c (mcore_valid_decl_attribute): Remove.
(TARGET_VALID_DECL_ATTRIBUTE): Don't define.
(TARGET_ATTRIBUTE_TABLE): Define.
(mcore_attribute_table, mcore_handle_naked_attribute): New.
* config/ns32k/ns32k.c (ns32k_valid_type_attribute_p): Remove.
(TARGET_VALID_TYPE_ATTRIBUTE): Don't define.
(TARGET_ATTRIBUTE_TABLE): Define.
(ns32k_attribute_table, ns32k_handle_fntype_attribute): New.
* config/rs6000/rs6000.c (rs6000_valid_type_attribute_p): Remove.
(TARGET_VALID_TYPE_ATTRIBUTE): Don't define.
(TARGET_ATTRIBUTE_TABLE): Define.
(rs6000_attribute_table, rs6000_handle_longcall_attribute): New.
* config/sh/sh.c (sh_valid_decl_attribute): Remove.
(TARGET_VALID_DECL_ATTRIBUTE): Don't define.
(TARGET_ATTRIBUTE_TABLE): Define.
(sh_attribute_table, sh_handle_interrupt_handler_attribute,
sh_handle_sp_switch_attribute, sh_handle_trap_exit_attribute):
New.
* config/stormy16/stormy16.c (stormy16_valid_type_attribute):
Remove.
(TARGET_VALID_TYPE_ATTRIBUTE): Don't define
(TARGET_ATTRIBUTE_TABLE): Define.
(stormy16_attribute_table, stormy16_handle_interrupt_attribute):
New.
* config/v850/v850.c (v850_valid_decl_attribute): Remove.
(TARGET_VALID_DECL_ATTRIBUTE): Don't define.
(TARGET_ATTRIBUTE_TABLE): Define.
(v850_attribute_table, v850_handle_interrupt_attribute,
v850_handle_data_area_attribute): New.
* config/v850/v850-c.c (mark_current_function_as_interrupt):
Return void. Call decl_attributes instead of
valid_machine_attribute.
cp:
Table-driven attributes.
* decl.c: Rename DECL_MACHINE_ATTRIBUTES to DECL_ATTRIBUTES.
* decl2.c (cplus_decl_attributes): Only take one attributes
parameter.
* cp-tree.c (cplus_decl_attributes): Update prototype.
* class.c (finish_struct), decl.c (start_decl, start_function),
decl2.c (grokfield), friend.c (do_friend), parse.y
(parse_bitfield): Update calls to cplus_decl_attributes.
* decl.c (grokdeclarator): Take a pointer to a single ordinary
attribute list.
* decl.h (grokdeclarator): Update prototype.
* decl2.c (grokfield): Take a single ordinary attribute list.
* friend.c (do_friend): Likewise.
* decl.c (shadow_tag, groktypename, start_decl,
start_handler_parms, grokdeclarator, grokparms, start_function,
start_method), decl2.c (grokfield, grokbitfield, grokoptypename),
parse.y (parse_field, parse_bitfield, component_decl_1), pt.c
(process_template_parm, do_decl_instantiation): Pass single
ordinary attribute lists around.
* decl.c (grokdeclarator): Correct handling of nested attributes.
Revert the patch
1998-10-18 Jason Merrill <jason@yorick.cygnus.com>
* decl.c (grokdeclarator): Embedded attrs bind to the right,
not the left.
.
* cp-tree.h (cp_valid_lang_attribute): Remove declaration
(cp_attribute_table): Declare.
* decl.c (valid_lang_attribute): Don't define.
(lang_attribute_table): Define.
(init_decl_processing): Initialize lang_attribute_table instead of
valid_lang_attribute.
* tree.c (cp_valid_lang_attribute): Remove.
(handle_java_interface_attribute, handle_com_interface_attribute,
handle_init_priority_attribute): New functions.
(cp_attribute_table): New array.
* decl2.c (import_export_class): Don't use
targetm.valid_type_attribute.
testsuite:
Table-driven attributes.
* g++.dg/ext/attrib1.C: New test.
From-SVN: r45718
2001-09-21 03:27:06 +02:00
|
|
|
|
decl_attributes (decl, attributes, flags);
|
1995-05-10 04:58:06 +02:00
|
|
|
|
|
c-common.c (decl_attributes): Take a pointer to the node to which attributes are to be attached...
* c-common.c (decl_attributes): Take a pointer to the node to
which attributes are to be attached, and a flags argument.
* c-common.h (enum attribute_flags): New.
(decl_attributes): Update prototype.
* c-decl.c (start_decl, push_parm_decl, finish_struct,
finish_enum, start_function): Update calls to decl_attributes.
* c-parse.in (component_declarator, component_notype_declarator,
label): Update calls to decl_attributes.
cp:
* decl2.c (cplus_decl_attributes): Take a pointer to the node to
which attributes are to be attached, and a flags argument. Update
call to decl_attributes.
(grokfield): Update call to decl_attributes.
* class.c (finish_struct): Update call to cplus_decl_attributes.
* cp-tree.h (cplus_decl_attributes): Update prototype.
* decl.c (start_decl, grokdeclarator, start_function): Update
calls to decl_attributes and cplus_decl_attributes.
* friend.c (do_friend): Update call to cplus_decl_attributes.
* parse.y (parse_bitfield): Update call to cplus_decl_attributes.
From-SVN: r43995
2001-07-13 22:40:43 +02:00
|
|
|
|
if (TREE_CODE (*decl) == TYPE_DECL)
|
|
|
|
|
SET_IDENTIFIER_TYPE_VALUE (DECL_NAME (*decl), TREE_TYPE (*decl));
|
1994-02-24 02:02:37 +01:00
|
|
|
|
}
|
|
|
|
|
|
2005-02-23 06:30:48 +01:00
|
|
|
|
/* Walks through the namespace- or function-scope anonymous union
|
2005-09-09 23:00:49 +02:00
|
|
|
|
OBJECT, with the indicated TYPE, building appropriate VAR_DECLs.
|
2005-02-23 06:30:48 +01:00
|
|
|
|
Returns one of the fields for use in the mangled name. */
|
2001-08-09 19:52:35 +02:00
|
|
|
|
|
2002-12-19 18:16:26 +01:00
|
|
|
|
static tree
|
2005-02-23 06:30:48 +01:00
|
|
|
|
build_anon_union_vars (tree type, tree object)
|
1998-05-20 13:03:18 +02:00
|
|
|
|
{
|
|
|
|
|
tree main_decl = NULL_TREE;
|
1998-05-21 02:48:49 +02:00
|
|
|
|
tree field;
|
1998-05-20 13:03:18 +02:00
|
|
|
|
|
1999-05-19 12:44:22 +02:00
|
|
|
|
/* Rather than write the code to handle the non-union case,
|
|
|
|
|
just give an error. */
|
|
|
|
|
if (TREE_CODE (type) != UNION_TYPE)
|
|
|
|
|
error ("anonymous struct not inside named type");
|
|
|
|
|
|
2005-06-14 22:01:59 +02:00
|
|
|
|
for (field = TYPE_FIELDS (type);
|
|
|
|
|
field != NULL_TREE;
|
2010-07-15 16:31:28 +02:00
|
|
|
|
field = DECL_CHAIN (field))
|
1998-05-20 13:03:18 +02:00
|
|
|
|
{
|
1998-05-21 02:48:49 +02:00
|
|
|
|
tree decl;
|
2002-12-19 18:16:26 +01:00
|
|
|
|
tree ref;
|
1998-11-18 03:21:54 +01:00
|
|
|
|
|
|
|
|
|
if (DECL_ARTIFICIAL (field))
|
1998-05-20 13:03:18 +02:00
|
|
|
|
continue;
|
1998-11-18 03:21:54 +01:00
|
|
|
|
if (TREE_CODE (field) != FIELD_DECL)
|
|
|
|
|
{
|
2008-08-18 13:17:52 +02:00
|
|
|
|
permerror (input_location, "%q+#D invalid; an anonymous union can only "
|
typeck.c (composite_pointer_type_r, [...]): Change pedwarn to permerror.
* typeck.c (composite_pointer_type_r, cxx_sizeof_expr,
cxx_alignof_expr, check_template_keyword, cp_build_binary_op,
pointer_diff, cp_build_unary_op, build_x_compound_expr_from_list,
build_reinterpret_cast_1, cp_build_c_cast, check_return_expr): Change
pedwarn to permerror.
* init.c (perform_member_init, build_new_1, build_new): Likewise.
* decl.c (warn_extern_redeclared_static, duplicate_decls,
* identify_goto, check_previous_goto_1, check_goto, define_label,
check_tag_decl, start_decl, check_class_member_definition_namespace,
grokfndecl, grokdeclarator): Likewise.
* except.c (check_handlers): Likewise.
* typeck2.c (digest_init): Likewise.
* pt.c (check_specialization_namespace,
check_explicit_instantiation_namespace,
maybe_process_partial_specialization, check_explicit_specialization,
convert_template_argument, do_decl_instantiation,
do_type_instantiation, instantiate_decl): Likewise.
* semantics.c (finish_template_type_parm): Likewise.
* name-lookup.c (pushdecl_maybe_friend,
check_for_out_of_scope_variable): Likewise.
* decl2.c (finish_static_data_member_decl, build_anon_union_vars,
coerce_new_type): Likewise.
* parser.c (cp_parser_nested_name_specifier_opt,
cp_parser_mem_initializer, cp_parser_elaborated_type_specifier,
cp_parser_class_head, cp_parser_check_class_key): Likewise.
(cp_parser_parameter_declaration): Check flag_permissive instead of
flag_pedantic_errors.
* call.c (joust): Change pedwarn to warning.
* friend.c (make_friend_class): Likewise.
From-SVN: r136999
2008-06-21 12:36:27 +02:00
|
|
|
|
"have non-static data members", field);
|
1998-11-18 03:21:54 +01:00
|
|
|
|
continue;
|
|
|
|
|
}
|
1998-05-20 13:03:18 +02:00
|
|
|
|
|
1998-05-21 02:48:49 +02:00
|
|
|
|
if (TREE_PRIVATE (field))
|
2008-08-18 13:17:52 +02:00
|
|
|
|
permerror (input_location, "private member %q+#D in anonymous union", field);
|
1998-05-21 02:48:49 +02:00
|
|
|
|
else if (TREE_PROTECTED (field))
|
2008-08-18 13:17:52 +02:00
|
|
|
|
permerror (input_location, "protected member %q+#D in anonymous union", field);
|
1998-05-21 02:48:49 +02:00
|
|
|
|
|
2003-01-16 21:30:50 +01:00
|
|
|
|
if (processing_template_decl)
|
alias.c (adjust_offset_for_component_ref): Use component_ref_field_offset.
* alias.c (adjust_offset_for_component_ref): Use
component_ref_field_offset.
* c-decl.c (build_array_declarator): Add news args for ARRAY_REF.
* c-gimplify.c (gimplify_expr_stmt): Use alloc_stmt_list.
(gimplify_decl_stmt): Call gimplify_type_sizes for type.
For decl, call gimplify_one_sizepos and use statement list.
(gimplify_compound_literal_expr): New arg PRE_P.
Add statement to PRE_P list and return DECL.
(c_gimplify_expr, case COMPOUND_LITERAL_EXPR): Add arg to
gimplify_compound_literal_expr.
* c-tree.h (getdecls): Deleted.
* c-typeck.c (build_component_ref): Add operand for COMPONENT_REF.
(build_array_ref): Add two operands for ARRAY_REF.
(build_unary_op): Set TREE_INVARIANT and TREE_CONSTANT for
COMPOUND_LITERAL_EXPR.
* coverage.c (tree_coverage_counter_ref): Add new operands
for ARRAY_REF.
* emit-rtl.c (component_ref_for_mem_expr): Add new operand
for COMPONENT_REF.
(set_mem_attributes_minus_bitpos): Use array_ref_low_bound
and array_ref_element_size.
(widen_memory_access):Use component_ref_field_offset.
* explow.c (update_nonlocal_goto_save_area): Add two operands
for ARRAY_REF.
* expr.c (array_ref_element_size, array_ref_low_bound): New functions.
(component_ref_field_offset): Likewise.
(get_inner_reference): Use them.
(expand_expr_real_1, case ARRAY_REF): Use array_ref_low_bound.
* fold-const.c (fold, case EQ_EXPR): Properly handle DECL_SIZE.
(fold_read_from_constant_string): Use array_ref_low_bound.
Verify that result is a character type.
(build_fold_indirect_ref): Add two operands for ARRAY_REF.
* function.c (expand_function_start): Likewise.
* gimple-low.c (expand_var_p): Delete duplicated line.
* gimplify.c: Add static decls for local functions.
(cgraph.h): Now included.
(create_tmp_var): Remove check for ARRAY_TYPE.
(copy_if_shared_r): Look at bounds and sizes of types.
(build_and_jump): Return alloc_stmt_list instead of build_empty_stmt.
(gimplify_exit_expr, shortcut_cond_expr): Likewise.
(gimplify_save_expr, gimple_push_cleanup): Likewise.
(gimplify_init_constructor): Likewise.
WANT_VALUE now bool.
If empty list with no result wanted, return GS_UNHANDLED.
Add additional operands for ARRAY_REF and COMPONENT_REF.
(canonicalize_component_ref): Convert to &array[L].
(gimplify_array_ref_to_plus): Use array_ref_element_size and
array_ref_lower_bound.
(build_addr_expr_with_type, build_addr_expr): New functions.
(gimplify_compound_lval): WANT_LVALUE now bool.
Major rework to allow handle_component_p and initialize and
gimplify new operands for ARRAY_REF, ARRAY_RANGE_REF, and
COMPONENT_REF.
(gimplify_array_ref): Deleted.
(gimplify_self_mod_expr): WANT_VALUE now bool.
(gimplify_modify_expr): Gimplify to_p and from_p later.
Factor out code into gimplify_modify_expr_rhs and call twice.
Move variable-size code earlier and handle PLACEHOLDER_EXPR.
(gimplify_modify_expr_rhs, gimplify_variable_sized_compare): New fns.
(gimplify_addr_expr, case VIEW_CONVERT_EXPR): New case.
(gimplify_expr, case ARRAY_REF): Delete special case.
Instead handle like COMPONENT_REF; also do ARRAY_RANGE_REF,
IMAGPART, and REALPART the same way.
(gimplify_expr, case VIEW_CONVERT_EXPR): New case.
(gimplify_expr): Call gimplify_variable_sized_compare if applicable.
Call alloc_stmt_list instead of build_empty_stmt.
Deal with _REF that's volatile.
(gimplify_type_sizes, gimplify_one_sizepos): New functions.
(unshare_body, unvisit_body): New functions.
(gimplify_body): Call them.
* stmt.c (expand_stack_alloc): Don't expand TYPE_MAX_VALUE.
* stor-layout.c (get_pending_sizes): Don't change SAVE_EXPR_CONTEXT.
* tree-alias-common.c (get_alias_var): Also skip ARRAY_RANGE_REF.
* tree-cfg.c (tree_node_can_be_shared): Treat ARRAY_RANGE_REF
like ARRAY_REF.
(verify_expr, case ADDR_EXPR): Use handled_component_p.
* tree-dfa.c (get_virtual_var): Likewise.
* tree-dump.c (dequeue_and_dump, case COMPONENT_REF, ARRAY_REF):
New cases to dump new operands; likewise for ARRAY_RANGE_REF.
* tree-eh.c (tree_could_trap, case ARRAY_RANGE_REF): Like ARRAY_REF.
* tree-gimple.c (is_gimple_addr_expr_arg): Add ARRAY_RANGE_REF
and INDIRECT_REF.
(get_base_address): Use handled_component_p.
* tree-gimple.h (gimplify_type_sizes, gimplify_one_sizepos): New.
* tree-line.c (walk_tree): Walk more things for types and decls.
* tree-mudflap.c (mf_build_check_statement_for): Add new operands
for ARRAY_REF and COMPONENT_REF.
(mx_xform_derefs_1): Clean up usage of decl sizes.
* tree-nested.c (build_addr): Use handled_component_p.
(walk_stmts, case CATCH_EXPR): Add missing "break".
(get_static_chain, get_frame_field): Add new operand for COMPONENT_REF.
(finalize_nesting_tree_1): Likewise.
(convert_nonlocal_reference, case ARRAY_RANGE_REF): Like ARRAY_REF
and process additional operands.
(convert_local_reference): Likewise.
* tree-outof-ssa.c (discover_nonconstant_array_refs_r): Treat
ARRAY_RANGE_REF similarly to ARRAY_REF.
* tree-pretty-print.c (dump_generic_node, case QUAL_UNION_TYPE): Handle
like RECORD_TYPE.
(dump_generic_node, case COMPONENT_REF): Print offset operand.
(dump_generic_node, case ARRAY_RANGE_REF): Treat like ARRAY_REF
and print lower bound and element size for both.
(op_prio, case ARRAY_RANGE_REF): Like ARRAY_REF.
* tree-sra.c (csc_build_component_ref): Add new operand.
(scalarize_call_expr): Use get_base_address.
* tree-ssa-ccp.c (widen_bitfield): Clean up size handling.
(maybe_fold_offset_to_array_ref): Rework to handle input having an
ARRAY_REF, refine handling of lower bound, and add new operands
for ARRAY_REF.
(maybe_fold_to_component_ref): Add new operand for COMPONENT_REF.
(maybe_fold_stmt_indirect): Only fold *&B to B if types match.
(maybe_fold_stmt_addition): Only handle constant lower bound.
* tree-ssa-operands.c (get_expr_operands): Minor rearrangements.
Treat ARRAY_REF and ARRAY_RANGE_REF the same; look at extra operands.
Look at new offset operand of COMPONENT_REF.
* tree-ssa.c (set_is_used): Use handled_component_p.
* tree.c (substitute_in_expr, case COMPONENT_REF): Add new operand.
(stabilize_reference, case COMPONENT_REF): Likewise.
(stabilize_reference, case ARRAY_RANGE_REF, ARRAY_REF): Similarly.
(recompute_tree_invariant_for_addr_expr): Completely rework to
be more precise. Also set TREE_SIDE_EFFECTS.
(build1_stat, case ARRAY_EXPR): Don't handle TREE_SIDE_EFFECTS here.
(build2_stat, build3_stat, build4_stat): For references,
propagate TREE_THIS_VOLATILE.
(get_unwidened): Add new operand for COMPONENT_REF.
(get_narrower): Likewise; use host_integerp for DECL_SIZE.
* tree.def (COMPONENT_REF): Add new operand.
(ARRAY_REF, ARRAY_RANGE_REF): Add two new operands.
* tree.h (array_ref_element_size, array_ref_low_bound): New decls.
(component_ref_field_offset): Likewise.
* config/alpha/alpha.c (alpha_va_start): Add new op for COMPONENT_REF.
(alpha_gimplify_va_arg): Likewise.
* config/i386/i386.c (ix86_va_start, ix86_gimplify_va_arg): Likewise.
* config/i860/i860.c (i860_va_start, i860_va_arg): Likewise.
* config/iq2000/iq2000.c (iq2000_va_arg): Likewise.
* config/mips/mips.c (mips_va_start, mips_va_arg): Likewise.
* config/rs6000/rs6000.c (rs6000_va_start, rs6000_gimplify_va_arg):
Likewise.
* config/s390/s390.c (s390_va_start, s390_gimplify_va_arg): Likewise.
* config/sh/sh.c (sh_va_start, sh_va_arg): Likewise.
* config/stormy16/stormy16.c (xstormy1_expand_builin_va_start):
Likewise.
(xstormy16_expand_builtin_va_arg): Likewise.
* config/xtensa/xtensa.c (xtensa_va_start, xtensa_va_arg): Likewise.
* cp/call.c (build_vfield_ref): Add new operand for COMPONENT_REF.
(build_new_method_call): Likewise.
* cp/decl.c (local_variable_p_walkfn): Don't walk into types.
* cp/decl2.c (grok_array_decl): Add new operands for ARRAY_REF.
(build_anon_union_vars): Add new operand for COMPONENT_REF.
* cp/init.c (buld_new): Add new operand for ARRAY_REF.
* cp/method.c (do_build_copy_constructor): New op for COMPONENT_REF.
(do_build_assign_ref): Likewise.
* cp/parser.c (cp_parser_direct_new_declarator): Add new operands
for ARRAY_REF.
(cp_parser_direct_declarator): Likewise.
* cp/pt.c (tsubst): Likewise.
(tsubst_copy, tsubst_copy_and_build): Likewise; also add new operand
for COMPONENT_REF.
* cp/semantics.c (finish_non_static_data_member): Add new operand
for COMPONENT_REF.
* cp/typeck.c (build_class_member_access_expr): Likewise.
(build_class_member_access_expr, finish_class_member_access_expr):
Likewise.
(build_ptrmemfunc_access_expr): Likewise.
(build_array_ref): Add new operands for ARRAY_REF.
* cp/typeck2.c (split_nonconstant_init_1): Likewise; COMPONENT_REF too.
* cp/tree.c (count_trees_r, no_linkage_helper): Don't walk in types.
* fortran/f95-lang.c (LANG_HOOKS_GIMPLE_BEFORE_INLINING): Deleted.
* fortran/trans-array.c (gfc_conv_descriptor_data): Add operand
for COMPONENT_REF.
(gfc_conv_descriptor_offset, gfc_conv_descriptor_dtype): Likewise.
(gfc_conv_descriptor_dimension, gfc_conv_descriptor_stride): Likewise.
(gfc_conv_descriptor_lbound, gfc_conv_descriptor_ubound): Likewise.
* fortran/trans-common.c (create_common): Likewise.
* fortran/trans-expr.c (gfc_conv_component_ref): Likewise.
* fortran/trans-io.c (set_parameter_value): Likewise.
(set_parameter_ref, set_string, set_flag, io_result): Likewise.
(transfer_expr): Likewise.
* fortran/trans-decl.c (gfc_trans_auto_character_variable):
Set up to get DECL_SIZE and DECL_SIZE_UNIT gimplified.
(gfc_simplify_function): New function.
(gfc_generate_function-code): Properly handle nested functions.
* fortran/trans.c (gfc_build_array_ref): Add two new operands
for ARRAY_REF.
* java/class.c (build_class_ref): Add new operand for COMPONENT_REF.
(build_static_field_ref): Likewise and add new operands for ARRAY_REF.
* java/constants.c (build_ref_from_constant_pool): Likewise.
* java/expr.c (build_java_array_length_access): Likewise.
(build_get_class, build_field_ref, build_known_method_ref): Likewise.
(invoke_build_dtable, build_invokevirtual): Likewise.
(build_invokeinterface, java_expand_expr): Likewise.
(emit_init_test_initialization): Likewise.
* java/java-gimplify.c (java_gimplify_new_array_init): Likewise.
* java/parse.y (make_qualifed_name, build_array_ref): Likewise.
* objc/ojbc-act.c (generate_static_references): Add additional
operands to ARRAY_REF.
(generate_strings, build_method_prototype_list_template): Likewise.
(generate_protocol_list): Likewise.
From-SVN: r83474
2004-06-22 05:07:05 +02:00
|
|
|
|
ref = build_min_nt (COMPONENT_REF, object,
|
|
|
|
|
DECL_NAME (field), NULL_TREE);
|
2003-01-16 21:30:50 +01:00
|
|
|
|
else
|
|
|
|
|
ref = build_class_member_access_expr (object, field, NULL_TREE,
|
2008-03-25 14:53:58 +01:00
|
|
|
|
false, tf_warning_or_error);
|
2002-12-19 18:16:26 +01:00
|
|
|
|
|
|
|
|
|
if (DECL_NAME (field))
|
1998-05-21 02:48:49 +02:00
|
|
|
|
{
|
2005-09-12 06:04:03 +02:00
|
|
|
|
tree base;
|
|
|
|
|
|
java-gimplify.c (java_gimplify_block): New argument to build_empty_stmt.
gcc/java/
* java-gimplify.c (java_gimplify_block): New argument to
build_empty_stmt.
* expr.c (force_evaluation_order): Same.
* typeck.c: Add location to build_decl or PUSH_FIELD calls.
* class.c: Same.
* decl.c: Same.
* jcf-parse.c: Same.
* constants.c: Same.
* resource.c: Same.
* except.c: Same.
* builtins.c: Same.
* expr.c: Same.
* java-tree.h (PUSH_FIELD): Add location field.
gcc/objc/
* objc-act.c (finish_var_decl): Pass location to finish_decl.
(objc_get_parm_info): Same.
(get_super_receiver): Same.
* objc-act.c (objc_build_component_ref): Pass location to
build_compound_ref.
(build_module_initializer_routine): Pass location to
c_end_compound_stmt.
(objc_generate_static_init_call): Pass location to build_stmt.
(build_typed_selector_reference): New location argument.
(build_selector_reference): Same.
(objc_substitute_decl): Pass location to build_array_ref.
(next_sjlj_build_try_catch_finally): Pass location to build_stmt.
(objc_begin_catch_clause): Same.
(objc_finish_try_stmt): Same.
(objc_finish_catch_clause): Pass location to c_end_compound_stmt.
(objc_build_throw_stmt): New argument.
(generate_shared_structures): Pass location to build_c_cast.
(objc_build_message_expr): Use local location.
(objc_finish_message_expr): Use input_location.
(build_objc_method_call): New argument.
(objc_build_selector_expr): Same.
(get_super_receiver): Pass location to build_c_cast,
build_modify_expr, build_compound_expr.
* objc-act.c: Add location to all calls to start_struct, build_decl,
finish_struct.
gcc/
* tree-pretty-print.c (dump_generic_node): Dump column numbers.
* gimple-pretty-print.c (dump_gimple_stmt): Same.
* gimplify.c (gimplify_modify_expr): Set location for GIMPLE_ASSIGNs
created.
* c-parser.c (c_parser_binary_expression): Use current column while
building binary operations.
* common.opt (fshow-column): Enable by default.
* tree-vrp.c (check_array_ref): Use warning_at.
(check_array_bounds): Use location from call back if expr has no
location.
* tree.h: Add location argument to maybe_fold_*.
* tree-ssa-ccp.c (ccp_fold): Pass location to maybe_fold_*.
(maybe_fold_offset_to_array_ref): Add location argument and use it.
(maybe_fold_offset_to_component_ref): Same.
(maybe_fold_offset_to_reference): Same.
(maybe_fold_offset_to_address): Same.
(maybe_fold_stmt_indirect): Same.
(maybe_fold_stmt_addition): Same.
(fold_stmt_r): Pass location to maybe_fold_*.
(fold_gimple_assign): Same.
* c-tree.h: Add location argument to finish_decl,
default_function_array_conversion, store_init_value.
* c-decl.c (define_label): Use error_at.
(c_make_fname_decl): Pass location to finish_decl.
(finish_decl): New location argument.
(build_compound_literal): Pass location to store_init_value.
(grokdeclarator): Pass location to finish_decl.
(grokfield): Same.
* c-typeck.c (array_to_pointer_conversion): New location argument.
(function_to_pointer_conversion): Same.
(default_function_array_conversion): Same.
(parser_build_unary_op): Pass location to overflow_warning.
(parser_build_binary_op): Same. Use warning_at.
(build_unary_op): Pass location to array_to_pointer_conversion.
(build_c_cast): Pass location to digest_init.
(build_modify_expr): New location argument.
(convert_for_assignment): Same.
(store_init_value): Same.
(digest_init): Same.
(output_init_element): Pass location to digest_init and
array_to_pointer_conversion.
(c_finish_return): Pass location to convert_for_assignment.
* gimplify.c (gimplify_conversion): Pass location to
maybe_fold_offset_to_address.
* tree-ssa-forwprop.c (forward_propagate_addr_expr_1): Pass location
to maybe_fold_stmt_addition.
* c-omp.c (c_finish_omp_atomic): Pass new location to
build_modify_expr.
(c_finish_omp_for): Same.
* c-common.c (overflow_warning): New argument.
* c-common.h: New argument to build_modify_expr, overflow_warning.
* c-parser.c (c_parser_declaration_or_fndef): Pass location to
finish_decl.
(c_parser_initializer): Pass location to
default_function_array_conversion.
(c_parser_initelt): Same.
(c_parser_initval): Same.
(c_parser_asm_operands): Same.
(c_parser_expr_no_commas): Same. Pass location to build_modify_expr.
(c_parser_conditional_expression): Same.
(c_parser_binary_expression): Add location info to stack. Use it.
(c_parser_unary_expression): Pass location to
default_function_array_conversion, parser_build_unary_op,
build_indirect_ref, c_parser_postfix_expression_after_primary.
(c_parser_postfix_expression_after_primary): New location argument.
Use it.
(c_parser_expression_conv): Pass location to
default_function_array_conversion.
(c_parser_expr_list): Same.
(c_parser_omp_atomic): Same.
(c_parser_omp_for_loop): Same.
* c-tree.h: (struct c_declarator): Add comment to id_loc.
(build_array_declarator): New argument.
* c-decl.c (build_array_declarator): Add location argument.
(grokdeclarator): Set id_loc for cdk_array.
* c-parser.c (c_parser_direct_declarator_inner): Pass location to
build_array_declarator.
* tree.c (build_omp_clause): Add location argument.
* tree.h (OMP_CLAUSE_HAS_LOCATION): New macro.
(OMP_CLAUSE_LOCATION): New macro.
(struct tree_omp_clause): Add location field.
(build_omp_clause): Add argument.
* testsuite/gcc.dg/gomp/for-1.c: Fix column.
* cp/pt.c (tsubst_omp_for_iterator): Pass location to
build_omp_clause.
* cp/parser.c (cp_parser_omp_var_list_no_open): Same.
(cp_parser_omp_clause_collapse): Same.
(cp_parser_omp_clause_default): Same.
(cp_parser_omp_clause_if): Same.
(cp_parser_omp_clause_nowait): Same.
(cp_parser_omp_clause_num_threads): Same.
(cp_parser_omp_clause_ordered): Same.
(cp_parser_omp_clause_schedule): Same.
(cp_parser_omp_clause_untied): Same.
(cp_parser_omp_for_loop): Same.
(cp_parser_omp_parallel): Pass location to c_split_parallel_clauses.
* c-tree.h (c_start_case): Add location argument.
(c_process_expr_stmt): Same.
(c_finish_goto_*): Same.
* tree-parloops.c (initialize_reductions): Pass location to
build_omp_clause.
(create_parallel_loop): Same.
* fortran/trans-openmp.c (gfc_trans_omp_variable_list): Same.
(gfc_trans_omp_reduction_list): Same.
(gfc_trans_omp_clauses): Same.
(gfc_trans_omp_do): Same.
* c-typeck.c (c_finish_goto_label): Same.
(c_finish_goto_ptr): New location argument.
(c_start_case): Same.
(emit_side_effect_warnings): Same.
(c_process_expr_stmt): Same.
(c_finish_stmt_expr): Same.
(c_finish_omp_clauses): Use error_at instead of error.
* gimplify.c (gimplify_adjust_omp_clauses_1): Pass location to
build_omp_clause.
* c-omp.c (c_split_parallel_clauses): New location argument.
* tree-nested.c (convert_nonlocal_reference_stmt): Pass location
to build_omp_clause.
(convert_local_reference_stmt): Same.
(convert_gimple_call): Same.
* c-common.h (c_split_parallel_clauses): New argument.
* c-parser.c (c_parser_statement_after_labels): Pass location to
c_finish_goto_label.
(c_parser_switch_statement): Pass location to c_start_case.
(c_parser_for_statement): Pass location to c_finish_expr_stmt,
and c_process_expr_stmt.
(c_parser_omp_variable_list): Add location argument.
(c_parser_omp_clause_collapse): Pass location to
build_omp_clause.
(c_parser_omp_clause_default): Same.
(c_parser_omp_clause_if): Same.
(c_parser_omp_clause_num_threads): Same.
(-c_parser_omp_clause_ordered): Same.
(c_parser_omp_clause_reduction): Pass location to
c_parser_omp_variable_list.
(c_parser_omp_clause_schedule): Pass location to build_omp_clause.
(c_parser_omp_clause_untied): Same.
(c_parser_omp_for_loop): Pass location to c_process_expr_stmt.
(c_parser_omp_parallel): Pass location to
c_split_parallel_clauses.
* c-tree.h (check_for_loop_decls, undeclared_variable,
build_component_ref, build_array_ref, build_external_ref,
c_expr_sizeof_expr, c_expr_sizeof_type, parser_build_unary_op,
build_conditional_expr, build_compound_expr, c_cast_expr,
build_c_cast, build_asm_expr, c_end_compound_stmt, c_finish_stmt_expr,
c_finish_return, c_finish_omp_parallel, c_finish_omp_task): New
argument.
* c-semantics.c (build_stmt): Same.
(build_case_label): Same.
* c-decl.c (c_finish_incomplete_decl): Pass location on down.
(undeclared_variable): New argument.
(make_label): Same.
(lookup_label): Pass location on down.
(define_label): Same.
(finish_decl): Same.
(build_compound_literal): Same.
(finish_struct): Same.
(finish_function): Do not set location here.
(check_for_loop_decls): New argument.
* tree.c (save_expr): Set location.
(build_empty_stmt): New argument.
* tree.h (build_empty_stmt): New argument to build_empty_stmt.
(CAN_HAVE_LOCATION_P): Make sure we have a non empty node.
* builtins.c (gimplify_va_arg_expr): Use locations.
(expand_builtin_sync_operation): Same.
* c-typeck.c (build_component_ref): New argument.
(build_array_ref): Same.
(build_external_ref): Same.
(c_expr_sizeof_expr): Same.
(c_expr_sizeof_type): Same.
(parser_build_unary_op): Same.
(build_conditional_expr): Same.
(build_compound_expr): Pass location on down.
(build_compound_expr): New argument.
(build_c_cast): Same.
(c_cast_expr): Same.
(build_asm_expr): Same.
(c_finish_return): Same.
(c_process_expr_stmt): Pass location on down.
(c_finish_stmt_expr): New argument.
(push_clenaup): Same.
(c_finish_omp_parallel): Same.
(c_finish_omp_task): Same.
* gimplify.c (gimplify_call_expr): Pass location on down.
* c-omp.c (c_finish_omp_master): New argument.
(c_finish_omp_critical): Same.
(c_finish_omp_ordered): Same.
(c_finish_omp_barrier): Same.
(-c_finish_omp_taskwait): Same.
(c_finish_omp_atomic): Same.
(c_finish_omp_flush): Same.
* tree-inline.c (copy_tree_body_r): Pass location on down.
(inline_forbidden_p): Remove use of input_location.
* c-gimplify.c (c_build_bind_expr): New argument.
* c-common.c (c_common_truthvalue_conversion): Pass location on down.
(c_sizeof_or_alignof_type): New argument.
(c_alignof_expr): Same.
(build_va_arg): Same.
(c_add_case_label): Same.
* c-common.h (c_sizeof_or_alignof_type, c_alignof_expr,
c_sizeof, c_alignof, build_va_arg, build_stmt, build_case_label,
c_build_bind_expr, objc_build_selector_expr, objc_build_throw_stmt,
c_finish_omp_master, c_finish_omp_critical, c_finish_omp_ordered,
c_finish_omp_barrier, c_finish_omp_atomic, c_finish_omp_flush,
c_finish_omp_taskwait, c_finish_omp_for, c_split_parallel_clauses):
New argument.
* stub-objc.c (objc_build_selector_expr): Same.
(objc_build_throw_stmt): Same.
* c-parser.c (c_parser_declaration_or_fndef): Pass location on down.
(c_parser_initelt): Same.
(c_parser_compound_statement): Same.
(c_parser_compound_statement_nostart): Same.
(c_parser_label): Same.
(c_parser_statement_after_labels): Same.
(c_parser_if_body): Same.
(c_parser_else_body): Same.
(c_parser_if_statement): Same.
(c_parser_switch_statement): Same.
(c_parser_while_statement): Same.
(c_parser_do_statement): Same.
(c_parser_for_statement): Same.
(c_parser_asm_statement): Same.
(c_parser_conditional_expression): Same.
(c_parser_binary_expression): Same.
(c_parser_cast_expression): Same.
(c_parser_unary_expression): Same.
(c_parser_sizeof_expression): Same.
(c_parser_alignof_expression): Same.
(c_parser_postfix_expression): Same.
(c_parser_expression): Same.
(c_parser_objc_receiver): Same.
(c_parser_omp_variable_list): Same.
(c_parser_omp_structured_block): Same.
(c_parser_omp_atomic): New argument.
(c_parser_omp_barrier): Same.
(c_parser_omp_critical): Same.
(c_parser_omp_flush): Pass location on down.
(c_parser_omp_for_loop): New argument.
(c_parser_omp_for): Same.
(c_parser_omp_master): Same.
(c_parser_omp_ordered): Same.
(c_parser_omp_sections_scope): Same.
(c_parser_omp_sections): Same.
(c_parser_omp_parallel): Same.
(c_parser_omp_single): Same.
(c_parser_omp_task): Same.
(c_parser_omp_taskwait): Pass location on down.
(c_parser_omp_construct): Same.
(c_parser_omp_threadprivate): Same.
* dwarf2asm.c, targhooks.c, optabs.c, tree.c, tree.h, target.h,
builtins.c, omp-low.c, cgraphunit.c, tree-call-cdce.c,
tree-ssa-alias.c, gimple-low.c, c-tree.h, expr.c, tree-parloops.c,
c-decl.c, tree-eh.c, langhooks.c, function.c, stor-layout.c,
c-typeck.c, gimplify.c, c-pragma.c, expmed.c, except.c, coverage.c,
emit-rtl.c, cfgexpand.c, tree-mudflap.c, varasm.c, tree-nested.c,
rtl.h, tree-inline.c, tree-profile.c, c-common.c, c-common.h,
tree-switch-conversion.c, tree-cfg.c, ipa-struct-reorg.c, c-parser.c,
config/i386/i386.c, stmt.c:
Add location argument to the following function definitions and/or
function calls: build_decl, objcp_start_struct, objcp_finish_struct,
start_struct, finish_struct, PUSH_FIELD, create_artificial_label,
cp_make_fname_decl, pushtag, implicitly_declare, c_make_fname_decl,
build_compound_literal, parser_xref_tag, resolve_overloaded_builtin,
do_case, c_finish_bc_stmt, build_compound_literal,
build_function_call.
* c-decl.c (build_compound_literal): Add location argument.
Make all diagnostic calls use location.
(start_struct): Same.
(finish_struct): Same.
(start_enum): Same.
(build_enumerator): Same.
(start_function): Same.
(grokdeclarator): Make all diagnostic calls use location.
(store_parm_decls_oldstyle): Same.
* c-typeck.c (build_function_call): Add location argument.
Make all diagnostic calls use location.
(do_case): Same.
(c_finish_bc_stmt): Same.
* tree-nested.c (get_trampoline_type): Add argument.
Pass location to build_decl.
(lookup_tramp_for_decl): Pass location to get_trampoline_type.
* rtl.h (RTL_LOCATION): New.
* c-common.c (c_add_case_label): Add location argument.
Make all diagnostic calls use location.
* c-common.h: Add location argument to make_fname_decl, do_case,
c_add_case_label, build_function_call, resolve_overloaded_builtin.
* c-parser.c (c_parser_enum_specifier): Rename ident_loc to enum_loc.
Set it appropriately for every case. Pass enum_loc to start_enum
call. Pass value_loc first to build_enumerator. Pass enum_loc to
parser_xref_tag.
(c_parser_struct_or_union_specifier): Save location. Use it for
start_struct, finish_struct, and parser_xref_tag.
gcc/testsuite/
* gcc.dg/old-style-prom-3.c: Add column info.
* gcc.dg/overflow-warn-1.c
* gcc.dg/gomp/pr27415.c
* gcc.dg/gomp/for-1.c: Same.
* gcc.dg/enum-compat-1.c: Same.
* gcc.dg/c99-tag-3.c: Same.
* gcc.dg/Wredundant-decls-2.c: Same.
* gcc.dg/func-ptr-conv-1.c: Same.
* gcc.dg/asm-wide-1.c: Same.
* gcc.dg/nofixed-point-2.c: Same.
* gcc.dg/cpp/line3.c: Same.
* gcc.dg/array-10.c: Same.
* gcc.dg/c99-vla-jump-1.c: Same.
* gcc.dg/pr20368-1.c: Same.
* gcc.dg/Wshadow-3.c: Same.
* gcc.dg/c90-const-expr-8.c: Same.
* gcc.dg/label-decl-2.c: Same.
* gcc.dg/dremf-type-compat-2.c: Same.
* gcc.dg/c90-const-expr-5.c: Same.
* gcc.dg/builtins-30.c: Same.
* gcc.dg/Warray-bounds.c: Same.
* gcc.dg/Wcxx-compat-2.c: Same.
* gcc.dg/tree-ssa/col-1.c: Same.
* gcc.dg/old-style-prom-2.c: Same.
* gcc.dg/cast-function-1.c: Same.
* gcc.dg/pr15698-1.c: Same.
* gcc.dg/dremf-type-compat-3.c: Same.
* gcc.dg/vla-8.c: Same.
* gcc.dg/gomp/pr27415.c: Move firstprivate diagnostics to correct
line.
* gcc.dg/label-decl-2.c: Move label diagnostic to correct line.
* gcc.dg/old-style-prom-3.c: Check for error on the correct line.
* gcc.dg/enum-compat-1.c: Same.
* gcc.dg/dremf-type-compat-2.c: Same.
* gcc.dg/old-style-prom-2.c: Same.
* gcc.dg/pr15698-1.c: Same.
* gcc.dg/pr20368-1.c: Same.
* gcc.dg/dremf-type-compat-3.c: Same.
* gcc.dg/builtins-30.c: Same. Test for columns.
gcc/objcp/
* objcp-decl.h (c_end_compound_stmt): New argument.
* objcp-decl.c (objcp_start_struct): Add argument.
(objcp_finish_struct): Same.
gcc/cp/
* typeck.c (cp_build_binary_op): Pass location to overflow_warning.
(build_modify_expr): New arg.
* semantics.c (finish_unary_op_expr): Pass location to
overflow_warning.
(handle_omp_for_class_iterator): Pass location to build_modify_expr.
* typeck.c (cxx_sizeof_or_alignof_type): Pass location to
c_sizeof_or_alignof_type.
(build_array_ref): New argument.
(build_compound_expr): Same.
(build_const_cast): Same.
(build_ptrmemfunc): Pass location to build_c_cast.
* init.c (avoid_placement_new_aliasing): Pass location to
build_stmt.
(build_vec_delete_1): Pass location to cp_build_modify_expr,
build_compound_expr.
* class.c (build_vtbl_ref_1): Pass location to build_array_ref.
* decl.c (poplevel): Pass location to c_build_bind_expr.
(finish_case_label): Pass location to build_case_label.
(finish_constructor_body): Same.
(finish_destructor_body): Pass location to build_stmt.
(cxx_maybe_build_cleanup): Same, but to build_compound_expr.
* call.c (build_new_op): Pass location to build_array_ref.
(build_x_va_arg): Pass location to build_va_arg.
* except.c (expand_end_catch_block): Pass location to
build_stmt.
* cp-tree.h (build_array_ref): New argument.
(build_compound_expr): Same.
(build_c_cast): Same.
* cp-gimplify.c (gimplify_if_stmt): Pass location on down.
(gimplify_switch_stmt): Same.
* typeck2.c (split_nonconstant_init_1): Same.
* pt.c (tsubst_copy): Same.
* semantics.c (add_decl_expr): Same.
(do_poplevel): Same.
(push_cleanup): Same.
(finish_goto_stmt): Same.
(finish_expr_stmt): Same.
(begin_if_stmt): Same.
(begin_while_stmt): Same.
(begin_do_stmt): Same.
(finish_return_stmt): Same.
(begin_for_stmt): Same.
(finish_break_stmt): Same.
(finish_continue_stmt): Same.
(begin_switch_stmt): Same.
(begin_try_block): Same.
(begin_handler): Same.
(finish_asm_stmt): Same.
(finish_label_stmt): Same.
(finish_stmt_expr_expr): Same.
(finalize_nrv_r): Same.
(finish_omp_atomic): Same.
* name-lookup.c (do_using_directive): Same.
* decl2.c (grok_array_decl): Same.
* parser.c (cp_parser_cast_expression): Same.
(cp_parser_selection_statement): Same.
(cp_parser_implicitly_scoped_statement): Same.
(cp_parser_objc_selector_expression): Same.
(cp_parser_objc_synchronized_statement): Same.
(cp_parser_objc_throw_statement): Same.
(cp_parser_omp_critical): Same.
(cp_parser_omp_master): Same.
* typeck.c (build_function_call): Add location argument.
* init.c: Add location argument to all build_decl calls.
* class.c: Same.
* method.c: Same.
* rtti.c: Same.
* tree.c: Same.
* pt.c: Same.
* semantics.c: Same.
* lex.c: Same.
* decl2.c: Same.
* cp-gimplify.c: Same.
* decl.c: Same.
(cp_make_fname_decl): Add location argument. Pass location ot
build_decl.
(finish_case_label): Same.
* cp-tree.h (finish_case_label): Add location argument.
* parser.c (cp_parser_label_for_labeled_statement): Pass location to
finish_case_label.
gcc/fortran/
* trans-array.c (gfc_trans_allocate_array_storage): Pass
location on down.
(gfc_trans_array_constructor_value): Same.
(gfc_trans_scalarized_loop_end): Same.
(gfc_conv_ss_startstride): Same.
(gfc_trans_g77_array): Same.
(gfc_trans_dummy_array_bias): Same.
(gfc_conv_array_parameter): Same.
(structure_alloc_comps): Same.
* trans-expr.c (gfc_conv_function_call): Same.
(fill_with_spaces): Same.
(gfc_trans_string_copy): Same.
(gfc_trans_scalar_assign): Same.
* trans-stmt.c (gfc_trans_goto): Same.
(gfc_trans_if_1): Same.
(gfc_trans_simple_do): Same.
(gfc_trans_do): Same.
(gfc_trans_do_while): Same.
(gfc_trans_logical_select): Same.
(gfc_trans_select): Same.
(gfc_trans_forall_loop): Same.
(gfc_trans_nested_forall_loop): Same.
(generate_loop_for_temp_to_lhs): Same.
(generate_loop_for_rhs_to_temp): Same.
(gfc_trans_forall_1): Same.
(gfc_trans_where_assign): Same.
(gfc_trans_where_3): Same.
(gfc_trans_allocate): Same.
* trans.c (gfc_finish_block): Same.
(gfc_trans_runtime_check): Same.
(gfc_call_malloc): Same.
(gfc_allocate_with_status): Same.
(gfc_call_free): Same.
(gfc_deallocate_with_status): Same.
(gfc_call_realloc): Same.
(gfc_trans_code): Same.
* trans-decl.c (gfc_init_default_dt): Same.
(gfc_generate_constructors): Same.
* trans-io.c (gfc_trans_io_runtime_check): Same.
* trans-intrinsic.c (gfc_conv_intrinsic_ctime): Same.
(gfc_conv_intrinsic_fdate): Same.
(gfc_conv_intrinsic_ttynam): Same.
(gfc_conv_intrinsic_minmax): Same.
(gfc_conv_intrinsic_minmax_char): Same.
(gfc_conv_intrinsic_anyall): Same.
(gfc_conv_intrinsic_count): Same.
(gfc_conv_intrinsic_arith): Same.
(gfc_conv_intrinsic_minmaxloc): Same.
(gfc_conv_intrinsic_minmaxval): Same.
(gfc_conv_intrinsic_rrspacing): Same.
(gfc_conv_intrinsic_array_transfer): Same.
(gfc_conv_intrinsic_trim): Same.
(gfc_conv_intrinsic_repeat): Same.
From-SVN: r148442
2009-06-13 00:06:47 +02:00
|
|
|
|
decl = build_decl (input_location,
|
|
|
|
|
VAR_DECL, DECL_NAME (field), TREE_TYPE (field));
|
2007-06-15 18:58:29 +02:00
|
|
|
|
DECL_ANON_UNION_VAR_P (decl) = 1;
|
2009-11-13 00:21:33 +01:00
|
|
|
|
DECL_ARTIFICIAL (decl) = 1;
|
2005-09-12 06:04:03 +02:00
|
|
|
|
|
|
|
|
|
base = get_base_address (object);
|
|
|
|
|
TREE_PUBLIC (decl) = TREE_PUBLIC (base);
|
|
|
|
|
TREE_STATIC (decl) = TREE_STATIC (base);
|
|
|
|
|
DECL_EXTERNAL (decl) = DECL_EXTERNAL (base);
|
|
|
|
|
|
2005-09-09 23:00:49 +02:00
|
|
|
|
SET_DECL_VALUE_EXPR (decl, ref);
|
|
|
|
|
DECL_HAS_VALUE_EXPR_P (decl) = 1;
|
2005-09-12 06:04:03 +02:00
|
|
|
|
|
1998-05-21 02:48:49 +02:00
|
|
|
|
decl = pushdecl (decl);
|
|
|
|
|
}
|
2002-12-19 18:16:26 +01:00
|
|
|
|
else if (ANON_AGGR_TYPE_P (TREE_TYPE (field)))
|
2005-02-23 06:30:48 +01:00
|
|
|
|
decl = build_anon_union_vars (TREE_TYPE (field), ref);
|
2003-01-15 02:21:46 +01:00
|
|
|
|
else
|
|
|
|
|
decl = 0;
|
1998-05-21 02:48:49 +02:00
|
|
|
|
|
2002-12-19 18:16:26 +01:00
|
|
|
|
if (main_decl == NULL_TREE)
|
|
|
|
|
main_decl = decl;
|
1998-05-21 02:48:49 +02:00
|
|
|
|
}
|
2002-12-19 18:16:26 +01:00
|
|
|
|
|
1998-05-20 13:03:18 +02:00
|
|
|
|
return main_decl;
|
|
|
|
|
}
|
|
|
|
|
|
2001-04-10 17:48:11 +02:00
|
|
|
|
/* Finish off the processing of a UNION_TYPE structure. If the union is an
|
|
|
|
|
anonymous union, then all members must be laid out together. PUBLIC_P
|
|
|
|
|
is nonzero if this union is not declared static. */
|
1996-07-11 03:13:25 +02:00
|
|
|
|
|
1994-02-24 02:02:37 +01:00
|
|
|
|
void
|
Remove traditional C constructs 4/n.
* decl2.c (grok_method_quals, warn_if_unknown_interface,
grok_x_components, cp_build_parm_decl, build_artificial_parm,
maybe_retrofit_in_chrg, grokclassfn, grok_array_decl,
delete_sanity, check_member_template, check_java_method,
check_classfn, finish_static_data_member_decl, grokfield,
grokbitfield, grokoptypename, grok_function_init,
cplus_decl_attributes, constructor_name, defer_fn,
build_anon_union_vars, finish_anon_union, coerce_new_type,
coerce_delete_type, comdat_linkage, maybe_make_one_only,
key_method, import_export_vtable, import_export_class,
output_vtable_inherit, import_export_decl, import_export_tinfo,
build_cleanup, get_guard, get_guard_bits, get_guard_cond,
set_guard, start_objects, finish_objects,
start_static_storage_duration_function,
finish_static_storage_duration_function, get_priority_info,
start_static_initialization_or_destruction,
finish_static_initialization_or_destruction,
do_static_initialization, do_static_destruction,
prune_vars_needing_no_initialization, write_out_vars,
reparse_decl_as_expr, finish_decl_parsing, namespace_ancestor,
add_using_namespace, merge_functions, ambiguous_decl,
lookup_using_namespace, lookup_using_namespace,
qualified_lookup_using_namespace, set_decl_namespace,
decl_namespace, current_decl_namespace, push_decl_namespace,
pop_decl_namespace, push_scope, pop_scope, add_function,
arg_assoc_namespace, arg_assoc_template_arg, arg_assoc,
lookup_arg_dependent, do_namespace_alias,
validate_nonmember_using_decl, do_nonmember_using_decl,
do_toplevel_using_decl, do_local_using_decl,
do_class_using_decl, do_using_directive, check_default_args,
mark_used, handle_class_head): Use C90 prototypings. Use booleans.
* parser.c (cp_parser_class_head): Use booleanss.
* decl.c (walk_globals, walk_vtables): Likewise.
* cp-tree.h (walk_globals_pred, walk_globals_fn, walk_vtables,
walk_globals): Change return type from 'int' to 'bool'.
* rtti.c (init_rtti_processing, build_headof, throw_bad_cast
throw_bad_typeid, get_tinfo_decl_dynamic, typeid_ok_p,
build_typeid, tinfo_name, get_tinfo_decl, get_tinfo_ptr,
get_typeid, ifnonnull, build_dynamic_cast_1, build_dynamic_cast,
qualifier_flags, tinfo_base_init, generic_initializer,
ptr_initializer, dfs_class_hint_mark, ptm_initializer,
dfs_class_hint_unmark, class_hint_flags, class_initializer,
typeinfo_in_lib_p, get_pseudo_ti_init, create_pseudo_type_info,
get_pseudo_ti_desc, create_tinfo_types, emit_support_tinfos,
unemitted_tinfo_decl_p, emit_tinfo_decl): Likewise.
* repo.c (repo_compile_flags, repo_template_declared,
repo_template_defined, repo_class_defined, repo_get_id,
repo_template_used, repo_vtable_used, repo_inline_used,
repo_tinfo_used, repo_template_instantiated, extract_string,
open_repo_file, afgets, init_repo, reopen_repo_file_for_write,
finish_repo): Likewise.
* ptree.c (cxx_print_decl, cxx_print_type, cxx_print_identifier,
cxx_print_xnode): Likewise..
* cp-lang.c (ok_to_generate_alias_set_for_type, cxx_get_alias_set,
cxx_warn_unused_global_decl, cp_expr_size): Likewise.
* cxxfilt.c (demangle_it, print_demangler_list, usage,
standard_symbol_characters, hp_symbol_characters, main, fatal):
Likewise.
(strip_underscore): Change type from 'int' to 'bool'.
(main): Use boolean constants.
From-SVN: r60601
2002-12-29 15:53:05 +01:00
|
|
|
|
finish_anon_union (tree anon_union_decl)
|
1994-02-24 02:02:37 +01:00
|
|
|
|
{
|
2004-10-11 18:59:23 +02:00
|
|
|
|
tree type;
|
1998-05-21 02:48:49 +02:00
|
|
|
|
tree main_decl;
|
2004-10-11 18:59:23 +02:00
|
|
|
|
bool public_p;
|
|
|
|
|
|
|
|
|
|
if (anon_union_decl == error_mark_node)
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
type = TREE_TYPE (anon_union_decl);
|
|
|
|
|
public_p = TREE_PUBLIC (anon_union_decl);
|
1994-02-24 02:02:37 +01:00
|
|
|
|
|
2002-09-13 13:33:47 +02:00
|
|
|
|
/* The VAR_DECL's context is the same as the TYPE's context. */
|
2001-06-01 13:57:35 +02:00
|
|
|
|
DECL_CONTEXT (anon_union_decl) = DECL_CONTEXT (TYPE_NAME (type));
|
2005-06-14 22:01:59 +02:00
|
|
|
|
|
1998-05-21 02:48:49 +02:00
|
|
|
|
if (TYPE_FIELDS (type) == NULL_TREE)
|
1994-02-24 02:02:37 +01:00
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
if (public_p)
|
|
|
|
|
{
|
2000-05-17 20:46:32 +02:00
|
|
|
|
error ("namespace-scope anonymous aggregates must be static");
|
1994-02-24 02:02:37 +01:00
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
2005-02-23 06:30:48 +01:00
|
|
|
|
main_decl = build_anon_union_vars (type, anon_union_decl);
|
2006-06-12 22:50:53 +02:00
|
|
|
|
if (main_decl == error_mark_node)
|
|
|
|
|
return;
|
2003-01-16 21:30:50 +01:00
|
|
|
|
if (main_decl == NULL_TREE)
|
2002-10-07 11:49:18 +02:00
|
|
|
|
{
|
diagnostic.c (warning): Accept parameter to classify warning option.
* diagnostic.c (warning): Accept parameter to classify warning option.
(warning0): New, for when a pointer to an error() like function is needed.
* errors.c (warning): Likewise.
* errors.h (warning, warning0): Adjust prototypes.
* toplev.h (warning, warning0): Likewise.
* attribs.c, builtins.c, c-common.c, c-decl.c, c-format.c,
c-gimplify.c, c-lex.c, c-objc-common.c, c-opts.c, c-parser.c,
c-pragma.c, c-typeck.c, calls.c, cgraph.c, coverage.c, emit-rtl.c,
fold-const.c, fortran/trans-decl.c, function.c, gcse.c,
genautomata.c, haifa-sched.c, opts.c, passes.c, regclass.c,
reload1.c, stmt.c, stor-layout.c, toplev.c, tree-cfg.c,
tree-dump.c, tree-inline.c, tree-mudflap.c, tree-optimize.c,
tree-ssa.c, tree.c, varasm.c: Adjust warning() callers.
* config/alpha/alpha.c, config/arc/arc.c, config/arm/arm.c,
config/avr/avr.c, config/bfin/bfin.c, config/c4x/c4x-c.c,
config/c4x/c4x.c, config/cris/cris.c, config/darwin-c.c,
config/darwin.c, config/darwin.h, config/h8300/h8300.c,
config/i386/cygming.h, config/i386/djgpp.h, config/i386/i386.c,
config/i386/winnt.c, config/ia64/ia64-c.c, config/ia64/ia64.c,
config/ip2k/ip2k.c, config/m32r/m32r.c, config/m68hc11/m68hc11.c,
config/m68k/m68k.c, config/mcore/mcore.c, config/mips/mips.c,
config/mmix/mmix.c, config/ns32k/ns32k.c, config/pa/pa-hpux11.h,
config/pa/pa.c, config/rs6000/aix43.h, config/rs6000/aix51.h,
config/rs6000/aix52.h, config/rs6000/darwin.h,
config/rs6000/rs6000-c.c, config/rs6000/rs6000.c,
config/s390/s390.c, config/sh/sh.c, config/sh/sh.h,
config/sh/symbian.c, config/sol2-c.c, config/sol2.c,
config/stormy16/stormy16.c, config/v850/v850-c.c,
config/v850/v850.c, config/xtensa/xtensa.c: Adjust warning()
callers.
* ada/misc.c: Adjust warning() callers.
* cp/call.c, cp/class.c, cp/cvt.c, cp/decl.c, cp/decl2.c,
cp/except.c, cp/friend.c, cp/init.c, cp/lex.c, cp/mangle.c,
cp/method.c, cp/name-lookup.c, cp/parser.c, cp/repo.c, cp/rtti.c,
cp/tree.c, cp/typeck.c, cp/typeck2.c: Adjust warning() callers.
* fortran/trans-decl.c: Adjust warning() callers.
* java/class.c, java/decl.c, java/expr.c, java/jcf-io.c,
java/jcf-parse.c, java/jv-scan.c, java/parse.y: Adjust warning()
callers.
* objc/objc-act.c: Adjust warning() callers.
* treelang/parse.y: Adjust warning() callers.
From-SVN: r98633
2005-04-23 23:29:07 +02:00
|
|
|
|
warning (0, "anonymous union with no members");
|
2003-01-16 21:30:50 +01:00
|
|
|
|
return;
|
|
|
|
|
}
|
2002-10-04 07:13:59 +02:00
|
|
|
|
|
2003-01-16 21:30:50 +01:00
|
|
|
|
if (!processing_template_decl)
|
|
|
|
|
{
|
2002-12-19 18:16:26 +01:00
|
|
|
|
/* Use main_decl to set the mangled name. */
|
|
|
|
|
DECL_NAME (anon_union_decl) = DECL_NAME (main_decl);
|
2009-02-19 16:22:28 +01:00
|
|
|
|
maybe_commonize_var (anon_union_decl);
|
2002-12-19 18:16:26 +01:00
|
|
|
|
mangle_decl (anon_union_decl);
|
|
|
|
|
DECL_NAME (anon_union_decl) = NULL_TREE;
|
2002-10-07 11:49:18 +02:00
|
|
|
|
}
|
2002-10-09 00:52:14 +02:00
|
|
|
|
|
2002-12-19 18:16:26 +01:00
|
|
|
|
pushdecl (anon_union_decl);
|
|
|
|
|
if (building_stmt_tree ()
|
|
|
|
|
&& at_function_scope_p ())
|
c-common.c (c_safe_from_p, [...]): Deleted.
2004-06-26 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
* c-common.c (c_safe_from_p, c_walk_subtrees): Deleted.
* c-common.def (DECL_STMT): Remove.
* c-common.h (DECL_STMT_DECL): Deleted.
(COMPOUNT_LITERAL_EXPR_DECL): Use DECL_EXPR_DECL.
(c_safe_from_p, c_walk_subtrees): Deleted.
* c-decl.c, c-parse.in, c-pretty-print.c: DECL_STMT now DECL_EXPR.
* c-dump.c (c_dump_tree, case DECL_STMT): Deleted.
* c-gimplify.c (gimplify_decl_stmt): Deleted.
(gimplify_compound_literal_expr): Use DECL_EXPR_DECL
and gimplify_and_add.
(c_gimplify_expr, case DECL_EXPR): New case.
(c_gimplify_expr, case DECL_STMT): Deleted.
* c-lang.c (LANG_HOOKS_SAFE_FROM_P): Likewise.
(LANG_HOOKS_TREE_INLINING_WALK_SUBTREES): Likewise.
* expr.c (safe_from_p, case 's'): New case.
* gimplify.c (gimplify_decl_expr): New function.
(gimplify_expr, case DECL_EXPR): New case.
* tree-inline.c (walk_tree): Walk into all fields of a type and
decl only if they are in a DECL_EXPR.
(mark_local_for_remap_r): Minor code cleanup.
* tree-outof-ssa.c (discover_nonconstant_array_refs_r): Add else.
* tree.c (has_cleanups, case DECL_EXPR): New case.
* tree.def (DECL_EXPR): New code.
* tree.h (DECL_EXPR_DECL): New macro.
* objc/objc-lang.c (LANG_HOOKS_SAFE_FROM_P): Deleted.
From-SVN: r83721
2004-06-26 23:11:23 +02:00
|
|
|
|
add_decl_expr (anon_union_decl);
|
2002-12-19 18:16:26 +01:00
|
|
|
|
else if (!processing_template_decl)
|
2004-08-05 07:52:01 +02:00
|
|
|
|
rest_of_decl_compilation (anon_union_decl,
|
2002-12-19 18:16:26 +01:00
|
|
|
|
toplevel_bindings_p (), at_eof);
|
1994-02-24 02:02:37 +01:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Auxiliary functions to make type signatures for
|
|
|
|
|
`operator new' and `operator delete' correspond to
|
|
|
|
|
what compiler will be expecting. */
|
|
|
|
|
|
|
|
|
|
tree
|
Remove traditional C constructs 4/n.
* decl2.c (grok_method_quals, warn_if_unknown_interface,
grok_x_components, cp_build_parm_decl, build_artificial_parm,
maybe_retrofit_in_chrg, grokclassfn, grok_array_decl,
delete_sanity, check_member_template, check_java_method,
check_classfn, finish_static_data_member_decl, grokfield,
grokbitfield, grokoptypename, grok_function_init,
cplus_decl_attributes, constructor_name, defer_fn,
build_anon_union_vars, finish_anon_union, coerce_new_type,
coerce_delete_type, comdat_linkage, maybe_make_one_only,
key_method, import_export_vtable, import_export_class,
output_vtable_inherit, import_export_decl, import_export_tinfo,
build_cleanup, get_guard, get_guard_bits, get_guard_cond,
set_guard, start_objects, finish_objects,
start_static_storage_duration_function,
finish_static_storage_duration_function, get_priority_info,
start_static_initialization_or_destruction,
finish_static_initialization_or_destruction,
do_static_initialization, do_static_destruction,
prune_vars_needing_no_initialization, write_out_vars,
reparse_decl_as_expr, finish_decl_parsing, namespace_ancestor,
add_using_namespace, merge_functions, ambiguous_decl,
lookup_using_namespace, lookup_using_namespace,
qualified_lookup_using_namespace, set_decl_namespace,
decl_namespace, current_decl_namespace, push_decl_namespace,
pop_decl_namespace, push_scope, pop_scope, add_function,
arg_assoc_namespace, arg_assoc_template_arg, arg_assoc,
lookup_arg_dependent, do_namespace_alias,
validate_nonmember_using_decl, do_nonmember_using_decl,
do_toplevel_using_decl, do_local_using_decl,
do_class_using_decl, do_using_directive, check_default_args,
mark_used, handle_class_head): Use C90 prototypings. Use booleans.
* parser.c (cp_parser_class_head): Use booleanss.
* decl.c (walk_globals, walk_vtables): Likewise.
* cp-tree.h (walk_globals_pred, walk_globals_fn, walk_vtables,
walk_globals): Change return type from 'int' to 'bool'.
* rtti.c (init_rtti_processing, build_headof, throw_bad_cast
throw_bad_typeid, get_tinfo_decl_dynamic, typeid_ok_p,
build_typeid, tinfo_name, get_tinfo_decl, get_tinfo_ptr,
get_typeid, ifnonnull, build_dynamic_cast_1, build_dynamic_cast,
qualifier_flags, tinfo_base_init, generic_initializer,
ptr_initializer, dfs_class_hint_mark, ptm_initializer,
dfs_class_hint_unmark, class_hint_flags, class_initializer,
typeinfo_in_lib_p, get_pseudo_ti_init, create_pseudo_type_info,
get_pseudo_ti_desc, create_tinfo_types, emit_support_tinfos,
unemitted_tinfo_decl_p, emit_tinfo_decl): Likewise.
* repo.c (repo_compile_flags, repo_template_declared,
repo_template_defined, repo_class_defined, repo_get_id,
repo_template_used, repo_vtable_used, repo_inline_used,
repo_tinfo_used, repo_template_instantiated, extract_string,
open_repo_file, afgets, init_repo, reopen_repo_file_for_write,
finish_repo): Likewise.
* ptree.c (cxx_print_decl, cxx_print_type, cxx_print_identifier,
cxx_print_xnode): Likewise..
* cp-lang.c (ok_to_generate_alias_set_for_type, cxx_get_alias_set,
cxx_warn_unused_global_decl, cp_expr_size): Likewise.
* cxxfilt.c (demangle_it, print_demangler_list, usage,
standard_symbol_characters, hp_symbol_characters, main, fatal):
Likewise.
(strip_underscore): Change type from 'int' to 'bool'.
(main): Use boolean constants.
From-SVN: r60601
2002-12-29 15:53:05 +01:00
|
|
|
|
coerce_new_type (tree type)
|
1994-02-24 02:02:37 +01:00
|
|
|
|
{
|
2000-11-08 15:03:32 +01:00
|
|
|
|
int e = 0;
|
|
|
|
|
tree args = TYPE_ARG_TYPES (type);
|
|
|
|
|
|
call.c (validate_conversion_obstack): Replace my_friendly_assert with gcc_assert or gcc_unreachable.
* call.c (validate_conversion_obstack): Replace
my_friendly_assert with gcc_assert or gcc_unreachable.
(direct_reference_binding, merge_conversion_sequences,
build_user_type_conversion_1, perform_overload_resolution,
build_op_delete_call, enforce_access, call_builtin_trap,
build_over_call, build_special_member_call, build_new_method_call,
initialize_reference): Likewise.
* class.c (build_base_path, build_primary_vtable, alter_access,
check_bases, update_vtable_entry_for_fn, layout_empty_base,
clone_function_decl, adjust_clone_args,
type_requires_array_cookie, include_empty_classes,
finish_struct_1, resolve_address_of_overloaded_function,
instantiate_type, get_vtbl_decl_for_binfo, build_vtt_inits,
dfs_build_secondary_vptr_vtt_inits, build_ctor_vtbl_group,
accumulate_vtbl_inits, build_vtbl_initializer,
build_vbase_offset_vtbl_entries, build_rtti_vtbl_entries): Likewise.
* cvt.c (build_up_reference, convert_to_reference): Likewise.
* decl.c (poplevel, duplicate_decls, make_typename_type,
cxx_init_decl_processing, reshape_init, check_initializer,
make_rtl_for_nonlocal_decl, initialize_local_var, cp_finish_decl,
expand_static_init, grokfndecl, grokvardecl, build_ptrmem_type,
grokdeclarator, copy_fn_p, grok_op_properties, xref_tag,
xref_basetypes, start_preparsed_function, save_function_data,
finish_function, finish_method, maybe_register_incomplete_var,
complete_vars): Likewise.
* decl2.c (grok_array_decl, check_member_template,
check_classfn, finish_static_data_member_decl, coerce_new_type,
coerce_delete_type, import_export_class, decl_needed_p,
determine_visibility, import_export_decl, build_cleanup,
start_static_initialization_or_destructi, do_static_destruction,
prune_vars_needing_no_initialization,
build_offset_ref_call_from_tree): Likewise.
* error.c (dump_decl, dump_expr): Likewise.
* init.c (finish_init_stmts, build_zero_init,
expand_virtual_init, expand_default_init, expand_aggr_init_1,
build_offset_ref, build_new_1, build_delete, build_vbase_delete):
Likewise.
* mangle.c (write_method_parms, write_template_args,
write_expression, write_template_arg): Likewise.
* method.c (make_thunk, finish_thunk, use_thunk): Likewise.
* name-lookup.c (pop_binding, begin_scope, leave_scope,
resume_scope, push_using_decl, validate_nonmember_using_decl,
is_ancestor, poplevel_class, set_inherited_value_binding_p,
push_class_level_binding, do_class_using_decl, push_namespace,
pop_namespace, add_using_namespace, ambiguous_decl,
lookup_namespace_name, lookup_type_current_level,
maybe_process_template_type_declaration): Likewise.
* parser.c (cp_lexer_peek_nth_token,
cp_parser_parse_and_diagnose_invalid_typ,
cp_parser_translation_unit, cp_parser_template_id,
cp_parser_lookup_name, cp_parser_late_parsing_for_member): Likewise.
* pt.c (push_access_scope, finish_member_template_decl,
push_inline_template_parms_recursive, add_outermost_template_args,
get_innermost_template_args, begin_explicit_instantiation,
end_explicit_instantiation, retrieve_specialization,
is_specialization_of, is_specialization_of_friend,
register_specialization, check_explicit_specialization,
comp_template_parms, process_template_parm,
process_partial_specialization, convert_nontype_argument,
coerce_template_template_parms, coerce_template_parms,
mangle_class_name_for_template, lookup_template_function,
lookup_template_class, instantiate_class_template, tsubst_decl,
tsubst_function_type, tsubst, tsubst_qualified_id, tsubst_copy,
instantiate_template, fn_type_unification, type_unification_real,
get_template_base, regenerate_decl_from_template,
template_for_substitution, instantiate_decl,
get_mostly_instantiated_function_type, dependent_scope_ref_p,
value_dependent_expression_p, resolve_typename_type): Likewise.
* repo.c (repo_emit_p): Likewise.
* rtti.c (build_headof, get_tinfo_decl, get_pseudo_ti_init,
create_tinfo_types, emit_tinfo_decl): Likewise.
* search.c (lookup_base_r, lookup_base, lookup_field_1,
dfs_access_in_type, build_baselink, lookup_member,
adjust_result_of_qualified_name_lookup, copied_binfo): Likewise.
* semantics.c (perform_or_defer_access_check,
finish_non_static_data_member, finish_stmt_expr_expr,
finish_stmt_expr, finish_call_expr, finish_pseudo_destructor_expr,
finish_template_template_parm, finish_member_declaration,
emit_associated_thunks): Likewise.
* tree.c (build_target_expr_with_type, force_target_expr,
copy_binfo, get_first_fn, cp_tree_equal): Likewise.
* typeck.c (type_after_usual_arithmetic_conversions, comptypes,
cxx_sizeof_or_alignof_type, perform_integral_promotions,
build_class_member_access_expr, finish_class_member_access_expr,
build_ptrmemfunc_access_expr, build_unary_op,
unary_complex_lvalue, cxx_mark_addressable, build_modify_expr,
build_ptrmemfunc, expand_ptrmemfunc_cst, check_return_expr
* typeck2.c (complete_type_check_abstract,
abstract_virtuals_error, process_init_constructor,
add_exception_specifier): Likewise.
From-SVN: r86669
2004-08-27 19:59:33 +02:00
|
|
|
|
gcc_assert (TREE_CODE (type) == FUNCTION_TYPE);
|
2005-06-14 22:01:59 +02:00
|
|
|
|
|
2000-11-08 15:03:32 +01:00
|
|
|
|
if (!same_type_p (TREE_TYPE (type), ptr_type_node))
|
Convert diagnostics to use quoting flag q 3/n
cp/
Convert diagnostics to use quoting flag q 3/n
* decl.c (pop_label, duplicate_decls,
redeclaration_error_message,
redeclaration_error_message, lookup_label, check_goto,
make_typename_type, make_unbound_class_template,
fixup_anonymous_aggr, check_tag_decl, start_decl,
start_decl_1,
grok_reference_init, layout_var_decl, maybe_commonize_var,
check_for_uninitialized_const_var, reshape_init_array,
reshape_init, check_initializer, cp_finish_decl,
member_function_or_else, bad_specifiers, grokfndecl,
grokvardecl,
check_static_variable_definition, compute_array_index_type,
create_array_type_for_decl,
check_special_function_return_type,
grokdeclarator, check_default_argument, grokparms,
grok_ctor_properties, grok_op_properties,
check_elaborated_type_specifier, xref_tag, finish_enum,
build_enumerator, check_function_type,
start_preparsed_function,
store_parm_decls): Use quoting formats.
* decl2.c (grok_array_decl, delete_sanity,
check_member_template,
check_java_method, check_classfn,
finish_static_data_member_decl,
grokfield, grokbitfield, grok_function_init,
build_anon_union_vars, coerce_new_type, coerce_delete_type,
check_default_args): Likewise.
* parser.c (cp_parser_decl_specifier_seq): Likewise.
testsuite/
* g++.dg/template/local1.C: Adjust quoting marks in
testing for diagnostics.
* g++.dg/tls/diag-2.C: Likewise.
* g++.dg/other/error8.C: Likewise.
From-SVN: r88478
2004-10-04 08:04:43 +02:00
|
|
|
|
{
|
|
|
|
|
e = 1;
|
|
|
|
|
error ("%<operator new%> must return type %qT", ptr_type_node);
|
|
|
|
|
}
|
2000-11-08 15:03:32 +01:00
|
|
|
|
|
2007-10-26 20:32:41 +02:00
|
|
|
|
if (args && args != void_list_node)
|
2000-11-08 15:03:32 +01:00
|
|
|
|
{
|
2007-10-26 20:32:41 +02:00
|
|
|
|
if (TREE_PURPOSE (args))
|
|
|
|
|
{
|
|
|
|
|
/* [basic.stc.dynamic.allocation]
|
|
|
|
|
|
|
|
|
|
The first parameter shall not have an associated default
|
|
|
|
|
argument. */
|
|
|
|
|
error ("the first parameter of %<operator new%> cannot "
|
|
|
|
|
"have a default argument");
|
|
|
|
|
/* Throw away the default argument. */
|
|
|
|
|
TREE_PURPOSE (args) = NULL_TREE;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (!same_type_p (TREE_VALUE (args), size_type_node))
|
|
|
|
|
{
|
|
|
|
|
e = 2;
|
|
|
|
|
args = TREE_CHAIN (args);
|
|
|
|
|
}
|
2000-11-08 15:03:32 +01:00
|
|
|
|
}
|
2007-10-26 20:32:41 +02:00
|
|
|
|
else
|
|
|
|
|
e = 2;
|
|
|
|
|
|
|
|
|
|
if (e == 2)
|
2008-08-18 13:17:52 +02:00
|
|
|
|
permerror (input_location, "%<operator new%> takes type %<size_t%> (%qT) "
|
typeck.c (composite_pointer_type_r, [...]): Change pedwarn to permerror.
* typeck.c (composite_pointer_type_r, cxx_sizeof_expr,
cxx_alignof_expr, check_template_keyword, cp_build_binary_op,
pointer_diff, cp_build_unary_op, build_x_compound_expr_from_list,
build_reinterpret_cast_1, cp_build_c_cast, check_return_expr): Change
pedwarn to permerror.
* init.c (perform_member_init, build_new_1, build_new): Likewise.
* decl.c (warn_extern_redeclared_static, duplicate_decls,
* identify_goto, check_previous_goto_1, check_goto, define_label,
check_tag_decl, start_decl, check_class_member_definition_namespace,
grokfndecl, grokdeclarator): Likewise.
* except.c (check_handlers): Likewise.
* typeck2.c (digest_init): Likewise.
* pt.c (check_specialization_namespace,
check_explicit_instantiation_namespace,
maybe_process_partial_specialization, check_explicit_specialization,
convert_template_argument, do_decl_instantiation,
do_type_instantiation, instantiate_decl): Likewise.
* semantics.c (finish_template_type_parm): Likewise.
* name-lookup.c (pushdecl_maybe_friend,
check_for_out_of_scope_variable): Likewise.
* decl2.c (finish_static_data_member_decl, build_anon_union_vars,
coerce_new_type): Likewise.
* parser.c (cp_parser_nested_name_specifier_opt,
cp_parser_mem_initializer, cp_parser_elaborated_type_specifier,
cp_parser_class_head, cp_parser_check_class_key): Likewise.
(cp_parser_parameter_declaration): Check flag_permissive instead of
flag_pedantic_errors.
* call.c (joust): Change pedwarn to warning.
* friend.c (make_friend_class): Likewise.
From-SVN: r136999
2008-06-21 12:36:27 +02:00
|
|
|
|
"as first parameter", size_type_node);
|
2007-10-26 20:32:41 +02:00
|
|
|
|
|
2000-11-08 15:03:32 +01:00
|
|
|
|
switch (e)
|
|
|
|
|
{
|
|
|
|
|
case 2:
|
2002-12-01 18:51:51 +01:00
|
|
|
|
args = tree_cons (NULL_TREE, size_type_node, args);
|
2003-12-21 22:07:32 +01:00
|
|
|
|
/* Fall through. */
|
2000-11-08 15:03:32 +01:00
|
|
|
|
case 1:
|
|
|
|
|
type = build_exception_variant
|
2005-06-15 02:41:35 +02:00
|
|
|
|
(build_function_type (ptr_type_node, args),
|
|
|
|
|
TYPE_RAISES_EXCEPTIONS (type));
|
2003-12-21 22:07:32 +01:00
|
|
|
|
/* Fall through. */
|
2000-11-08 15:03:32 +01:00
|
|
|
|
default:;
|
|
|
|
|
}
|
1994-02-24 02:02:37 +01:00
|
|
|
|
return type;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
tree
|
Remove traditional C constructs 4/n.
* decl2.c (grok_method_quals, warn_if_unknown_interface,
grok_x_components, cp_build_parm_decl, build_artificial_parm,
maybe_retrofit_in_chrg, grokclassfn, grok_array_decl,
delete_sanity, check_member_template, check_java_method,
check_classfn, finish_static_data_member_decl, grokfield,
grokbitfield, grokoptypename, grok_function_init,
cplus_decl_attributes, constructor_name, defer_fn,
build_anon_union_vars, finish_anon_union, coerce_new_type,
coerce_delete_type, comdat_linkage, maybe_make_one_only,
key_method, import_export_vtable, import_export_class,
output_vtable_inherit, import_export_decl, import_export_tinfo,
build_cleanup, get_guard, get_guard_bits, get_guard_cond,
set_guard, start_objects, finish_objects,
start_static_storage_duration_function,
finish_static_storage_duration_function, get_priority_info,
start_static_initialization_or_destruction,
finish_static_initialization_or_destruction,
do_static_initialization, do_static_destruction,
prune_vars_needing_no_initialization, write_out_vars,
reparse_decl_as_expr, finish_decl_parsing, namespace_ancestor,
add_using_namespace, merge_functions, ambiguous_decl,
lookup_using_namespace, lookup_using_namespace,
qualified_lookup_using_namespace, set_decl_namespace,
decl_namespace, current_decl_namespace, push_decl_namespace,
pop_decl_namespace, push_scope, pop_scope, add_function,
arg_assoc_namespace, arg_assoc_template_arg, arg_assoc,
lookup_arg_dependent, do_namespace_alias,
validate_nonmember_using_decl, do_nonmember_using_decl,
do_toplevel_using_decl, do_local_using_decl,
do_class_using_decl, do_using_directive, check_default_args,
mark_used, handle_class_head): Use C90 prototypings. Use booleans.
* parser.c (cp_parser_class_head): Use booleanss.
* decl.c (walk_globals, walk_vtables): Likewise.
* cp-tree.h (walk_globals_pred, walk_globals_fn, walk_vtables,
walk_globals): Change return type from 'int' to 'bool'.
* rtti.c (init_rtti_processing, build_headof, throw_bad_cast
throw_bad_typeid, get_tinfo_decl_dynamic, typeid_ok_p,
build_typeid, tinfo_name, get_tinfo_decl, get_tinfo_ptr,
get_typeid, ifnonnull, build_dynamic_cast_1, build_dynamic_cast,
qualifier_flags, tinfo_base_init, generic_initializer,
ptr_initializer, dfs_class_hint_mark, ptm_initializer,
dfs_class_hint_unmark, class_hint_flags, class_initializer,
typeinfo_in_lib_p, get_pseudo_ti_init, create_pseudo_type_info,
get_pseudo_ti_desc, create_tinfo_types, emit_support_tinfos,
unemitted_tinfo_decl_p, emit_tinfo_decl): Likewise.
* repo.c (repo_compile_flags, repo_template_declared,
repo_template_defined, repo_class_defined, repo_get_id,
repo_template_used, repo_vtable_used, repo_inline_used,
repo_tinfo_used, repo_template_instantiated, extract_string,
open_repo_file, afgets, init_repo, reopen_repo_file_for_write,
finish_repo): Likewise.
* ptree.c (cxx_print_decl, cxx_print_type, cxx_print_identifier,
cxx_print_xnode): Likewise..
* cp-lang.c (ok_to_generate_alias_set_for_type, cxx_get_alias_set,
cxx_warn_unused_global_decl, cp_expr_size): Likewise.
* cxxfilt.c (demangle_it, print_demangler_list, usage,
standard_symbol_characters, hp_symbol_characters, main, fatal):
Likewise.
(strip_underscore): Change type from 'int' to 'bool'.
(main): Use boolean constants.
From-SVN: r60601
2002-12-29 15:53:05 +01:00
|
|
|
|
coerce_delete_type (tree type)
|
1994-02-24 02:02:37 +01:00
|
|
|
|
{
|
2000-11-08 15:03:32 +01:00
|
|
|
|
int e = 0;
|
|
|
|
|
tree args = TYPE_ARG_TYPES (type);
|
2005-06-14 22:01:59 +02:00
|
|
|
|
|
call.c (validate_conversion_obstack): Replace my_friendly_assert with gcc_assert or gcc_unreachable.
* call.c (validate_conversion_obstack): Replace
my_friendly_assert with gcc_assert or gcc_unreachable.
(direct_reference_binding, merge_conversion_sequences,
build_user_type_conversion_1, perform_overload_resolution,
build_op_delete_call, enforce_access, call_builtin_trap,
build_over_call, build_special_member_call, build_new_method_call,
initialize_reference): Likewise.
* class.c (build_base_path, build_primary_vtable, alter_access,
check_bases, update_vtable_entry_for_fn, layout_empty_base,
clone_function_decl, adjust_clone_args,
type_requires_array_cookie, include_empty_classes,
finish_struct_1, resolve_address_of_overloaded_function,
instantiate_type, get_vtbl_decl_for_binfo, build_vtt_inits,
dfs_build_secondary_vptr_vtt_inits, build_ctor_vtbl_group,
accumulate_vtbl_inits, build_vtbl_initializer,
build_vbase_offset_vtbl_entries, build_rtti_vtbl_entries): Likewise.
* cvt.c (build_up_reference, convert_to_reference): Likewise.
* decl.c (poplevel, duplicate_decls, make_typename_type,
cxx_init_decl_processing, reshape_init, check_initializer,
make_rtl_for_nonlocal_decl, initialize_local_var, cp_finish_decl,
expand_static_init, grokfndecl, grokvardecl, build_ptrmem_type,
grokdeclarator, copy_fn_p, grok_op_properties, xref_tag,
xref_basetypes, start_preparsed_function, save_function_data,
finish_function, finish_method, maybe_register_incomplete_var,
complete_vars): Likewise.
* decl2.c (grok_array_decl, check_member_template,
check_classfn, finish_static_data_member_decl, coerce_new_type,
coerce_delete_type, import_export_class, decl_needed_p,
determine_visibility, import_export_decl, build_cleanup,
start_static_initialization_or_destructi, do_static_destruction,
prune_vars_needing_no_initialization,
build_offset_ref_call_from_tree): Likewise.
* error.c (dump_decl, dump_expr): Likewise.
* init.c (finish_init_stmts, build_zero_init,
expand_virtual_init, expand_default_init, expand_aggr_init_1,
build_offset_ref, build_new_1, build_delete, build_vbase_delete):
Likewise.
* mangle.c (write_method_parms, write_template_args,
write_expression, write_template_arg): Likewise.
* method.c (make_thunk, finish_thunk, use_thunk): Likewise.
* name-lookup.c (pop_binding, begin_scope, leave_scope,
resume_scope, push_using_decl, validate_nonmember_using_decl,
is_ancestor, poplevel_class, set_inherited_value_binding_p,
push_class_level_binding, do_class_using_decl, push_namespace,
pop_namespace, add_using_namespace, ambiguous_decl,
lookup_namespace_name, lookup_type_current_level,
maybe_process_template_type_declaration): Likewise.
* parser.c (cp_lexer_peek_nth_token,
cp_parser_parse_and_diagnose_invalid_typ,
cp_parser_translation_unit, cp_parser_template_id,
cp_parser_lookup_name, cp_parser_late_parsing_for_member): Likewise.
* pt.c (push_access_scope, finish_member_template_decl,
push_inline_template_parms_recursive, add_outermost_template_args,
get_innermost_template_args, begin_explicit_instantiation,
end_explicit_instantiation, retrieve_specialization,
is_specialization_of, is_specialization_of_friend,
register_specialization, check_explicit_specialization,
comp_template_parms, process_template_parm,
process_partial_specialization, convert_nontype_argument,
coerce_template_template_parms, coerce_template_parms,
mangle_class_name_for_template, lookup_template_function,
lookup_template_class, instantiate_class_template, tsubst_decl,
tsubst_function_type, tsubst, tsubst_qualified_id, tsubst_copy,
instantiate_template, fn_type_unification, type_unification_real,
get_template_base, regenerate_decl_from_template,
template_for_substitution, instantiate_decl,
get_mostly_instantiated_function_type, dependent_scope_ref_p,
value_dependent_expression_p, resolve_typename_type): Likewise.
* repo.c (repo_emit_p): Likewise.
* rtti.c (build_headof, get_tinfo_decl, get_pseudo_ti_init,
create_tinfo_types, emit_tinfo_decl): Likewise.
* search.c (lookup_base_r, lookup_base, lookup_field_1,
dfs_access_in_type, build_baselink, lookup_member,
adjust_result_of_qualified_name_lookup, copied_binfo): Likewise.
* semantics.c (perform_or_defer_access_check,
finish_non_static_data_member, finish_stmt_expr_expr,
finish_stmt_expr, finish_call_expr, finish_pseudo_destructor_expr,
finish_template_template_parm, finish_member_declaration,
emit_associated_thunks): Likewise.
* tree.c (build_target_expr_with_type, force_target_expr,
copy_binfo, get_first_fn, cp_tree_equal): Likewise.
* typeck.c (type_after_usual_arithmetic_conversions, comptypes,
cxx_sizeof_or_alignof_type, perform_integral_promotions,
build_class_member_access_expr, finish_class_member_access_expr,
build_ptrmemfunc_access_expr, build_unary_op,
unary_complex_lvalue, cxx_mark_addressable, build_modify_expr,
build_ptrmemfunc, expand_ptrmemfunc_cst, check_return_expr
* typeck2.c (complete_type_check_abstract,
abstract_virtuals_error, process_init_constructor,
add_exception_specifier): Likewise.
From-SVN: r86669
2004-08-27 19:59:33 +02:00
|
|
|
|
gcc_assert (TREE_CODE (type) == FUNCTION_TYPE);
|
1997-02-04 03:31:49 +01:00
|
|
|
|
|
2000-11-08 15:03:32 +01:00
|
|
|
|
if (!same_type_p (TREE_TYPE (type), void_type_node))
|
Convert diagnostics to use quoting flag q 3/n
cp/
Convert diagnostics to use quoting flag q 3/n
* decl.c (pop_label, duplicate_decls,
redeclaration_error_message,
redeclaration_error_message, lookup_label, check_goto,
make_typename_type, make_unbound_class_template,
fixup_anonymous_aggr, check_tag_decl, start_decl,
start_decl_1,
grok_reference_init, layout_var_decl, maybe_commonize_var,
check_for_uninitialized_const_var, reshape_init_array,
reshape_init, check_initializer, cp_finish_decl,
member_function_or_else, bad_specifiers, grokfndecl,
grokvardecl,
check_static_variable_definition, compute_array_index_type,
create_array_type_for_decl,
check_special_function_return_type,
grokdeclarator, check_default_argument, grokparms,
grok_ctor_properties, grok_op_properties,
check_elaborated_type_specifier, xref_tag, finish_enum,
build_enumerator, check_function_type,
start_preparsed_function,
store_parm_decls): Use quoting formats.
* decl2.c (grok_array_decl, delete_sanity,
check_member_template,
check_java_method, check_classfn,
finish_static_data_member_decl,
grokfield, grokbitfield, grok_function_init,
build_anon_union_vars, coerce_new_type, coerce_delete_type,
check_default_args): Likewise.
* parser.c (cp_parser_decl_specifier_seq): Likewise.
testsuite/
* g++.dg/template/local1.C: Adjust quoting marks in
testing for diagnostics.
* g++.dg/tls/diag-2.C: Likewise.
* g++.dg/other/error8.C: Likewise.
From-SVN: r88478
2004-10-04 08:04:43 +02:00
|
|
|
|
{
|
|
|
|
|
e = 1;
|
|
|
|
|
error ("%<operator delete%> must return type %qT", void_type_node);
|
|
|
|
|
}
|
1994-02-24 02:02:37 +01:00
|
|
|
|
|
2000-11-08 15:03:32 +01:00
|
|
|
|
if (!args || args == void_list_node
|
|
|
|
|
|| !same_type_p (TREE_VALUE (args), ptr_type_node))
|
1994-02-24 02:02:37 +01:00
|
|
|
|
{
|
2000-11-08 15:03:32 +01:00
|
|
|
|
e = 2;
|
|
|
|
|
if (args && args != void_list_node)
|
2005-06-15 02:41:35 +02:00
|
|
|
|
args = TREE_CHAIN (args);
|
Convert diagnostics to use quoting flag q 3/n
cp/
Convert diagnostics to use quoting flag q 3/n
* decl.c (pop_label, duplicate_decls,
redeclaration_error_message,
redeclaration_error_message, lookup_label, check_goto,
make_typename_type, make_unbound_class_template,
fixup_anonymous_aggr, check_tag_decl, start_decl,
start_decl_1,
grok_reference_init, layout_var_decl, maybe_commonize_var,
check_for_uninitialized_const_var, reshape_init_array,
reshape_init, check_initializer, cp_finish_decl,
member_function_or_else, bad_specifiers, grokfndecl,
grokvardecl,
check_static_variable_definition, compute_array_index_type,
create_array_type_for_decl,
check_special_function_return_type,
grokdeclarator, check_default_argument, grokparms,
grok_ctor_properties, grok_op_properties,
check_elaborated_type_specifier, xref_tag, finish_enum,
build_enumerator, check_function_type,
start_preparsed_function,
store_parm_decls): Use quoting formats.
* decl2.c (grok_array_decl, delete_sanity,
check_member_template,
check_java_method, check_classfn,
finish_static_data_member_decl,
grokfield, grokbitfield, grok_function_init,
build_anon_union_vars, coerce_new_type, coerce_delete_type,
check_default_args): Likewise.
* parser.c (cp_parser_decl_specifier_seq): Likewise.
testsuite/
* g++.dg/template/local1.C: Adjust quoting marks in
testing for diagnostics.
* g++.dg/tls/diag-2.C: Likewise.
* g++.dg/other/error8.C: Likewise.
From-SVN: r88478
2004-10-04 08:04:43 +02:00
|
|
|
|
error ("%<operator delete%> takes type %qT as first parameter",
|
2005-06-15 02:41:35 +02:00
|
|
|
|
ptr_type_node);
|
1994-02-24 02:02:37 +01:00
|
|
|
|
}
|
2000-11-08 15:03:32 +01:00
|
|
|
|
switch (e)
|
|
|
|
|
{
|
|
|
|
|
case 2:
|
|
|
|
|
args = tree_cons (NULL_TREE, ptr_type_node, args);
|
2003-12-21 22:07:32 +01:00
|
|
|
|
/* Fall through. */
|
2000-11-08 15:03:32 +01:00
|
|
|
|
case 1:
|
|
|
|
|
type = build_exception_variant
|
2005-06-15 02:41:35 +02:00
|
|
|
|
(build_function_type (void_type_node, args),
|
|
|
|
|
TYPE_RAISES_EXCEPTIONS (type));
|
2003-12-21 22:07:32 +01:00
|
|
|
|
/* Fall through. */
|
2000-11-08 15:03:32 +01:00
|
|
|
|
default:;
|
|
|
|
|
}
|
1994-02-24 02:02:37 +01:00
|
|
|
|
|
|
|
|
|
return type;
|
|
|
|
|
}
|
|
|
|
|
|
2007-09-30 04:41:39 +02:00
|
|
|
|
/* DECL is a VAR_DECL for a vtable: walk through the entries in the vtable
|
|
|
|
|
and mark them as needed. */
|
|
|
|
|
|
1994-02-24 02:02:37 +01:00
|
|
|
|
static void
|
Remove traditional C constructs 4/n.
* decl2.c (grok_method_quals, warn_if_unknown_interface,
grok_x_components, cp_build_parm_decl, build_artificial_parm,
maybe_retrofit_in_chrg, grokclassfn, grok_array_decl,
delete_sanity, check_member_template, check_java_method,
check_classfn, finish_static_data_member_decl, grokfield,
grokbitfield, grokoptypename, grok_function_init,
cplus_decl_attributes, constructor_name, defer_fn,
build_anon_union_vars, finish_anon_union, coerce_new_type,
coerce_delete_type, comdat_linkage, maybe_make_one_only,
key_method, import_export_vtable, import_export_class,
output_vtable_inherit, import_export_decl, import_export_tinfo,
build_cleanup, get_guard, get_guard_bits, get_guard_cond,
set_guard, start_objects, finish_objects,
start_static_storage_duration_function,
finish_static_storage_duration_function, get_priority_info,
start_static_initialization_or_destruction,
finish_static_initialization_or_destruction,
do_static_initialization, do_static_destruction,
prune_vars_needing_no_initialization, write_out_vars,
reparse_decl_as_expr, finish_decl_parsing, namespace_ancestor,
add_using_namespace, merge_functions, ambiguous_decl,
lookup_using_namespace, lookup_using_namespace,
qualified_lookup_using_namespace, set_decl_namespace,
decl_namespace, current_decl_namespace, push_decl_namespace,
pop_decl_namespace, push_scope, pop_scope, add_function,
arg_assoc_namespace, arg_assoc_template_arg, arg_assoc,
lookup_arg_dependent, do_namespace_alias,
validate_nonmember_using_decl, do_nonmember_using_decl,
do_toplevel_using_decl, do_local_using_decl,
do_class_using_decl, do_using_directive, check_default_args,
mark_used, handle_class_head): Use C90 prototypings. Use booleans.
* parser.c (cp_parser_class_head): Use booleanss.
* decl.c (walk_globals, walk_vtables): Likewise.
* cp-tree.h (walk_globals_pred, walk_globals_fn, walk_vtables,
walk_globals): Change return type from 'int' to 'bool'.
* rtti.c (init_rtti_processing, build_headof, throw_bad_cast
throw_bad_typeid, get_tinfo_decl_dynamic, typeid_ok_p,
build_typeid, tinfo_name, get_tinfo_decl, get_tinfo_ptr,
get_typeid, ifnonnull, build_dynamic_cast_1, build_dynamic_cast,
qualifier_flags, tinfo_base_init, generic_initializer,
ptr_initializer, dfs_class_hint_mark, ptm_initializer,
dfs_class_hint_unmark, class_hint_flags, class_initializer,
typeinfo_in_lib_p, get_pseudo_ti_init, create_pseudo_type_info,
get_pseudo_ti_desc, create_tinfo_types, emit_support_tinfos,
unemitted_tinfo_decl_p, emit_tinfo_decl): Likewise.
* repo.c (repo_compile_flags, repo_template_declared,
repo_template_defined, repo_class_defined, repo_get_id,
repo_template_used, repo_vtable_used, repo_inline_used,
repo_tinfo_used, repo_template_instantiated, extract_string,
open_repo_file, afgets, init_repo, reopen_repo_file_for_write,
finish_repo): Likewise.
* ptree.c (cxx_print_decl, cxx_print_type, cxx_print_identifier,
cxx_print_xnode): Likewise..
* cp-lang.c (ok_to_generate_alias_set_for_type, cxx_get_alias_set,
cxx_warn_unused_global_decl, cp_expr_size): Likewise.
* cxxfilt.c (demangle_it, print_demangler_list, usage,
standard_symbol_characters, hp_symbol_characters, main, fatal):
Likewise.
(strip_underscore): Change type from 'int' to 'bool'.
(main): Use boolean constants.
From-SVN: r60601
2002-12-29 15:53:05 +01:00
|
|
|
|
mark_vtable_entries (tree decl)
|
1994-02-24 02:02:37 +01:00
|
|
|
|
{
|
Make CONSTRUCTOR use VEC to store initializers.
* c-common.c (complete_array_type): Update to cope with VEC in
CONSTRUCTOR_ELTS.
* c-pretty-print.c (pp_c_initializer_list): Use pp_c_constructor_elts.
(pp_c_constructor_elts): New function.
* c-pretty-print.h (pp_c_constructor_elts): Declare.
* c-typeck.c (build_function_call, build_c_cast, digest_init,
struct constructor_stack, struct initializer_stack,
constructor_elements, push_init_level, pop_init_level,
add_pending_init, find_init_member, output_init_element): Update to
cope with VEC in CONSTRUCTOR_ELTS.
* coverage.c (build_fn_info_value, build_ctr_info_value,
build_gcov_info): Likewise.
* expr.c (categorize_ctor_elements_1, store_constructor,
expand_expr_real_1): Likewise.
* fold-const.c (fold_ternary): Likewise.
* gimplify.c (gimplify_init_ctor_preeval, zero_sized_field_decl,
gimplify_init_constructor, gimplify_expr): Likewise.
* tree-dump.c (dequeue_and_dump): Likewise.
* tree-inline.c (copy_tree_r): Add code to duplicate a CONSTRUCTOR
node.
* tree-pretty-print.c (dump_generic_node): Update to cope with VEC in
CONSTRUCTOR_ELTS.
* tree-sra.c (generate_element_init_1): Likewise.
* tree-ssa-ccp.c (fold_const_aggregate_ref): Likewise.
* tree-ssa-operands.c (get_expr_operands): Likewise.
* tree-vect-generic.c (expand_vector_piecewise): Likewise.
* tree-vect-transform.c (vect_get_vec_def_for_operand):
(get_initial_def_for_reduction): Likewise.
* tree-vn.c (set_value_handle, get_value_handle): CONSTURCTOR uses
value handle in annotations.
* tree.c (tree_node_kind, tree_code_size, make_node_stat,
tree_node_structure): Add support for constr_kind.
(build_vector_from_ctor, build_constructor_single,
build_constructor_from_list): New functions.
(build_constructor): Update to take a VEC instead of a TREE_LIST.
(simple_cst_equal, iterative_hash_expr, initializer_zerop, walk_tree):
Update to cope with VEC in CONSTRUCTOR_ELTS.
* tree.def (CONSTRUCTOR): Make it a tcc_exceptional node.
* tree.h (FOR_EACH_CONSTRUCTOR_VALUE, FOR_EACH_CONSTRUCTOR_ELT,
CONSTRUCTOR_APPEND_ELT): New macros.
(struct constructor_elt, struct tree_constructor): New data types.
(union tree_node): Add tree_constructor field.
* treestruct.def: Define TS_CONSTRUCTOR.
* varasm.c (const_hash_1, compare_constant, copy_constant,
compute_reloc_for_constant, output_addressed_constants,
initializer_constant_valid_p, output_constant,
array_size_for_constructor, output_constructor): Update to cope with
VEC in CONSTRUCTOR_ELTS.
* vec.h (VEC_empty, VEC_copy): New macros.
ada/
Make CONSTRUCTOR use VEC to store initializers.
* decl.c (gnat_to_gnu_entity): Update to cope with VEC in
CONSTRUCTOR_ELTS.
* trans.c (extract_values): Likewise.
* utils.c (convert, remove_conversions): Likewise.
* utils2.c (contains_save_expr_p, build_binary_op, build_unary_op,
gnat_build_constructor): Likewise.
cp/
Make CONSTRUCTOR use VEC to store initializers.
* call.c (convert_default_arg): Update call to digest_init.
* class.c (dump_class_hierarchy, dump_array): Update to cope with
VEC in CONSTRUCTOR_ELTS.
* cp-tree.h (EMPTY_CONSTRUCTOR_P): Likewise.
(finish_compound_literal, digest_init): Update declaration.
* decl.c (struct reshape_iter): New data type.
(reshape_init_array): Rename to...
(reshape_init_array_1): Update to cope with VEC in CONSTRUCTOR_ELTS.
(reshape_init): Rewrite from scratch. Split parts into...
(reshape_init_array, reshape_init_vector, reshape_init_class,
reshape_init_r): New functions.
(check_initializer): Update call to reshape_init. Remove obsolete
code.
(initialize_artificial_var, cp_complete_array_type): Update to cope
with VEC in CONSTRUCTOR_ELTS.
* decl2.c (grokfield): Update calls to digest_init.
(mark_vtable_entries): Update to cope with VEC in CONSTRUCTOR_ELTS.
* error.c (dump_expr_init_vec): New function.
(dump_expr): Use dump_expr_init_vec.
* init.c (build_zero_init, build_vec_init): Update to cope with VEC
in CONSTRUCTOR_ELTS.
(expand_default_init): Update call to digest_init.
* parser.c (cp_parser_postfix_expression): Use a VEC for the
initializers.
(cp_parser_initializer_list): Build a VEC of initializers.
* pt.c (tsubst_copy, tsubst_copy_and_build): Update to cope with VEC
in CONSTRUCTOR_ELTS.
* rtti.c (tinfo_base_init, generic_initializer, ptr_initializer,
ptm_initializer, class_initializer, get_pseudo_ti_init): Use
build_constructor_from_list instead of build_constructor.
* semantics.c (finish_compound_literal): Update call to digest_init.
* tree.c (stabilize_init): Update to cope with VEC in
CONSTRUCTOR_ELTS.
* typeck.c (build_ptrmemfunc1): Likewise.
* typeck2.c: (cxx_incomplete_type_error, split_nonconstant_init_1):
Likewise.
(store_init_value): Use build_constructor_from_list and update call
to digest_init.
(digest_init): Rewrite.
(process_init_constructor): Rewrite from scratch. Split into...
(process_init_constructor_array, picflag_from_initializer,
process_init_constructor_record, process_init_constructor_union):
New functions.
(PICFLAG_ERRONEOUS, PICFLAG_NOT_ALL_CONSTANT, PICFLAG_NOT_ALL_SIMPLE):
New macros.
(build_functional_cast): Use build_constructor_from_list instead of
build_constructor.
fortran/
Make CONSTRUCTOR use VEC to store initializers.
* trans-array.c (gfc_build_null_descriptor,
gfc_trans_array_constructor_value, gfc_conv_array_initializer):
Update to cope with VEC in CONSTRUCTOR_ELTS.
* trans-common.c (create_common): Likewise.
* trans-expr.c (gfc_conv_structure): Likewise.
* trans-stmt.c (gfc_trans_character_select): Use
build_constructor_from_list instead of build_constructor.
java/
Make CONSTRUCTOR use VEC to store initializers.
* check-init.c (check_init): Update to cope with VEC in
CONSTRUCTOR_ELTS.
* class.c (make_field_value, make_method_value, get_dispatch_table,
make_class_data, emit_symbol_table, emit_catch_table,
emit_assertion_table): Use build_constructor_from_list instead of
build_constructor.
* constants.c (build_constants_constructor): Likewise.
* java-gimplify.c (java_gimplify_new_array_init): Update to cope with
VEC in CONSTRUCTOR_ELTS.
* java-tree.h (START_RECORD_CONSTRUCTOR, PUSH_SUPER_VALUE,
PUSH_FIELD_VALUE, FINISH_RECORD_CONSTRUCTOR): Create a VEC instead
of a TREE_LIST.
* jcf-write.c (generate_bytecode_insns): Update to cope with VEC in
CONSTRUCTOR_ELTS.
* parse.y (build_new_array_init): Use build_constructor_from_list
instead of build_constructor.
(patch_new_array_init): Update to cope with VEC in
CONSTRUCTOR_ELTS.
(array_constructor_check_entry): Likewise.
objc/
Make CONSTRUCTOR use VEC to store initializers.
* objc-act.c (objc_build_constructor): Use build_constructor_from_list
instead of build_constructor.
testsuite/
Make CONSTRUCTOR use VEC to store initializers.
* g++.dg/ext/complit3.C: Check for specific error messages.
* g++.dg/init/brace2.C: Update error message.
* g++.dg/warn/Wbraces2.C: Likewise.
From-SVN: r102182
2005-07-20 03:19:59 +02:00
|
|
|
|
tree fnaddr;
|
|
|
|
|
unsigned HOST_WIDE_INT idx;
|
1995-10-12 03:33:51 +01:00
|
|
|
|
|
Make CONSTRUCTOR use VEC to store initializers.
* c-common.c (complete_array_type): Update to cope with VEC in
CONSTRUCTOR_ELTS.
* c-pretty-print.c (pp_c_initializer_list): Use pp_c_constructor_elts.
(pp_c_constructor_elts): New function.
* c-pretty-print.h (pp_c_constructor_elts): Declare.
* c-typeck.c (build_function_call, build_c_cast, digest_init,
struct constructor_stack, struct initializer_stack,
constructor_elements, push_init_level, pop_init_level,
add_pending_init, find_init_member, output_init_element): Update to
cope with VEC in CONSTRUCTOR_ELTS.
* coverage.c (build_fn_info_value, build_ctr_info_value,
build_gcov_info): Likewise.
* expr.c (categorize_ctor_elements_1, store_constructor,
expand_expr_real_1): Likewise.
* fold-const.c (fold_ternary): Likewise.
* gimplify.c (gimplify_init_ctor_preeval, zero_sized_field_decl,
gimplify_init_constructor, gimplify_expr): Likewise.
* tree-dump.c (dequeue_and_dump): Likewise.
* tree-inline.c (copy_tree_r): Add code to duplicate a CONSTRUCTOR
node.
* tree-pretty-print.c (dump_generic_node): Update to cope with VEC in
CONSTRUCTOR_ELTS.
* tree-sra.c (generate_element_init_1): Likewise.
* tree-ssa-ccp.c (fold_const_aggregate_ref): Likewise.
* tree-ssa-operands.c (get_expr_operands): Likewise.
* tree-vect-generic.c (expand_vector_piecewise): Likewise.
* tree-vect-transform.c (vect_get_vec_def_for_operand):
(get_initial_def_for_reduction): Likewise.
* tree-vn.c (set_value_handle, get_value_handle): CONSTURCTOR uses
value handle in annotations.
* tree.c (tree_node_kind, tree_code_size, make_node_stat,
tree_node_structure): Add support for constr_kind.
(build_vector_from_ctor, build_constructor_single,
build_constructor_from_list): New functions.
(build_constructor): Update to take a VEC instead of a TREE_LIST.
(simple_cst_equal, iterative_hash_expr, initializer_zerop, walk_tree):
Update to cope with VEC in CONSTRUCTOR_ELTS.
* tree.def (CONSTRUCTOR): Make it a tcc_exceptional node.
* tree.h (FOR_EACH_CONSTRUCTOR_VALUE, FOR_EACH_CONSTRUCTOR_ELT,
CONSTRUCTOR_APPEND_ELT): New macros.
(struct constructor_elt, struct tree_constructor): New data types.
(union tree_node): Add tree_constructor field.
* treestruct.def: Define TS_CONSTRUCTOR.
* varasm.c (const_hash_1, compare_constant, copy_constant,
compute_reloc_for_constant, output_addressed_constants,
initializer_constant_valid_p, output_constant,
array_size_for_constructor, output_constructor): Update to cope with
VEC in CONSTRUCTOR_ELTS.
* vec.h (VEC_empty, VEC_copy): New macros.
ada/
Make CONSTRUCTOR use VEC to store initializers.
* decl.c (gnat_to_gnu_entity): Update to cope with VEC in
CONSTRUCTOR_ELTS.
* trans.c (extract_values): Likewise.
* utils.c (convert, remove_conversions): Likewise.
* utils2.c (contains_save_expr_p, build_binary_op, build_unary_op,
gnat_build_constructor): Likewise.
cp/
Make CONSTRUCTOR use VEC to store initializers.
* call.c (convert_default_arg): Update call to digest_init.
* class.c (dump_class_hierarchy, dump_array): Update to cope with
VEC in CONSTRUCTOR_ELTS.
* cp-tree.h (EMPTY_CONSTRUCTOR_P): Likewise.
(finish_compound_literal, digest_init): Update declaration.
* decl.c (struct reshape_iter): New data type.
(reshape_init_array): Rename to...
(reshape_init_array_1): Update to cope with VEC in CONSTRUCTOR_ELTS.
(reshape_init): Rewrite from scratch. Split parts into...
(reshape_init_array, reshape_init_vector, reshape_init_class,
reshape_init_r): New functions.
(check_initializer): Update call to reshape_init. Remove obsolete
code.
(initialize_artificial_var, cp_complete_array_type): Update to cope
with VEC in CONSTRUCTOR_ELTS.
* decl2.c (grokfield): Update calls to digest_init.
(mark_vtable_entries): Update to cope with VEC in CONSTRUCTOR_ELTS.
* error.c (dump_expr_init_vec): New function.
(dump_expr): Use dump_expr_init_vec.
* init.c (build_zero_init, build_vec_init): Update to cope with VEC
in CONSTRUCTOR_ELTS.
(expand_default_init): Update call to digest_init.
* parser.c (cp_parser_postfix_expression): Use a VEC for the
initializers.
(cp_parser_initializer_list): Build a VEC of initializers.
* pt.c (tsubst_copy, tsubst_copy_and_build): Update to cope with VEC
in CONSTRUCTOR_ELTS.
* rtti.c (tinfo_base_init, generic_initializer, ptr_initializer,
ptm_initializer, class_initializer, get_pseudo_ti_init): Use
build_constructor_from_list instead of build_constructor.
* semantics.c (finish_compound_literal): Update call to digest_init.
* tree.c (stabilize_init): Update to cope with VEC in
CONSTRUCTOR_ELTS.
* typeck.c (build_ptrmemfunc1): Likewise.
* typeck2.c: (cxx_incomplete_type_error, split_nonconstant_init_1):
Likewise.
(store_init_value): Use build_constructor_from_list and update call
to digest_init.
(digest_init): Rewrite.
(process_init_constructor): Rewrite from scratch. Split into...
(process_init_constructor_array, picflag_from_initializer,
process_init_constructor_record, process_init_constructor_union):
New functions.
(PICFLAG_ERRONEOUS, PICFLAG_NOT_ALL_CONSTANT, PICFLAG_NOT_ALL_SIMPLE):
New macros.
(build_functional_cast): Use build_constructor_from_list instead of
build_constructor.
fortran/
Make CONSTRUCTOR use VEC to store initializers.
* trans-array.c (gfc_build_null_descriptor,
gfc_trans_array_constructor_value, gfc_conv_array_initializer):
Update to cope with VEC in CONSTRUCTOR_ELTS.
* trans-common.c (create_common): Likewise.
* trans-expr.c (gfc_conv_structure): Likewise.
* trans-stmt.c (gfc_trans_character_select): Use
build_constructor_from_list instead of build_constructor.
java/
Make CONSTRUCTOR use VEC to store initializers.
* check-init.c (check_init): Update to cope with VEC in
CONSTRUCTOR_ELTS.
* class.c (make_field_value, make_method_value, get_dispatch_table,
make_class_data, emit_symbol_table, emit_catch_table,
emit_assertion_table): Use build_constructor_from_list instead of
build_constructor.
* constants.c (build_constants_constructor): Likewise.
* java-gimplify.c (java_gimplify_new_array_init): Update to cope with
VEC in CONSTRUCTOR_ELTS.
* java-tree.h (START_RECORD_CONSTRUCTOR, PUSH_SUPER_VALUE,
PUSH_FIELD_VALUE, FINISH_RECORD_CONSTRUCTOR): Create a VEC instead
of a TREE_LIST.
* jcf-write.c (generate_bytecode_insns): Update to cope with VEC in
CONSTRUCTOR_ELTS.
* parse.y (build_new_array_init): Use build_constructor_from_list
instead of build_constructor.
(patch_new_array_init): Update to cope with VEC in
CONSTRUCTOR_ELTS.
(array_constructor_check_entry): Likewise.
objc/
Make CONSTRUCTOR use VEC to store initializers.
* objc-act.c (objc_build_constructor): Use build_constructor_from_list
instead of build_constructor.
testsuite/
Make CONSTRUCTOR use VEC to store initializers.
* g++.dg/ext/complit3.C: Check for specific error messages.
* g++.dg/init/brace2.C: Update error message.
* g++.dg/warn/Wbraces2.C: Likewise.
From-SVN: r102182
2005-07-20 03:19:59 +02:00
|
|
|
|
FOR_EACH_CONSTRUCTOR_VALUE (CONSTRUCTOR_ELTS (DECL_INITIAL (decl)),
|
|
|
|
|
idx, fnaddr)
|
1994-02-24 02:02:37 +01:00
|
|
|
|
{
|
1999-04-13 02:39:32 +02:00
|
|
|
|
tree fn;
|
2003-06-23 19:46:26 +02:00
|
|
|
|
|
|
|
|
|
STRIP_NOPS (fnaddr);
|
|
|
|
|
|
2001-09-21 18:58:22 +02:00
|
|
|
|
if (TREE_CODE (fnaddr) != ADDR_EXPR
|
|
|
|
|
&& TREE_CODE (fnaddr) != FDESC_EXPR)
|
2000-01-17 05:08:01 +01:00
|
|
|
|
/* This entry is an offset: a virtual base class offset, a
|
2001-03-22 01:55:13 +01:00
|
|
|
|
virtual call offset, an RTTI offset, etc. */
|
1999-04-13 02:39:32 +02:00
|
|
|
|
continue;
|
|
|
|
|
|
|
|
|
|
fn = TREE_OPERAND (fnaddr, 0);
|
1994-04-08 08:08:43 +02:00
|
|
|
|
TREE_ADDRESSABLE (fn) = 1;
|
2000-06-23 03:14:40 +02:00
|
|
|
|
/* When we don't have vcall offsets, we output thunks whenever
|
|
|
|
|
we output the vtables that contain them. With vcall offsets,
|
|
|
|
|
we know all the thunks we'll need when we emit a virtual
|
|
|
|
|
function, so we emit the thunks there instead. */
|
2005-06-14 22:01:59 +02:00
|
|
|
|
if (DECL_THUNK_P (fn))
|
2001-06-06 23:52:52 +02:00
|
|
|
|
use_thunk (fn, /*emit_p=*/0);
|
1996-02-28 23:01:56 +01:00
|
|
|
|
mark_used (fn);
|
1994-04-22 01:30:18 +02:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
1996-08-26 22:32:48 +02:00
|
|
|
|
/* Set DECL up to have the closest approximation of "initialized common"
|
|
|
|
|
linkage available. */
|
|
|
|
|
|
|
|
|
|
void
|
Remove traditional C constructs 4/n.
* decl2.c (grok_method_quals, warn_if_unknown_interface,
grok_x_components, cp_build_parm_decl, build_artificial_parm,
maybe_retrofit_in_chrg, grokclassfn, grok_array_decl,
delete_sanity, check_member_template, check_java_method,
check_classfn, finish_static_data_member_decl, grokfield,
grokbitfield, grokoptypename, grok_function_init,
cplus_decl_attributes, constructor_name, defer_fn,
build_anon_union_vars, finish_anon_union, coerce_new_type,
coerce_delete_type, comdat_linkage, maybe_make_one_only,
key_method, import_export_vtable, import_export_class,
output_vtable_inherit, import_export_decl, import_export_tinfo,
build_cleanup, get_guard, get_guard_bits, get_guard_cond,
set_guard, start_objects, finish_objects,
start_static_storage_duration_function,
finish_static_storage_duration_function, get_priority_info,
start_static_initialization_or_destruction,
finish_static_initialization_or_destruction,
do_static_initialization, do_static_destruction,
prune_vars_needing_no_initialization, write_out_vars,
reparse_decl_as_expr, finish_decl_parsing, namespace_ancestor,
add_using_namespace, merge_functions, ambiguous_decl,
lookup_using_namespace, lookup_using_namespace,
qualified_lookup_using_namespace, set_decl_namespace,
decl_namespace, current_decl_namespace, push_decl_namespace,
pop_decl_namespace, push_scope, pop_scope, add_function,
arg_assoc_namespace, arg_assoc_template_arg, arg_assoc,
lookup_arg_dependent, do_namespace_alias,
validate_nonmember_using_decl, do_nonmember_using_decl,
do_toplevel_using_decl, do_local_using_decl,
do_class_using_decl, do_using_directive, check_default_args,
mark_used, handle_class_head): Use C90 prototypings. Use booleans.
* parser.c (cp_parser_class_head): Use booleanss.
* decl.c (walk_globals, walk_vtables): Likewise.
* cp-tree.h (walk_globals_pred, walk_globals_fn, walk_vtables,
walk_globals): Change return type from 'int' to 'bool'.
* rtti.c (init_rtti_processing, build_headof, throw_bad_cast
throw_bad_typeid, get_tinfo_decl_dynamic, typeid_ok_p,
build_typeid, tinfo_name, get_tinfo_decl, get_tinfo_ptr,
get_typeid, ifnonnull, build_dynamic_cast_1, build_dynamic_cast,
qualifier_flags, tinfo_base_init, generic_initializer,
ptr_initializer, dfs_class_hint_mark, ptm_initializer,
dfs_class_hint_unmark, class_hint_flags, class_initializer,
typeinfo_in_lib_p, get_pseudo_ti_init, create_pseudo_type_info,
get_pseudo_ti_desc, create_tinfo_types, emit_support_tinfos,
unemitted_tinfo_decl_p, emit_tinfo_decl): Likewise.
* repo.c (repo_compile_flags, repo_template_declared,
repo_template_defined, repo_class_defined, repo_get_id,
repo_template_used, repo_vtable_used, repo_inline_used,
repo_tinfo_used, repo_template_instantiated, extract_string,
open_repo_file, afgets, init_repo, reopen_repo_file_for_write,
finish_repo): Likewise.
* ptree.c (cxx_print_decl, cxx_print_type, cxx_print_identifier,
cxx_print_xnode): Likewise..
* cp-lang.c (ok_to_generate_alias_set_for_type, cxx_get_alias_set,
cxx_warn_unused_global_decl, cp_expr_size): Likewise.
* cxxfilt.c (demangle_it, print_demangler_list, usage,
standard_symbol_characters, hp_symbol_characters, main, fatal):
Likewise.
(strip_underscore): Change type from 'int' to 'bool'.
(main): Use boolean constants.
From-SVN: r60601
2002-12-29 15:53:05 +01:00
|
|
|
|
comdat_linkage (tree decl)
|
1996-08-26 22:32:48 +02:00
|
|
|
|
{
|
|
|
|
|
if (flag_weak)
|
2009-06-15 16:25:50 +02:00
|
|
|
|
make_decl_one_only (decl, cxx_comdat_group (decl));
|
2005-06-14 22:01:59 +02:00
|
|
|
|
else if (TREE_CODE (decl) == FUNCTION_DECL
|
2001-02-04 09:35:11 +01:00
|
|
|
|
|| (TREE_CODE (decl) == VAR_DECL && DECL_ARTIFICIAL (decl)))
|
|
|
|
|
/* We can just emit function and compiler-generated variables
|
|
|
|
|
statically; having multiple copies is (for the most part) only
|
2005-06-14 22:01:59 +02:00
|
|
|
|
a waste of space.
|
2001-02-04 09:35:11 +01:00
|
|
|
|
|
|
|
|
|
There are two correctness issues, however: the address of a
|
|
|
|
|
template instantiation with external linkage should be the
|
2000-10-31 02:30:59 +01:00
|
|
|
|
same, independent of what translation unit asks for the
|
|
|
|
|
address, and this will not hold when we emit multiple copies of
|
2005-06-14 22:01:59 +02:00
|
|
|
|
the function. However, there's little else we can do.
|
2001-02-04 09:35:11 +01:00
|
|
|
|
|
2001-07-21 02:03:21 +02:00
|
|
|
|
Also, by default, the typeinfo implementation assumes that
|
|
|
|
|
there will be only one copy of the string used as the name for
|
|
|
|
|
each type. Therefore, if weak symbols are unavailable, the
|
|
|
|
|
run-time library should perform a more conservative check; it
|
|
|
|
|
should perform a string comparison, rather than an address
|
|
|
|
|
comparison. */
|
1996-09-18 19:20:21 +02:00
|
|
|
|
TREE_PUBLIC (decl) = 0;
|
1999-03-23 03:33:34 +01:00
|
|
|
|
else
|
|
|
|
|
{
|
1999-03-25 20:45:25 +01:00
|
|
|
|
/* Static data member template instantiations, however, cannot
|
|
|
|
|
have multiple copies. */
|
1999-03-23 03:33:34 +01:00
|
|
|
|
if (DECL_INITIAL (decl) == 0
|
|
|
|
|
|| DECL_INITIAL (decl) == error_mark_node)
|
|
|
|
|
DECL_COMMON (decl) = 1;
|
|
|
|
|
else if (EMPTY_CONSTRUCTOR_P (DECL_INITIAL (decl)))
|
|
|
|
|
{
|
|
|
|
|
DECL_COMMON (decl) = 1;
|
|
|
|
|
DECL_INITIAL (decl) = error_mark_node;
|
|
|
|
|
}
|
2003-05-01 17:46:01 +02:00
|
|
|
|
else if (!DECL_EXPLICIT_INSTANTIATION (decl))
|
1999-03-23 03:33:34 +01:00
|
|
|
|
{
|
|
|
|
|
/* We can't do anything useful; leave vars for explicit
|
|
|
|
|
instantiation. */
|
|
|
|
|
DECL_EXTERNAL (decl) = 1;
|
|
|
|
|
DECL_NOT_REALLY_EXTERN (decl) = 0;
|
|
|
|
|
}
|
|
|
|
|
}
|
1997-12-12 07:20:32 +01:00
|
|
|
|
|
2009-12-01 22:58:04 +01:00
|
|
|
|
DECL_COMDAT (decl) = 1;
|
1996-08-26 22:32:48 +02:00
|
|
|
|
}
|
|
|
|
|
|
1998-05-21 07:42:51 +02:00
|
|
|
|
/* For win32 we also want to put explicit instantiations in
|
|
|
|
|
linkonce sections, so that they will be merged with implicit
|
2005-06-14 22:01:59 +02:00
|
|
|
|
instantiations; otherwise we get duplicate symbol errors.
|
|
|
|
|
For Darwin we do not want explicit instantiations to be
|
2004-05-31 10:42:32 +02:00
|
|
|
|
linkonce. */
|
1998-05-21 07:42:51 +02:00
|
|
|
|
|
|
|
|
|
void
|
Remove traditional C constructs 4/n.
* decl2.c (grok_method_quals, warn_if_unknown_interface,
grok_x_components, cp_build_parm_decl, build_artificial_parm,
maybe_retrofit_in_chrg, grokclassfn, grok_array_decl,
delete_sanity, check_member_template, check_java_method,
check_classfn, finish_static_data_member_decl, grokfield,
grokbitfield, grokoptypename, grok_function_init,
cplus_decl_attributes, constructor_name, defer_fn,
build_anon_union_vars, finish_anon_union, coerce_new_type,
coerce_delete_type, comdat_linkage, maybe_make_one_only,
key_method, import_export_vtable, import_export_class,
output_vtable_inherit, import_export_decl, import_export_tinfo,
build_cleanup, get_guard, get_guard_bits, get_guard_cond,
set_guard, start_objects, finish_objects,
start_static_storage_duration_function,
finish_static_storage_duration_function, get_priority_info,
start_static_initialization_or_destruction,
finish_static_initialization_or_destruction,
do_static_initialization, do_static_destruction,
prune_vars_needing_no_initialization, write_out_vars,
reparse_decl_as_expr, finish_decl_parsing, namespace_ancestor,
add_using_namespace, merge_functions, ambiguous_decl,
lookup_using_namespace, lookup_using_namespace,
qualified_lookup_using_namespace, set_decl_namespace,
decl_namespace, current_decl_namespace, push_decl_namespace,
pop_decl_namespace, push_scope, pop_scope, add_function,
arg_assoc_namespace, arg_assoc_template_arg, arg_assoc,
lookup_arg_dependent, do_namespace_alias,
validate_nonmember_using_decl, do_nonmember_using_decl,
do_toplevel_using_decl, do_local_using_decl,
do_class_using_decl, do_using_directive, check_default_args,
mark_used, handle_class_head): Use C90 prototypings. Use booleans.
* parser.c (cp_parser_class_head): Use booleanss.
* decl.c (walk_globals, walk_vtables): Likewise.
* cp-tree.h (walk_globals_pred, walk_globals_fn, walk_vtables,
walk_globals): Change return type from 'int' to 'bool'.
* rtti.c (init_rtti_processing, build_headof, throw_bad_cast
throw_bad_typeid, get_tinfo_decl_dynamic, typeid_ok_p,
build_typeid, tinfo_name, get_tinfo_decl, get_tinfo_ptr,
get_typeid, ifnonnull, build_dynamic_cast_1, build_dynamic_cast,
qualifier_flags, tinfo_base_init, generic_initializer,
ptr_initializer, dfs_class_hint_mark, ptm_initializer,
dfs_class_hint_unmark, class_hint_flags, class_initializer,
typeinfo_in_lib_p, get_pseudo_ti_init, create_pseudo_type_info,
get_pseudo_ti_desc, create_tinfo_types, emit_support_tinfos,
unemitted_tinfo_decl_p, emit_tinfo_decl): Likewise.
* repo.c (repo_compile_flags, repo_template_declared,
repo_template_defined, repo_class_defined, repo_get_id,
repo_template_used, repo_vtable_used, repo_inline_used,
repo_tinfo_used, repo_template_instantiated, extract_string,
open_repo_file, afgets, init_repo, reopen_repo_file_for_write,
finish_repo): Likewise.
* ptree.c (cxx_print_decl, cxx_print_type, cxx_print_identifier,
cxx_print_xnode): Likewise..
* cp-lang.c (ok_to_generate_alias_set_for_type, cxx_get_alias_set,
cxx_warn_unused_global_decl, cp_expr_size): Likewise.
* cxxfilt.c (demangle_it, print_demangler_list, usage,
standard_symbol_characters, hp_symbol_characters, main, fatal):
Likewise.
(strip_underscore): Change type from 'int' to 'bool'.
(main): Use boolean constants.
From-SVN: r60601
2002-12-29 15:53:05 +01:00
|
|
|
|
maybe_make_one_only (tree decl)
|
1998-05-21 07:42:51 +02:00
|
|
|
|
{
|
1999-11-02 08:33:05 +01:00
|
|
|
|
/* We used to say that this was not necessary on targets that support weak
|
|
|
|
|
symbols, because the implicit instantiations will defer to the explicit
|
|
|
|
|
one. However, that's not actually the case in SVR4; a strong definition
|
|
|
|
|
after a weak one is an error. Also, not making explicit
|
|
|
|
|
instantiations one_only means that we can end up with two copies of
|
2002-09-13 13:33:47 +02:00
|
|
|
|
some template instantiations. */
|
2001-05-21 17:55:40 +02:00
|
|
|
|
if (! flag_weak)
|
1998-05-21 07:42:51 +02:00
|
|
|
|
return;
|
|
|
|
|
|
Make-lang.in (CXX_AND_OBJCXX_OBJS): Add cp/cp-objcp-common.o.
2004-08-31 Ziemowit Laski <zlaski@apple.com>
* Make-lang.in (CXX_AND_OBJCXX_OBJS): Add cp/cp-objcp-common.o.
(cp/cp-lang.o): Depend on debug.h, gtype-cp.h and cp/cp-objcp-common.h.
(cp/cp-decl.c): Do not depend on gtype-cp.h.
(cp/cp-objcp-common.o): New target.
* cp-lang.c: Include debug.h, cp-objcp-common.h and gtype-cp.h.
(cxx_get_alias_set, cxx_warn_unused_global_decl, cp_expr_size,
cp_tree_size, cp_var_mod_type_p, cxx_initialize_diagnostics): Move
prototypes and definitions to cp-objcp-common.h and cp-objcp-common.c,
respectively.
(LANG_HOOKS_TREE_SIZE, LANG_HOOKS_FINISH,
LANG_HOOKS_CLEAR_BINDING_STACK, LANG_HOOKS_INIT_OPTIONS,
LANG_HOOKS_INITIALIZE_DIAGNOSTICS, LANG_HOOKS_HANDLE_OPTION,
LANG_HOOKS_HANDLE_FILENAME, LANG_HOOKS_MISSING_ARGUMENT,
LANG_HOOKS_POST_OPTIONS, LANG_HOOKS_GET_ALIAS_SET,
LANG_HOOKS_EXPAND_CONSTANT, LANG_HOOKS_EXPAND_EXPR,
LANG_HOOKS_EXPAND_DECL, LANG_HOOKS_PARSE_FILE,
LANG_HOOKS_DUP_LANG_SPECIFIC_DECL, LANG_HOOKS_TRUTHVALUE_CONVERSION,
LANG_HOOKS_SET_DECL_ASSEMBLER_NAME, LANG_HOOKS_MARK_ADDRESSABLE,
LANG_HOOKS_PRINT_STATISTICS, LANG_HOOKS_PRINT_XNODE,
LANG_HOOKS_PRINT_DECL, LANG_HOOKS_PRINT_TYPE,
LANG_HOOKS_PRINT_IDENTIFIER, LANG_HOOKS_PRINT_ERROR_FUNCTION,
LANG_HOOKS_WARN_UNUSED_GLOBAL_DECL, LANG_HOOKS_WRITE_GLOBALS,
LANG_HOOKS_FUNCTION_INIT, LANG_HOOKS_FUNCTION_FINAL,
LANG_HOOKS_FUNCTION_MISSING_NORETURN_OK_P,
LANG_HOOKS_COMMON_ATTRIBUTE_TABLE, LANG_HOOKS_FORMAT_ATTRIBUTE_TABLE,
LANG_HOOKS_ATTRIBUTE_TABLE, LANG_HOOKS_TREE_INLINING_WALK_SUBTREES,
LANG_HOOKS_TREE_INLINING_CANNOT_INLINE_TREE_FN,
LANG_HOOKS_TREE_INLINING_ADD_PENDING_FN_DECLS,
LANG_HOOKS_TREE_INLINING_AUTO_VAR_IN_FN_P,
LANG_HOOKS_TREE_INLINING_ANON_AGGR_TYPE_P,
LANG_HOOKS_TREE_INLINING_VAR_MOD_TYPE_P,
LANG_HOOKS_TREE_DUMP_DUMP_TREE_FN,
LANG_HOOKS_TREE_DUMP_TYPE_QUALS_FN, LANG_HOOKS_EXPR_SIZE,
LANG_HOOKS_CALLGRAPH_ANALYZE_EXPR,
LANG_HOOKS_CALLGRAPH_EXPAND_FUNCTION, LANG_HOOKS_MAKE_TYPE,
LANG_HOOKS_TYPE_FOR_MODE, LANG_HOOKS_TYPE_FOR_SIZE,
LANG_HOOKS_SIGNED_TYPE, LANG_HOOKS_UNSIGNED_TYPE,
LANG_HOOKS_SIGNED_OR_UNSIGNED_TYPE, LANG_HOOKS_INCOMPLETE_TYPE_ERROR,
LANG_HOOKS_TYPE_PROMOTES_TO, LANG_HOOKS_REGISTER_BUILTIN_TYPE,
LANG_HOOKS_GIMPLIFY_EXPR, LANG_HOOKS_FOLD_OBJ_TYPE_REF): Move
hooks to cp-objcp-common.h.
(finish_file): New function.
* cp-objcp-common.c: New file.
* cp-objcp-common.h: New file.
* cp-tree.h (cp_finish_file): New prototype.
* decl.c: Do not include gtype-cp.h.
* decl2.c (finish_file): Rename to cp_finish_file.
From-SVN: r86837
2004-08-31 20:51:08 +02:00
|
|
|
|
/* We can't set DECL_COMDAT on functions, or cp_finish_file will think
|
1999-03-23 03:33:34 +01:00
|
|
|
|
we can get away with not emitting them if they aren't used. We need
|
|
|
|
|
to for variables so that cp_finish_decl will update their linkage,
|
|
|
|
|
because their DECL_INITIAL may not have been set properly yet. */
|
1998-05-21 07:42:51 +02:00
|
|
|
|
|
2004-06-04 01:15:01 +02:00
|
|
|
|
if (!TARGET_WEAK_NOT_IN_ARCHIVE_TOC
|
2004-03-12 18:09:03 +01:00
|
|
|
|
|| (! DECL_EXPLICIT_INSTANTIATION (decl)
|
|
|
|
|
&& ! DECL_TEMPLATE_SPECIALIZATION (decl)))
|
2002-03-15 10:54:42 +01:00
|
|
|
|
{
|
2009-06-15 16:25:50 +02:00
|
|
|
|
make_decl_one_only (decl, cxx_comdat_group (decl));
|
2004-03-12 18:09:03 +01:00
|
|
|
|
|
|
|
|
|
if (TREE_CODE (decl) == VAR_DECL)
|
|
|
|
|
{
|
|
|
|
|
DECL_COMDAT (decl) = 1;
|
|
|
|
|
/* Mark it needed so we don't forget to emit it. */
|
2004-05-19 03:28:56 +02:00
|
|
|
|
mark_decl_referenced (decl);
|
2004-03-12 18:09:03 +01:00
|
|
|
|
}
|
2002-03-15 10:54:42 +01:00
|
|
|
|
}
|
1998-05-21 07:42:51 +02:00
|
|
|
|
}
|
|
|
|
|
|
2010-03-03 20:01:46 +01:00
|
|
|
|
/* Returns true iff DECL, a FUNCTION_DECL or VAR_DECL, has vague linkage.
|
|
|
|
|
This predicate will give the right answer during parsing of the
|
|
|
|
|
function, which other tests may not. */
|
2009-09-18 23:25:18 +02:00
|
|
|
|
|
|
|
|
|
bool
|
2010-03-03 20:01:46 +01:00
|
|
|
|
vague_linkage_p (tree decl)
|
2009-09-18 23:25:18 +02:00
|
|
|
|
{
|
|
|
|
|
/* Unfortunately, import_export_decl has not always been called
|
|
|
|
|
before the function is processed, so we cannot simply check
|
|
|
|
|
DECL_COMDAT. */
|
2010-03-03 20:01:46 +01:00
|
|
|
|
return (DECL_COMDAT (decl)
|
|
|
|
|
|| (((TREE_CODE (decl) == FUNCTION_DECL
|
|
|
|
|
&& DECL_DECLARED_INLINE_P (decl))
|
2010-03-20 09:55:32 +01:00
|
|
|
|
|| (DECL_LANG_SPECIFIC (decl)
|
|
|
|
|
&& DECL_TEMPLATE_INSTANTIATION (decl)))
|
2010-03-03 20:01:46 +01:00
|
|
|
|
&& TREE_PUBLIC (decl)));
|
2009-09-18 23:25:18 +02:00
|
|
|
|
}
|
|
|
|
|
|
1998-07-23 19:51:17 +02:00
|
|
|
|
/* Determine whether or not we want to specifically import or export CTYPE,
|
|
|
|
|
using various heuristics. */
|
1998-07-23 04:29:34 +02:00
|
|
|
|
|
2000-02-27 03:46:57 +01:00
|
|
|
|
static void
|
Remove traditional C constructs 4/n.
* decl2.c (grok_method_quals, warn_if_unknown_interface,
grok_x_components, cp_build_parm_decl, build_artificial_parm,
maybe_retrofit_in_chrg, grokclassfn, grok_array_decl,
delete_sanity, check_member_template, check_java_method,
check_classfn, finish_static_data_member_decl, grokfield,
grokbitfield, grokoptypename, grok_function_init,
cplus_decl_attributes, constructor_name, defer_fn,
build_anon_union_vars, finish_anon_union, coerce_new_type,
coerce_delete_type, comdat_linkage, maybe_make_one_only,
key_method, import_export_vtable, import_export_class,
output_vtable_inherit, import_export_decl, import_export_tinfo,
build_cleanup, get_guard, get_guard_bits, get_guard_cond,
set_guard, start_objects, finish_objects,
start_static_storage_duration_function,
finish_static_storage_duration_function, get_priority_info,
start_static_initialization_or_destruction,
finish_static_initialization_or_destruction,
do_static_initialization, do_static_destruction,
prune_vars_needing_no_initialization, write_out_vars,
reparse_decl_as_expr, finish_decl_parsing, namespace_ancestor,
add_using_namespace, merge_functions, ambiguous_decl,
lookup_using_namespace, lookup_using_namespace,
qualified_lookup_using_namespace, set_decl_namespace,
decl_namespace, current_decl_namespace, push_decl_namespace,
pop_decl_namespace, push_scope, pop_scope, add_function,
arg_assoc_namespace, arg_assoc_template_arg, arg_assoc,
lookup_arg_dependent, do_namespace_alias,
validate_nonmember_using_decl, do_nonmember_using_decl,
do_toplevel_using_decl, do_local_using_decl,
do_class_using_decl, do_using_directive, check_default_args,
mark_used, handle_class_head): Use C90 prototypings. Use booleans.
* parser.c (cp_parser_class_head): Use booleanss.
* decl.c (walk_globals, walk_vtables): Likewise.
* cp-tree.h (walk_globals_pred, walk_globals_fn, walk_vtables,
walk_globals): Change return type from 'int' to 'bool'.
* rtti.c (init_rtti_processing, build_headof, throw_bad_cast
throw_bad_typeid, get_tinfo_decl_dynamic, typeid_ok_p,
build_typeid, tinfo_name, get_tinfo_decl, get_tinfo_ptr,
get_typeid, ifnonnull, build_dynamic_cast_1, build_dynamic_cast,
qualifier_flags, tinfo_base_init, generic_initializer,
ptr_initializer, dfs_class_hint_mark, ptm_initializer,
dfs_class_hint_unmark, class_hint_flags, class_initializer,
typeinfo_in_lib_p, get_pseudo_ti_init, create_pseudo_type_info,
get_pseudo_ti_desc, create_tinfo_types, emit_support_tinfos,
unemitted_tinfo_decl_p, emit_tinfo_decl): Likewise.
* repo.c (repo_compile_flags, repo_template_declared,
repo_template_defined, repo_class_defined, repo_get_id,
repo_template_used, repo_vtable_used, repo_inline_used,
repo_tinfo_used, repo_template_instantiated, extract_string,
open_repo_file, afgets, init_repo, reopen_repo_file_for_write,
finish_repo): Likewise.
* ptree.c (cxx_print_decl, cxx_print_type, cxx_print_identifier,
cxx_print_xnode): Likewise..
* cp-lang.c (ok_to_generate_alias_set_for_type, cxx_get_alias_set,
cxx_warn_unused_global_decl, cp_expr_size): Likewise.
* cxxfilt.c (demangle_it, print_demangler_list, usage,
standard_symbol_characters, hp_symbol_characters, main, fatal):
Likewise.
(strip_underscore): Change type from 'int' to 'bool'.
(main): Use boolean constants.
From-SVN: r60601
2002-12-29 15:53:05 +01:00
|
|
|
|
import_export_class (tree ctype)
|
1994-02-24 02:02:37 +01:00
|
|
|
|
{
|
1998-07-23 19:51:17 +02:00
|
|
|
|
/* -1 for imported, 1 for exported. */
|
|
|
|
|
int import_export = 0;
|
|
|
|
|
|
2000-02-27 03:46:57 +01:00
|
|
|
|
/* It only makes sense to call this function at EOF. The reason is
|
|
|
|
|
that this function looks at whether or not the first non-inline
|
|
|
|
|
non-abstract virtual member function has been defined in this
|
|
|
|
|
translation unit. But, we can't possibly know that until we've
|
|
|
|
|
seen the entire translation unit. */
|
call.c (validate_conversion_obstack): Replace my_friendly_assert with gcc_assert or gcc_unreachable.
* call.c (validate_conversion_obstack): Replace
my_friendly_assert with gcc_assert or gcc_unreachable.
(direct_reference_binding, merge_conversion_sequences,
build_user_type_conversion_1, perform_overload_resolution,
build_op_delete_call, enforce_access, call_builtin_trap,
build_over_call, build_special_member_call, build_new_method_call,
initialize_reference): Likewise.
* class.c (build_base_path, build_primary_vtable, alter_access,
check_bases, update_vtable_entry_for_fn, layout_empty_base,
clone_function_decl, adjust_clone_args,
type_requires_array_cookie, include_empty_classes,
finish_struct_1, resolve_address_of_overloaded_function,
instantiate_type, get_vtbl_decl_for_binfo, build_vtt_inits,
dfs_build_secondary_vptr_vtt_inits, build_ctor_vtbl_group,
accumulate_vtbl_inits, build_vtbl_initializer,
build_vbase_offset_vtbl_entries, build_rtti_vtbl_entries): Likewise.
* cvt.c (build_up_reference, convert_to_reference): Likewise.
* decl.c (poplevel, duplicate_decls, make_typename_type,
cxx_init_decl_processing, reshape_init, check_initializer,
make_rtl_for_nonlocal_decl, initialize_local_var, cp_finish_decl,
expand_static_init, grokfndecl, grokvardecl, build_ptrmem_type,
grokdeclarator, copy_fn_p, grok_op_properties, xref_tag,
xref_basetypes, start_preparsed_function, save_function_data,
finish_function, finish_method, maybe_register_incomplete_var,
complete_vars): Likewise.
* decl2.c (grok_array_decl, check_member_template,
check_classfn, finish_static_data_member_decl, coerce_new_type,
coerce_delete_type, import_export_class, decl_needed_p,
determine_visibility, import_export_decl, build_cleanup,
start_static_initialization_or_destructi, do_static_destruction,
prune_vars_needing_no_initialization,
build_offset_ref_call_from_tree): Likewise.
* error.c (dump_decl, dump_expr): Likewise.
* init.c (finish_init_stmts, build_zero_init,
expand_virtual_init, expand_default_init, expand_aggr_init_1,
build_offset_ref, build_new_1, build_delete, build_vbase_delete):
Likewise.
* mangle.c (write_method_parms, write_template_args,
write_expression, write_template_arg): Likewise.
* method.c (make_thunk, finish_thunk, use_thunk): Likewise.
* name-lookup.c (pop_binding, begin_scope, leave_scope,
resume_scope, push_using_decl, validate_nonmember_using_decl,
is_ancestor, poplevel_class, set_inherited_value_binding_p,
push_class_level_binding, do_class_using_decl, push_namespace,
pop_namespace, add_using_namespace, ambiguous_decl,
lookup_namespace_name, lookup_type_current_level,
maybe_process_template_type_declaration): Likewise.
* parser.c (cp_lexer_peek_nth_token,
cp_parser_parse_and_diagnose_invalid_typ,
cp_parser_translation_unit, cp_parser_template_id,
cp_parser_lookup_name, cp_parser_late_parsing_for_member): Likewise.
* pt.c (push_access_scope, finish_member_template_decl,
push_inline_template_parms_recursive, add_outermost_template_args,
get_innermost_template_args, begin_explicit_instantiation,
end_explicit_instantiation, retrieve_specialization,
is_specialization_of, is_specialization_of_friend,
register_specialization, check_explicit_specialization,
comp_template_parms, process_template_parm,
process_partial_specialization, convert_nontype_argument,
coerce_template_template_parms, coerce_template_parms,
mangle_class_name_for_template, lookup_template_function,
lookup_template_class, instantiate_class_template, tsubst_decl,
tsubst_function_type, tsubst, tsubst_qualified_id, tsubst_copy,
instantiate_template, fn_type_unification, type_unification_real,
get_template_base, regenerate_decl_from_template,
template_for_substitution, instantiate_decl,
get_mostly_instantiated_function_type, dependent_scope_ref_p,
value_dependent_expression_p, resolve_typename_type): Likewise.
* repo.c (repo_emit_p): Likewise.
* rtti.c (build_headof, get_tinfo_decl, get_pseudo_ti_init,
create_tinfo_types, emit_tinfo_decl): Likewise.
* search.c (lookup_base_r, lookup_base, lookup_field_1,
dfs_access_in_type, build_baselink, lookup_member,
adjust_result_of_qualified_name_lookup, copied_binfo): Likewise.
* semantics.c (perform_or_defer_access_check,
finish_non_static_data_member, finish_stmt_expr_expr,
finish_stmt_expr, finish_call_expr, finish_pseudo_destructor_expr,
finish_template_template_parm, finish_member_declaration,
emit_associated_thunks): Likewise.
* tree.c (build_target_expr_with_type, force_target_expr,
copy_binfo, get_first_fn, cp_tree_equal): Likewise.
* typeck.c (type_after_usual_arithmetic_conversions, comptypes,
cxx_sizeof_or_alignof_type, perform_integral_promotions,
build_class_member_access_expr, finish_class_member_access_expr,
build_ptrmemfunc_access_expr, build_unary_op,
unary_complex_lvalue, cxx_mark_addressable, build_modify_expr,
build_ptrmemfunc, expand_ptrmemfunc_cst, check_return_expr
* typeck2.c (complete_type_check_abstract,
abstract_virtuals_error, process_init_constructor,
add_exception_specifier): Likewise.
From-SVN: r86669
2004-08-27 19:59:33 +02:00
|
|
|
|
gcc_assert (at_eof);
|
2000-02-27 03:46:57 +01:00
|
|
|
|
|
1998-07-23 19:51:17 +02:00
|
|
|
|
if (CLASSTYPE_INTERFACE_KNOWN (ctype))
|
|
|
|
|
return;
|
|
|
|
|
|
2004-09-09 19:11:18 +02:00
|
|
|
|
/* If MULTIPLE_SYMBOL_SPACES is set and we saw a #pragma interface,
|
1999-03-03 12:24:45 +01:00
|
|
|
|
we will have CLASSTYPE_INTERFACE_ONLY set but not
|
|
|
|
|
CLASSTYPE_INTERFACE_KNOWN. In that case, we don't want to use this
|
|
|
|
|
heuristic because someone will supply a #pragma implementation
|
|
|
|
|
elsewhere, and deducing it here would produce a conflict. */
|
|
|
|
|
if (CLASSTYPE_INTERFACE_ONLY (ctype))
|
|
|
|
|
return;
|
|
|
|
|
|
Table-driven attributes.
* c-decl.c, config/alpha/alpha.c, config/arc/arc.c,
config/arm/arm.c, config/arm/pe.c, config/avr/avr.c,
config/avr/avr.h, config/d30v/d30v.h, config/fr30/fr30.h,
config/h8300/h8300.c, config/i386/cygwin.h, config/i386/winnt.c,
config/m32r/m32r.c, config/mcore/mcore.c, config/sh/sh.c,
config/stormy16/stormy16.h, config/v850/v850.c, doc/c-tree.texi,
doc/tm.texi, ggc-common.c, integrate.c, print-tree.c, tree.c,
tree.h: Rename DECL_MACHINE_ATTRIBUTES to DECL_ATTRIBUTES.
* tree.h (struct tree_decl): Change machine_attributes to
attributes.
* doc/c-tree.texi: Document that all attributes are now attached
to decls and types.
* c-common.c (add_attribute, attrtab, attrtab_idx,
default_valid_lang_attribute, valid_lang_attribute): Remove.
(attribute_tables, attributes_initialized,
c_common_attribute_table, default_lang_attribute_table): New
variables.
(handle_packed_attribute, handle_nocommon_attribute,
handle_common_attribute, handle_noreturn_attribute,
handle_unused_attribute, handle_const_attribute,
handle_transparent_union_attribute, handle_constructor_attribute,
handle_destructor_attribute, handle_mode_attribute,
handle_section_attribute, handle_aligned_attribute,
handle_weak_attribute, handle_alias_attribute,
handle_no_instrument_function_attribute,
handle_no_check_memory_usage_attribute, handle_malloc_attribute,
handle_no_limit_stack_attribute, handle_pure_attribute): New
functions.
(init_attributes, decl_attributes): Rewrite to implement
table-driven attributes.
* c-common.h (enum attribute_flags): Move to tree.h.
* c-format.c (decl_handle_format_attribute,
decl_handle_format_arg_attribute): Rename to
handle_format_attribute and handle_format_arg_attribute. Update
for table-driven attributes.
* c-common.h (decl_handle_format_attribute,
decl_handle_format_arg_attribute): Remove prototypes.
(handle_format_attribute, handle_format_arg_attribute): Add
prototypes.
* c-decl.c (grokdeclarator): Handle attributes nested inside
declarators.
* c-parse.in (setattrs, maybe_setattrs): Remove.
(maybe_type_quals_setattrs): Rename to maybe_type_quals_attrs.
Update to handle nested attributes properly.
(maybe_resetattrs, after_type_declarator,
parm_declarator_nostarttypename, notype_declarator, absdcl1_noea,
absdcl1_ea, direct_absdcl1): Update to handle nested attributes
properly.
(make_pointer_declarator): Update to handle nested attributes
properly.
* doc/extend.texi: Update documentation of limits of attributes
syntax. Warn about problems with attribute semantics in C++.
* target.h (struct target): Remove valid_decl_attribute and
valid_type_attribute. Add attribute_table and
function_attribute_inlinable_p.
* target-def.h (TARGET_VALID_DECL_ATTRIBUTE,
TARGET_VALID_TYPE_ATTRIBUTE): Remove.
(TARGET_ATTRIBUTE_TABLE, TARGET_FUNCTION_ATTRIBUTE_INLINABLE_P):
Add.
(TARGET_INITIALIZER): Update.
* integrate.c (FUNCTION_ATTRIBUTE_INLINABLE_P): Remove default
definition.
(function_attribute_inlinable_p): New function. Check for the
presence of any machine attributes before using
targetm.function_attribute_inlinable_p.
(function_cannot_inline_p): Update.
* Makefile.in (integrate.o): Update dependencies.
* doc/tm.texi: Update documentation of target attributes and
example definition of TARGET_VALID_TYPE_ATTRIBUTE.
* tree.c (default_valid_attribute_p, valid_machine_attribute):
Remove.
(default_target_attribute_table,
default_function_attribute_inlinable_p): New.
(lookup_attribute): Update comment to clarify handling of multiple
attributes with the same name.
(merge_attributes, attribute_list_contained): Allow multiple
attributes with the same name but different arguments to appear in
the same attribute list.
* tree.h (default_valid_attribute_p): Remove prototype.
(struct attribute_spec): New.
(default_target_attribute_table): Declare.
(enum attribute_flags): Move from c-common.h. Add
ATTR_FLAG_TYPE_IN_PLACE.
(default_function_attribute_inlinable_p): Declare.
* config/alpha/alpha.c (vms_valid_decl_attribute_p): Remove.
(TARGET_VALID_DECL_ATTRIBUTE): Don't define.
(TARGET_ATTRIBUTE_TABLE): Define.
(vms_attribute_table): New.
* config/arc/arc.c (arc_valid_decl_attribute): Remove.
(TARGET_VALID_DECL_ATTRIBUTE): Don't define.
(TARGET_ATTRIBUTE_TABLE): Define.
(arc_attribute_table, arc_handle_interrupt_attribute): New.
* config/arm/arm.c (arm_valid_type_attribute_p,
arm_valid_decl_attribute_p, arm_pe_valid_decl_attribute_p):
Remove.
(TARGET_VALID_TYPE_ATTRIBUTE, TARGET_VALID_DECL_ATTRIBUTE): Don't
define.
(TARGET_ATTRIBUTE_TABLE): Define.
(arm_attribute_table, arm_handle_fndecl_attribute,
arm_handle_isr_attribute): New.
* config/avr/avr.c (avr_valid_type_attribute,
avr_valid_decl_attribute): Remove.
(TARGET_VALID_DECL_ATTRIBUTE, TARGET_VALID_TYPE_ATTRIBUTE): Don't
define.
(TARGET_ATTRIBUTE_TABLE): Define.
(avr_attribute_table, avr_handle_progmem_attribute,
avr_handle_fndecl_attribute): New.
* config/c4x/c4x.c (c4x_valid_type_attribute_p): Remove.
(TARGET_VALID_TYPE_ATTRIBUTE): Don't define.
(TARGET_ATTRIBUTE_TABLE): Define.
(c4x_attribute_table, c4x_handle_fntype_attribute): New.
* config/h8300/h8300.c (h8300_valid_decl_attribute): Remove.
(TARGET_VALID_DECL_ATTRIBUTE): Don't define.
(TARGET_ATTRIBUTE_TABLE): Define.
(h8300_attribute_table, h8300_handle_fndecl_attribute,
h8300_handle_eightbit_data_attribute,
h8300_handle_tiny_data_attribute): New.
* config/i386/i386-protos.h (ix86_valid_type_attribute_p,
i386_pe_valid_decl_attribute_p, i386_pe_valid_type_attribute_p):
Remove prototypes.
(ix86_handle_dll_attribute, ix86_handle_shared_attribute): New
declarations.
* config/i386/i386.c (ix86_valid_type_attribute_p: Remove.
(TARGET_VALID_TYPE_ATTRIBUTE, TARGET_VALID_DECL_ATTRIBUTE): Don't
define.
(TARGET_ATTRIBUTE_TABLE): Define.
(ix86_attribute_table, ix86_handle_cdecl_attribute,
ix86_handle_regparm_attribute): New.
* config/i386/winnt.c (i386_pe_valid_decl_attribute_p,
i386_pe_valid_type_attribute_p): Remove.
(ix86_handle_dll_attribute, ix86_handle_shared_attribute): New.
* config/ia64/ia64.c (ia64_valid_type_attribute): Remove.
(TARGET_VALID_TYPE_ATTRIBUTE): Don't define.
(TARGET_ATTRIBUTE_TABLE): Define.
(ia64_attribute_table): New.
* config/m32r/m32r.c (m32r_valid_decl_attribute, interrupt_ident1,
interrupt_ident2, model_ident1, model_ident2): Remove.
(TARGET_VALID_DECL_ATTRIBUTE): Don't define.
(TARGET_ATTRIBUTE_TABLE): Define.
(init_idents): Update.
(m32r_attribute_table, m32r_handle_model_attribute): New.
* config/m68hc11/m68hc11.c (m68hc11_valid_type_attribute_p):
Remove.
(TARGET_VALID_TYPE_ATTRIBUTE): Don't define.
(TARGET_ATTRIBUTE_TABLE): Define.
(m68hc11_attribute_table, m68hc11_handle_fntype_attribute): New.
* config/mcore/mcore.c (mcore_valid_decl_attribute): Remove.
(TARGET_VALID_DECL_ATTRIBUTE): Don't define.
(TARGET_ATTRIBUTE_TABLE): Define.
(mcore_attribute_table, mcore_handle_naked_attribute): New.
* config/ns32k/ns32k.c (ns32k_valid_type_attribute_p): Remove.
(TARGET_VALID_TYPE_ATTRIBUTE): Don't define.
(TARGET_ATTRIBUTE_TABLE): Define.
(ns32k_attribute_table, ns32k_handle_fntype_attribute): New.
* config/rs6000/rs6000.c (rs6000_valid_type_attribute_p): Remove.
(TARGET_VALID_TYPE_ATTRIBUTE): Don't define.
(TARGET_ATTRIBUTE_TABLE): Define.
(rs6000_attribute_table, rs6000_handle_longcall_attribute): New.
* config/sh/sh.c (sh_valid_decl_attribute): Remove.
(TARGET_VALID_DECL_ATTRIBUTE): Don't define.
(TARGET_ATTRIBUTE_TABLE): Define.
(sh_attribute_table, sh_handle_interrupt_handler_attribute,
sh_handle_sp_switch_attribute, sh_handle_trap_exit_attribute):
New.
* config/stormy16/stormy16.c (stormy16_valid_type_attribute):
Remove.
(TARGET_VALID_TYPE_ATTRIBUTE): Don't define
(TARGET_ATTRIBUTE_TABLE): Define.
(stormy16_attribute_table, stormy16_handle_interrupt_attribute):
New.
* config/v850/v850.c (v850_valid_decl_attribute): Remove.
(TARGET_VALID_DECL_ATTRIBUTE): Don't define.
(TARGET_ATTRIBUTE_TABLE): Define.
(v850_attribute_table, v850_handle_interrupt_attribute,
v850_handle_data_area_attribute): New.
* config/v850/v850-c.c (mark_current_function_as_interrupt):
Return void. Call decl_attributes instead of
valid_machine_attribute.
cp:
Table-driven attributes.
* decl.c: Rename DECL_MACHINE_ATTRIBUTES to DECL_ATTRIBUTES.
* decl2.c (cplus_decl_attributes): Only take one attributes
parameter.
* cp-tree.c (cplus_decl_attributes): Update prototype.
* class.c (finish_struct), decl.c (start_decl, start_function),
decl2.c (grokfield), friend.c (do_friend), parse.y
(parse_bitfield): Update calls to cplus_decl_attributes.
* decl.c (grokdeclarator): Take a pointer to a single ordinary
attribute list.
* decl.h (grokdeclarator): Update prototype.
* decl2.c (grokfield): Take a single ordinary attribute list.
* friend.c (do_friend): Likewise.
* decl.c (shadow_tag, groktypename, start_decl,
start_handler_parms, grokdeclarator, grokparms, start_function,
start_method), decl2.c (grokfield, grokbitfield, grokoptypename),
parse.y (parse_field, parse_bitfield, component_decl_1), pt.c
(process_template_parm, do_decl_instantiation): Pass single
ordinary attribute lists around.
* decl.c (grokdeclarator): Correct handling of nested attributes.
Revert the patch
1998-10-18 Jason Merrill <jason@yorick.cygnus.com>
* decl.c (grokdeclarator): Embedded attrs bind to the right,
not the left.
.
* cp-tree.h (cp_valid_lang_attribute): Remove declaration
(cp_attribute_table): Declare.
* decl.c (valid_lang_attribute): Don't define.
(lang_attribute_table): Define.
(init_decl_processing): Initialize lang_attribute_table instead of
valid_lang_attribute.
* tree.c (cp_valid_lang_attribute): Remove.
(handle_java_interface_attribute, handle_com_interface_attribute,
handle_init_priority_attribute): New functions.
(cp_attribute_table): New array.
* decl2.c (import_export_class): Don't use
targetm.valid_type_attribute.
testsuite:
Table-driven attributes.
* g++.dg/ext/attrib1.C: New test.
From-SVN: r45718
2001-09-21 03:27:06 +02:00
|
|
|
|
if (lookup_attribute ("dllimport", TYPE_ATTRIBUTES (ctype)))
|
2001-06-27 08:55:29 +02:00
|
|
|
|
import_export = -1;
|
Table-driven attributes.
* c-decl.c, config/alpha/alpha.c, config/arc/arc.c,
config/arm/arm.c, config/arm/pe.c, config/avr/avr.c,
config/avr/avr.h, config/d30v/d30v.h, config/fr30/fr30.h,
config/h8300/h8300.c, config/i386/cygwin.h, config/i386/winnt.c,
config/m32r/m32r.c, config/mcore/mcore.c, config/sh/sh.c,
config/stormy16/stormy16.h, config/v850/v850.c, doc/c-tree.texi,
doc/tm.texi, ggc-common.c, integrate.c, print-tree.c, tree.c,
tree.h: Rename DECL_MACHINE_ATTRIBUTES to DECL_ATTRIBUTES.
* tree.h (struct tree_decl): Change machine_attributes to
attributes.
* doc/c-tree.texi: Document that all attributes are now attached
to decls and types.
* c-common.c (add_attribute, attrtab, attrtab_idx,
default_valid_lang_attribute, valid_lang_attribute): Remove.
(attribute_tables, attributes_initialized,
c_common_attribute_table, default_lang_attribute_table): New
variables.
(handle_packed_attribute, handle_nocommon_attribute,
handle_common_attribute, handle_noreturn_attribute,
handle_unused_attribute, handle_const_attribute,
handle_transparent_union_attribute, handle_constructor_attribute,
handle_destructor_attribute, handle_mode_attribute,
handle_section_attribute, handle_aligned_attribute,
handle_weak_attribute, handle_alias_attribute,
handle_no_instrument_function_attribute,
handle_no_check_memory_usage_attribute, handle_malloc_attribute,
handle_no_limit_stack_attribute, handle_pure_attribute): New
functions.
(init_attributes, decl_attributes): Rewrite to implement
table-driven attributes.
* c-common.h (enum attribute_flags): Move to tree.h.
* c-format.c (decl_handle_format_attribute,
decl_handle_format_arg_attribute): Rename to
handle_format_attribute and handle_format_arg_attribute. Update
for table-driven attributes.
* c-common.h (decl_handle_format_attribute,
decl_handle_format_arg_attribute): Remove prototypes.
(handle_format_attribute, handle_format_arg_attribute): Add
prototypes.
* c-decl.c (grokdeclarator): Handle attributes nested inside
declarators.
* c-parse.in (setattrs, maybe_setattrs): Remove.
(maybe_type_quals_setattrs): Rename to maybe_type_quals_attrs.
Update to handle nested attributes properly.
(maybe_resetattrs, after_type_declarator,
parm_declarator_nostarttypename, notype_declarator, absdcl1_noea,
absdcl1_ea, direct_absdcl1): Update to handle nested attributes
properly.
(make_pointer_declarator): Update to handle nested attributes
properly.
* doc/extend.texi: Update documentation of limits of attributes
syntax. Warn about problems with attribute semantics in C++.
* target.h (struct target): Remove valid_decl_attribute and
valid_type_attribute. Add attribute_table and
function_attribute_inlinable_p.
* target-def.h (TARGET_VALID_DECL_ATTRIBUTE,
TARGET_VALID_TYPE_ATTRIBUTE): Remove.
(TARGET_ATTRIBUTE_TABLE, TARGET_FUNCTION_ATTRIBUTE_INLINABLE_P):
Add.
(TARGET_INITIALIZER): Update.
* integrate.c (FUNCTION_ATTRIBUTE_INLINABLE_P): Remove default
definition.
(function_attribute_inlinable_p): New function. Check for the
presence of any machine attributes before using
targetm.function_attribute_inlinable_p.
(function_cannot_inline_p): Update.
* Makefile.in (integrate.o): Update dependencies.
* doc/tm.texi: Update documentation of target attributes and
example definition of TARGET_VALID_TYPE_ATTRIBUTE.
* tree.c (default_valid_attribute_p, valid_machine_attribute):
Remove.
(default_target_attribute_table,
default_function_attribute_inlinable_p): New.
(lookup_attribute): Update comment to clarify handling of multiple
attributes with the same name.
(merge_attributes, attribute_list_contained): Allow multiple
attributes with the same name but different arguments to appear in
the same attribute list.
* tree.h (default_valid_attribute_p): Remove prototype.
(struct attribute_spec): New.
(default_target_attribute_table): Declare.
(enum attribute_flags): Move from c-common.h. Add
ATTR_FLAG_TYPE_IN_PLACE.
(default_function_attribute_inlinable_p): Declare.
* config/alpha/alpha.c (vms_valid_decl_attribute_p): Remove.
(TARGET_VALID_DECL_ATTRIBUTE): Don't define.
(TARGET_ATTRIBUTE_TABLE): Define.
(vms_attribute_table): New.
* config/arc/arc.c (arc_valid_decl_attribute): Remove.
(TARGET_VALID_DECL_ATTRIBUTE): Don't define.
(TARGET_ATTRIBUTE_TABLE): Define.
(arc_attribute_table, arc_handle_interrupt_attribute): New.
* config/arm/arm.c (arm_valid_type_attribute_p,
arm_valid_decl_attribute_p, arm_pe_valid_decl_attribute_p):
Remove.
(TARGET_VALID_TYPE_ATTRIBUTE, TARGET_VALID_DECL_ATTRIBUTE): Don't
define.
(TARGET_ATTRIBUTE_TABLE): Define.
(arm_attribute_table, arm_handle_fndecl_attribute,
arm_handle_isr_attribute): New.
* config/avr/avr.c (avr_valid_type_attribute,
avr_valid_decl_attribute): Remove.
(TARGET_VALID_DECL_ATTRIBUTE, TARGET_VALID_TYPE_ATTRIBUTE): Don't
define.
(TARGET_ATTRIBUTE_TABLE): Define.
(avr_attribute_table, avr_handle_progmem_attribute,
avr_handle_fndecl_attribute): New.
* config/c4x/c4x.c (c4x_valid_type_attribute_p): Remove.
(TARGET_VALID_TYPE_ATTRIBUTE): Don't define.
(TARGET_ATTRIBUTE_TABLE): Define.
(c4x_attribute_table, c4x_handle_fntype_attribute): New.
* config/h8300/h8300.c (h8300_valid_decl_attribute): Remove.
(TARGET_VALID_DECL_ATTRIBUTE): Don't define.
(TARGET_ATTRIBUTE_TABLE): Define.
(h8300_attribute_table, h8300_handle_fndecl_attribute,
h8300_handle_eightbit_data_attribute,
h8300_handle_tiny_data_attribute): New.
* config/i386/i386-protos.h (ix86_valid_type_attribute_p,
i386_pe_valid_decl_attribute_p, i386_pe_valid_type_attribute_p):
Remove prototypes.
(ix86_handle_dll_attribute, ix86_handle_shared_attribute): New
declarations.
* config/i386/i386.c (ix86_valid_type_attribute_p: Remove.
(TARGET_VALID_TYPE_ATTRIBUTE, TARGET_VALID_DECL_ATTRIBUTE): Don't
define.
(TARGET_ATTRIBUTE_TABLE): Define.
(ix86_attribute_table, ix86_handle_cdecl_attribute,
ix86_handle_regparm_attribute): New.
* config/i386/winnt.c (i386_pe_valid_decl_attribute_p,
i386_pe_valid_type_attribute_p): Remove.
(ix86_handle_dll_attribute, ix86_handle_shared_attribute): New.
* config/ia64/ia64.c (ia64_valid_type_attribute): Remove.
(TARGET_VALID_TYPE_ATTRIBUTE): Don't define.
(TARGET_ATTRIBUTE_TABLE): Define.
(ia64_attribute_table): New.
* config/m32r/m32r.c (m32r_valid_decl_attribute, interrupt_ident1,
interrupt_ident2, model_ident1, model_ident2): Remove.
(TARGET_VALID_DECL_ATTRIBUTE): Don't define.
(TARGET_ATTRIBUTE_TABLE): Define.
(init_idents): Update.
(m32r_attribute_table, m32r_handle_model_attribute): New.
* config/m68hc11/m68hc11.c (m68hc11_valid_type_attribute_p):
Remove.
(TARGET_VALID_TYPE_ATTRIBUTE): Don't define.
(TARGET_ATTRIBUTE_TABLE): Define.
(m68hc11_attribute_table, m68hc11_handle_fntype_attribute): New.
* config/mcore/mcore.c (mcore_valid_decl_attribute): Remove.
(TARGET_VALID_DECL_ATTRIBUTE): Don't define.
(TARGET_ATTRIBUTE_TABLE): Define.
(mcore_attribute_table, mcore_handle_naked_attribute): New.
* config/ns32k/ns32k.c (ns32k_valid_type_attribute_p): Remove.
(TARGET_VALID_TYPE_ATTRIBUTE): Don't define.
(TARGET_ATTRIBUTE_TABLE): Define.
(ns32k_attribute_table, ns32k_handle_fntype_attribute): New.
* config/rs6000/rs6000.c (rs6000_valid_type_attribute_p): Remove.
(TARGET_VALID_TYPE_ATTRIBUTE): Don't define.
(TARGET_ATTRIBUTE_TABLE): Define.
(rs6000_attribute_table, rs6000_handle_longcall_attribute): New.
* config/sh/sh.c (sh_valid_decl_attribute): Remove.
(TARGET_VALID_DECL_ATTRIBUTE): Don't define.
(TARGET_ATTRIBUTE_TABLE): Define.
(sh_attribute_table, sh_handle_interrupt_handler_attribute,
sh_handle_sp_switch_attribute, sh_handle_trap_exit_attribute):
New.
* config/stormy16/stormy16.c (stormy16_valid_type_attribute):
Remove.
(TARGET_VALID_TYPE_ATTRIBUTE): Don't define
(TARGET_ATTRIBUTE_TABLE): Define.
(stormy16_attribute_table, stormy16_handle_interrupt_attribute):
New.
* config/v850/v850.c (v850_valid_decl_attribute): Remove.
(TARGET_VALID_DECL_ATTRIBUTE): Don't define.
(TARGET_ATTRIBUTE_TABLE): Define.
(v850_attribute_table, v850_handle_interrupt_attribute,
v850_handle_data_area_attribute): New.
* config/v850/v850-c.c (mark_current_function_as_interrupt):
Return void. Call decl_attributes instead of
valid_machine_attribute.
cp:
Table-driven attributes.
* decl.c: Rename DECL_MACHINE_ATTRIBUTES to DECL_ATTRIBUTES.
* decl2.c (cplus_decl_attributes): Only take one attributes
parameter.
* cp-tree.c (cplus_decl_attributes): Update prototype.
* class.c (finish_struct), decl.c (start_decl, start_function),
decl2.c (grokfield), friend.c (do_friend), parse.y
(parse_bitfield): Update calls to cplus_decl_attributes.
* decl.c (grokdeclarator): Take a pointer to a single ordinary
attribute list.
* decl.h (grokdeclarator): Update prototype.
* decl2.c (grokfield): Take a single ordinary attribute list.
* friend.c (do_friend): Likewise.
* decl.c (shadow_tag, groktypename, start_decl,
start_handler_parms, grokdeclarator, grokparms, start_function,
start_method), decl2.c (grokfield, grokbitfield, grokoptypename),
parse.y (parse_field, parse_bitfield, component_decl_1), pt.c
(process_template_parm, do_decl_instantiation): Pass single
ordinary attribute lists around.
* decl.c (grokdeclarator): Correct handling of nested attributes.
Revert the patch
1998-10-18 Jason Merrill <jason@yorick.cygnus.com>
* decl.c (grokdeclarator): Embedded attrs bind to the right,
not the left.
.
* cp-tree.h (cp_valid_lang_attribute): Remove declaration
(cp_attribute_table): Declare.
* decl.c (valid_lang_attribute): Don't define.
(lang_attribute_table): Define.
(init_decl_processing): Initialize lang_attribute_table instead of
valid_lang_attribute.
* tree.c (cp_valid_lang_attribute): Remove.
(handle_java_interface_attribute, handle_com_interface_attribute,
handle_init_priority_attribute): New functions.
(cp_attribute_table): New array.
* decl2.c (import_export_class): Don't use
targetm.valid_type_attribute.
testsuite:
Table-driven attributes.
* g++.dg/ext/attrib1.C: New test.
From-SVN: r45718
2001-09-21 03:27:06 +02:00
|
|
|
|
else if (lookup_attribute ("dllexport", TYPE_ATTRIBUTES (ctype)))
|
2001-06-27 08:55:29 +02:00
|
|
|
|
import_export = 1;
|
2004-07-29 19:59:31 +02:00
|
|
|
|
else if (CLASSTYPE_IMPLICIT_INSTANTIATION (ctype)
|
|
|
|
|
&& !flag_implicit_templates)
|
|
|
|
|
/* For a template class, without -fimplicit-templates, check the
|
|
|
|
|
repository. If the virtual table is assigned to this
|
|
|
|
|
translation unit, then export the class; otherwise, import
|
|
|
|
|
it. */
|
|
|
|
|
import_export = repo_export_class_p (ctype) ? 1 : -1;
|
|
|
|
|
else if (TYPE_POLYMORPHIC_P (ctype))
|
|
|
|
|
{
|
|
|
|
|
/* The ABI specifies that the virtual table and associated
|
|
|
|
|
information are emitted with the key method, if any. */
|
2003-01-03 20:48:55 +01:00
|
|
|
|
tree method = CLASSTYPE_KEY_METHOD (ctype);
|
2004-07-11 07:13:12 +02:00
|
|
|
|
/* If weak symbol support is not available, then we must be
|
|
|
|
|
careful not to emit the vtable when the key function is
|
|
|
|
|
inline. An inline function can be defined in multiple
|
|
|
|
|
translation units. If we were to emit the vtable in each
|
|
|
|
|
translation unit containing a definition, we would get
|
|
|
|
|
multiple definition errors at link-time. */
|
|
|
|
|
if (method && (flag_weak || ! DECL_DECLARED_INLINE_P (method)))
|
2000-03-04 01:45:24 +01:00
|
|
|
|
import_export = (DECL_REALLY_EXTERN (method) ? -1 : 1);
|
1994-03-24 00:33:53 +01:00
|
|
|
|
}
|
1999-01-14 11:42:12 +01:00
|
|
|
|
|
2004-09-09 19:11:18 +02:00
|
|
|
|
/* When MULTIPLE_SYMBOL_SPACES is set, we cannot count on seeing
|
|
|
|
|
a definition anywhere else. */
|
|
|
|
|
if (MULTIPLE_SYMBOL_SPACES && import_export == -1)
|
1999-01-14 11:42:12 +01:00
|
|
|
|
import_export = 0;
|
1998-07-23 19:51:17 +02:00
|
|
|
|
|
class.c, [...]: Follow spelling conventions.
* class.c, cp-tree.h, decl.c, decl2.c, g++spec.c, init.c,
parser.c, pt.c, tree.c, typeck.c: Follow spelling conventions.
From-SVN: r121566
2007-02-04 05:24:53 +01:00
|
|
|
|
/* Allow back ends the chance to overrule the decision. */
|
2004-07-01 10:47:16 +02:00
|
|
|
|
if (targetm.cxx.import_export_class)
|
|
|
|
|
import_export = targetm.cxx.import_export_class (ctype, import_export);
|
|
|
|
|
|
1998-07-23 19:51:17 +02:00
|
|
|
|
if (import_export)
|
|
|
|
|
{
|
|
|
|
|
SET_CLASSTYPE_INTERFACE_KNOWN (ctype);
|
|
|
|
|
CLASSTYPE_INTERFACE_ONLY (ctype) = (import_export < 0);
|
|
|
|
|
}
|
1998-07-23 04:29:34 +02:00
|
|
|
|
}
|
1998-08-28 18:11:35 +02:00
|
|
|
|
|
2003-09-11 01:46:26 +02:00
|
|
|
|
/* Return true if VAR has already been provided to the back end; in that
|
|
|
|
|
case VAR should not be modified further by the front end. */
|
|
|
|
|
static bool
|
|
|
|
|
var_finalized_p (tree var)
|
|
|
|
|
{
|
Move all varpool routines out of cgraph/cgraphunit to varpool.c
Move all varpool routines out of cgraph/cgraphunit to varpool.c
* cgraph.c: Update comments.
(cgraph_varpool_hash,
cgraph_varpool_nodes, cgraph_varpool_last_needed_node
cgraph_varpool_node_name, cgraph_varpool_node,
cgraph_varpol_mode_for_asm, cgraph_varpool_mark_needed_node,
cgraph_variable_initializer_availability): Move to
varpool.c and drop cgraph_ prefixes.
(cgraph_varpool_enqueue_needed_node, cgraph_varpool_reset_queue,
cgraph_varpool_first_unanalyzed_node, cgraph_varpool_finalize_decl):
move to varpool.c; drop cgraph_ prefix; make static.
(dump_cgraph_varpool_node): Move to varpool.c under name
dump_varpool_node.
(dump_varpool, hash_varpool_node, eq_varpool_node,
decide_is_variable_needed): Move to varpool.c
(decl_assembler_name_equal): Move to tree.c.
(availability_names): Rename to ...
(cgraph_availability_names): ... this one.
(dump_cgraph_node): Update.
* cgraph.h: Reorder declarations now in varpool.c
(cgraph_vailablity_names): Declare.
(struct cgraph_varpool_node): Rename to ...
(struct varpool_node): ... this one.
(cgraph_varpool_first_unanalyzed_node, cgraph_varpool_nodes_queue,
cgraph_varpool_first_unanalyzed_node, cgraph_varpool_node,
cgraph_varpool_node_for_asm, cgraph_varpool_mark_needed_node,
cgraph_varpool_finalize_decl, cgraph_varpool_enqueue_needed_node,
cgraph_varpool_reset_queue, cgraph_varpool_assemble_pending_decls,
cgraph_variable_initializer_availability): Rename to ...
(varpool_first_unanalyzed_node, varpool_nodes_queue,
varpool_first_unanalyzed_node, varpool_node,
varpool_node_for_asm, varpool_mark_needed_node,
varpool_finalize_decl, varpool_enqueue_needed_node,
varpool_assemble_pending_decls, variable_initializer_availability):
Rename to ...
* tree.c (decl_assembler_name_equal): Move here from cgraph.c.
* tree.h (decl_assembler_name_equal): Declare.
* omp-low.c (lower_omp_critical): Update.
* ipa-reference (analyze_variable, static_execute): Likewise.
* toplev.c (wrapup_global_declaration_2, compile_file): Update.
* cgraphunit.c: Update comments.
(cgraph_varpool_assembled_nodes_queue): Move to varpool.c under name
varpool_assembled_nodes_queue.
(cgraph_varpool_analyze_pending_decls): Move to varpool.c under name
varpool_analyze_pending_decls.
(cgraph_varpool_remove_unreferenced_decls): Move to varpool.c under name
varpool_remove_unreferenced_decls.
(record_reference): Update.
(cgraph_create_edges): Update.
(record_referneces_in_initializer): New function.
(cgraph_varpool_assemble_decl): Move to varpool.c under name
varpool_assemble_decl; make global.
(cgraph_varpool_assemble_pending_decls): Move to varpool.c under name
varpool_assemble_pending_decls.
(process_function_and_variable_attributes, cgraph_finalize_compilation_unit,
struct cgraph_order_sort, cgraph_output_in_order,
cgraph_function_and_variable_invisibility, cgraph_optimize,
cgraph_increase_alignment): Update.
* dwarf2out.c (decls_for_scope): Likewise.
* ipa-type-escape.c (analyze_variable, type_escape_execute): Likewise.
* except.c (output_ttype): Likewise.
* varasm.c (mark_decl_referenced): Likewise.
(find_decl_and_mark_referenced, assemble_alias): update.
* Makefile.in: Add varpool.c, gt-varpool.c and remove gt-cgraphunit.c
* passes.c (rest_of_decl_compilation): Update.
* cp/decl2.c (var_finalized_p): Update for renamed varpool functions.
* fortran/f59-lang.c (gfc_expand_function): Update for renamed varpool functions.
From-SVN: r119731
2006-12-11 09:07:52 +01:00
|
|
|
|
return varpool_node (var)->finalized;
|
2004-07-29 19:59:31 +02:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* DECL is a VAR_DECL or FUNCTION_DECL which, for whatever reason,
|
|
|
|
|
must be emitted in this translation unit. Mark it as such. */
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
|
mark_needed (tree decl)
|
|
|
|
|
{
|
|
|
|
|
/* It's possible that we no longer need to set
|
|
|
|
|
TREE_SYMBOL_REFERENCED here directly, but doing so is
|
|
|
|
|
harmless. */
|
|
|
|
|
TREE_SYMBOL_REFERENCED (DECL_ASSEMBLER_NAME (decl)) = 1;
|
|
|
|
|
mark_decl_referenced (decl);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* DECL is either a FUNCTION_DECL or a VAR_DECL. This function
|
|
|
|
|
returns true if a definition of this entity should be provided in
|
|
|
|
|
this object file. Callers use this function to determine whether
|
|
|
|
|
or not to let the back end know that a definition of DECL is
|
|
|
|
|
available in this translation unit. */
|
|
|
|
|
|
|
|
|
|
bool
|
|
|
|
|
decl_needed_p (tree decl)
|
|
|
|
|
{
|
call.c (validate_conversion_obstack): Replace my_friendly_assert with gcc_assert or gcc_unreachable.
* call.c (validate_conversion_obstack): Replace
my_friendly_assert with gcc_assert or gcc_unreachable.
(direct_reference_binding, merge_conversion_sequences,
build_user_type_conversion_1, perform_overload_resolution,
build_op_delete_call, enforce_access, call_builtin_trap,
build_over_call, build_special_member_call, build_new_method_call,
initialize_reference): Likewise.
* class.c (build_base_path, build_primary_vtable, alter_access,
check_bases, update_vtable_entry_for_fn, layout_empty_base,
clone_function_decl, adjust_clone_args,
type_requires_array_cookie, include_empty_classes,
finish_struct_1, resolve_address_of_overloaded_function,
instantiate_type, get_vtbl_decl_for_binfo, build_vtt_inits,
dfs_build_secondary_vptr_vtt_inits, build_ctor_vtbl_group,
accumulate_vtbl_inits, build_vtbl_initializer,
build_vbase_offset_vtbl_entries, build_rtti_vtbl_entries): Likewise.
* cvt.c (build_up_reference, convert_to_reference): Likewise.
* decl.c (poplevel, duplicate_decls, make_typename_type,
cxx_init_decl_processing, reshape_init, check_initializer,
make_rtl_for_nonlocal_decl, initialize_local_var, cp_finish_decl,
expand_static_init, grokfndecl, grokvardecl, build_ptrmem_type,
grokdeclarator, copy_fn_p, grok_op_properties, xref_tag,
xref_basetypes, start_preparsed_function, save_function_data,
finish_function, finish_method, maybe_register_incomplete_var,
complete_vars): Likewise.
* decl2.c (grok_array_decl, check_member_template,
check_classfn, finish_static_data_member_decl, coerce_new_type,
coerce_delete_type, import_export_class, decl_needed_p,
determine_visibility, import_export_decl, build_cleanup,
start_static_initialization_or_destructi, do_static_destruction,
prune_vars_needing_no_initialization,
build_offset_ref_call_from_tree): Likewise.
* error.c (dump_decl, dump_expr): Likewise.
* init.c (finish_init_stmts, build_zero_init,
expand_virtual_init, expand_default_init, expand_aggr_init_1,
build_offset_ref, build_new_1, build_delete, build_vbase_delete):
Likewise.
* mangle.c (write_method_parms, write_template_args,
write_expression, write_template_arg): Likewise.
* method.c (make_thunk, finish_thunk, use_thunk): Likewise.
* name-lookup.c (pop_binding, begin_scope, leave_scope,
resume_scope, push_using_decl, validate_nonmember_using_decl,
is_ancestor, poplevel_class, set_inherited_value_binding_p,
push_class_level_binding, do_class_using_decl, push_namespace,
pop_namespace, add_using_namespace, ambiguous_decl,
lookup_namespace_name, lookup_type_current_level,
maybe_process_template_type_declaration): Likewise.
* parser.c (cp_lexer_peek_nth_token,
cp_parser_parse_and_diagnose_invalid_typ,
cp_parser_translation_unit, cp_parser_template_id,
cp_parser_lookup_name, cp_parser_late_parsing_for_member): Likewise.
* pt.c (push_access_scope, finish_member_template_decl,
push_inline_template_parms_recursive, add_outermost_template_args,
get_innermost_template_args, begin_explicit_instantiation,
end_explicit_instantiation, retrieve_specialization,
is_specialization_of, is_specialization_of_friend,
register_specialization, check_explicit_specialization,
comp_template_parms, process_template_parm,
process_partial_specialization, convert_nontype_argument,
coerce_template_template_parms, coerce_template_parms,
mangle_class_name_for_template, lookup_template_function,
lookup_template_class, instantiate_class_template, tsubst_decl,
tsubst_function_type, tsubst, tsubst_qualified_id, tsubst_copy,
instantiate_template, fn_type_unification, type_unification_real,
get_template_base, regenerate_decl_from_template,
template_for_substitution, instantiate_decl,
get_mostly_instantiated_function_type, dependent_scope_ref_p,
value_dependent_expression_p, resolve_typename_type): Likewise.
* repo.c (repo_emit_p): Likewise.
* rtti.c (build_headof, get_tinfo_decl, get_pseudo_ti_init,
create_tinfo_types, emit_tinfo_decl): Likewise.
* search.c (lookup_base_r, lookup_base, lookup_field_1,
dfs_access_in_type, build_baselink, lookup_member,
adjust_result_of_qualified_name_lookup, copied_binfo): Likewise.
* semantics.c (perform_or_defer_access_check,
finish_non_static_data_member, finish_stmt_expr_expr,
finish_stmt_expr, finish_call_expr, finish_pseudo_destructor_expr,
finish_template_template_parm, finish_member_declaration,
emit_associated_thunks): Likewise.
* tree.c (build_target_expr_with_type, force_target_expr,
copy_binfo, get_first_fn, cp_tree_equal): Likewise.
* typeck.c (type_after_usual_arithmetic_conversions, comptypes,
cxx_sizeof_or_alignof_type, perform_integral_promotions,
build_class_member_access_expr, finish_class_member_access_expr,
build_ptrmemfunc_access_expr, build_unary_op,
unary_complex_lvalue, cxx_mark_addressable, build_modify_expr,
build_ptrmemfunc, expand_ptrmemfunc_cst, check_return_expr
* typeck2.c (complete_type_check_abstract,
abstract_virtuals_error, process_init_constructor,
add_exception_specifier): Likewise.
From-SVN: r86669
2004-08-27 19:59:33 +02:00
|
|
|
|
gcc_assert (TREE_CODE (decl) == VAR_DECL
|
|
|
|
|
|| TREE_CODE (decl) == FUNCTION_DECL);
|
2004-07-29 19:59:31 +02:00
|
|
|
|
/* This function should only be called at the end of the translation
|
|
|
|
|
unit. We cannot be sure of whether or not something will be
|
|
|
|
|
COMDAT until that point. */
|
call.c (validate_conversion_obstack): Replace my_friendly_assert with gcc_assert or gcc_unreachable.
* call.c (validate_conversion_obstack): Replace
my_friendly_assert with gcc_assert or gcc_unreachable.
(direct_reference_binding, merge_conversion_sequences,
build_user_type_conversion_1, perform_overload_resolution,
build_op_delete_call, enforce_access, call_builtin_trap,
build_over_call, build_special_member_call, build_new_method_call,
initialize_reference): Likewise.
* class.c (build_base_path, build_primary_vtable, alter_access,
check_bases, update_vtable_entry_for_fn, layout_empty_base,
clone_function_decl, adjust_clone_args,
type_requires_array_cookie, include_empty_classes,
finish_struct_1, resolve_address_of_overloaded_function,
instantiate_type, get_vtbl_decl_for_binfo, build_vtt_inits,
dfs_build_secondary_vptr_vtt_inits, build_ctor_vtbl_group,
accumulate_vtbl_inits, build_vtbl_initializer,
build_vbase_offset_vtbl_entries, build_rtti_vtbl_entries): Likewise.
* cvt.c (build_up_reference, convert_to_reference): Likewise.
* decl.c (poplevel, duplicate_decls, make_typename_type,
cxx_init_decl_processing, reshape_init, check_initializer,
make_rtl_for_nonlocal_decl, initialize_local_var, cp_finish_decl,
expand_static_init, grokfndecl, grokvardecl, build_ptrmem_type,
grokdeclarator, copy_fn_p, grok_op_properties, xref_tag,
xref_basetypes, start_preparsed_function, save_function_data,
finish_function, finish_method, maybe_register_incomplete_var,
complete_vars): Likewise.
* decl2.c (grok_array_decl, check_member_template,
check_classfn, finish_static_data_member_decl, coerce_new_type,
coerce_delete_type, import_export_class, decl_needed_p,
determine_visibility, import_export_decl, build_cleanup,
start_static_initialization_or_destructi, do_static_destruction,
prune_vars_needing_no_initialization,
build_offset_ref_call_from_tree): Likewise.
* error.c (dump_decl, dump_expr): Likewise.
* init.c (finish_init_stmts, build_zero_init,
expand_virtual_init, expand_default_init, expand_aggr_init_1,
build_offset_ref, build_new_1, build_delete, build_vbase_delete):
Likewise.
* mangle.c (write_method_parms, write_template_args,
write_expression, write_template_arg): Likewise.
* method.c (make_thunk, finish_thunk, use_thunk): Likewise.
* name-lookup.c (pop_binding, begin_scope, leave_scope,
resume_scope, push_using_decl, validate_nonmember_using_decl,
is_ancestor, poplevel_class, set_inherited_value_binding_p,
push_class_level_binding, do_class_using_decl, push_namespace,
pop_namespace, add_using_namespace, ambiguous_decl,
lookup_namespace_name, lookup_type_current_level,
maybe_process_template_type_declaration): Likewise.
* parser.c (cp_lexer_peek_nth_token,
cp_parser_parse_and_diagnose_invalid_typ,
cp_parser_translation_unit, cp_parser_template_id,
cp_parser_lookup_name, cp_parser_late_parsing_for_member): Likewise.
* pt.c (push_access_scope, finish_member_template_decl,
push_inline_template_parms_recursive, add_outermost_template_args,
get_innermost_template_args, begin_explicit_instantiation,
end_explicit_instantiation, retrieve_specialization,
is_specialization_of, is_specialization_of_friend,
register_specialization, check_explicit_specialization,
comp_template_parms, process_template_parm,
process_partial_specialization, convert_nontype_argument,
coerce_template_template_parms, coerce_template_parms,
mangle_class_name_for_template, lookup_template_function,
lookup_template_class, instantiate_class_template, tsubst_decl,
tsubst_function_type, tsubst, tsubst_qualified_id, tsubst_copy,
instantiate_template, fn_type_unification, type_unification_real,
get_template_base, regenerate_decl_from_template,
template_for_substitution, instantiate_decl,
get_mostly_instantiated_function_type, dependent_scope_ref_p,
value_dependent_expression_p, resolve_typename_type): Likewise.
* repo.c (repo_emit_p): Likewise.
* rtti.c (build_headof, get_tinfo_decl, get_pseudo_ti_init,
create_tinfo_types, emit_tinfo_decl): Likewise.
* search.c (lookup_base_r, lookup_base, lookup_field_1,
dfs_access_in_type, build_baselink, lookup_member,
adjust_result_of_qualified_name_lookup, copied_binfo): Likewise.
* semantics.c (perform_or_defer_access_check,
finish_non_static_data_member, finish_stmt_expr_expr,
finish_stmt_expr, finish_call_expr, finish_pseudo_destructor_expr,
finish_template_template_parm, finish_member_declaration,
emit_associated_thunks): Likewise.
* tree.c (build_target_expr_with_type, force_target_expr,
copy_binfo, get_first_fn, cp_tree_equal): Likewise.
* typeck.c (type_after_usual_arithmetic_conversions, comptypes,
cxx_sizeof_or_alignof_type, perform_integral_promotions,
build_class_member_access_expr, finish_class_member_access_expr,
build_ptrmemfunc_access_expr, build_unary_op,
unary_complex_lvalue, cxx_mark_addressable, build_modify_expr,
build_ptrmemfunc, expand_ptrmemfunc_cst, check_return_expr
* typeck2.c (complete_type_check_abstract,
abstract_virtuals_error, process_init_constructor,
add_exception_specifier): Likewise.
From-SVN: r86669
2004-08-27 19:59:33 +02:00
|
|
|
|
gcc_assert (at_eof);
|
2004-07-29 19:59:31 +02:00
|
|
|
|
|
|
|
|
|
/* All entities with external linkage that are not COMDAT should be
|
|
|
|
|
emitted; they may be referred to from other object files. */
|
|
|
|
|
if (TREE_PUBLIC (decl) && !DECL_COMDAT (decl))
|
|
|
|
|
return true;
|
class.c, [...]: Follow spelling conventions.
* class.c, cp-tree.h, decl.c, decl2.c, g++spec.c, init.c,
parser.c, pt.c, tree.c, typeck.c: Follow spelling conventions.
From-SVN: r121566
2007-02-04 05:24:53 +01:00
|
|
|
|
/* If this entity was used, let the back end see it; it will decide
|
2004-07-29 19:59:31 +02:00
|
|
|
|
whether or not to emit it into the object file. */
|
2005-06-14 22:01:59 +02:00
|
|
|
|
if (TREE_USED (decl)
|
2004-07-29 19:59:31 +02:00
|
|
|
|
|| (DECL_ASSEMBLER_NAME_SET_P (decl)
|
|
|
|
|
&& TREE_SYMBOL_REFERENCED (DECL_ASSEMBLER_NAME (decl))))
|
|
|
|
|
return true;
|
2009-05-22 16:57:15 +02:00
|
|
|
|
/* Functions marked "dllexport" must be emitted so that they are
|
|
|
|
|
visible to other DLLs. */
|
|
|
|
|
if (lookup_attribute ("dllexport", DECL_ATTRIBUTES (decl)))
|
|
|
|
|
return true;
|
2004-07-29 19:59:31 +02:00
|
|
|
|
/* Otherwise, DECL does not need to be emitted -- yet. A subsequent
|
|
|
|
|
reference to DECL might cause it to be emitted later. */
|
|
|
|
|
return false;
|
2003-09-11 01:46:26 +02:00
|
|
|
|
}
|
|
|
|
|
|
2002-11-04 02:45:58 +01:00
|
|
|
|
/* If necessary, write out the vtables for the dynamic class CTYPE.
|
Remove traditional C constructs 4/n.
* decl2.c (grok_method_quals, warn_if_unknown_interface,
grok_x_components, cp_build_parm_decl, build_artificial_parm,
maybe_retrofit_in_chrg, grokclassfn, grok_array_decl,
delete_sanity, check_member_template, check_java_method,
check_classfn, finish_static_data_member_decl, grokfield,
grokbitfield, grokoptypename, grok_function_init,
cplus_decl_attributes, constructor_name, defer_fn,
build_anon_union_vars, finish_anon_union, coerce_new_type,
coerce_delete_type, comdat_linkage, maybe_make_one_only,
key_method, import_export_vtable, import_export_class,
output_vtable_inherit, import_export_decl, import_export_tinfo,
build_cleanup, get_guard, get_guard_bits, get_guard_cond,
set_guard, start_objects, finish_objects,
start_static_storage_duration_function,
finish_static_storage_duration_function, get_priority_info,
start_static_initialization_or_destruction,
finish_static_initialization_or_destruction,
do_static_initialization, do_static_destruction,
prune_vars_needing_no_initialization, write_out_vars,
reparse_decl_as_expr, finish_decl_parsing, namespace_ancestor,
add_using_namespace, merge_functions, ambiguous_decl,
lookup_using_namespace, lookup_using_namespace,
qualified_lookup_using_namespace, set_decl_namespace,
decl_namespace, current_decl_namespace, push_decl_namespace,
pop_decl_namespace, push_scope, pop_scope, add_function,
arg_assoc_namespace, arg_assoc_template_arg, arg_assoc,
lookup_arg_dependent, do_namespace_alias,
validate_nonmember_using_decl, do_nonmember_using_decl,
do_toplevel_using_decl, do_local_using_decl,
do_class_using_decl, do_using_directive, check_default_args,
mark_used, handle_class_head): Use C90 prototypings. Use booleans.
* parser.c (cp_parser_class_head): Use booleanss.
* decl.c (walk_globals, walk_vtables): Likewise.
* cp-tree.h (walk_globals_pred, walk_globals_fn, walk_vtables,
walk_globals): Change return type from 'int' to 'bool'.
* rtti.c (init_rtti_processing, build_headof, throw_bad_cast
throw_bad_typeid, get_tinfo_decl_dynamic, typeid_ok_p,
build_typeid, tinfo_name, get_tinfo_decl, get_tinfo_ptr,
get_typeid, ifnonnull, build_dynamic_cast_1, build_dynamic_cast,
qualifier_flags, tinfo_base_init, generic_initializer,
ptr_initializer, dfs_class_hint_mark, ptm_initializer,
dfs_class_hint_unmark, class_hint_flags, class_initializer,
typeinfo_in_lib_p, get_pseudo_ti_init, create_pseudo_type_info,
get_pseudo_ti_desc, create_tinfo_types, emit_support_tinfos,
unemitted_tinfo_decl_p, emit_tinfo_decl): Likewise.
* repo.c (repo_compile_flags, repo_template_declared,
repo_template_defined, repo_class_defined, repo_get_id,
repo_template_used, repo_vtable_used, repo_inline_used,
repo_tinfo_used, repo_template_instantiated, extract_string,
open_repo_file, afgets, init_repo, reopen_repo_file_for_write,
finish_repo): Likewise.
* ptree.c (cxx_print_decl, cxx_print_type, cxx_print_identifier,
cxx_print_xnode): Likewise..
* cp-lang.c (ok_to_generate_alias_set_for_type, cxx_get_alias_set,
cxx_warn_unused_global_decl, cp_expr_size): Likewise.
* cxxfilt.c (demangle_it, print_demangler_list, usage,
standard_symbol_characters, hp_symbol_characters, main, fatal):
Likewise.
(strip_underscore): Change type from 'int' to 'bool'.
(main): Use boolean constants.
From-SVN: r60601
2002-12-29 15:53:05 +01:00
|
|
|
|
Returns true if any vtables were emitted. */
|
2002-11-04 02:45:58 +01:00
|
|
|
|
|
Remove traditional C constructs 4/n.
* decl2.c (grok_method_quals, warn_if_unknown_interface,
grok_x_components, cp_build_parm_decl, build_artificial_parm,
maybe_retrofit_in_chrg, grokclassfn, grok_array_decl,
delete_sanity, check_member_template, check_java_method,
check_classfn, finish_static_data_member_decl, grokfield,
grokbitfield, grokoptypename, grok_function_init,
cplus_decl_attributes, constructor_name, defer_fn,
build_anon_union_vars, finish_anon_union, coerce_new_type,
coerce_delete_type, comdat_linkage, maybe_make_one_only,
key_method, import_export_vtable, import_export_class,
output_vtable_inherit, import_export_decl, import_export_tinfo,
build_cleanup, get_guard, get_guard_bits, get_guard_cond,
set_guard, start_objects, finish_objects,
start_static_storage_duration_function,
finish_static_storage_duration_function, get_priority_info,
start_static_initialization_or_destruction,
finish_static_initialization_or_destruction,
do_static_initialization, do_static_destruction,
prune_vars_needing_no_initialization, write_out_vars,
reparse_decl_as_expr, finish_decl_parsing, namespace_ancestor,
add_using_namespace, merge_functions, ambiguous_decl,
lookup_using_namespace, lookup_using_namespace,
qualified_lookup_using_namespace, set_decl_namespace,
decl_namespace, current_decl_namespace, push_decl_namespace,
pop_decl_namespace, push_scope, pop_scope, add_function,
arg_assoc_namespace, arg_assoc_template_arg, arg_assoc,
lookup_arg_dependent, do_namespace_alias,
validate_nonmember_using_decl, do_nonmember_using_decl,
do_toplevel_using_decl, do_local_using_decl,
do_class_using_decl, do_using_directive, check_default_args,
mark_used, handle_class_head): Use C90 prototypings. Use booleans.
* parser.c (cp_parser_class_head): Use booleanss.
* decl.c (walk_globals, walk_vtables): Likewise.
* cp-tree.h (walk_globals_pred, walk_globals_fn, walk_vtables,
walk_globals): Change return type from 'int' to 'bool'.
* rtti.c (init_rtti_processing, build_headof, throw_bad_cast
throw_bad_typeid, get_tinfo_decl_dynamic, typeid_ok_p,
build_typeid, tinfo_name, get_tinfo_decl, get_tinfo_ptr,
get_typeid, ifnonnull, build_dynamic_cast_1, build_dynamic_cast,
qualifier_flags, tinfo_base_init, generic_initializer,
ptr_initializer, dfs_class_hint_mark, ptm_initializer,
dfs_class_hint_unmark, class_hint_flags, class_initializer,
typeinfo_in_lib_p, get_pseudo_ti_init, create_pseudo_type_info,
get_pseudo_ti_desc, create_tinfo_types, emit_support_tinfos,
unemitted_tinfo_decl_p, emit_tinfo_decl): Likewise.
* repo.c (repo_compile_flags, repo_template_declared,
repo_template_defined, repo_class_defined, repo_get_id,
repo_template_used, repo_vtable_used, repo_inline_used,
repo_tinfo_used, repo_template_instantiated, extract_string,
open_repo_file, afgets, init_repo, reopen_repo_file_for_write,
finish_repo): Likewise.
* ptree.c (cxx_print_decl, cxx_print_type, cxx_print_identifier,
cxx_print_xnode): Likewise..
* cp-lang.c (ok_to_generate_alias_set_for_type, cxx_get_alias_set,
cxx_warn_unused_global_decl, cp_expr_size): Likewise.
* cxxfilt.c (demangle_it, print_demangler_list, usage,
standard_symbol_characters, hp_symbol_characters, main, fatal):
Likewise.
(strip_underscore): Change type from 'int' to 'bool'.
(main): Use boolean constants.
From-SVN: r60601
2002-12-29 15:53:05 +01:00
|
|
|
|
static bool
|
2002-11-04 02:45:58 +01:00
|
|
|
|
maybe_emit_vtables (tree ctype)
|
1995-01-31 23:18:02 +01:00
|
|
|
|
{
|
2002-11-04 02:45:58 +01:00
|
|
|
|
tree vtbl;
|
|
|
|
|
tree primary_vtbl;
|
2004-07-29 19:59:31 +02:00
|
|
|
|
int needed = 0;
|
2010-05-22 16:48:40 +02:00
|
|
|
|
struct varpool_node *current = NULL, *last = NULL, *first = NULL;
|
2002-11-04 02:45:58 +01:00
|
|
|
|
|
|
|
|
|
/* If the vtables for this class have already been emitted there is
|
|
|
|
|
nothing more to do. */
|
|
|
|
|
primary_vtbl = CLASSTYPE_VTABLES (ctype);
|
2003-09-11 01:46:26 +02:00
|
|
|
|
if (var_finalized_p (primary_vtbl))
|
Remove traditional C constructs 4/n.
* decl2.c (grok_method_quals, warn_if_unknown_interface,
grok_x_components, cp_build_parm_decl, build_artificial_parm,
maybe_retrofit_in_chrg, grokclassfn, grok_array_decl,
delete_sanity, check_member_template, check_java_method,
check_classfn, finish_static_data_member_decl, grokfield,
grokbitfield, grokoptypename, grok_function_init,
cplus_decl_attributes, constructor_name, defer_fn,
build_anon_union_vars, finish_anon_union, coerce_new_type,
coerce_delete_type, comdat_linkage, maybe_make_one_only,
key_method, import_export_vtable, import_export_class,
output_vtable_inherit, import_export_decl, import_export_tinfo,
build_cleanup, get_guard, get_guard_bits, get_guard_cond,
set_guard, start_objects, finish_objects,
start_static_storage_duration_function,
finish_static_storage_duration_function, get_priority_info,
start_static_initialization_or_destruction,
finish_static_initialization_or_destruction,
do_static_initialization, do_static_destruction,
prune_vars_needing_no_initialization, write_out_vars,
reparse_decl_as_expr, finish_decl_parsing, namespace_ancestor,
add_using_namespace, merge_functions, ambiguous_decl,
lookup_using_namespace, lookup_using_namespace,
qualified_lookup_using_namespace, set_decl_namespace,
decl_namespace, current_decl_namespace, push_decl_namespace,
pop_decl_namespace, push_scope, pop_scope, add_function,
arg_assoc_namespace, arg_assoc_template_arg, arg_assoc,
lookup_arg_dependent, do_namespace_alias,
validate_nonmember_using_decl, do_nonmember_using_decl,
do_toplevel_using_decl, do_local_using_decl,
do_class_using_decl, do_using_directive, check_default_args,
mark_used, handle_class_head): Use C90 prototypings. Use booleans.
* parser.c (cp_parser_class_head): Use booleanss.
* decl.c (walk_globals, walk_vtables): Likewise.
* cp-tree.h (walk_globals_pred, walk_globals_fn, walk_vtables,
walk_globals): Change return type from 'int' to 'bool'.
* rtti.c (init_rtti_processing, build_headof, throw_bad_cast
throw_bad_typeid, get_tinfo_decl_dynamic, typeid_ok_p,
build_typeid, tinfo_name, get_tinfo_decl, get_tinfo_ptr,
get_typeid, ifnonnull, build_dynamic_cast_1, build_dynamic_cast,
qualifier_flags, tinfo_base_init, generic_initializer,
ptr_initializer, dfs_class_hint_mark, ptm_initializer,
dfs_class_hint_unmark, class_hint_flags, class_initializer,
typeinfo_in_lib_p, get_pseudo_ti_init, create_pseudo_type_info,
get_pseudo_ti_desc, create_tinfo_types, emit_support_tinfos,
unemitted_tinfo_decl_p, emit_tinfo_decl): Likewise.
* repo.c (repo_compile_flags, repo_template_declared,
repo_template_defined, repo_class_defined, repo_get_id,
repo_template_used, repo_vtable_used, repo_inline_used,
repo_tinfo_used, repo_template_instantiated, extract_string,
open_repo_file, afgets, init_repo, reopen_repo_file_for_write,
finish_repo): Likewise.
* ptree.c (cxx_print_decl, cxx_print_type, cxx_print_identifier,
cxx_print_xnode): Likewise..
* cp-lang.c (ok_to_generate_alias_set_for_type, cxx_get_alias_set,
cxx_warn_unused_global_decl, cp_expr_size): Likewise.
* cxxfilt.c (demangle_it, print_demangler_list, usage,
standard_symbol_characters, hp_symbol_characters, main, fatal):
Likewise.
(strip_underscore): Change type from 'int' to 'bool'.
(main): Use boolean constants.
From-SVN: r60601
2002-12-29 15:53:05 +01:00
|
|
|
|
return false;
|
2002-11-04 02:45:58 +01:00
|
|
|
|
/* Ignore dummy vtables made by get_vtable_decl. */
|
|
|
|
|
if (TREE_TYPE (primary_vtbl) == void_type_node)
|
Remove traditional C constructs 4/n.
* decl2.c (grok_method_quals, warn_if_unknown_interface,
grok_x_components, cp_build_parm_decl, build_artificial_parm,
maybe_retrofit_in_chrg, grokclassfn, grok_array_decl,
delete_sanity, check_member_template, check_java_method,
check_classfn, finish_static_data_member_decl, grokfield,
grokbitfield, grokoptypename, grok_function_init,
cplus_decl_attributes, constructor_name, defer_fn,
build_anon_union_vars, finish_anon_union, coerce_new_type,
coerce_delete_type, comdat_linkage, maybe_make_one_only,
key_method, import_export_vtable, import_export_class,
output_vtable_inherit, import_export_decl, import_export_tinfo,
build_cleanup, get_guard, get_guard_bits, get_guard_cond,
set_guard, start_objects, finish_objects,
start_static_storage_duration_function,
finish_static_storage_duration_function, get_priority_info,
start_static_initialization_or_destruction,
finish_static_initialization_or_destruction,
do_static_initialization, do_static_destruction,
prune_vars_needing_no_initialization, write_out_vars,
reparse_decl_as_expr, finish_decl_parsing, namespace_ancestor,
add_using_namespace, merge_functions, ambiguous_decl,
lookup_using_namespace, lookup_using_namespace,
qualified_lookup_using_namespace, set_decl_namespace,
decl_namespace, current_decl_namespace, push_decl_namespace,
pop_decl_namespace, push_scope, pop_scope, add_function,
arg_assoc_namespace, arg_assoc_template_arg, arg_assoc,
lookup_arg_dependent, do_namespace_alias,
validate_nonmember_using_decl, do_nonmember_using_decl,
do_toplevel_using_decl, do_local_using_decl,
do_class_using_decl, do_using_directive, check_default_args,
mark_used, handle_class_head): Use C90 prototypings. Use booleans.
* parser.c (cp_parser_class_head): Use booleanss.
* decl.c (walk_globals, walk_vtables): Likewise.
* cp-tree.h (walk_globals_pred, walk_globals_fn, walk_vtables,
walk_globals): Change return type from 'int' to 'bool'.
* rtti.c (init_rtti_processing, build_headof, throw_bad_cast
throw_bad_typeid, get_tinfo_decl_dynamic, typeid_ok_p,
build_typeid, tinfo_name, get_tinfo_decl, get_tinfo_ptr,
get_typeid, ifnonnull, build_dynamic_cast_1, build_dynamic_cast,
qualifier_flags, tinfo_base_init, generic_initializer,
ptr_initializer, dfs_class_hint_mark, ptm_initializer,
dfs_class_hint_unmark, class_hint_flags, class_initializer,
typeinfo_in_lib_p, get_pseudo_ti_init, create_pseudo_type_info,
get_pseudo_ti_desc, create_tinfo_types, emit_support_tinfos,
unemitted_tinfo_decl_p, emit_tinfo_decl): Likewise.
* repo.c (repo_compile_flags, repo_template_declared,
repo_template_defined, repo_class_defined, repo_get_id,
repo_template_used, repo_vtable_used, repo_inline_used,
repo_tinfo_used, repo_template_instantiated, extract_string,
open_repo_file, afgets, init_repo, reopen_repo_file_for_write,
finish_repo): Likewise.
* ptree.c (cxx_print_decl, cxx_print_type, cxx_print_identifier,
cxx_print_xnode): Likewise..
* cp-lang.c (ok_to_generate_alias_set_for_type, cxx_get_alias_set,
cxx_warn_unused_global_decl, cp_expr_size): Likewise.
* cxxfilt.c (demangle_it, print_demangler_list, usage,
standard_symbol_characters, hp_symbol_characters, main, fatal):
Likewise.
(strip_underscore): Change type from 'int' to 'bool'.
(main): Use boolean constants.
From-SVN: r60601
2002-12-29 15:53:05 +01:00
|
|
|
|
return false;
|
2002-11-04 02:45:58 +01:00
|
|
|
|
|
2004-08-31 22:29:28 +02:00
|
|
|
|
/* On some targets, we cannot determine the key method until the end
|
|
|
|
|
of the translation unit -- which is when this function is
|
|
|
|
|
called. */
|
|
|
|
|
if (!targetm.cxx.key_method_may_be_inline ())
|
|
|
|
|
determine_key_method (ctype);
|
|
|
|
|
|
2002-11-04 02:45:58 +01:00
|
|
|
|
/* See if any of the vtables are needed. */
|
2010-07-15 16:31:28 +02:00
|
|
|
|
for (vtbl = CLASSTYPE_VTABLES (ctype); vtbl; vtbl = DECL_CHAIN (vtbl))
|
2004-06-26 12:23:05 +02:00
|
|
|
|
{
|
2004-07-29 19:59:31 +02:00
|
|
|
|
import_export_decl (vtbl);
|
|
|
|
|
if (DECL_NOT_REALLY_EXTERN (vtbl) && decl_needed_p (vtbl))
|
|
|
|
|
needed = 1;
|
2004-06-26 12:23:05 +02:00
|
|
|
|
}
|
2004-07-29 19:59:31 +02:00
|
|
|
|
if (!needed)
|
2002-11-04 02:45:58 +01:00
|
|
|
|
{
|
|
|
|
|
/* If the references to this class' vtables are optimized away,
|
|
|
|
|
still emit the appropriate debugging information. See
|
|
|
|
|
dfs_debug_mark. */
|
2005-06-14 22:01:59 +02:00
|
|
|
|
if (DECL_COMDAT (primary_vtbl)
|
2002-11-04 02:45:58 +01:00
|
|
|
|
&& CLASSTYPE_DEBUG_REQUESTED (ctype))
|
|
|
|
|
note_debug_info_needed (ctype);
|
Remove traditional C constructs 4/n.
* decl2.c (grok_method_quals, warn_if_unknown_interface,
grok_x_components, cp_build_parm_decl, build_artificial_parm,
maybe_retrofit_in_chrg, grokclassfn, grok_array_decl,
delete_sanity, check_member_template, check_java_method,
check_classfn, finish_static_data_member_decl, grokfield,
grokbitfield, grokoptypename, grok_function_init,
cplus_decl_attributes, constructor_name, defer_fn,
build_anon_union_vars, finish_anon_union, coerce_new_type,
coerce_delete_type, comdat_linkage, maybe_make_one_only,
key_method, import_export_vtable, import_export_class,
output_vtable_inherit, import_export_decl, import_export_tinfo,
build_cleanup, get_guard, get_guard_bits, get_guard_cond,
set_guard, start_objects, finish_objects,
start_static_storage_duration_function,
finish_static_storage_duration_function, get_priority_info,
start_static_initialization_or_destruction,
finish_static_initialization_or_destruction,
do_static_initialization, do_static_destruction,
prune_vars_needing_no_initialization, write_out_vars,
reparse_decl_as_expr, finish_decl_parsing, namespace_ancestor,
add_using_namespace, merge_functions, ambiguous_decl,
lookup_using_namespace, lookup_using_namespace,
qualified_lookup_using_namespace, set_decl_namespace,
decl_namespace, current_decl_namespace, push_decl_namespace,
pop_decl_namespace, push_scope, pop_scope, add_function,
arg_assoc_namespace, arg_assoc_template_arg, arg_assoc,
lookup_arg_dependent, do_namespace_alias,
validate_nonmember_using_decl, do_nonmember_using_decl,
do_toplevel_using_decl, do_local_using_decl,
do_class_using_decl, do_using_directive, check_default_args,
mark_used, handle_class_head): Use C90 prototypings. Use booleans.
* parser.c (cp_parser_class_head): Use booleanss.
* decl.c (walk_globals, walk_vtables): Likewise.
* cp-tree.h (walk_globals_pred, walk_globals_fn, walk_vtables,
walk_globals): Change return type from 'int' to 'bool'.
* rtti.c (init_rtti_processing, build_headof, throw_bad_cast
throw_bad_typeid, get_tinfo_decl_dynamic, typeid_ok_p,
build_typeid, tinfo_name, get_tinfo_decl, get_tinfo_ptr,
get_typeid, ifnonnull, build_dynamic_cast_1, build_dynamic_cast,
qualifier_flags, tinfo_base_init, generic_initializer,
ptr_initializer, dfs_class_hint_mark, ptm_initializer,
dfs_class_hint_unmark, class_hint_flags, class_initializer,
typeinfo_in_lib_p, get_pseudo_ti_init, create_pseudo_type_info,
get_pseudo_ti_desc, create_tinfo_types, emit_support_tinfos,
unemitted_tinfo_decl_p, emit_tinfo_decl): Likewise.
* repo.c (repo_compile_flags, repo_template_declared,
repo_template_defined, repo_class_defined, repo_get_id,
repo_template_used, repo_vtable_used, repo_inline_used,
repo_tinfo_used, repo_template_instantiated, extract_string,
open_repo_file, afgets, init_repo, reopen_repo_file_for_write,
finish_repo): Likewise.
* ptree.c (cxx_print_decl, cxx_print_type, cxx_print_identifier,
cxx_print_xnode): Likewise..
* cp-lang.c (ok_to_generate_alias_set_for_type, cxx_get_alias_set,
cxx_warn_unused_global_decl, cp_expr_size): Likewise.
* cxxfilt.c (demangle_it, print_demangler_list, usage,
standard_symbol_characters, hp_symbol_characters, main, fatal):
Likewise.
(strip_underscore): Change type from 'int' to 'bool'.
(main): Use boolean constants.
From-SVN: r60601
2002-12-29 15:53:05 +01:00
|
|
|
|
return false;
|
2002-11-04 02:45:58 +01:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* The ABI requires that we emit all of the vtables if we emit any
|
|
|
|
|
of them. */
|
2010-07-15 16:31:28 +02:00
|
|
|
|
for (vtbl = CLASSTYPE_VTABLES (ctype); vtbl; vtbl = DECL_CHAIN (vtbl))
|
1995-01-31 23:18:02 +01:00
|
|
|
|
{
|
2004-07-29 19:59:31 +02:00
|
|
|
|
/* Mark entities references from the virtual table as used. */
|
2002-11-04 02:45:58 +01:00
|
|
|
|
mark_vtable_entries (vtbl);
|
2003-07-02 02:12:10 +02:00
|
|
|
|
|
2002-11-04 02:45:58 +01:00
|
|
|
|
if (TREE_TYPE (DECL_INITIAL (vtbl)) == 0)
|
2004-01-12 22:38:04 +01:00
|
|
|
|
{
|
2009-05-18 23:48:02 +02:00
|
|
|
|
tree expr = store_init_value (vtbl, DECL_INITIAL (vtbl), LOOKUP_NORMAL);
|
2005-06-14 22:01:59 +02:00
|
|
|
|
|
2004-01-12 22:38:04 +01:00
|
|
|
|
/* It had better be all done at compile-time. */
|
call.c (check_dtor_name): Replace abort with gcc_assert or gcc_unreachable.
* call.c (check_dtor_name): Replace abort with gcc_assert or
gcc_unreachable.
(build_call, add_builtin_candidate, build_new_op,
convert_like_real, build_over_call, in_charge_arg_for_name,
source_type, joust): Likewise.
* class.c (build_simple_base_path, get_vcall_index,
finish_struct_1, instantiate_type, get_enclosing_class,
add_vcall_offset_vtbl_entries_1, cp_fold_obj_type_ref): Likewise.
* cp-gimplify.c (cp_genericize): Likewise.
* cp-lang.c (cp_expr_size, cp_tree_size): Likewise.
* cvt.c (cp_convert_to_pointer, ocp_convert): Likewise.
* decl.c (poplevel, make_unbound_class_template, reshape_init,
check_special_function_return_type, grokdeclarator,
grok_op_properties, tag_name, xref_tag, start_preparsed_function,
finish_function): Likewise.
* decl2.c (grokfield, maybe_emit_vtables):Likewise.
* error.c (dump_global_iord, dump_decl, dump_template_decl,
language_to_string): Likewise.
* except.c (choose_personality_routine): Likewise.
* friend.c (do_friend): Likewise.
* g++spec.c (lang_specific_driver): Likewise.
* init.c (build_zero_init, expand_default_init, build_new_1,
build_vec_delete_1, build_vec_init, build_dtor_call): Likewise.
* lex.c (retrofit_lang_decl, cp_type_qual_from_rid): Likewise.
* mangle.c (add_substitution, write_unscoped_name,
write_template_prefix, write_identifier,
write_special_name_destructor, write_type, write_builtin_type,
write_expression, write_template_param,
write_java_integer_type_codes): Likewise.
* method.c (implicitly_declare_fn): Likewise.
From-SVN: r86778
2004-08-30 17:28:48 +02:00
|
|
|
|
gcc_assert (!expr);
|
2004-01-12 22:38:04 +01:00
|
|
|
|
}
|
1994-02-24 02:02:37 +01:00
|
|
|
|
|
2004-07-29 19:59:31 +02:00
|
|
|
|
/* Write it out. */
|
|
|
|
|
DECL_EXTERNAL (vtbl) = 0;
|
2004-08-05 07:52:01 +02:00
|
|
|
|
rest_of_decl_compilation (vtbl, 1, 1);
|
1998-08-28 18:11:35 +02:00
|
|
|
|
|
1999-09-29 10:06:21 +02:00
|
|
|
|
/* Because we're only doing syntax-checking, we'll never end up
|
|
|
|
|
actually marking the variable as written. */
|
|
|
|
|
if (flag_syntax_only)
|
2002-11-04 02:45:58 +01:00
|
|
|
|
TREE_ASM_WRITTEN (vtbl) = 1;
|
2010-05-22 16:48:40 +02:00
|
|
|
|
else if (DECL_COMDAT (vtbl))
|
|
|
|
|
{
|
|
|
|
|
current = varpool_node (vtbl);
|
|
|
|
|
if (last)
|
|
|
|
|
last->same_comdat_group = current;
|
|
|
|
|
last = current;
|
|
|
|
|
if (!first)
|
|
|
|
|
first = current;
|
|
|
|
|
}
|
1994-02-24 02:02:37 +01:00
|
|
|
|
}
|
2000-03-04 01:45:24 +01:00
|
|
|
|
|
2010-05-22 16:48:40 +02:00
|
|
|
|
if (first != last)
|
|
|
|
|
last->same_comdat_group = first;
|
|
|
|
|
|
2002-11-04 02:45:58 +01:00
|
|
|
|
/* Since we're writing out the vtable here, also write the debug
|
|
|
|
|
info. */
|
|
|
|
|
note_debug_info_needed (ctype);
|
1995-03-16 00:03:59 +01:00
|
|
|
|
|
Remove traditional C constructs 4/n.
* decl2.c (grok_method_quals, warn_if_unknown_interface,
grok_x_components, cp_build_parm_decl, build_artificial_parm,
maybe_retrofit_in_chrg, grokclassfn, grok_array_decl,
delete_sanity, check_member_template, check_java_method,
check_classfn, finish_static_data_member_decl, grokfield,
grokbitfield, grokoptypename, grok_function_init,
cplus_decl_attributes, constructor_name, defer_fn,
build_anon_union_vars, finish_anon_union, coerce_new_type,
coerce_delete_type, comdat_linkage, maybe_make_one_only,
key_method, import_export_vtable, import_export_class,
output_vtable_inherit, import_export_decl, import_export_tinfo,
build_cleanup, get_guard, get_guard_bits, get_guard_cond,
set_guard, start_objects, finish_objects,
start_static_storage_duration_function,
finish_static_storage_duration_function, get_priority_info,
start_static_initialization_or_destruction,
finish_static_initialization_or_destruction,
do_static_initialization, do_static_destruction,
prune_vars_needing_no_initialization, write_out_vars,
reparse_decl_as_expr, finish_decl_parsing, namespace_ancestor,
add_using_namespace, merge_functions, ambiguous_decl,
lookup_using_namespace, lookup_using_namespace,
qualified_lookup_using_namespace, set_decl_namespace,
decl_namespace, current_decl_namespace, push_decl_namespace,
pop_decl_namespace, push_scope, pop_scope, add_function,
arg_assoc_namespace, arg_assoc_template_arg, arg_assoc,
lookup_arg_dependent, do_namespace_alias,
validate_nonmember_using_decl, do_nonmember_using_decl,
do_toplevel_using_decl, do_local_using_decl,
do_class_using_decl, do_using_directive, check_default_args,
mark_used, handle_class_head): Use C90 prototypings. Use booleans.
* parser.c (cp_parser_class_head): Use booleanss.
* decl.c (walk_globals, walk_vtables): Likewise.
* cp-tree.h (walk_globals_pred, walk_globals_fn, walk_vtables,
walk_globals): Change return type from 'int' to 'bool'.
* rtti.c (init_rtti_processing, build_headof, throw_bad_cast
throw_bad_typeid, get_tinfo_decl_dynamic, typeid_ok_p,
build_typeid, tinfo_name, get_tinfo_decl, get_tinfo_ptr,
get_typeid, ifnonnull, build_dynamic_cast_1, build_dynamic_cast,
qualifier_flags, tinfo_base_init, generic_initializer,
ptr_initializer, dfs_class_hint_mark, ptm_initializer,
dfs_class_hint_unmark, class_hint_flags, class_initializer,
typeinfo_in_lib_p, get_pseudo_ti_init, create_pseudo_type_info,
get_pseudo_ti_desc, create_tinfo_types, emit_support_tinfos,
unemitted_tinfo_decl_p, emit_tinfo_decl): Likewise.
* repo.c (repo_compile_flags, repo_template_declared,
repo_template_defined, repo_class_defined, repo_get_id,
repo_template_used, repo_vtable_used, repo_inline_used,
repo_tinfo_used, repo_template_instantiated, extract_string,
open_repo_file, afgets, init_repo, reopen_repo_file_for_write,
finish_repo): Likewise.
* ptree.c (cxx_print_decl, cxx_print_type, cxx_print_identifier,
cxx_print_xnode): Likewise..
* cp-lang.c (ok_to_generate_alias_set_for_type, cxx_get_alias_set,
cxx_warn_unused_global_decl, cp_expr_size): Likewise.
* cxxfilt.c (demangle_it, print_demangler_list, usage,
standard_symbol_characters, hp_symbol_characters, main, fatal):
Likewise.
(strip_underscore): Change type from 'int' to 'bool'.
(main): Use boolean constants.
From-SVN: r60601
2002-12-29 15:53:05 +01:00
|
|
|
|
return true;
|
1995-03-16 00:03:59 +01:00
|
|
|
|
}
|
|
|
|
|
|
2006-06-30 03:15:56 +02:00
|
|
|
|
/* A special return value from type_visibility meaning internal
|
|
|
|
|
linkage. */
|
|
|
|
|
|
2006-07-20 18:02:57 +02:00
|
|
|
|
enum { VISIBILITY_ANON = VISIBILITY_INTERNAL+1 };
|
2006-06-30 03:15:56 +02:00
|
|
|
|
|
|
|
|
|
/* walk_tree helper function for type_visibility. */
|
|
|
|
|
|
|
|
|
|
static tree
|
|
|
|
|
min_vis_r (tree *tp, int *walk_subtrees, void *data)
|
|
|
|
|
{
|
|
|
|
|
int *vis_p = (int *)data;
|
|
|
|
|
if (! TYPE_P (*tp))
|
|
|
|
|
{
|
|
|
|
|
*walk_subtrees = 0;
|
|
|
|
|
}
|
|
|
|
|
else if (CLASS_TYPE_P (*tp))
|
|
|
|
|
{
|
|
|
|
|
if (!TREE_PUBLIC (TYPE_MAIN_DECL (*tp)))
|
|
|
|
|
{
|
2006-07-20 18:02:57 +02:00
|
|
|
|
*vis_p = VISIBILITY_ANON;
|
2006-06-30 03:15:56 +02:00
|
|
|
|
return *tp;
|
|
|
|
|
}
|
|
|
|
|
else if (CLASSTYPE_VISIBILITY (*tp) > *vis_p)
|
|
|
|
|
*vis_p = CLASSTYPE_VISIBILITY (*tp);
|
|
|
|
|
}
|
|
|
|
|
return NULL;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Returns the visibility of TYPE, which is the minimum visibility of its
|
|
|
|
|
component types. */
|
|
|
|
|
|
|
|
|
|
static int
|
|
|
|
|
type_visibility (tree type)
|
|
|
|
|
{
|
|
|
|
|
int vis = VISIBILITY_DEFAULT;
|
2007-08-20 13:19:22 +02:00
|
|
|
|
cp_walk_tree_without_duplicates (&type, min_vis_r, &vis);
|
2006-06-30 03:15:56 +02:00
|
|
|
|
return vis;
|
|
|
|
|
}
|
|
|
|
|
|
2006-07-20 18:02:57 +02:00
|
|
|
|
/* Limit the visibility of DECL to VISIBILITY, if not explicitly
|
|
|
|
|
specified (or if VISIBILITY is static). */
|
2006-06-30 03:15:56 +02:00
|
|
|
|
|
|
|
|
|
static bool
|
2006-07-20 18:02:57 +02:00
|
|
|
|
constrain_visibility (tree decl, int visibility)
|
2006-06-30 03:15:56 +02:00
|
|
|
|
{
|
2006-07-20 18:02:57 +02:00
|
|
|
|
if (visibility == VISIBILITY_ANON)
|
2006-06-30 03:15:56 +02:00
|
|
|
|
{
|
2006-07-20 18:02:57 +02:00
|
|
|
|
/* extern "C" declarations aren't affected by the anonymous
|
|
|
|
|
namespace. */
|
|
|
|
|
if (!DECL_EXTERN_C_P (decl))
|
|
|
|
|
{
|
|
|
|
|
TREE_PUBLIC (decl) = 0;
|
2009-11-12 07:50:19 +01:00
|
|
|
|
DECL_WEAK (decl) = 0;
|
|
|
|
|
DECL_COMMON (decl) = 0;
|
2009-06-15 16:25:50 +02:00
|
|
|
|
DECL_COMDAT_GROUP (decl) = NULL_TREE;
|
2006-07-20 18:02:57 +02:00
|
|
|
|
DECL_INTERFACE_KNOWN (decl) = 1;
|
|
|
|
|
if (DECL_LANG_SPECIFIC (decl))
|
|
|
|
|
DECL_NOT_REALLY_EXTERN (decl) = 1;
|
|
|
|
|
}
|
2006-06-30 03:15:56 +02:00
|
|
|
|
}
|
2006-07-20 18:02:57 +02:00
|
|
|
|
else if (visibility > DECL_VISIBILITY (decl)
|
|
|
|
|
&& !DECL_VISIBILITY_SPECIFIED (decl))
|
2006-06-30 03:15:56 +02:00
|
|
|
|
{
|
2009-04-24 17:31:38 +02:00
|
|
|
|
DECL_VISIBILITY (decl) = (enum symbol_visibility) visibility;
|
2006-06-30 03:15:56 +02:00
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
2006-06-30 21:34:38 +02:00
|
|
|
|
/* Constrain the visibility of DECL based on the visibility of its template
|
2006-06-30 03:15:56 +02:00
|
|
|
|
arguments. */
|
|
|
|
|
|
|
|
|
|
static void
|
|
|
|
|
constrain_visibility_for_template (tree decl, tree targs)
|
|
|
|
|
{
|
|
|
|
|
/* If this is a template instantiation, check the innermost
|
|
|
|
|
template args for visibility constraints. The outer template
|
|
|
|
|
args are covered by the class check. */
|
|
|
|
|
tree args = INNERMOST_TEMPLATE_ARGS (targs);
|
|
|
|
|
int i;
|
|
|
|
|
for (i = TREE_VEC_LENGTH (args); i > 0; --i)
|
|
|
|
|
{
|
|
|
|
|
int vis = 0;
|
|
|
|
|
|
|
|
|
|
tree arg = TREE_VEC_ELT (args, i-1);
|
|
|
|
|
if (TYPE_P (arg))
|
|
|
|
|
vis = type_visibility (arg);
|
|
|
|
|
else if (TREE_TYPE (arg) && POINTER_TYPE_P (TREE_TYPE (arg)))
|
|
|
|
|
{
|
|
|
|
|
STRIP_NOPS (arg);
|
|
|
|
|
if (TREE_CODE (arg) == ADDR_EXPR)
|
|
|
|
|
arg = TREE_OPERAND (arg, 0);
|
|
|
|
|
if (TREE_CODE (arg) == VAR_DECL
|
|
|
|
|
|| TREE_CODE (arg) == FUNCTION_DECL)
|
|
|
|
|
{
|
|
|
|
|
if (! TREE_PUBLIC (arg))
|
2006-07-20 18:02:57 +02:00
|
|
|
|
vis = VISIBILITY_ANON;
|
2006-06-30 03:15:56 +02:00
|
|
|
|
else
|
|
|
|
|
vis = DECL_VISIBILITY (arg);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (vis)
|
2006-07-20 18:02:57 +02:00
|
|
|
|
constrain_visibility (decl, vis);
|
2006-06-30 03:15:56 +02:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2004-08-06 04:03:29 +02:00
|
|
|
|
/* Like c_determine_visibility, but with additional C++-specific
|
2006-03-21 04:19:06 +01:00
|
|
|
|
behavior.
|
|
|
|
|
|
|
|
|
|
Function-scope entities can rely on the function's visibility because
|
|
|
|
|
it is set in start_preparsed_function.
|
|
|
|
|
|
|
|
|
|
Class-scope entities cannot rely on the class's visibility until the end
|
|
|
|
|
of the enclosing class definition.
|
|
|
|
|
|
|
|
|
|
Note that because namespaces have multiple independent definitions,
|
|
|
|
|
namespace visibility is handled elsewhere using the #pragma visibility
|
2006-06-30 03:15:56 +02:00
|
|
|
|
machinery rather than by decorating the namespace declaration.
|
|
|
|
|
|
|
|
|
|
The goal is for constraints from the type to give a diagnostic, and
|
|
|
|
|
other constraints to be applied silently. */
|
2004-08-04 07:27:52 +02:00
|
|
|
|
|
|
|
|
|
void
|
|
|
|
|
determine_visibility (tree decl)
|
|
|
|
|
{
|
2006-06-30 03:15:56 +02:00
|
|
|
|
tree class_type = NULL_TREE;
|
|
|
|
|
bool use_template;
|
2009-02-19 22:15:12 +01:00
|
|
|
|
bool orig_visibility_specified;
|
|
|
|
|
enum symbol_visibility orig_visibility;
|
2006-06-30 03:15:56 +02:00
|
|
|
|
|
|
|
|
|
/* Remember that all decls get VISIBILITY_DEFAULT when built. */
|
2004-08-04 07:27:52 +02:00
|
|
|
|
|
2006-03-21 04:19:06 +01:00
|
|
|
|
/* Only relevant for names with external linkage. */
|
|
|
|
|
if (!TREE_PUBLIC (decl))
|
|
|
|
|
return;
|
|
|
|
|
|
2004-08-04 07:27:52 +02:00
|
|
|
|
/* Cloned constructors and destructors get the same visibility as
|
|
|
|
|
the underlying function. That should be set up in
|
|
|
|
|
maybe_clone_body. */
|
call.c (validate_conversion_obstack): Replace my_friendly_assert with gcc_assert or gcc_unreachable.
* call.c (validate_conversion_obstack): Replace
my_friendly_assert with gcc_assert or gcc_unreachable.
(direct_reference_binding, merge_conversion_sequences,
build_user_type_conversion_1, perform_overload_resolution,
build_op_delete_call, enforce_access, call_builtin_trap,
build_over_call, build_special_member_call, build_new_method_call,
initialize_reference): Likewise.
* class.c (build_base_path, build_primary_vtable, alter_access,
check_bases, update_vtable_entry_for_fn, layout_empty_base,
clone_function_decl, adjust_clone_args,
type_requires_array_cookie, include_empty_classes,
finish_struct_1, resolve_address_of_overloaded_function,
instantiate_type, get_vtbl_decl_for_binfo, build_vtt_inits,
dfs_build_secondary_vptr_vtt_inits, build_ctor_vtbl_group,
accumulate_vtbl_inits, build_vtbl_initializer,
build_vbase_offset_vtbl_entries, build_rtti_vtbl_entries): Likewise.
* cvt.c (build_up_reference, convert_to_reference): Likewise.
* decl.c (poplevel, duplicate_decls, make_typename_type,
cxx_init_decl_processing, reshape_init, check_initializer,
make_rtl_for_nonlocal_decl, initialize_local_var, cp_finish_decl,
expand_static_init, grokfndecl, grokvardecl, build_ptrmem_type,
grokdeclarator, copy_fn_p, grok_op_properties, xref_tag,
xref_basetypes, start_preparsed_function, save_function_data,
finish_function, finish_method, maybe_register_incomplete_var,
complete_vars): Likewise.
* decl2.c (grok_array_decl, check_member_template,
check_classfn, finish_static_data_member_decl, coerce_new_type,
coerce_delete_type, import_export_class, decl_needed_p,
determine_visibility, import_export_decl, build_cleanup,
start_static_initialization_or_destructi, do_static_destruction,
prune_vars_needing_no_initialization,
build_offset_ref_call_from_tree): Likewise.
* error.c (dump_decl, dump_expr): Likewise.
* init.c (finish_init_stmts, build_zero_init,
expand_virtual_init, expand_default_init, expand_aggr_init_1,
build_offset_ref, build_new_1, build_delete, build_vbase_delete):
Likewise.
* mangle.c (write_method_parms, write_template_args,
write_expression, write_template_arg): Likewise.
* method.c (make_thunk, finish_thunk, use_thunk): Likewise.
* name-lookup.c (pop_binding, begin_scope, leave_scope,
resume_scope, push_using_decl, validate_nonmember_using_decl,
is_ancestor, poplevel_class, set_inherited_value_binding_p,
push_class_level_binding, do_class_using_decl, push_namespace,
pop_namespace, add_using_namespace, ambiguous_decl,
lookup_namespace_name, lookup_type_current_level,
maybe_process_template_type_declaration): Likewise.
* parser.c (cp_lexer_peek_nth_token,
cp_parser_parse_and_diagnose_invalid_typ,
cp_parser_translation_unit, cp_parser_template_id,
cp_parser_lookup_name, cp_parser_late_parsing_for_member): Likewise.
* pt.c (push_access_scope, finish_member_template_decl,
push_inline_template_parms_recursive, add_outermost_template_args,
get_innermost_template_args, begin_explicit_instantiation,
end_explicit_instantiation, retrieve_specialization,
is_specialization_of, is_specialization_of_friend,
register_specialization, check_explicit_specialization,
comp_template_parms, process_template_parm,
process_partial_specialization, convert_nontype_argument,
coerce_template_template_parms, coerce_template_parms,
mangle_class_name_for_template, lookup_template_function,
lookup_template_class, instantiate_class_template, tsubst_decl,
tsubst_function_type, tsubst, tsubst_qualified_id, tsubst_copy,
instantiate_template, fn_type_unification, type_unification_real,
get_template_base, regenerate_decl_from_template,
template_for_substitution, instantiate_decl,
get_mostly_instantiated_function_type, dependent_scope_ref_p,
value_dependent_expression_p, resolve_typename_type): Likewise.
* repo.c (repo_emit_p): Likewise.
* rtti.c (build_headof, get_tinfo_decl, get_pseudo_ti_init,
create_tinfo_types, emit_tinfo_decl): Likewise.
* search.c (lookup_base_r, lookup_base, lookup_field_1,
dfs_access_in_type, build_baselink, lookup_member,
adjust_result_of_qualified_name_lookup, copied_binfo): Likewise.
* semantics.c (perform_or_defer_access_check,
finish_non_static_data_member, finish_stmt_expr_expr,
finish_stmt_expr, finish_call_expr, finish_pseudo_destructor_expr,
finish_template_template_parm, finish_member_declaration,
emit_associated_thunks): Likewise.
* tree.c (build_target_expr_with_type, force_target_expr,
copy_binfo, get_first_fn, cp_tree_equal): Likewise.
* typeck.c (type_after_usual_arithmetic_conversions, comptypes,
cxx_sizeof_or_alignof_type, perform_integral_promotions,
build_class_member_access_expr, finish_class_member_access_expr,
build_ptrmemfunc_access_expr, build_unary_op,
unary_complex_lvalue, cxx_mark_addressable, build_modify_expr,
build_ptrmemfunc, expand_ptrmemfunc_cst, check_return_expr
* typeck2.c (complete_type_check_abstract,
abstract_virtuals_error, process_init_constructor,
add_exception_specifier): Likewise.
From-SVN: r86669
2004-08-27 19:59:33 +02:00
|
|
|
|
gcc_assert (!DECL_CLONED_FUNCTION_P (decl));
|
2004-08-06 04:03:29 +02:00
|
|
|
|
|
2009-02-19 22:15:12 +01:00
|
|
|
|
orig_visibility_specified = DECL_VISIBILITY_SPECIFIED (decl);
|
|
|
|
|
orig_visibility = DECL_VISIBILITY (decl);
|
|
|
|
|
|
2006-06-30 03:15:56 +02:00
|
|
|
|
if (TREE_CODE (decl) == TYPE_DECL)
|
|
|
|
|
{
|
|
|
|
|
if (CLASS_TYPE_P (TREE_TYPE (decl)))
|
|
|
|
|
use_template = CLASSTYPE_USE_TEMPLATE (TREE_TYPE (decl));
|
|
|
|
|
else if (TYPE_TEMPLATE_INFO (TREE_TYPE (decl)))
|
|
|
|
|
use_template = 1;
|
|
|
|
|
else
|
|
|
|
|
use_template = 0;
|
|
|
|
|
}
|
|
|
|
|
else if (DECL_LANG_SPECIFIC (decl))
|
|
|
|
|
use_template = DECL_USE_TEMPLATE (decl);
|
|
|
|
|
else
|
|
|
|
|
use_template = 0;
|
|
|
|
|
|
2004-08-06 04:03:29 +02:00
|
|
|
|
/* If DECL is a member of a class, visibility specifiers on the
|
|
|
|
|
class can influence the visibility of the DECL. */
|
2004-08-04 07:27:52 +02:00
|
|
|
|
if (DECL_CLASS_SCOPE_P (decl))
|
|
|
|
|
class_type = DECL_CONTEXT (decl);
|
|
|
|
|
else
|
|
|
|
|
{
|
2006-06-30 03:15:56 +02:00
|
|
|
|
/* Not a class member. */
|
|
|
|
|
|
2004-08-04 07:27:52 +02:00
|
|
|
|
/* Virtual tables have DECL_CONTEXT set to their associated class,
|
|
|
|
|
so they are automatically handled above. */
|
call.c (validate_conversion_obstack): Replace my_friendly_assert with gcc_assert or gcc_unreachable.
* call.c (validate_conversion_obstack): Replace
my_friendly_assert with gcc_assert or gcc_unreachable.
(direct_reference_binding, merge_conversion_sequences,
build_user_type_conversion_1, perform_overload_resolution,
build_op_delete_call, enforce_access, call_builtin_trap,
build_over_call, build_special_member_call, build_new_method_call,
initialize_reference): Likewise.
* class.c (build_base_path, build_primary_vtable, alter_access,
check_bases, update_vtable_entry_for_fn, layout_empty_base,
clone_function_decl, adjust_clone_args,
type_requires_array_cookie, include_empty_classes,
finish_struct_1, resolve_address_of_overloaded_function,
instantiate_type, get_vtbl_decl_for_binfo, build_vtt_inits,
dfs_build_secondary_vptr_vtt_inits, build_ctor_vtbl_group,
accumulate_vtbl_inits, build_vtbl_initializer,
build_vbase_offset_vtbl_entries, build_rtti_vtbl_entries): Likewise.
* cvt.c (build_up_reference, convert_to_reference): Likewise.
* decl.c (poplevel, duplicate_decls, make_typename_type,
cxx_init_decl_processing, reshape_init, check_initializer,
make_rtl_for_nonlocal_decl, initialize_local_var, cp_finish_decl,
expand_static_init, grokfndecl, grokvardecl, build_ptrmem_type,
grokdeclarator, copy_fn_p, grok_op_properties, xref_tag,
xref_basetypes, start_preparsed_function, save_function_data,
finish_function, finish_method, maybe_register_incomplete_var,
complete_vars): Likewise.
* decl2.c (grok_array_decl, check_member_template,
check_classfn, finish_static_data_member_decl, coerce_new_type,
coerce_delete_type, import_export_class, decl_needed_p,
determine_visibility, import_export_decl, build_cleanup,
start_static_initialization_or_destructi, do_static_destruction,
prune_vars_needing_no_initialization,
build_offset_ref_call_from_tree): Likewise.
* error.c (dump_decl, dump_expr): Likewise.
* init.c (finish_init_stmts, build_zero_init,
expand_virtual_init, expand_default_init, expand_aggr_init_1,
build_offset_ref, build_new_1, build_delete, build_vbase_delete):
Likewise.
* mangle.c (write_method_parms, write_template_args,
write_expression, write_template_arg): Likewise.
* method.c (make_thunk, finish_thunk, use_thunk): Likewise.
* name-lookup.c (pop_binding, begin_scope, leave_scope,
resume_scope, push_using_decl, validate_nonmember_using_decl,
is_ancestor, poplevel_class, set_inherited_value_binding_p,
push_class_level_binding, do_class_using_decl, push_namespace,
pop_namespace, add_using_namespace, ambiguous_decl,
lookup_namespace_name, lookup_type_current_level,
maybe_process_template_type_declaration): Likewise.
* parser.c (cp_lexer_peek_nth_token,
cp_parser_parse_and_diagnose_invalid_typ,
cp_parser_translation_unit, cp_parser_template_id,
cp_parser_lookup_name, cp_parser_late_parsing_for_member): Likewise.
* pt.c (push_access_scope, finish_member_template_decl,
push_inline_template_parms_recursive, add_outermost_template_args,
get_innermost_template_args, begin_explicit_instantiation,
end_explicit_instantiation, retrieve_specialization,
is_specialization_of, is_specialization_of_friend,
register_specialization, check_explicit_specialization,
comp_template_parms, process_template_parm,
process_partial_specialization, convert_nontype_argument,
coerce_template_template_parms, coerce_template_parms,
mangle_class_name_for_template, lookup_template_function,
lookup_template_class, instantiate_class_template, tsubst_decl,
tsubst_function_type, tsubst, tsubst_qualified_id, tsubst_copy,
instantiate_template, fn_type_unification, type_unification_real,
get_template_base, regenerate_decl_from_template,
template_for_substitution, instantiate_decl,
get_mostly_instantiated_function_type, dependent_scope_ref_p,
value_dependent_expression_p, resolve_typename_type): Likewise.
* repo.c (repo_emit_p): Likewise.
* rtti.c (build_headof, get_tinfo_decl, get_pseudo_ti_init,
create_tinfo_types, emit_tinfo_decl): Likewise.
* search.c (lookup_base_r, lookup_base, lookup_field_1,
dfs_access_in_type, build_baselink, lookup_member,
adjust_result_of_qualified_name_lookup, copied_binfo): Likewise.
* semantics.c (perform_or_defer_access_check,
finish_non_static_data_member, finish_stmt_expr_expr,
finish_stmt_expr, finish_call_expr, finish_pseudo_destructor_expr,
finish_template_template_parm, finish_member_declaration,
emit_associated_thunks): Likewise.
* tree.c (build_target_expr_with_type, force_target_expr,
copy_binfo, get_first_fn, cp_tree_equal): Likewise.
* typeck.c (type_after_usual_arithmetic_conversions, comptypes,
cxx_sizeof_or_alignof_type, perform_integral_promotions,
build_class_member_access_expr, finish_class_member_access_expr,
build_ptrmemfunc_access_expr, build_unary_op,
unary_complex_lvalue, cxx_mark_addressable, build_modify_expr,
build_ptrmemfunc, expand_ptrmemfunc_cst, check_return_expr
* typeck2.c (complete_type_check_abstract,
abstract_virtuals_error, process_init_constructor,
add_exception_specifier): Likewise.
From-SVN: r86669
2004-08-27 19:59:33 +02:00
|
|
|
|
gcc_assert (TREE_CODE (decl) != VAR_DECL
|
|
|
|
|
|| !DECL_VTABLE_OR_VTT_P (decl));
|
2006-03-21 04:19:06 +01:00
|
|
|
|
|
2006-07-13 08:16:59 +02:00
|
|
|
|
if (DECL_FUNCTION_SCOPE_P (decl) && ! DECL_VISIBILITY_SPECIFIED (decl))
|
2006-03-21 04:19:06 +01:00
|
|
|
|
{
|
2006-06-30 03:15:56 +02:00
|
|
|
|
/* Local statics and classes get the visibility of their
|
2006-07-13 08:16:59 +02:00
|
|
|
|
containing function by default, except that
|
|
|
|
|
-fvisibility-inlines-hidden doesn't affect them. */
|
2006-03-21 04:19:06 +01:00
|
|
|
|
tree fn = DECL_CONTEXT (decl);
|
2006-07-13 08:16:59 +02:00
|
|
|
|
if (DECL_VISIBILITY_SPECIFIED (fn) || ! DECL_CLASS_SCOPE_P (fn))
|
|
|
|
|
{
|
|
|
|
|
DECL_VISIBILITY (decl) = DECL_VISIBILITY (fn);
|
|
|
|
|
DECL_VISIBILITY_SPECIFIED (decl) =
|
|
|
|
|
DECL_VISIBILITY_SPECIFIED (fn);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
determine_visibility_from_class (decl, DECL_CONTEXT (fn));
|
2006-03-21 04:19:06 +01:00
|
|
|
|
|
2006-06-30 03:15:56 +02:00
|
|
|
|
/* Local classes in templates have CLASSTYPE_USE_TEMPLATE set,
|
|
|
|
|
but have no TEMPLATE_INFO, so don't try to check it. */
|
|
|
|
|
use_template = 0;
|
|
|
|
|
}
|
2007-06-28 21:31:45 +02:00
|
|
|
|
else if (TREE_CODE (decl) == VAR_DECL && DECL_TINFO_P (decl)
|
|
|
|
|
&& flag_visibility_ms_compat)
|
|
|
|
|
{
|
|
|
|
|
/* Under -fvisibility-ms-compat, types are visible by default,
|
|
|
|
|
even though their contents aren't. */
|
|
|
|
|
tree underlying_type = TREE_TYPE (DECL_NAME (decl));
|
|
|
|
|
int underlying_vis = type_visibility (underlying_type);
|
|
|
|
|
if (underlying_vis == VISIBILITY_ANON
|
|
|
|
|
|| CLASSTYPE_VISIBILITY_SPECIFIED (underlying_type))
|
|
|
|
|
constrain_visibility (decl, underlying_vis);
|
|
|
|
|
else
|
|
|
|
|
DECL_VISIBILITY (decl) = VISIBILITY_DEFAULT;
|
|
|
|
|
}
|
2006-06-30 03:15:56 +02:00
|
|
|
|
else if (TREE_CODE (decl) == VAR_DECL && DECL_TINFO_P (decl))
|
|
|
|
|
{
|
|
|
|
|
/* tinfo visibility is based on the type it's for. */
|
|
|
|
|
constrain_visibility
|
2006-07-20 18:02:57 +02:00
|
|
|
|
(decl, type_visibility (TREE_TYPE (DECL_NAME (decl))));
|
2008-07-17 16:03:50 +02:00
|
|
|
|
|
|
|
|
|
/* Give the target a chance to override the visibility associated
|
|
|
|
|
with DECL. */
|
|
|
|
|
if (TREE_PUBLIC (decl)
|
|
|
|
|
&& !DECL_REALLY_EXTERN (decl)
|
|
|
|
|
&& CLASS_TYPE_P (TREE_TYPE (DECL_NAME (decl)))
|
|
|
|
|
&& !CLASSTYPE_VISIBILITY_SPECIFIED (TREE_TYPE (DECL_NAME (decl))))
|
|
|
|
|
targetm.cxx.determine_class_data_visibility (decl);
|
2006-06-30 03:15:56 +02:00
|
|
|
|
}
|
|
|
|
|
else if (use_template)
|
|
|
|
|
/* Template instantiations and specializations get visibility based
|
|
|
|
|
on their template unless they override it with an attribute. */;
|
|
|
|
|
else if (! DECL_VISIBILITY_SPECIFIED (decl))
|
|
|
|
|
{
|
|
|
|
|
/* Set default visibility to whatever the user supplied with
|
|
|
|
|
#pragma GCC visibility or a namespace visibility attribute. */
|
|
|
|
|
DECL_VISIBILITY (decl) = default_visibility;
|
|
|
|
|
DECL_VISIBILITY_SPECIFIED (decl) = visibility_options.inpragma;
|
|
|
|
|
}
|
2004-08-04 07:27:52 +02:00
|
|
|
|
}
|
|
|
|
|
|
2006-06-30 03:15:56 +02:00
|
|
|
|
if (use_template)
|
2004-08-04 07:27:52 +02:00
|
|
|
|
{
|
2006-07-20 18:02:57 +02:00
|
|
|
|
/* If the specialization doesn't specify visibility, use the
|
|
|
|
|
visibility from the template. */
|
2006-06-30 03:15:56 +02:00
|
|
|
|
tree tinfo = (TREE_CODE (decl) == TYPE_DECL
|
|
|
|
|
? TYPE_TEMPLATE_INFO (TREE_TYPE (decl))
|
|
|
|
|
: DECL_TEMPLATE_INFO (decl));
|
|
|
|
|
tree args = TI_ARGS (tinfo);
|
2006-08-21 19:41:18 +02:00
|
|
|
|
|
|
|
|
|
if (args != error_mark_node)
|
2006-06-30 03:15:56 +02:00
|
|
|
|
{
|
2006-08-21 19:41:18 +02:00
|
|
|
|
int depth = TMPL_ARGS_DEPTH (args);
|
|
|
|
|
tree pattern = DECL_TEMPLATE_RESULT (TI_TEMPLATE (tinfo));
|
|
|
|
|
|
|
|
|
|
if (!DECL_VISIBILITY_SPECIFIED (decl))
|
|
|
|
|
{
|
|
|
|
|
DECL_VISIBILITY (decl) = DECL_VISIBILITY (pattern);
|
|
|
|
|
DECL_VISIBILITY_SPECIFIED (decl)
|
|
|
|
|
= DECL_VISIBILITY_SPECIFIED (pattern);
|
|
|
|
|
}
|
2006-06-30 03:15:56 +02:00
|
|
|
|
|
2006-08-21 19:41:18 +02:00
|
|
|
|
/* FIXME should TMPL_ARGS_DEPTH really return 1 for null input? */
|
|
|
|
|
if (args && depth > template_class_depth (class_type))
|
|
|
|
|
/* Limit visibility based on its template arguments. */
|
|
|
|
|
constrain_visibility_for_template (decl, args);
|
|
|
|
|
}
|
2006-06-06 13:44:09 +02:00
|
|
|
|
}
|
2006-07-20 18:02:57 +02:00
|
|
|
|
|
2006-06-30 03:15:56 +02:00
|
|
|
|
if (class_type)
|
|
|
|
|
determine_visibility_from_class (decl, class_type);
|
|
|
|
|
|
|
|
|
|
if (decl_anon_ns_mem_p (decl))
|
|
|
|
|
/* Names in an anonymous namespace get internal linkage.
|
|
|
|
|
This might change once we implement export. */
|
2006-07-20 18:02:57 +02:00
|
|
|
|
constrain_visibility (decl, VISIBILITY_ANON);
|
2006-07-21 23:00:20 +02:00
|
|
|
|
else if (TREE_CODE (decl) != TYPE_DECL)
|
|
|
|
|
{
|
|
|
|
|
/* Propagate anonymity from type to decl. */
|
|
|
|
|
int tvis = type_visibility (TREE_TYPE (decl));
|
2007-06-14 23:04:10 +02:00
|
|
|
|
if (tvis == VISIBILITY_ANON
|
|
|
|
|
|| ! DECL_VISIBILITY_SPECIFIED (decl))
|
2006-07-21 23:00:20 +02:00
|
|
|
|
constrain_visibility (decl, tvis);
|
|
|
|
|
}
|
2009-09-18 23:25:18 +02:00
|
|
|
|
else if (no_linkage_check (TREE_TYPE (decl), /*relaxed_p=*/true))
|
|
|
|
|
/* DR 757: A type without linkage shall not be used as the type of a
|
|
|
|
|
variable or function with linkage, unless
|
|
|
|
|
o the variable or function has extern "C" linkage (7.5 [dcl.link]), or
|
|
|
|
|
o the variable or function is not used (3.2 [basic.def.odr]) or is
|
|
|
|
|
defined in the same translation unit.
|
|
|
|
|
|
|
|
|
|
Since non-extern "C" decls need to be defined in the same
|
|
|
|
|
translation unit, we can make the type internal. */
|
|
|
|
|
constrain_visibility (decl, VISIBILITY_ANON);
|
2009-02-19 22:15:12 +01:00
|
|
|
|
|
|
|
|
|
/* If visibility changed and DECL already has DECL_RTL, ensure
|
|
|
|
|
symbol flags are updated. */
|
|
|
|
|
if ((DECL_VISIBILITY (decl) != orig_visibility
|
|
|
|
|
|| DECL_VISIBILITY_SPECIFIED (decl) != orig_visibility_specified)
|
|
|
|
|
&& ((TREE_CODE (decl) == VAR_DECL && TREE_STATIC (decl))
|
|
|
|
|
|| TREE_CODE (decl) == FUNCTION_DECL)
|
|
|
|
|
&& DECL_RTL_SET_P (decl))
|
|
|
|
|
make_decl_rtl (decl);
|
2006-03-21 04:19:06 +01:00
|
|
|
|
}
|
|
|
|
|
|
2006-06-30 03:15:56 +02:00
|
|
|
|
/* By default, static data members and function members receive
|
|
|
|
|
the visibility of their containing class. */
|
|
|
|
|
|
2006-03-21 04:19:06 +01:00
|
|
|
|
static void
|
|
|
|
|
determine_visibility_from_class (tree decl, tree class_type)
|
|
|
|
|
{
|
2007-06-23 21:17:04 +02:00
|
|
|
|
if (DECL_VISIBILITY_SPECIFIED (decl))
|
|
|
|
|
return;
|
|
|
|
|
|
2006-06-30 03:15:56 +02:00
|
|
|
|
if (visibility_options.inlines_hidden
|
|
|
|
|
/* Don't do this for inline templates; specializations might not be
|
|
|
|
|
inline, and we don't want them to inherit the hidden
|
|
|
|
|
visibility. We'll set it here for all inline instantiations. */
|
|
|
|
|
&& !processing_template_decl
|
|
|
|
|
&& TREE_CODE (decl) == FUNCTION_DECL
|
2006-07-21 22:39:19 +02:00
|
|
|
|
&& DECL_DECLARED_INLINE_P (decl)
|
|
|
|
|
&& (! DECL_LANG_SPECIFIC (decl)
|
|
|
|
|
|| ! DECL_EXPLICIT_INSTANTIATION (decl)))
|
2006-06-30 03:15:56 +02:00
|
|
|
|
DECL_VISIBILITY (decl) = VISIBILITY_HIDDEN;
|
2007-06-23 21:17:04 +02:00
|
|
|
|
else
|
2006-07-20 18:02:57 +02:00
|
|
|
|
{
|
|
|
|
|
/* Default to the class visibility. */
|
|
|
|
|
DECL_VISIBILITY (decl) = CLASSTYPE_VISIBILITY (class_type);
|
|
|
|
|
DECL_VISIBILITY_SPECIFIED (decl)
|
|
|
|
|
= CLASSTYPE_VISIBILITY_SPECIFIED (class_type);
|
|
|
|
|
}
|
2006-06-30 03:15:56 +02:00
|
|
|
|
|
|
|
|
|
/* Give the target a chance to override the visibility associated
|
|
|
|
|
with DECL. */
|
|
|
|
|
if (TREE_CODE (decl) == VAR_DECL
|
|
|
|
|
&& (DECL_TINFO_P (decl)
|
|
|
|
|
|| (DECL_VTABLE_OR_VTT_P (decl)
|
|
|
|
|
/* Construction virtual tables are not exported because
|
|
|
|
|
they cannot be referred to from other object files;
|
|
|
|
|
their name is not standardized by the ABI. */
|
|
|
|
|
&& !DECL_CONSTRUCTION_VTABLE_P (decl)))
|
|
|
|
|
&& TREE_PUBLIC (decl)
|
|
|
|
|
&& !DECL_REALLY_EXTERN (decl)
|
2006-07-20 18:02:57 +02:00
|
|
|
|
&& !CLASSTYPE_VISIBILITY_SPECIFIED (class_type))
|
2006-06-30 03:15:56 +02:00
|
|
|
|
targetm.cxx.determine_class_data_visibility (decl);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Constrain the visibility of a class TYPE based on the visibility of its
|
|
|
|
|
field types. Warn if any fields require lesser visibility. */
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
|
constrain_class_visibility (tree type)
|
|
|
|
|
{
|
2006-07-20 18:02:57 +02:00
|
|
|
|
tree binfo;
|
2006-06-30 03:15:56 +02:00
|
|
|
|
tree t;
|
|
|
|
|
int i;
|
|
|
|
|
|
2006-07-20 18:02:57 +02:00
|
|
|
|
int vis = type_visibility (type);
|
|
|
|
|
|
2006-07-21 23:00:20 +02:00
|
|
|
|
if (vis == VISIBILITY_ANON
|
|
|
|
|
|| DECL_IN_SYSTEM_HEADER (TYPE_MAIN_DECL (type)))
|
2006-07-20 18:02:57 +02:00
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
/* Don't warn about visibility if the class has explicit visibility. */
|
|
|
|
|
if (CLASSTYPE_VISIBILITY_SPECIFIED (type))
|
|
|
|
|
vis = VISIBILITY_INTERNAL;
|
|
|
|
|
|
2010-07-15 16:31:28 +02:00
|
|
|
|
for (t = TYPE_FIELDS (type); t; t = DECL_CHAIN (t))
|
2006-07-20 18:02:57 +02:00
|
|
|
|
if (TREE_CODE (t) == FIELD_DECL && TREE_TYPE (t) != error_mark_node)
|
|
|
|
|
{
|
2007-05-03 01:11:13 +02:00
|
|
|
|
tree ftype = strip_pointer_or_array_types (TREE_TYPE (t));
|
2006-07-21 23:00:20 +02:00
|
|
|
|
int subvis = type_visibility (ftype);
|
2006-07-20 18:02:57 +02:00
|
|
|
|
|
|
|
|
|
if (subvis == VISIBILITY_ANON)
|
2007-04-16 18:49:02 +02:00
|
|
|
|
{
|
2007-08-22 19:23:37 +02:00
|
|
|
|
if (!in_main_input_context ())
|
2007-04-16 18:49:02 +02:00
|
|
|
|
warning (0, "\
|
2006-07-20 18:02:57 +02:00
|
|
|
|
%qT has a field %qD whose type uses the anonymous namespace",
|
2007-04-16 18:49:02 +02:00
|
|
|
|
type, t);
|
|
|
|
|
}
|
cp-tree.h (IS_AGGR_TYPE): Rename to MAYBE_CLASS_TYPE_P.
2008-03-21 Paolo Carlini <pcarlini@suse.de>
* cp-tree.h (IS_AGGR_TYPE): Rename to MAYBE_CLASS_TYPE_P.
(SET_IS_AGGR_TYPE): Rename to SET_CLASS_TYPE_P.
(IS_AGGR_TYPE_CODE): Rename to RECORD_OR_UNION_CODE_P.
(PROMOTES_TO_AGGR_TYPE): Remove.
(CLASS_TYPE_P, TYPE_NON_AGGREGATE_CLASS): Adjust.
* typeck.c (unary_complex_lvalue, build_modify_expr,
convert_for_initialization): Adjust.
* init.c (is_aggr_type): Remove.
(is_class_type): Add.
(build_offset_ref, build_new_1, build_vec_delete_1, build_vec_init,
build_delete): Adjust.
* lex.c (make_aggr_type): Remove.
(make_class_type): Add.
(cxx_make_type): Adjust.
* class.c (finish_struct_1, fixed_type_or_null, is_empty_class):
Adjust.
* decl.c (build_typename_type, make_typename_type,
make_unbound_class_template, cxx_init_decl_processing,
check_tag_decl, groktypename, start_decl_1, layout_var_decl,
check_initializer, cp_finish_decl, build_ptrmemfunc_type, grokparms,
grok_op_properties, xref_tag, check_function_type): Adjust.
* call.c (check_dtor_name, standard_conversion, implicit_conversion,
add_builtin_candidate, add_builtin_candidates,
build_user_type_conversion_1, convert_like_real, build_cxx_call,
is_subseq, compare_ics): Adjust.
* method.c (use_thunk): Adjust.
* rtti.c (build_dynamic_cast_1, create_pseudo_type_info,
create_tinfo_types): Adjust.
* cvt.c (cp_convert_to_pointer, convert_to_pointer_force,
build_up_reference, convert_to_reference, convert_from_reference,
ocp_convert, build_expr_type_conversion): Adjust.
* tree.c (bind_template_template_parm, error_type): Adjust.
* dump.c (cp_dump_tree): Adjust.
* search.c (lookup_member): Adjust.
* friend.c (make_friend_class, do_friend): Adjust.
* typeck2.c (store_init_value, process_init_constructor_array,
process_init_constructor_record, build_x_arrow, build_m_component_ref,
build_functional_cast): Adjust.
* pt.c (finish_member_template_decl, process_template_parm,
lookup_template_class, tsubst_function_type, tsubst,
tsubst_copy_and_build, get_template_base, bt_instantiate_type_proc):
Adjust.
* semantics.c (begin_class_definition, finish_base_specifier,
finish_typeof, cxx_omp_predetermined_sharing, finish_decltype_type):
Adjust.
* name-lookup.c (constructor_name_p, push_overloaded_decl,
do_class_using_decl, lookup_qualified_name,
maybe_process_template_type_declaration): Adjust.
* decl2.c (grok_array_decl, check_member_template,
constrain_class_visibility): Adjust.
* parser.c (cp_parser_class_name): Adjust.
From-SVN: r133434
2008-03-21 19:56:51 +01:00
|
|
|
|
else if (MAYBE_CLASS_TYPE_P (ftype)
|
2006-07-21 23:00:20 +02:00
|
|
|
|
&& vis < VISIBILITY_HIDDEN
|
2006-07-20 18:02:57 +02:00
|
|
|
|
&& subvis >= VISIBILITY_HIDDEN)
|
|
|
|
|
warning (OPT_Wattributes, "\
|
2006-06-30 03:15:56 +02:00
|
|
|
|
%qT declared with greater visibility than the type of its field %qD",
|
2006-07-20 18:02:57 +02:00
|
|
|
|
type, t);
|
|
|
|
|
}
|
2006-06-30 03:15:56 +02:00
|
|
|
|
|
2006-07-20 18:02:57 +02:00
|
|
|
|
binfo = TYPE_BINFO (type);
|
2006-06-30 03:15:56 +02:00
|
|
|
|
for (i = 0; BINFO_BASE_ITERATE (binfo, i, t); ++i)
|
2006-07-20 18:02:57 +02:00
|
|
|
|
{
|
|
|
|
|
int subvis = type_visibility (TREE_TYPE (t));
|
|
|
|
|
|
|
|
|
|
if (subvis == VISIBILITY_ANON)
|
2007-04-16 18:49:02 +02:00
|
|
|
|
{
|
2007-08-22 19:23:37 +02:00
|
|
|
|
if (!in_main_input_context())
|
2007-04-16 18:49:02 +02:00
|
|
|
|
warning (0, "\
|
2006-07-20 18:02:57 +02:00
|
|
|
|
%qT has a base %qT whose type uses the anonymous namespace",
|
2007-04-16 18:49:02 +02:00
|
|
|
|
type, TREE_TYPE (t));
|
|
|
|
|
}
|
2006-07-20 18:02:57 +02:00
|
|
|
|
else if (vis < VISIBILITY_HIDDEN
|
|
|
|
|
&& subvis >= VISIBILITY_HIDDEN)
|
|
|
|
|
warning (OPT_Wattributes, "\
|
2006-06-30 03:15:56 +02:00
|
|
|
|
%qT declared with greater visibility than its base %qT",
|
2006-07-20 18:02:57 +02:00
|
|
|
|
type, TREE_TYPE (t));
|
|
|
|
|
}
|
2004-08-04 07:27:52 +02:00
|
|
|
|
}
|
|
|
|
|
|
2004-07-29 19:59:31 +02:00
|
|
|
|
/* DECL is a FUNCTION_DECL or VAR_DECL. If the object file linkage
|
|
|
|
|
for DECL has not already been determined, do so now by setting
|
|
|
|
|
DECL_EXTERNAL, DECL_COMDAT and other related flags. Until this
|
|
|
|
|
function is called entities with vague linkage whose definitions
|
|
|
|
|
are available must have TREE_PUBLIC set.
|
|
|
|
|
|
|
|
|
|
If this function decides to place DECL in COMDAT, it will set
|
|
|
|
|
appropriate flags -- but will not clear DECL_EXTERNAL. It is up to
|
|
|
|
|
the caller to decide whether or not to clear DECL_EXTERNAL. Some
|
|
|
|
|
callers defer that decision until it is clear that DECL is actually
|
|
|
|
|
required. */
|
1994-08-18 22:50:43 +02:00
|
|
|
|
|
|
|
|
|
void
|
Remove traditional C constructs 4/n.
* decl2.c (grok_method_quals, warn_if_unknown_interface,
grok_x_components, cp_build_parm_decl, build_artificial_parm,
maybe_retrofit_in_chrg, grokclassfn, grok_array_decl,
delete_sanity, check_member_template, check_java_method,
check_classfn, finish_static_data_member_decl, grokfield,
grokbitfield, grokoptypename, grok_function_init,
cplus_decl_attributes, constructor_name, defer_fn,
build_anon_union_vars, finish_anon_union, coerce_new_type,
coerce_delete_type, comdat_linkage, maybe_make_one_only,
key_method, import_export_vtable, import_export_class,
output_vtable_inherit, import_export_decl, import_export_tinfo,
build_cleanup, get_guard, get_guard_bits, get_guard_cond,
set_guard, start_objects, finish_objects,
start_static_storage_duration_function,
finish_static_storage_duration_function, get_priority_info,
start_static_initialization_or_destruction,
finish_static_initialization_or_destruction,
do_static_initialization, do_static_destruction,
prune_vars_needing_no_initialization, write_out_vars,
reparse_decl_as_expr, finish_decl_parsing, namespace_ancestor,
add_using_namespace, merge_functions, ambiguous_decl,
lookup_using_namespace, lookup_using_namespace,
qualified_lookup_using_namespace, set_decl_namespace,
decl_namespace, current_decl_namespace, push_decl_namespace,
pop_decl_namespace, push_scope, pop_scope, add_function,
arg_assoc_namespace, arg_assoc_template_arg, arg_assoc,
lookup_arg_dependent, do_namespace_alias,
validate_nonmember_using_decl, do_nonmember_using_decl,
do_toplevel_using_decl, do_local_using_decl,
do_class_using_decl, do_using_directive, check_default_args,
mark_used, handle_class_head): Use C90 prototypings. Use booleans.
* parser.c (cp_parser_class_head): Use booleanss.
* decl.c (walk_globals, walk_vtables): Likewise.
* cp-tree.h (walk_globals_pred, walk_globals_fn, walk_vtables,
walk_globals): Change return type from 'int' to 'bool'.
* rtti.c (init_rtti_processing, build_headof, throw_bad_cast
throw_bad_typeid, get_tinfo_decl_dynamic, typeid_ok_p,
build_typeid, tinfo_name, get_tinfo_decl, get_tinfo_ptr,
get_typeid, ifnonnull, build_dynamic_cast_1, build_dynamic_cast,
qualifier_flags, tinfo_base_init, generic_initializer,
ptr_initializer, dfs_class_hint_mark, ptm_initializer,
dfs_class_hint_unmark, class_hint_flags, class_initializer,
typeinfo_in_lib_p, get_pseudo_ti_init, create_pseudo_type_info,
get_pseudo_ti_desc, create_tinfo_types, emit_support_tinfos,
unemitted_tinfo_decl_p, emit_tinfo_decl): Likewise.
* repo.c (repo_compile_flags, repo_template_declared,
repo_template_defined, repo_class_defined, repo_get_id,
repo_template_used, repo_vtable_used, repo_inline_used,
repo_tinfo_used, repo_template_instantiated, extract_string,
open_repo_file, afgets, init_repo, reopen_repo_file_for_write,
finish_repo): Likewise.
* ptree.c (cxx_print_decl, cxx_print_type, cxx_print_identifier,
cxx_print_xnode): Likewise..
* cp-lang.c (ok_to_generate_alias_set_for_type, cxx_get_alias_set,
cxx_warn_unused_global_decl, cp_expr_size): Likewise.
* cxxfilt.c (demangle_it, print_demangler_list, usage,
standard_symbol_characters, hp_symbol_characters, main, fatal):
Likewise.
(strip_underscore): Change type from 'int' to 'bool'.
(main): Use boolean constants.
From-SVN: r60601
2002-12-29 15:53:05 +01:00
|
|
|
|
import_export_decl (tree decl)
|
1994-08-18 22:50:43 +02:00
|
|
|
|
{
|
2004-07-29 19:59:31 +02:00
|
|
|
|
int emit_p;
|
|
|
|
|
bool comdat_p;
|
|
|
|
|
bool import_p;
|
2005-04-12 08:33:48 +02:00
|
|
|
|
tree class_type = NULL_TREE;
|
2004-07-29 19:59:31 +02:00
|
|
|
|
|
1994-11-29 01:59:16 +01:00
|
|
|
|
if (DECL_INTERFACE_KNOWN (decl))
|
1994-08-18 22:50:43 +02:00
|
|
|
|
return;
|
|
|
|
|
|
2004-07-29 19:59:31 +02:00
|
|
|
|
/* We cannot determine what linkage to give to an entity with vague
|
|
|
|
|
linkage until the end of the file. For example, a virtual table
|
|
|
|
|
for a class will be defined if and only if the key method is
|
|
|
|
|
defined in this translation unit. As a further example, consider
|
|
|
|
|
that when compiling a translation unit that uses PCH file with
|
|
|
|
|
"-frepo" it would be incorrect to make decisions about what
|
|
|
|
|
entities to emit when building the PCH; those decisions must be
|
|
|
|
|
delayed until the repository information has been processed. */
|
call.c (validate_conversion_obstack): Replace my_friendly_assert with gcc_assert or gcc_unreachable.
* call.c (validate_conversion_obstack): Replace
my_friendly_assert with gcc_assert or gcc_unreachable.
(direct_reference_binding, merge_conversion_sequences,
build_user_type_conversion_1, perform_overload_resolution,
build_op_delete_call, enforce_access, call_builtin_trap,
build_over_call, build_special_member_call, build_new_method_call,
initialize_reference): Likewise.
* class.c (build_base_path, build_primary_vtable, alter_access,
check_bases, update_vtable_entry_for_fn, layout_empty_base,
clone_function_decl, adjust_clone_args,
type_requires_array_cookie, include_empty_classes,
finish_struct_1, resolve_address_of_overloaded_function,
instantiate_type, get_vtbl_decl_for_binfo, build_vtt_inits,
dfs_build_secondary_vptr_vtt_inits, build_ctor_vtbl_group,
accumulate_vtbl_inits, build_vtbl_initializer,
build_vbase_offset_vtbl_entries, build_rtti_vtbl_entries): Likewise.
* cvt.c (build_up_reference, convert_to_reference): Likewise.
* decl.c (poplevel, duplicate_decls, make_typename_type,
cxx_init_decl_processing, reshape_init, check_initializer,
make_rtl_for_nonlocal_decl, initialize_local_var, cp_finish_decl,
expand_static_init, grokfndecl, grokvardecl, build_ptrmem_type,
grokdeclarator, copy_fn_p, grok_op_properties, xref_tag,
xref_basetypes, start_preparsed_function, save_function_data,
finish_function, finish_method, maybe_register_incomplete_var,
complete_vars): Likewise.
* decl2.c (grok_array_decl, check_member_template,
check_classfn, finish_static_data_member_decl, coerce_new_type,
coerce_delete_type, import_export_class, decl_needed_p,
determine_visibility, import_export_decl, build_cleanup,
start_static_initialization_or_destructi, do_static_destruction,
prune_vars_needing_no_initialization,
build_offset_ref_call_from_tree): Likewise.
* error.c (dump_decl, dump_expr): Likewise.
* init.c (finish_init_stmts, build_zero_init,
expand_virtual_init, expand_default_init, expand_aggr_init_1,
build_offset_ref, build_new_1, build_delete, build_vbase_delete):
Likewise.
* mangle.c (write_method_parms, write_template_args,
write_expression, write_template_arg): Likewise.
* method.c (make_thunk, finish_thunk, use_thunk): Likewise.
* name-lookup.c (pop_binding, begin_scope, leave_scope,
resume_scope, push_using_decl, validate_nonmember_using_decl,
is_ancestor, poplevel_class, set_inherited_value_binding_p,
push_class_level_binding, do_class_using_decl, push_namespace,
pop_namespace, add_using_namespace, ambiguous_decl,
lookup_namespace_name, lookup_type_current_level,
maybe_process_template_type_declaration): Likewise.
* parser.c (cp_lexer_peek_nth_token,
cp_parser_parse_and_diagnose_invalid_typ,
cp_parser_translation_unit, cp_parser_template_id,
cp_parser_lookup_name, cp_parser_late_parsing_for_member): Likewise.
* pt.c (push_access_scope, finish_member_template_decl,
push_inline_template_parms_recursive, add_outermost_template_args,
get_innermost_template_args, begin_explicit_instantiation,
end_explicit_instantiation, retrieve_specialization,
is_specialization_of, is_specialization_of_friend,
register_specialization, check_explicit_specialization,
comp_template_parms, process_template_parm,
process_partial_specialization, convert_nontype_argument,
coerce_template_template_parms, coerce_template_parms,
mangle_class_name_for_template, lookup_template_function,
lookup_template_class, instantiate_class_template, tsubst_decl,
tsubst_function_type, tsubst, tsubst_qualified_id, tsubst_copy,
instantiate_template, fn_type_unification, type_unification_real,
get_template_base, regenerate_decl_from_template,
template_for_substitution, instantiate_decl,
get_mostly_instantiated_function_type, dependent_scope_ref_p,
value_dependent_expression_p, resolve_typename_type): Likewise.
* repo.c (repo_emit_p): Likewise.
* rtti.c (build_headof, get_tinfo_decl, get_pseudo_ti_init,
create_tinfo_types, emit_tinfo_decl): Likewise.
* search.c (lookup_base_r, lookup_base, lookup_field_1,
dfs_access_in_type, build_baselink, lookup_member,
adjust_result_of_qualified_name_lookup, copied_binfo): Likewise.
* semantics.c (perform_or_defer_access_check,
finish_non_static_data_member, finish_stmt_expr_expr,
finish_stmt_expr, finish_call_expr, finish_pseudo_destructor_expr,
finish_template_template_parm, finish_member_declaration,
emit_associated_thunks): Likewise.
* tree.c (build_target_expr_with_type, force_target_expr,
copy_binfo, get_first_fn, cp_tree_equal): Likewise.
* typeck.c (type_after_usual_arithmetic_conversions, comptypes,
cxx_sizeof_or_alignof_type, perform_integral_promotions,
build_class_member_access_expr, finish_class_member_access_expr,
build_ptrmemfunc_access_expr, build_unary_op,
unary_complex_lvalue, cxx_mark_addressable, build_modify_expr,
build_ptrmemfunc, expand_ptrmemfunc_cst, check_return_expr
* typeck2.c (complete_type_check_abstract,
abstract_virtuals_error, process_init_constructor,
add_exception_specifier): Likewise.
From-SVN: r86669
2004-08-27 19:59:33 +02:00
|
|
|
|
gcc_assert (at_eof);
|
2004-07-29 19:59:31 +02:00
|
|
|
|
/* Object file linkage for explicit instantiations is handled in
|
|
|
|
|
mark_decl_instantiated. For static variables in functions with
|
|
|
|
|
vague linkage, maybe_commonize_var is used.
|
|
|
|
|
|
|
|
|
|
Therefore, the only declarations that should be provided to this
|
2004-11-12 22:47:13 +01:00
|
|
|
|
function are those with external linkage that are:
|
2004-07-29 19:59:31 +02:00
|
|
|
|
|
|
|
|
|
* implicit instantiations of function templates
|
|
|
|
|
|
|
|
|
|
* inline function
|
|
|
|
|
|
|
|
|
|
* implicit instantiations of static data members of class
|
|
|
|
|
templates
|
|
|
|
|
|
|
|
|
|
* virtual tables
|
|
|
|
|
|
|
|
|
|
* typeinfo objects
|
|
|
|
|
|
|
|
|
|
Furthermore, all entities that reach this point must have a
|
|
|
|
|
definition available in this translation unit.
|
|
|
|
|
|
|
|
|
|
The following assertions check these conditions. */
|
call.c (validate_conversion_obstack): Replace my_friendly_assert with gcc_assert or gcc_unreachable.
* call.c (validate_conversion_obstack): Replace
my_friendly_assert with gcc_assert or gcc_unreachable.
(direct_reference_binding, merge_conversion_sequences,
build_user_type_conversion_1, perform_overload_resolution,
build_op_delete_call, enforce_access, call_builtin_trap,
build_over_call, build_special_member_call, build_new_method_call,
initialize_reference): Likewise.
* class.c (build_base_path, build_primary_vtable, alter_access,
check_bases, update_vtable_entry_for_fn, layout_empty_base,
clone_function_decl, adjust_clone_args,
type_requires_array_cookie, include_empty_classes,
finish_struct_1, resolve_address_of_overloaded_function,
instantiate_type, get_vtbl_decl_for_binfo, build_vtt_inits,
dfs_build_secondary_vptr_vtt_inits, build_ctor_vtbl_group,
accumulate_vtbl_inits, build_vtbl_initializer,
build_vbase_offset_vtbl_entries, build_rtti_vtbl_entries): Likewise.
* cvt.c (build_up_reference, convert_to_reference): Likewise.
* decl.c (poplevel, duplicate_decls, make_typename_type,
cxx_init_decl_processing, reshape_init, check_initializer,
make_rtl_for_nonlocal_decl, initialize_local_var, cp_finish_decl,
expand_static_init, grokfndecl, grokvardecl, build_ptrmem_type,
grokdeclarator, copy_fn_p, grok_op_properties, xref_tag,
xref_basetypes, start_preparsed_function, save_function_data,
finish_function, finish_method, maybe_register_incomplete_var,
complete_vars): Likewise.
* decl2.c (grok_array_decl, check_member_template,
check_classfn, finish_static_data_member_decl, coerce_new_type,
coerce_delete_type, import_export_class, decl_needed_p,
determine_visibility, import_export_decl, build_cleanup,
start_static_initialization_or_destructi, do_static_destruction,
prune_vars_needing_no_initialization,
build_offset_ref_call_from_tree): Likewise.
* error.c (dump_decl, dump_expr): Likewise.
* init.c (finish_init_stmts, build_zero_init,
expand_virtual_init, expand_default_init, expand_aggr_init_1,
build_offset_ref, build_new_1, build_delete, build_vbase_delete):
Likewise.
* mangle.c (write_method_parms, write_template_args,
write_expression, write_template_arg): Likewise.
* method.c (make_thunk, finish_thunk, use_thunk): Likewise.
* name-lookup.c (pop_binding, begin_scope, leave_scope,
resume_scope, push_using_decl, validate_nonmember_using_decl,
is_ancestor, poplevel_class, set_inherited_value_binding_p,
push_class_level_binding, do_class_using_decl, push_namespace,
pop_namespace, add_using_namespace, ambiguous_decl,
lookup_namespace_name, lookup_type_current_level,
maybe_process_template_type_declaration): Likewise.
* parser.c (cp_lexer_peek_nth_token,
cp_parser_parse_and_diagnose_invalid_typ,
cp_parser_translation_unit, cp_parser_template_id,
cp_parser_lookup_name, cp_parser_late_parsing_for_member): Likewise.
* pt.c (push_access_scope, finish_member_template_decl,
push_inline_template_parms_recursive, add_outermost_template_args,
get_innermost_template_args, begin_explicit_instantiation,
end_explicit_instantiation, retrieve_specialization,
is_specialization_of, is_specialization_of_friend,
register_specialization, check_explicit_specialization,
comp_template_parms, process_template_parm,
process_partial_specialization, convert_nontype_argument,
coerce_template_template_parms, coerce_template_parms,
mangle_class_name_for_template, lookup_template_function,
lookup_template_class, instantiate_class_template, tsubst_decl,
tsubst_function_type, tsubst, tsubst_qualified_id, tsubst_copy,
instantiate_template, fn_type_unification, type_unification_real,
get_template_base, regenerate_decl_from_template,
template_for_substitution, instantiate_decl,
get_mostly_instantiated_function_type, dependent_scope_ref_p,
value_dependent_expression_p, resolve_typename_type): Likewise.
* repo.c (repo_emit_p): Likewise.
* rtti.c (build_headof, get_tinfo_decl, get_pseudo_ti_init,
create_tinfo_types, emit_tinfo_decl): Likewise.
* search.c (lookup_base_r, lookup_base, lookup_field_1,
dfs_access_in_type, build_baselink, lookup_member,
adjust_result_of_qualified_name_lookup, copied_binfo): Likewise.
* semantics.c (perform_or_defer_access_check,
finish_non_static_data_member, finish_stmt_expr_expr,
finish_stmt_expr, finish_call_expr, finish_pseudo_destructor_expr,
finish_template_template_parm, finish_member_declaration,
emit_associated_thunks): Likewise.
* tree.c (build_target_expr_with_type, force_target_expr,
copy_binfo, get_first_fn, cp_tree_equal): Likewise.
* typeck.c (type_after_usual_arithmetic_conversions, comptypes,
cxx_sizeof_or_alignof_type, perform_integral_promotions,
build_class_member_access_expr, finish_class_member_access_expr,
build_ptrmemfunc_access_expr, build_unary_op,
unary_complex_lvalue, cxx_mark_addressable, build_modify_expr,
build_ptrmemfunc, expand_ptrmemfunc_cst, check_return_expr
* typeck2.c (complete_type_check_abstract,
abstract_virtuals_error, process_init_constructor,
add_exception_specifier): Likewise.
From-SVN: r86669
2004-08-27 19:59:33 +02:00
|
|
|
|
gcc_assert (TREE_CODE (decl) == FUNCTION_DECL
|
|
|
|
|
|| TREE_CODE (decl) == VAR_DECL);
|
2004-07-29 19:59:31 +02:00
|
|
|
|
/* Any code that creates entities with TREE_PUBLIC cleared should
|
|
|
|
|
also set DECL_INTERFACE_KNOWN. */
|
call.c (validate_conversion_obstack): Replace my_friendly_assert with gcc_assert or gcc_unreachable.
* call.c (validate_conversion_obstack): Replace
my_friendly_assert with gcc_assert or gcc_unreachable.
(direct_reference_binding, merge_conversion_sequences,
build_user_type_conversion_1, perform_overload_resolution,
build_op_delete_call, enforce_access, call_builtin_trap,
build_over_call, build_special_member_call, build_new_method_call,
initialize_reference): Likewise.
* class.c (build_base_path, build_primary_vtable, alter_access,
check_bases, update_vtable_entry_for_fn, layout_empty_base,
clone_function_decl, adjust_clone_args,
type_requires_array_cookie, include_empty_classes,
finish_struct_1, resolve_address_of_overloaded_function,
instantiate_type, get_vtbl_decl_for_binfo, build_vtt_inits,
dfs_build_secondary_vptr_vtt_inits, build_ctor_vtbl_group,
accumulate_vtbl_inits, build_vtbl_initializer,
build_vbase_offset_vtbl_entries, build_rtti_vtbl_entries): Likewise.
* cvt.c (build_up_reference, convert_to_reference): Likewise.
* decl.c (poplevel, duplicate_decls, make_typename_type,
cxx_init_decl_processing, reshape_init, check_initializer,
make_rtl_for_nonlocal_decl, initialize_local_var, cp_finish_decl,
expand_static_init, grokfndecl, grokvardecl, build_ptrmem_type,
grokdeclarator, copy_fn_p, grok_op_properties, xref_tag,
xref_basetypes, start_preparsed_function, save_function_data,
finish_function, finish_method, maybe_register_incomplete_var,
complete_vars): Likewise.
* decl2.c (grok_array_decl, check_member_template,
check_classfn, finish_static_data_member_decl, coerce_new_type,
coerce_delete_type, import_export_class, decl_needed_p,
determine_visibility, import_export_decl, build_cleanup,
start_static_initialization_or_destructi, do_static_destruction,
prune_vars_needing_no_initialization,
build_offset_ref_call_from_tree): Likewise.
* error.c (dump_decl, dump_expr): Likewise.
* init.c (finish_init_stmts, build_zero_init,
expand_virtual_init, expand_default_init, expand_aggr_init_1,
build_offset_ref, build_new_1, build_delete, build_vbase_delete):
Likewise.
* mangle.c (write_method_parms, write_template_args,
write_expression, write_template_arg): Likewise.
* method.c (make_thunk, finish_thunk, use_thunk): Likewise.
* name-lookup.c (pop_binding, begin_scope, leave_scope,
resume_scope, push_using_decl, validate_nonmember_using_decl,
is_ancestor, poplevel_class, set_inherited_value_binding_p,
push_class_level_binding, do_class_using_decl, push_namespace,
pop_namespace, add_using_namespace, ambiguous_decl,
lookup_namespace_name, lookup_type_current_level,
maybe_process_template_type_declaration): Likewise.
* parser.c (cp_lexer_peek_nth_token,
cp_parser_parse_and_diagnose_invalid_typ,
cp_parser_translation_unit, cp_parser_template_id,
cp_parser_lookup_name, cp_parser_late_parsing_for_member): Likewise.
* pt.c (push_access_scope, finish_member_template_decl,
push_inline_template_parms_recursive, add_outermost_template_args,
get_innermost_template_args, begin_explicit_instantiation,
end_explicit_instantiation, retrieve_specialization,
is_specialization_of, is_specialization_of_friend,
register_specialization, check_explicit_specialization,
comp_template_parms, process_template_parm,
process_partial_specialization, convert_nontype_argument,
coerce_template_template_parms, coerce_template_parms,
mangle_class_name_for_template, lookup_template_function,
lookup_template_class, instantiate_class_template, tsubst_decl,
tsubst_function_type, tsubst, tsubst_qualified_id, tsubst_copy,
instantiate_template, fn_type_unification, type_unification_real,
get_template_base, regenerate_decl_from_template,
template_for_substitution, instantiate_decl,
get_mostly_instantiated_function_type, dependent_scope_ref_p,
value_dependent_expression_p, resolve_typename_type): Likewise.
* repo.c (repo_emit_p): Likewise.
* rtti.c (build_headof, get_tinfo_decl, get_pseudo_ti_init,
create_tinfo_types, emit_tinfo_decl): Likewise.
* search.c (lookup_base_r, lookup_base, lookup_field_1,
dfs_access_in_type, build_baselink, lookup_member,
adjust_result_of_qualified_name_lookup, copied_binfo): Likewise.
* semantics.c (perform_or_defer_access_check,
finish_non_static_data_member, finish_stmt_expr_expr,
finish_stmt_expr, finish_call_expr, finish_pseudo_destructor_expr,
finish_template_template_parm, finish_member_declaration,
emit_associated_thunks): Likewise.
* tree.c (build_target_expr_with_type, force_target_expr,
copy_binfo, get_first_fn, cp_tree_equal): Likewise.
* typeck.c (type_after_usual_arithmetic_conversions, comptypes,
cxx_sizeof_or_alignof_type, perform_integral_promotions,
build_class_member_access_expr, finish_class_member_access_expr,
build_ptrmemfunc_access_expr, build_unary_op,
unary_complex_lvalue, cxx_mark_addressable, build_modify_expr,
build_ptrmemfunc, expand_ptrmemfunc_cst, check_return_expr
* typeck2.c (complete_type_check_abstract,
abstract_virtuals_error, process_init_constructor,
add_exception_specifier): Likewise.
From-SVN: r86669
2004-08-27 19:59:33 +02:00
|
|
|
|
gcc_assert (TREE_PUBLIC (decl));
|
2004-07-29 19:59:31 +02:00
|
|
|
|
if (TREE_CODE (decl) == FUNCTION_DECL)
|
call.c (validate_conversion_obstack): Replace my_friendly_assert with gcc_assert or gcc_unreachable.
* call.c (validate_conversion_obstack): Replace
my_friendly_assert with gcc_assert or gcc_unreachable.
(direct_reference_binding, merge_conversion_sequences,
build_user_type_conversion_1, perform_overload_resolution,
build_op_delete_call, enforce_access, call_builtin_trap,
build_over_call, build_special_member_call, build_new_method_call,
initialize_reference): Likewise.
* class.c (build_base_path, build_primary_vtable, alter_access,
check_bases, update_vtable_entry_for_fn, layout_empty_base,
clone_function_decl, adjust_clone_args,
type_requires_array_cookie, include_empty_classes,
finish_struct_1, resolve_address_of_overloaded_function,
instantiate_type, get_vtbl_decl_for_binfo, build_vtt_inits,
dfs_build_secondary_vptr_vtt_inits, build_ctor_vtbl_group,
accumulate_vtbl_inits, build_vtbl_initializer,
build_vbase_offset_vtbl_entries, build_rtti_vtbl_entries): Likewise.
* cvt.c (build_up_reference, convert_to_reference): Likewise.
* decl.c (poplevel, duplicate_decls, make_typename_type,
cxx_init_decl_processing, reshape_init, check_initializer,
make_rtl_for_nonlocal_decl, initialize_local_var, cp_finish_decl,
expand_static_init, grokfndecl, grokvardecl, build_ptrmem_type,
grokdeclarator, copy_fn_p, grok_op_properties, xref_tag,
xref_basetypes, start_preparsed_function, save_function_data,
finish_function, finish_method, maybe_register_incomplete_var,
complete_vars): Likewise.
* decl2.c (grok_array_decl, check_member_template,
check_classfn, finish_static_data_member_decl, coerce_new_type,
coerce_delete_type, import_export_class, decl_needed_p,
determine_visibility, import_export_decl, build_cleanup,
start_static_initialization_or_destructi, do_static_destruction,
prune_vars_needing_no_initialization,
build_offset_ref_call_from_tree): Likewise.
* error.c (dump_decl, dump_expr): Likewise.
* init.c (finish_init_stmts, build_zero_init,
expand_virtual_init, expand_default_init, expand_aggr_init_1,
build_offset_ref, build_new_1, build_delete, build_vbase_delete):
Likewise.
* mangle.c (write_method_parms, write_template_args,
write_expression, write_template_arg): Likewise.
* method.c (make_thunk, finish_thunk, use_thunk): Likewise.
* name-lookup.c (pop_binding, begin_scope, leave_scope,
resume_scope, push_using_decl, validate_nonmember_using_decl,
is_ancestor, poplevel_class, set_inherited_value_binding_p,
push_class_level_binding, do_class_using_decl, push_namespace,
pop_namespace, add_using_namespace, ambiguous_decl,
lookup_namespace_name, lookup_type_current_level,
maybe_process_template_type_declaration): Likewise.
* parser.c (cp_lexer_peek_nth_token,
cp_parser_parse_and_diagnose_invalid_typ,
cp_parser_translation_unit, cp_parser_template_id,
cp_parser_lookup_name, cp_parser_late_parsing_for_member): Likewise.
* pt.c (push_access_scope, finish_member_template_decl,
push_inline_template_parms_recursive, add_outermost_template_args,
get_innermost_template_args, begin_explicit_instantiation,
end_explicit_instantiation, retrieve_specialization,
is_specialization_of, is_specialization_of_friend,
register_specialization, check_explicit_specialization,
comp_template_parms, process_template_parm,
process_partial_specialization, convert_nontype_argument,
coerce_template_template_parms, coerce_template_parms,
mangle_class_name_for_template, lookup_template_function,
lookup_template_class, instantiate_class_template, tsubst_decl,
tsubst_function_type, tsubst, tsubst_qualified_id, tsubst_copy,
instantiate_template, fn_type_unification, type_unification_real,
get_template_base, regenerate_decl_from_template,
template_for_substitution, instantiate_decl,
get_mostly_instantiated_function_type, dependent_scope_ref_p,
value_dependent_expression_p, resolve_typename_type): Likewise.
* repo.c (repo_emit_p): Likewise.
* rtti.c (build_headof, get_tinfo_decl, get_pseudo_ti_init,
create_tinfo_types, emit_tinfo_decl): Likewise.
* search.c (lookup_base_r, lookup_base, lookup_field_1,
dfs_access_in_type, build_baselink, lookup_member,
adjust_result_of_qualified_name_lookup, copied_binfo): Likewise.
* semantics.c (perform_or_defer_access_check,
finish_non_static_data_member, finish_stmt_expr_expr,
finish_stmt_expr, finish_call_expr, finish_pseudo_destructor_expr,
finish_template_template_parm, finish_member_declaration,
emit_associated_thunks): Likewise.
* tree.c (build_target_expr_with_type, force_target_expr,
copy_binfo, get_first_fn, cp_tree_equal): Likewise.
* typeck.c (type_after_usual_arithmetic_conversions, comptypes,
cxx_sizeof_or_alignof_type, perform_integral_promotions,
build_class_member_access_expr, finish_class_member_access_expr,
build_ptrmemfunc_access_expr, build_unary_op,
unary_complex_lvalue, cxx_mark_addressable, build_modify_expr,
build_ptrmemfunc, expand_ptrmemfunc_cst, check_return_expr
* typeck2.c (complete_type_check_abstract,
abstract_virtuals_error, process_init_constructor,
add_exception_specifier): Likewise.
From-SVN: r86669
2004-08-27 19:59:33 +02:00
|
|
|
|
gcc_assert (DECL_IMPLICIT_INSTANTIATION (decl)
|
|
|
|
|
|| DECL_FRIEND_PSEUDO_TEMPLATE_INSTANTIATION (decl)
|
|
|
|
|
|| DECL_DECLARED_INLINE_P (decl));
|
2004-07-29 19:59:31 +02:00
|
|
|
|
else
|
call.c (validate_conversion_obstack): Replace my_friendly_assert with gcc_assert or gcc_unreachable.
* call.c (validate_conversion_obstack): Replace
my_friendly_assert with gcc_assert or gcc_unreachable.
(direct_reference_binding, merge_conversion_sequences,
build_user_type_conversion_1, perform_overload_resolution,
build_op_delete_call, enforce_access, call_builtin_trap,
build_over_call, build_special_member_call, build_new_method_call,
initialize_reference): Likewise.
* class.c (build_base_path, build_primary_vtable, alter_access,
check_bases, update_vtable_entry_for_fn, layout_empty_base,
clone_function_decl, adjust_clone_args,
type_requires_array_cookie, include_empty_classes,
finish_struct_1, resolve_address_of_overloaded_function,
instantiate_type, get_vtbl_decl_for_binfo, build_vtt_inits,
dfs_build_secondary_vptr_vtt_inits, build_ctor_vtbl_group,
accumulate_vtbl_inits, build_vtbl_initializer,
build_vbase_offset_vtbl_entries, build_rtti_vtbl_entries): Likewise.
* cvt.c (build_up_reference, convert_to_reference): Likewise.
* decl.c (poplevel, duplicate_decls, make_typename_type,
cxx_init_decl_processing, reshape_init, check_initializer,
make_rtl_for_nonlocal_decl, initialize_local_var, cp_finish_decl,
expand_static_init, grokfndecl, grokvardecl, build_ptrmem_type,
grokdeclarator, copy_fn_p, grok_op_properties, xref_tag,
xref_basetypes, start_preparsed_function, save_function_data,
finish_function, finish_method, maybe_register_incomplete_var,
complete_vars): Likewise.
* decl2.c (grok_array_decl, check_member_template,
check_classfn, finish_static_data_member_decl, coerce_new_type,
coerce_delete_type, import_export_class, decl_needed_p,
determine_visibility, import_export_decl, build_cleanup,
start_static_initialization_or_destructi, do_static_destruction,
prune_vars_needing_no_initialization,
build_offset_ref_call_from_tree): Likewise.
* error.c (dump_decl, dump_expr): Likewise.
* init.c (finish_init_stmts, build_zero_init,
expand_virtual_init, expand_default_init, expand_aggr_init_1,
build_offset_ref, build_new_1, build_delete, build_vbase_delete):
Likewise.
* mangle.c (write_method_parms, write_template_args,
write_expression, write_template_arg): Likewise.
* method.c (make_thunk, finish_thunk, use_thunk): Likewise.
* name-lookup.c (pop_binding, begin_scope, leave_scope,
resume_scope, push_using_decl, validate_nonmember_using_decl,
is_ancestor, poplevel_class, set_inherited_value_binding_p,
push_class_level_binding, do_class_using_decl, push_namespace,
pop_namespace, add_using_namespace, ambiguous_decl,
lookup_namespace_name, lookup_type_current_level,
maybe_process_template_type_declaration): Likewise.
* parser.c (cp_lexer_peek_nth_token,
cp_parser_parse_and_diagnose_invalid_typ,
cp_parser_translation_unit, cp_parser_template_id,
cp_parser_lookup_name, cp_parser_late_parsing_for_member): Likewise.
* pt.c (push_access_scope, finish_member_template_decl,
push_inline_template_parms_recursive, add_outermost_template_args,
get_innermost_template_args, begin_explicit_instantiation,
end_explicit_instantiation, retrieve_specialization,
is_specialization_of, is_specialization_of_friend,
register_specialization, check_explicit_specialization,
comp_template_parms, process_template_parm,
process_partial_specialization, convert_nontype_argument,
coerce_template_template_parms, coerce_template_parms,
mangle_class_name_for_template, lookup_template_function,
lookup_template_class, instantiate_class_template, tsubst_decl,
tsubst_function_type, tsubst, tsubst_qualified_id, tsubst_copy,
instantiate_template, fn_type_unification, type_unification_real,
get_template_base, regenerate_decl_from_template,
template_for_substitution, instantiate_decl,
get_mostly_instantiated_function_type, dependent_scope_ref_p,
value_dependent_expression_p, resolve_typename_type): Likewise.
* repo.c (repo_emit_p): Likewise.
* rtti.c (build_headof, get_tinfo_decl, get_pseudo_ti_init,
create_tinfo_types, emit_tinfo_decl): Likewise.
* search.c (lookup_base_r, lookup_base, lookup_field_1,
dfs_access_in_type, build_baselink, lookup_member,
adjust_result_of_qualified_name_lookup, copied_binfo): Likewise.
* semantics.c (perform_or_defer_access_check,
finish_non_static_data_member, finish_stmt_expr_expr,
finish_stmt_expr, finish_call_expr, finish_pseudo_destructor_expr,
finish_template_template_parm, finish_member_declaration,
emit_associated_thunks): Likewise.
* tree.c (build_target_expr_with_type, force_target_expr,
copy_binfo, get_first_fn, cp_tree_equal): Likewise.
* typeck.c (type_after_usual_arithmetic_conversions, comptypes,
cxx_sizeof_or_alignof_type, perform_integral_promotions,
build_class_member_access_expr, finish_class_member_access_expr,
build_ptrmemfunc_access_expr, build_unary_op,
unary_complex_lvalue, cxx_mark_addressable, build_modify_expr,
build_ptrmemfunc, expand_ptrmemfunc_cst, check_return_expr
* typeck2.c (complete_type_check_abstract,
abstract_virtuals_error, process_init_constructor,
add_exception_specifier): Likewise.
From-SVN: r86669
2004-08-27 19:59:33 +02:00
|
|
|
|
gcc_assert (DECL_IMPLICIT_INSTANTIATION (decl)
|
|
|
|
|
|| DECL_VTABLE_OR_VTT_P (decl)
|
|
|
|
|
|| DECL_TINFO_P (decl));
|
2004-07-29 19:59:31 +02:00
|
|
|
|
/* Check that a definition of DECL is available in this translation
|
|
|
|
|
unit. */
|
call.c (validate_conversion_obstack): Replace my_friendly_assert with gcc_assert or gcc_unreachable.
* call.c (validate_conversion_obstack): Replace
my_friendly_assert with gcc_assert or gcc_unreachable.
(direct_reference_binding, merge_conversion_sequences,
build_user_type_conversion_1, perform_overload_resolution,
build_op_delete_call, enforce_access, call_builtin_trap,
build_over_call, build_special_member_call, build_new_method_call,
initialize_reference): Likewise.
* class.c (build_base_path, build_primary_vtable, alter_access,
check_bases, update_vtable_entry_for_fn, layout_empty_base,
clone_function_decl, adjust_clone_args,
type_requires_array_cookie, include_empty_classes,
finish_struct_1, resolve_address_of_overloaded_function,
instantiate_type, get_vtbl_decl_for_binfo, build_vtt_inits,
dfs_build_secondary_vptr_vtt_inits, build_ctor_vtbl_group,
accumulate_vtbl_inits, build_vtbl_initializer,
build_vbase_offset_vtbl_entries, build_rtti_vtbl_entries): Likewise.
* cvt.c (build_up_reference, convert_to_reference): Likewise.
* decl.c (poplevel, duplicate_decls, make_typename_type,
cxx_init_decl_processing, reshape_init, check_initializer,
make_rtl_for_nonlocal_decl, initialize_local_var, cp_finish_decl,
expand_static_init, grokfndecl, grokvardecl, build_ptrmem_type,
grokdeclarator, copy_fn_p, grok_op_properties, xref_tag,
xref_basetypes, start_preparsed_function, save_function_data,
finish_function, finish_method, maybe_register_incomplete_var,
complete_vars): Likewise.
* decl2.c (grok_array_decl, check_member_template,
check_classfn, finish_static_data_member_decl, coerce_new_type,
coerce_delete_type, import_export_class, decl_needed_p,
determine_visibility, import_export_decl, build_cleanup,
start_static_initialization_or_destructi, do_static_destruction,
prune_vars_needing_no_initialization,
build_offset_ref_call_from_tree): Likewise.
* error.c (dump_decl, dump_expr): Likewise.
* init.c (finish_init_stmts, build_zero_init,
expand_virtual_init, expand_default_init, expand_aggr_init_1,
build_offset_ref, build_new_1, build_delete, build_vbase_delete):
Likewise.
* mangle.c (write_method_parms, write_template_args,
write_expression, write_template_arg): Likewise.
* method.c (make_thunk, finish_thunk, use_thunk): Likewise.
* name-lookup.c (pop_binding, begin_scope, leave_scope,
resume_scope, push_using_decl, validate_nonmember_using_decl,
is_ancestor, poplevel_class, set_inherited_value_binding_p,
push_class_level_binding, do_class_using_decl, push_namespace,
pop_namespace, add_using_namespace, ambiguous_decl,
lookup_namespace_name, lookup_type_current_level,
maybe_process_template_type_declaration): Likewise.
* parser.c (cp_lexer_peek_nth_token,
cp_parser_parse_and_diagnose_invalid_typ,
cp_parser_translation_unit, cp_parser_template_id,
cp_parser_lookup_name, cp_parser_late_parsing_for_member): Likewise.
* pt.c (push_access_scope, finish_member_template_decl,
push_inline_template_parms_recursive, add_outermost_template_args,
get_innermost_template_args, begin_explicit_instantiation,
end_explicit_instantiation, retrieve_specialization,
is_specialization_of, is_specialization_of_friend,
register_specialization, check_explicit_specialization,
comp_template_parms, process_template_parm,
process_partial_specialization, convert_nontype_argument,
coerce_template_template_parms, coerce_template_parms,
mangle_class_name_for_template, lookup_template_function,
lookup_template_class, instantiate_class_template, tsubst_decl,
tsubst_function_type, tsubst, tsubst_qualified_id, tsubst_copy,
instantiate_template, fn_type_unification, type_unification_real,
get_template_base, regenerate_decl_from_template,
template_for_substitution, instantiate_decl,
get_mostly_instantiated_function_type, dependent_scope_ref_p,
value_dependent_expression_p, resolve_typename_type): Likewise.
* repo.c (repo_emit_p): Likewise.
* rtti.c (build_headof, get_tinfo_decl, get_pseudo_ti_init,
create_tinfo_types, emit_tinfo_decl): Likewise.
* search.c (lookup_base_r, lookup_base, lookup_field_1,
dfs_access_in_type, build_baselink, lookup_member,
adjust_result_of_qualified_name_lookup, copied_binfo): Likewise.
* semantics.c (perform_or_defer_access_check,
finish_non_static_data_member, finish_stmt_expr_expr,
finish_stmt_expr, finish_call_expr, finish_pseudo_destructor_expr,
finish_template_template_parm, finish_member_declaration,
emit_associated_thunks): Likewise.
* tree.c (build_target_expr_with_type, force_target_expr,
copy_binfo, get_first_fn, cp_tree_equal): Likewise.
* typeck.c (type_after_usual_arithmetic_conversions, comptypes,
cxx_sizeof_or_alignof_type, perform_integral_promotions,
build_class_member_access_expr, finish_class_member_access_expr,
build_ptrmemfunc_access_expr, build_unary_op,
unary_complex_lvalue, cxx_mark_addressable, build_modify_expr,
build_ptrmemfunc, expand_ptrmemfunc_cst, check_return_expr
* typeck2.c (complete_type_check_abstract,
abstract_virtuals_error, process_init_constructor,
add_exception_specifier): Likewise.
From-SVN: r86669
2004-08-27 19:59:33 +02:00
|
|
|
|
gcc_assert (!DECL_REALLY_EXTERN (decl));
|
2004-07-29 19:59:31 +02:00
|
|
|
|
|
|
|
|
|
/* Assume that DECL will not have COMDAT linkage. */
|
|
|
|
|
comdat_p = false;
|
|
|
|
|
/* Assume that DECL will not be imported into this translation
|
|
|
|
|
unit. */
|
|
|
|
|
import_p = false;
|
|
|
|
|
|
|
|
|
|
/* See if the repository tells us whether or not to emit DECL in
|
|
|
|
|
this translation unit. */
|
|
|
|
|
emit_p = repo_emit_p (decl);
|
|
|
|
|
if (emit_p == 0)
|
|
|
|
|
import_p = true;
|
|
|
|
|
else if (emit_p == 1)
|
|
|
|
|
{
|
|
|
|
|
/* The repository indicates that this entity should be defined
|
|
|
|
|
here. Make sure the back end honors that request. */
|
|
|
|
|
if (TREE_CODE (decl) == VAR_DECL)
|
|
|
|
|
mark_needed (decl);
|
|
|
|
|
else if (DECL_MAYBE_IN_CHARGE_CONSTRUCTOR_P (decl)
|
|
|
|
|
|| DECL_MAYBE_IN_CHARGE_DESTRUCTOR_P (decl))
|
1995-05-16 23:10:32 +02:00
|
|
|
|
{
|
2004-07-29 19:59:31 +02:00
|
|
|
|
tree clone;
|
|
|
|
|
FOR_EACH_CLONE (clone, decl)
|
|
|
|
|
mark_needed (clone);
|
1995-05-16 23:10:32 +02:00
|
|
|
|
}
|
1994-11-29 01:59:16 +01:00
|
|
|
|
else
|
2004-07-29 19:59:31 +02:00
|
|
|
|
mark_needed (decl);
|
|
|
|
|
/* Output the definition as an ordinary strong definition. */
|
|
|
|
|
DECL_EXTERNAL (decl) = 0;
|
|
|
|
|
DECL_INTERFACE_KNOWN (decl) = 1;
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (import_p)
|
|
|
|
|
/* We have already decided what to do with this DECL; there is no
|
|
|
|
|
need to check anything further. */
|
|
|
|
|
;
|
|
|
|
|
else if (TREE_CODE (decl) == VAR_DECL && DECL_VTABLE_OR_VTT_P (decl))
|
|
|
|
|
{
|
2005-04-12 08:33:48 +02:00
|
|
|
|
class_type = DECL_CONTEXT (decl);
|
|
|
|
|
import_export_class (class_type);
|
|
|
|
|
if (TYPE_FOR_JAVA (class_type))
|
2004-07-29 19:59:31 +02:00
|
|
|
|
import_p = true;
|
2005-04-12 08:33:48 +02:00
|
|
|
|
else if (CLASSTYPE_INTERFACE_KNOWN (class_type)
|
|
|
|
|
&& CLASSTYPE_INTERFACE_ONLY (class_type))
|
2004-07-29 19:59:31 +02:00
|
|
|
|
import_p = true;
|
2005-04-05 17:40:16 +02:00
|
|
|
|
else if ((!flag_weak || TARGET_WEAK_NOT_IN_ARCHIVE_TOC)
|
2005-04-12 08:33:48 +02:00
|
|
|
|
&& !CLASSTYPE_USE_TEMPLATE (class_type)
|
|
|
|
|
&& CLASSTYPE_KEY_METHOD (class_type)
|
|
|
|
|
&& !DECL_DECLARED_INLINE_P (CLASSTYPE_KEY_METHOD (class_type)))
|
2004-07-29 19:59:31 +02:00
|
|
|
|
/* The ABI requires that all virtual tables be emitted with
|
|
|
|
|
COMDAT linkage. However, on systems where COMDAT symbols
|
|
|
|
|
don't show up in the table of contents for a static
|
2005-04-05 17:40:16 +02:00
|
|
|
|
archive, or on systems without weak symbols (where we
|
|
|
|
|
approximate COMDAT linkage by using internal linkage), the
|
|
|
|
|
linker will report errors about undefined symbols because
|
|
|
|
|
it will not see the virtual table definition. Therefore,
|
|
|
|
|
in the case that we know that the virtual table will be
|
|
|
|
|
emitted in only one translation unit, we make the virtual
|
|
|
|
|
table an ordinary definition with external linkage. */
|
2004-07-29 19:59:31 +02:00
|
|
|
|
DECL_EXTERNAL (decl) = 0;
|
2005-04-12 08:33:48 +02:00
|
|
|
|
else if (CLASSTYPE_INTERFACE_KNOWN (class_type))
|
2002-05-18 06:47:31 +02:00
|
|
|
|
{
|
2005-04-12 08:33:48 +02:00
|
|
|
|
/* CLASS_TYPE is being exported from this translation unit,
|
2005-06-14 22:01:59 +02:00
|
|
|
|
so DECL should be defined here. */
|
2005-04-12 08:33:48 +02:00
|
|
|
|
if (!flag_weak && CLASSTYPE_EXPLICIT_INSTANTIATION (class_type))
|
2005-04-05 17:40:16 +02:00
|
|
|
|
/* If a class is declared in a header with the "extern
|
|
|
|
|
template" extension, then it will not be instantiated,
|
|
|
|
|
even in translation units that would normally require
|
|
|
|
|
it. Often such classes are explicitly instantiated in
|
|
|
|
|
one translation unit. Therefore, the explicit
|
|
|
|
|
instantiation must be made visible to other translation
|
|
|
|
|
units. */
|
|
|
|
|
DECL_EXTERNAL (decl) = 0;
|
|
|
|
|
else
|
|
|
|
|
{
|
2005-04-12 08:33:48 +02:00
|
|
|
|
/* The generic C++ ABI says that class data is always
|
|
|
|
|
COMDAT, even if there is a key function. Some
|
|
|
|
|
variants (e.g., the ARM EABI) says that class data
|
2006-03-02 03:20:54 +01:00
|
|
|
|
only has COMDAT linkage if the class data might be
|
|
|
|
|
emitted in more than one translation unit. When the
|
|
|
|
|
key method can be inline and is inline, we still have
|
|
|
|
|
to arrange for comdat even though
|
|
|
|
|
class_data_always_comdat is false. */
|
2005-04-12 08:33:48 +02:00
|
|
|
|
if (!CLASSTYPE_KEY_METHOD (class_type)
|
2006-03-03 21:37:50 +01:00
|
|
|
|
|| DECL_DECLARED_INLINE_P (CLASSTYPE_KEY_METHOD (class_type))
|
2005-04-12 08:33:48 +02:00
|
|
|
|
|| targetm.cxx.class_data_always_comdat ())
|
|
|
|
|
{
|
|
|
|
|
/* The ABI requires COMDAT linkage. Normally, we
|
|
|
|
|
only emit COMDAT things when they are needed;
|
|
|
|
|
make sure that we realize that this entity is
|
|
|
|
|
indeed needed. */
|
|
|
|
|
comdat_p = true;
|
|
|
|
|
mark_needed (decl);
|
|
|
|
|
}
|
2005-04-05 17:40:16 +02:00
|
|
|
|
}
|
2002-05-18 06:47:31 +02:00
|
|
|
|
}
|
2004-07-29 19:59:31 +02:00
|
|
|
|
else if (!flag_implicit_templates
|
2005-04-12 08:33:48 +02:00
|
|
|
|
&& CLASSTYPE_IMPLICIT_INSTANTIATION (class_type))
|
2004-07-29 19:59:31 +02:00
|
|
|
|
import_p = true;
|
|
|
|
|
else
|
|
|
|
|
comdat_p = true;
|
|
|
|
|
}
|
|
|
|
|
else if (TREE_CODE (decl) == VAR_DECL && DECL_TINFO_P (decl))
|
|
|
|
|
{
|
|
|
|
|
tree type = TREE_TYPE (DECL_NAME (decl));
|
|
|
|
|
if (CLASS_TYPE_P (type))
|
|
|
|
|
{
|
2005-04-12 08:33:48 +02:00
|
|
|
|
class_type = type;
|
2004-07-29 19:59:31 +02:00
|
|
|
|
import_export_class (type);
|
|
|
|
|
if (CLASSTYPE_INTERFACE_KNOWN (type)
|
|
|
|
|
&& TYPE_POLYMORPHIC_P (type)
|
|
|
|
|
&& CLASSTYPE_INTERFACE_ONLY (type)
|
|
|
|
|
/* If -fno-rtti was specified, then we cannot be sure
|
|
|
|
|
that RTTI information will be emitted with the
|
|
|
|
|
virtual table of the class, so we must emit it
|
|
|
|
|
wherever it is used. */
|
|
|
|
|
&& flag_rtti)
|
|
|
|
|
import_p = true;
|
2005-06-14 22:01:59 +02:00
|
|
|
|
else
|
2004-07-29 19:59:31 +02:00
|
|
|
|
{
|
|
|
|
|
if (CLASSTYPE_INTERFACE_KNOWN (type)
|
|
|
|
|
&& !CLASSTYPE_INTERFACE_ONLY (type))
|
2005-04-05 17:40:16 +02:00
|
|
|
|
{
|
2006-03-02 03:20:54 +01:00
|
|
|
|
comdat_p = (targetm.cxx.class_data_always_comdat ()
|
|
|
|
|
|| (CLASSTYPE_KEY_METHOD (type)
|
2006-03-03 21:37:50 +01:00
|
|
|
|
&& DECL_DECLARED_INLINE_P (CLASSTYPE_KEY_METHOD (type))));
|
2005-04-05 17:40:16 +02:00
|
|
|
|
mark_needed (decl);
|
|
|
|
|
if (!flag_weak)
|
|
|
|
|
{
|
|
|
|
|
comdat_p = false;
|
|
|
|
|
DECL_EXTERNAL (decl) = 0;
|
|
|
|
|
}
|
|
|
|
|
}
|
2005-04-12 08:33:48 +02:00
|
|
|
|
else
|
|
|
|
|
comdat_p = true;
|
2004-07-29 19:59:31 +02:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
comdat_p = true;
|
|
|
|
|
}
|
|
|
|
|
else if (DECL_TEMPLATE_INSTANTIATION (decl)
|
|
|
|
|
|| DECL_FRIEND_PSEUDO_TEMPLATE_INSTANTIATION (decl))
|
|
|
|
|
{
|
|
|
|
|
/* DECL is an implicit instantiation of a function or static
|
|
|
|
|
data member. */
|
2007-12-09 22:26:29 +01:00
|
|
|
|
if ((flag_implicit_templates
|
|
|
|
|
&& !flag_use_repository)
|
2004-07-29 19:59:31 +02:00
|
|
|
|
|| (flag_implicit_inline_templates
|
2005-06-14 22:01:59 +02:00
|
|
|
|
&& TREE_CODE (decl) == FUNCTION_DECL
|
2004-07-29 19:59:31 +02:00
|
|
|
|
&& DECL_DECLARED_INLINE_P (decl)))
|
|
|
|
|
comdat_p = true;
|
|
|
|
|
else
|
|
|
|
|
/* If we are not implicitly generating templates, then mark
|
|
|
|
|
this entity as undefined in this translation unit. */
|
|
|
|
|
import_p = true;
|
1994-08-18 22:50:43 +02:00
|
|
|
|
}
|
|
|
|
|
else if (DECL_FUNCTION_MEMBER_P (decl))
|
|
|
|
|
{
|
2001-04-06 08:33:07 +02:00
|
|
|
|
if (!DECL_DECLARED_INLINE_P (decl))
|
1994-08-18 22:50:43 +02:00
|
|
|
|
{
|
2001-04-04 01:37:53 +02:00
|
|
|
|
tree ctype = DECL_CONTEXT (decl);
|
|
|
|
|
import_export_class (ctype);
|
|
|
|
|
if (CLASSTYPE_INTERFACE_KNOWN (ctype))
|
|
|
|
|
{
|
|
|
|
|
DECL_NOT_REALLY_EXTERN (decl)
|
|
|
|
|
= ! (CLASSTYPE_INTERFACE_ONLY (ctype)
|
2005-06-14 22:01:59 +02:00
|
|
|
|
|| (DECL_DECLARED_INLINE_P (decl)
|
2001-04-06 08:33:07 +02:00
|
|
|
|
&& ! flag_implement_inlines
|
2001-04-04 01:37:53 +02:00
|
|
|
|
&& !DECL_VINDEX (decl)));
|
|
|
|
|
|
2002-05-18 06:47:31 +02:00
|
|
|
|
if (!DECL_NOT_REALLY_EXTERN (decl))
|
|
|
|
|
DECL_EXTERNAL (decl) = 1;
|
|
|
|
|
|
2001-04-04 01:37:53 +02:00
|
|
|
|
/* Always make artificials weak. */
|
|
|
|
|
if (DECL_ARTIFICIAL (decl) && flag_weak)
|
2004-07-29 19:59:31 +02:00
|
|
|
|
comdat_p = true;
|
2001-04-04 01:37:53 +02:00
|
|
|
|
else
|
|
|
|
|
maybe_make_one_only (decl);
|
|
|
|
|
}
|
1994-08-18 22:50:43 +02:00
|
|
|
|
}
|
1994-11-29 01:59:16 +01:00
|
|
|
|
else
|
2004-07-29 19:59:31 +02:00
|
|
|
|
comdat_p = true;
|
1994-08-18 22:50:43 +02:00
|
|
|
|
}
|
1994-11-29 01:59:16 +01:00
|
|
|
|
else
|
2004-07-29 19:59:31 +02:00
|
|
|
|
comdat_p = true;
|
2002-06-30 22:41:38 +02:00
|
|
|
|
|
2004-07-29 19:59:31 +02:00
|
|
|
|
if (import_p)
|
2002-06-30 22:41:38 +02:00
|
|
|
|
{
|
2004-07-29 19:59:31 +02:00
|
|
|
|
/* If we are importing DECL into this translation unit, mark is
|
|
|
|
|
an undefined here. */
|
|
|
|
|
DECL_EXTERNAL (decl) = 1;
|
|
|
|
|
DECL_NOT_REALLY_EXTERN (decl) = 0;
|
2002-06-30 22:41:38 +02:00
|
|
|
|
}
|
2004-07-29 19:59:31 +02:00
|
|
|
|
else if (comdat_p)
|
2002-06-30 22:41:38 +02:00
|
|
|
|
{
|
2004-07-29 19:59:31 +02:00
|
|
|
|
/* If we decided to put DECL in COMDAT, mark it accordingly at
|
|
|
|
|
this point. */
|
|
|
|
|
comdat_linkage (decl);
|
2002-06-30 22:41:38 +02:00
|
|
|
|
}
|
2002-07-05 12:40:47 +02:00
|
|
|
|
|
2002-06-30 22:41:38 +02:00
|
|
|
|
DECL_INTERFACE_KNOWN (decl) = 1;
|
|
|
|
|
}
|
|
|
|
|
|
2003-01-07 03:38:32 +01:00
|
|
|
|
/* Return an expression that performs the destruction of DECL, which
|
|
|
|
|
must be a VAR_DECL whose type has a non-trivial destructor, or is
|
|
|
|
|
an array whose (innermost) elements have a non-trivial destructor. */
|
|
|
|
|
|
1995-12-19 07:51:14 +01:00
|
|
|
|
tree
|
Remove traditional C constructs 4/n.
* decl2.c (grok_method_quals, warn_if_unknown_interface,
grok_x_components, cp_build_parm_decl, build_artificial_parm,
maybe_retrofit_in_chrg, grokclassfn, grok_array_decl,
delete_sanity, check_member_template, check_java_method,
check_classfn, finish_static_data_member_decl, grokfield,
grokbitfield, grokoptypename, grok_function_init,
cplus_decl_attributes, constructor_name, defer_fn,
build_anon_union_vars, finish_anon_union, coerce_new_type,
coerce_delete_type, comdat_linkage, maybe_make_one_only,
key_method, import_export_vtable, import_export_class,
output_vtable_inherit, import_export_decl, import_export_tinfo,
build_cleanup, get_guard, get_guard_bits, get_guard_cond,
set_guard, start_objects, finish_objects,
start_static_storage_duration_function,
finish_static_storage_duration_function, get_priority_info,
start_static_initialization_or_destruction,
finish_static_initialization_or_destruction,
do_static_initialization, do_static_destruction,
prune_vars_needing_no_initialization, write_out_vars,
reparse_decl_as_expr, finish_decl_parsing, namespace_ancestor,
add_using_namespace, merge_functions, ambiguous_decl,
lookup_using_namespace, lookup_using_namespace,
qualified_lookup_using_namespace, set_decl_namespace,
decl_namespace, current_decl_namespace, push_decl_namespace,
pop_decl_namespace, push_scope, pop_scope, add_function,
arg_assoc_namespace, arg_assoc_template_arg, arg_assoc,
lookup_arg_dependent, do_namespace_alias,
validate_nonmember_using_decl, do_nonmember_using_decl,
do_toplevel_using_decl, do_local_using_decl,
do_class_using_decl, do_using_directive, check_default_args,
mark_used, handle_class_head): Use C90 prototypings. Use booleans.
* parser.c (cp_parser_class_head): Use booleanss.
* decl.c (walk_globals, walk_vtables): Likewise.
* cp-tree.h (walk_globals_pred, walk_globals_fn, walk_vtables,
walk_globals): Change return type from 'int' to 'bool'.
* rtti.c (init_rtti_processing, build_headof, throw_bad_cast
throw_bad_typeid, get_tinfo_decl_dynamic, typeid_ok_p,
build_typeid, tinfo_name, get_tinfo_decl, get_tinfo_ptr,
get_typeid, ifnonnull, build_dynamic_cast_1, build_dynamic_cast,
qualifier_flags, tinfo_base_init, generic_initializer,
ptr_initializer, dfs_class_hint_mark, ptm_initializer,
dfs_class_hint_unmark, class_hint_flags, class_initializer,
typeinfo_in_lib_p, get_pseudo_ti_init, create_pseudo_type_info,
get_pseudo_ti_desc, create_tinfo_types, emit_support_tinfos,
unemitted_tinfo_decl_p, emit_tinfo_decl): Likewise.
* repo.c (repo_compile_flags, repo_template_declared,
repo_template_defined, repo_class_defined, repo_get_id,
repo_template_used, repo_vtable_used, repo_inline_used,
repo_tinfo_used, repo_template_instantiated, extract_string,
open_repo_file, afgets, init_repo, reopen_repo_file_for_write,
finish_repo): Likewise.
* ptree.c (cxx_print_decl, cxx_print_type, cxx_print_identifier,
cxx_print_xnode): Likewise..
* cp-lang.c (ok_to_generate_alias_set_for_type, cxx_get_alias_set,
cxx_warn_unused_global_decl, cp_expr_size): Likewise.
* cxxfilt.c (demangle_it, print_demangler_list, usage,
standard_symbol_characters, hp_symbol_characters, main, fatal):
Likewise.
(strip_underscore): Change type from 'int' to 'bool'.
(main): Use boolean constants.
From-SVN: r60601
2002-12-29 15:53:05 +01:00
|
|
|
|
build_cleanup (tree decl)
|
1995-12-19 07:51:14 +01:00
|
|
|
|
{
|
|
|
|
|
tree temp;
|
|
|
|
|
tree type = TREE_TYPE (decl);
|
|
|
|
|
|
2003-01-07 03:38:32 +01:00
|
|
|
|
/* This function should only be called for declarations that really
|
|
|
|
|
require cleanups. */
|
call.c (validate_conversion_obstack): Replace my_friendly_assert with gcc_assert or gcc_unreachable.
* call.c (validate_conversion_obstack): Replace
my_friendly_assert with gcc_assert or gcc_unreachable.
(direct_reference_binding, merge_conversion_sequences,
build_user_type_conversion_1, perform_overload_resolution,
build_op_delete_call, enforce_access, call_builtin_trap,
build_over_call, build_special_member_call, build_new_method_call,
initialize_reference): Likewise.
* class.c (build_base_path, build_primary_vtable, alter_access,
check_bases, update_vtable_entry_for_fn, layout_empty_base,
clone_function_decl, adjust_clone_args,
type_requires_array_cookie, include_empty_classes,
finish_struct_1, resolve_address_of_overloaded_function,
instantiate_type, get_vtbl_decl_for_binfo, build_vtt_inits,
dfs_build_secondary_vptr_vtt_inits, build_ctor_vtbl_group,
accumulate_vtbl_inits, build_vtbl_initializer,
build_vbase_offset_vtbl_entries, build_rtti_vtbl_entries): Likewise.
* cvt.c (build_up_reference, convert_to_reference): Likewise.
* decl.c (poplevel, duplicate_decls, make_typename_type,
cxx_init_decl_processing, reshape_init, check_initializer,
make_rtl_for_nonlocal_decl, initialize_local_var, cp_finish_decl,
expand_static_init, grokfndecl, grokvardecl, build_ptrmem_type,
grokdeclarator, copy_fn_p, grok_op_properties, xref_tag,
xref_basetypes, start_preparsed_function, save_function_data,
finish_function, finish_method, maybe_register_incomplete_var,
complete_vars): Likewise.
* decl2.c (grok_array_decl, check_member_template,
check_classfn, finish_static_data_member_decl, coerce_new_type,
coerce_delete_type, import_export_class, decl_needed_p,
determine_visibility, import_export_decl, build_cleanup,
start_static_initialization_or_destructi, do_static_destruction,
prune_vars_needing_no_initialization,
build_offset_ref_call_from_tree): Likewise.
* error.c (dump_decl, dump_expr): Likewise.
* init.c (finish_init_stmts, build_zero_init,
expand_virtual_init, expand_default_init, expand_aggr_init_1,
build_offset_ref, build_new_1, build_delete, build_vbase_delete):
Likewise.
* mangle.c (write_method_parms, write_template_args,
write_expression, write_template_arg): Likewise.
* method.c (make_thunk, finish_thunk, use_thunk): Likewise.
* name-lookup.c (pop_binding, begin_scope, leave_scope,
resume_scope, push_using_decl, validate_nonmember_using_decl,
is_ancestor, poplevel_class, set_inherited_value_binding_p,
push_class_level_binding, do_class_using_decl, push_namespace,
pop_namespace, add_using_namespace, ambiguous_decl,
lookup_namespace_name, lookup_type_current_level,
maybe_process_template_type_declaration): Likewise.
* parser.c (cp_lexer_peek_nth_token,
cp_parser_parse_and_diagnose_invalid_typ,
cp_parser_translation_unit, cp_parser_template_id,
cp_parser_lookup_name, cp_parser_late_parsing_for_member): Likewise.
* pt.c (push_access_scope, finish_member_template_decl,
push_inline_template_parms_recursive, add_outermost_template_args,
get_innermost_template_args, begin_explicit_instantiation,
end_explicit_instantiation, retrieve_specialization,
is_specialization_of, is_specialization_of_friend,
register_specialization, check_explicit_specialization,
comp_template_parms, process_template_parm,
process_partial_specialization, convert_nontype_argument,
coerce_template_template_parms, coerce_template_parms,
mangle_class_name_for_template, lookup_template_function,
lookup_template_class, instantiate_class_template, tsubst_decl,
tsubst_function_type, tsubst, tsubst_qualified_id, tsubst_copy,
instantiate_template, fn_type_unification, type_unification_real,
get_template_base, regenerate_decl_from_template,
template_for_substitution, instantiate_decl,
get_mostly_instantiated_function_type, dependent_scope_ref_p,
value_dependent_expression_p, resolve_typename_type): Likewise.
* repo.c (repo_emit_p): Likewise.
* rtti.c (build_headof, get_tinfo_decl, get_pseudo_ti_init,
create_tinfo_types, emit_tinfo_decl): Likewise.
* search.c (lookup_base_r, lookup_base, lookup_field_1,
dfs_access_in_type, build_baselink, lookup_member,
adjust_result_of_qualified_name_lookup, copied_binfo): Likewise.
* semantics.c (perform_or_defer_access_check,
finish_non_static_data_member, finish_stmt_expr_expr,
finish_stmt_expr, finish_call_expr, finish_pseudo_destructor_expr,
finish_template_template_parm, finish_member_declaration,
emit_associated_thunks): Likewise.
* tree.c (build_target_expr_with_type, force_target_expr,
copy_binfo, get_first_fn, cp_tree_equal): Likewise.
* typeck.c (type_after_usual_arithmetic_conversions, comptypes,
cxx_sizeof_or_alignof_type, perform_integral_promotions,
build_class_member_access_expr, finish_class_member_access_expr,
build_ptrmemfunc_access_expr, build_unary_op,
unary_complex_lvalue, cxx_mark_addressable, build_modify_expr,
build_ptrmemfunc, expand_ptrmemfunc_cst, check_return_expr
* typeck2.c (complete_type_check_abstract,
abstract_virtuals_error, process_init_constructor,
add_exception_specifier): Likewise.
From-SVN: r86669
2004-08-27 19:59:33 +02:00
|
|
|
|
gcc_assert (!TYPE_HAS_TRIVIAL_DESTRUCTOR (type));
|
2003-01-07 03:38:32 +01:00
|
|
|
|
|
|
|
|
|
/* Treat all objects with destructors as used; the destructor may do
|
|
|
|
|
something substantive. */
|
|
|
|
|
mark_used (decl);
|
|
|
|
|
|
1995-12-19 07:51:14 +01:00
|
|
|
|
if (TREE_CODE (type) == ARRAY_TYPE)
|
|
|
|
|
temp = decl;
|
|
|
|
|
else
|
2007-06-01 02:44:36 +02:00
|
|
|
|
temp = build_address (decl);
|
1995-12-19 07:51:14 +01:00
|
|
|
|
temp = build_delete (TREE_TYPE (temp), temp,
|
2000-05-25 00:56:54 +02:00
|
|
|
|
sfk_complete_destructor,
|
1995-12-19 07:51:14 +01:00
|
|
|
|
LOOKUP_NORMAL|LOOKUP_NONVIRTUAL|LOOKUP_DESTRUCTOR, 0);
|
|
|
|
|
return temp;
|
|
|
|
|
}
|
|
|
|
|
|
2000-06-30 09:16:35 +02:00
|
|
|
|
/* Returns the initialization guard variable for the variable DECL,
|
|
|
|
|
which has static storage duration. */
|
2000-06-04 23:12:27 +02:00
|
|
|
|
|
2000-06-30 09:16:35 +02:00
|
|
|
|
tree
|
Remove traditional C constructs 4/n.
* decl2.c (grok_method_quals, warn_if_unknown_interface,
grok_x_components, cp_build_parm_decl, build_artificial_parm,
maybe_retrofit_in_chrg, grokclassfn, grok_array_decl,
delete_sanity, check_member_template, check_java_method,
check_classfn, finish_static_data_member_decl, grokfield,
grokbitfield, grokoptypename, grok_function_init,
cplus_decl_attributes, constructor_name, defer_fn,
build_anon_union_vars, finish_anon_union, coerce_new_type,
coerce_delete_type, comdat_linkage, maybe_make_one_only,
key_method, import_export_vtable, import_export_class,
output_vtable_inherit, import_export_decl, import_export_tinfo,
build_cleanup, get_guard, get_guard_bits, get_guard_cond,
set_guard, start_objects, finish_objects,
start_static_storage_duration_function,
finish_static_storage_duration_function, get_priority_info,
start_static_initialization_or_destruction,
finish_static_initialization_or_destruction,
do_static_initialization, do_static_destruction,
prune_vars_needing_no_initialization, write_out_vars,
reparse_decl_as_expr, finish_decl_parsing, namespace_ancestor,
add_using_namespace, merge_functions, ambiguous_decl,
lookup_using_namespace, lookup_using_namespace,
qualified_lookup_using_namespace, set_decl_namespace,
decl_namespace, current_decl_namespace, push_decl_namespace,
pop_decl_namespace, push_scope, pop_scope, add_function,
arg_assoc_namespace, arg_assoc_template_arg, arg_assoc,
lookup_arg_dependent, do_namespace_alias,
validate_nonmember_using_decl, do_nonmember_using_decl,
do_toplevel_using_decl, do_local_using_decl,
do_class_using_decl, do_using_directive, check_default_args,
mark_used, handle_class_head): Use C90 prototypings. Use booleans.
* parser.c (cp_parser_class_head): Use booleanss.
* decl.c (walk_globals, walk_vtables): Likewise.
* cp-tree.h (walk_globals_pred, walk_globals_fn, walk_vtables,
walk_globals): Change return type from 'int' to 'bool'.
* rtti.c (init_rtti_processing, build_headof, throw_bad_cast
throw_bad_typeid, get_tinfo_decl_dynamic, typeid_ok_p,
build_typeid, tinfo_name, get_tinfo_decl, get_tinfo_ptr,
get_typeid, ifnonnull, build_dynamic_cast_1, build_dynamic_cast,
qualifier_flags, tinfo_base_init, generic_initializer,
ptr_initializer, dfs_class_hint_mark, ptm_initializer,
dfs_class_hint_unmark, class_hint_flags, class_initializer,
typeinfo_in_lib_p, get_pseudo_ti_init, create_pseudo_type_info,
get_pseudo_ti_desc, create_tinfo_types, emit_support_tinfos,
unemitted_tinfo_decl_p, emit_tinfo_decl): Likewise.
* repo.c (repo_compile_flags, repo_template_declared,
repo_template_defined, repo_class_defined, repo_get_id,
repo_template_used, repo_vtable_used, repo_inline_used,
repo_tinfo_used, repo_template_instantiated, extract_string,
open_repo_file, afgets, init_repo, reopen_repo_file_for_write,
finish_repo): Likewise.
* ptree.c (cxx_print_decl, cxx_print_type, cxx_print_identifier,
cxx_print_xnode): Likewise..
* cp-lang.c (ok_to_generate_alias_set_for_type, cxx_get_alias_set,
cxx_warn_unused_global_decl, cp_expr_size): Likewise.
* cxxfilt.c (demangle_it, print_demangler_list, usage,
standard_symbol_characters, hp_symbol_characters, main, fatal):
Likewise.
(strip_underscore): Change type from 'int' to 'bool'.
(main): Use boolean constants.
From-SVN: r60601
2002-12-29 15:53:05 +01:00
|
|
|
|
get_guard (tree decl)
|
1996-04-24 20:30:21 +02:00
|
|
|
|
{
|
2000-06-04 23:12:27 +02:00
|
|
|
|
tree sname;
|
2000-06-30 09:16:35 +02:00
|
|
|
|
tree guard;
|
|
|
|
|
|
2001-02-12 10:58:18 +01:00
|
|
|
|
sname = mangle_guard_variable (decl);
|
2000-06-30 09:16:35 +02:00
|
|
|
|
guard = IDENTIFIER_GLOBAL_VALUE (sname);
|
|
|
|
|
if (! guard)
|
|
|
|
|
{
|
|
|
|
|
tree guard_type;
|
|
|
|
|
|
2001-07-21 02:03:21 +02:00
|
|
|
|
/* We use a type that is big enough to contain a mutex as well
|
|
|
|
|
as an integer counter. */
|
2004-06-25 19:15:46 +02:00
|
|
|
|
guard_type = targetm.cxx.guard_type ();
|
java-gimplify.c (java_gimplify_block): New argument to build_empty_stmt.
gcc/java/
* java-gimplify.c (java_gimplify_block): New argument to
build_empty_stmt.
* expr.c (force_evaluation_order): Same.
* typeck.c: Add location to build_decl or PUSH_FIELD calls.
* class.c: Same.
* decl.c: Same.
* jcf-parse.c: Same.
* constants.c: Same.
* resource.c: Same.
* except.c: Same.
* builtins.c: Same.
* expr.c: Same.
* java-tree.h (PUSH_FIELD): Add location field.
gcc/objc/
* objc-act.c (finish_var_decl): Pass location to finish_decl.
(objc_get_parm_info): Same.
(get_super_receiver): Same.
* objc-act.c (objc_build_component_ref): Pass location to
build_compound_ref.
(build_module_initializer_routine): Pass location to
c_end_compound_stmt.
(objc_generate_static_init_call): Pass location to build_stmt.
(build_typed_selector_reference): New location argument.
(build_selector_reference): Same.
(objc_substitute_decl): Pass location to build_array_ref.
(next_sjlj_build_try_catch_finally): Pass location to build_stmt.
(objc_begin_catch_clause): Same.
(objc_finish_try_stmt): Same.
(objc_finish_catch_clause): Pass location to c_end_compound_stmt.
(objc_build_throw_stmt): New argument.
(generate_shared_structures): Pass location to build_c_cast.
(objc_build_message_expr): Use local location.
(objc_finish_message_expr): Use input_location.
(build_objc_method_call): New argument.
(objc_build_selector_expr): Same.
(get_super_receiver): Pass location to build_c_cast,
build_modify_expr, build_compound_expr.
* objc-act.c: Add location to all calls to start_struct, build_decl,
finish_struct.
gcc/
* tree-pretty-print.c (dump_generic_node): Dump column numbers.
* gimple-pretty-print.c (dump_gimple_stmt): Same.
* gimplify.c (gimplify_modify_expr): Set location for GIMPLE_ASSIGNs
created.
* c-parser.c (c_parser_binary_expression): Use current column while
building binary operations.
* common.opt (fshow-column): Enable by default.
* tree-vrp.c (check_array_ref): Use warning_at.
(check_array_bounds): Use location from call back if expr has no
location.
* tree.h: Add location argument to maybe_fold_*.
* tree-ssa-ccp.c (ccp_fold): Pass location to maybe_fold_*.
(maybe_fold_offset_to_array_ref): Add location argument and use it.
(maybe_fold_offset_to_component_ref): Same.
(maybe_fold_offset_to_reference): Same.
(maybe_fold_offset_to_address): Same.
(maybe_fold_stmt_indirect): Same.
(maybe_fold_stmt_addition): Same.
(fold_stmt_r): Pass location to maybe_fold_*.
(fold_gimple_assign): Same.
* c-tree.h: Add location argument to finish_decl,
default_function_array_conversion, store_init_value.
* c-decl.c (define_label): Use error_at.
(c_make_fname_decl): Pass location to finish_decl.
(finish_decl): New location argument.
(build_compound_literal): Pass location to store_init_value.
(grokdeclarator): Pass location to finish_decl.
(grokfield): Same.
* c-typeck.c (array_to_pointer_conversion): New location argument.
(function_to_pointer_conversion): Same.
(default_function_array_conversion): Same.
(parser_build_unary_op): Pass location to overflow_warning.
(parser_build_binary_op): Same. Use warning_at.
(build_unary_op): Pass location to array_to_pointer_conversion.
(build_c_cast): Pass location to digest_init.
(build_modify_expr): New location argument.
(convert_for_assignment): Same.
(store_init_value): Same.
(digest_init): Same.
(output_init_element): Pass location to digest_init and
array_to_pointer_conversion.
(c_finish_return): Pass location to convert_for_assignment.
* gimplify.c (gimplify_conversion): Pass location to
maybe_fold_offset_to_address.
* tree-ssa-forwprop.c (forward_propagate_addr_expr_1): Pass location
to maybe_fold_stmt_addition.
* c-omp.c (c_finish_omp_atomic): Pass new location to
build_modify_expr.
(c_finish_omp_for): Same.
* c-common.c (overflow_warning): New argument.
* c-common.h: New argument to build_modify_expr, overflow_warning.
* c-parser.c (c_parser_declaration_or_fndef): Pass location to
finish_decl.
(c_parser_initializer): Pass location to
default_function_array_conversion.
(c_parser_initelt): Same.
(c_parser_initval): Same.
(c_parser_asm_operands): Same.
(c_parser_expr_no_commas): Same. Pass location to build_modify_expr.
(c_parser_conditional_expression): Same.
(c_parser_binary_expression): Add location info to stack. Use it.
(c_parser_unary_expression): Pass location to
default_function_array_conversion, parser_build_unary_op,
build_indirect_ref, c_parser_postfix_expression_after_primary.
(c_parser_postfix_expression_after_primary): New location argument.
Use it.
(c_parser_expression_conv): Pass location to
default_function_array_conversion.
(c_parser_expr_list): Same.
(c_parser_omp_atomic): Same.
(c_parser_omp_for_loop): Same.
* c-tree.h: (struct c_declarator): Add comment to id_loc.
(build_array_declarator): New argument.
* c-decl.c (build_array_declarator): Add location argument.
(grokdeclarator): Set id_loc for cdk_array.
* c-parser.c (c_parser_direct_declarator_inner): Pass location to
build_array_declarator.
* tree.c (build_omp_clause): Add location argument.
* tree.h (OMP_CLAUSE_HAS_LOCATION): New macro.
(OMP_CLAUSE_LOCATION): New macro.
(struct tree_omp_clause): Add location field.
(build_omp_clause): Add argument.
* testsuite/gcc.dg/gomp/for-1.c: Fix column.
* cp/pt.c (tsubst_omp_for_iterator): Pass location to
build_omp_clause.
* cp/parser.c (cp_parser_omp_var_list_no_open): Same.
(cp_parser_omp_clause_collapse): Same.
(cp_parser_omp_clause_default): Same.
(cp_parser_omp_clause_if): Same.
(cp_parser_omp_clause_nowait): Same.
(cp_parser_omp_clause_num_threads): Same.
(cp_parser_omp_clause_ordered): Same.
(cp_parser_omp_clause_schedule): Same.
(cp_parser_omp_clause_untied): Same.
(cp_parser_omp_for_loop): Same.
(cp_parser_omp_parallel): Pass location to c_split_parallel_clauses.
* c-tree.h (c_start_case): Add location argument.
(c_process_expr_stmt): Same.
(c_finish_goto_*): Same.
* tree-parloops.c (initialize_reductions): Pass location to
build_omp_clause.
(create_parallel_loop): Same.
* fortran/trans-openmp.c (gfc_trans_omp_variable_list): Same.
(gfc_trans_omp_reduction_list): Same.
(gfc_trans_omp_clauses): Same.
(gfc_trans_omp_do): Same.
* c-typeck.c (c_finish_goto_label): Same.
(c_finish_goto_ptr): New location argument.
(c_start_case): Same.
(emit_side_effect_warnings): Same.
(c_process_expr_stmt): Same.
(c_finish_stmt_expr): Same.
(c_finish_omp_clauses): Use error_at instead of error.
* gimplify.c (gimplify_adjust_omp_clauses_1): Pass location to
build_omp_clause.
* c-omp.c (c_split_parallel_clauses): New location argument.
* tree-nested.c (convert_nonlocal_reference_stmt): Pass location
to build_omp_clause.
(convert_local_reference_stmt): Same.
(convert_gimple_call): Same.
* c-common.h (c_split_parallel_clauses): New argument.
* c-parser.c (c_parser_statement_after_labels): Pass location to
c_finish_goto_label.
(c_parser_switch_statement): Pass location to c_start_case.
(c_parser_for_statement): Pass location to c_finish_expr_stmt,
and c_process_expr_stmt.
(c_parser_omp_variable_list): Add location argument.
(c_parser_omp_clause_collapse): Pass location to
build_omp_clause.
(c_parser_omp_clause_default): Same.
(c_parser_omp_clause_if): Same.
(c_parser_omp_clause_num_threads): Same.
(-c_parser_omp_clause_ordered): Same.
(c_parser_omp_clause_reduction): Pass location to
c_parser_omp_variable_list.
(c_parser_omp_clause_schedule): Pass location to build_omp_clause.
(c_parser_omp_clause_untied): Same.
(c_parser_omp_for_loop): Pass location to c_process_expr_stmt.
(c_parser_omp_parallel): Pass location to
c_split_parallel_clauses.
* c-tree.h (check_for_loop_decls, undeclared_variable,
build_component_ref, build_array_ref, build_external_ref,
c_expr_sizeof_expr, c_expr_sizeof_type, parser_build_unary_op,
build_conditional_expr, build_compound_expr, c_cast_expr,
build_c_cast, build_asm_expr, c_end_compound_stmt, c_finish_stmt_expr,
c_finish_return, c_finish_omp_parallel, c_finish_omp_task): New
argument.
* c-semantics.c (build_stmt): Same.
(build_case_label): Same.
* c-decl.c (c_finish_incomplete_decl): Pass location on down.
(undeclared_variable): New argument.
(make_label): Same.
(lookup_label): Pass location on down.
(define_label): Same.
(finish_decl): Same.
(build_compound_literal): Same.
(finish_struct): Same.
(finish_function): Do not set location here.
(check_for_loop_decls): New argument.
* tree.c (save_expr): Set location.
(build_empty_stmt): New argument.
* tree.h (build_empty_stmt): New argument to build_empty_stmt.
(CAN_HAVE_LOCATION_P): Make sure we have a non empty node.
* builtins.c (gimplify_va_arg_expr): Use locations.
(expand_builtin_sync_operation): Same.
* c-typeck.c (build_component_ref): New argument.
(build_array_ref): Same.
(build_external_ref): Same.
(c_expr_sizeof_expr): Same.
(c_expr_sizeof_type): Same.
(parser_build_unary_op): Same.
(build_conditional_expr): Same.
(build_compound_expr): Pass location on down.
(build_compound_expr): New argument.
(build_c_cast): Same.
(c_cast_expr): Same.
(build_asm_expr): Same.
(c_finish_return): Same.
(c_process_expr_stmt): Pass location on down.
(c_finish_stmt_expr): New argument.
(push_clenaup): Same.
(c_finish_omp_parallel): Same.
(c_finish_omp_task): Same.
* gimplify.c (gimplify_call_expr): Pass location on down.
* c-omp.c (c_finish_omp_master): New argument.
(c_finish_omp_critical): Same.
(c_finish_omp_ordered): Same.
(c_finish_omp_barrier): Same.
(-c_finish_omp_taskwait): Same.
(c_finish_omp_atomic): Same.
(c_finish_omp_flush): Same.
* tree-inline.c (copy_tree_body_r): Pass location on down.
(inline_forbidden_p): Remove use of input_location.
* c-gimplify.c (c_build_bind_expr): New argument.
* c-common.c (c_common_truthvalue_conversion): Pass location on down.
(c_sizeof_or_alignof_type): New argument.
(c_alignof_expr): Same.
(build_va_arg): Same.
(c_add_case_label): Same.
* c-common.h (c_sizeof_or_alignof_type, c_alignof_expr,
c_sizeof, c_alignof, build_va_arg, build_stmt, build_case_label,
c_build_bind_expr, objc_build_selector_expr, objc_build_throw_stmt,
c_finish_omp_master, c_finish_omp_critical, c_finish_omp_ordered,
c_finish_omp_barrier, c_finish_omp_atomic, c_finish_omp_flush,
c_finish_omp_taskwait, c_finish_omp_for, c_split_parallel_clauses):
New argument.
* stub-objc.c (objc_build_selector_expr): Same.
(objc_build_throw_stmt): Same.
* c-parser.c (c_parser_declaration_or_fndef): Pass location on down.
(c_parser_initelt): Same.
(c_parser_compound_statement): Same.
(c_parser_compound_statement_nostart): Same.
(c_parser_label): Same.
(c_parser_statement_after_labels): Same.
(c_parser_if_body): Same.
(c_parser_else_body): Same.
(c_parser_if_statement): Same.
(c_parser_switch_statement): Same.
(c_parser_while_statement): Same.
(c_parser_do_statement): Same.
(c_parser_for_statement): Same.
(c_parser_asm_statement): Same.
(c_parser_conditional_expression): Same.
(c_parser_binary_expression): Same.
(c_parser_cast_expression): Same.
(c_parser_unary_expression): Same.
(c_parser_sizeof_expression): Same.
(c_parser_alignof_expression): Same.
(c_parser_postfix_expression): Same.
(c_parser_expression): Same.
(c_parser_objc_receiver): Same.
(c_parser_omp_variable_list): Same.
(c_parser_omp_structured_block): Same.
(c_parser_omp_atomic): New argument.
(c_parser_omp_barrier): Same.
(c_parser_omp_critical): Same.
(c_parser_omp_flush): Pass location on down.
(c_parser_omp_for_loop): New argument.
(c_parser_omp_for): Same.
(c_parser_omp_master): Same.
(c_parser_omp_ordered): Same.
(c_parser_omp_sections_scope): Same.
(c_parser_omp_sections): Same.
(c_parser_omp_parallel): Same.
(c_parser_omp_single): Same.
(c_parser_omp_task): Same.
(c_parser_omp_taskwait): Pass location on down.
(c_parser_omp_construct): Same.
(c_parser_omp_threadprivate): Same.
* dwarf2asm.c, targhooks.c, optabs.c, tree.c, tree.h, target.h,
builtins.c, omp-low.c, cgraphunit.c, tree-call-cdce.c,
tree-ssa-alias.c, gimple-low.c, c-tree.h, expr.c, tree-parloops.c,
c-decl.c, tree-eh.c, langhooks.c, function.c, stor-layout.c,
c-typeck.c, gimplify.c, c-pragma.c, expmed.c, except.c, coverage.c,
emit-rtl.c, cfgexpand.c, tree-mudflap.c, varasm.c, tree-nested.c,
rtl.h, tree-inline.c, tree-profile.c, c-common.c, c-common.h,
tree-switch-conversion.c, tree-cfg.c, ipa-struct-reorg.c, c-parser.c,
config/i386/i386.c, stmt.c:
Add location argument to the following function definitions and/or
function calls: build_decl, objcp_start_struct, objcp_finish_struct,
start_struct, finish_struct, PUSH_FIELD, create_artificial_label,
cp_make_fname_decl, pushtag, implicitly_declare, c_make_fname_decl,
build_compound_literal, parser_xref_tag, resolve_overloaded_builtin,
do_case, c_finish_bc_stmt, build_compound_literal,
build_function_call.
* c-decl.c (build_compound_literal): Add location argument.
Make all diagnostic calls use location.
(start_struct): Same.
(finish_struct): Same.
(start_enum): Same.
(build_enumerator): Same.
(start_function): Same.
(grokdeclarator): Make all diagnostic calls use location.
(store_parm_decls_oldstyle): Same.
* c-typeck.c (build_function_call): Add location argument.
Make all diagnostic calls use location.
(do_case): Same.
(c_finish_bc_stmt): Same.
* tree-nested.c (get_trampoline_type): Add argument.
Pass location to build_decl.
(lookup_tramp_for_decl): Pass location to get_trampoline_type.
* rtl.h (RTL_LOCATION): New.
* c-common.c (c_add_case_label): Add location argument.
Make all diagnostic calls use location.
* c-common.h: Add location argument to make_fname_decl, do_case,
c_add_case_label, build_function_call, resolve_overloaded_builtin.
* c-parser.c (c_parser_enum_specifier): Rename ident_loc to enum_loc.
Set it appropriately for every case. Pass enum_loc to start_enum
call. Pass value_loc first to build_enumerator. Pass enum_loc to
parser_xref_tag.
(c_parser_struct_or_union_specifier): Save location. Use it for
start_struct, finish_struct, and parser_xref_tag.
gcc/testsuite/
* gcc.dg/old-style-prom-3.c: Add column info.
* gcc.dg/overflow-warn-1.c
* gcc.dg/gomp/pr27415.c
* gcc.dg/gomp/for-1.c: Same.
* gcc.dg/enum-compat-1.c: Same.
* gcc.dg/c99-tag-3.c: Same.
* gcc.dg/Wredundant-decls-2.c: Same.
* gcc.dg/func-ptr-conv-1.c: Same.
* gcc.dg/asm-wide-1.c: Same.
* gcc.dg/nofixed-point-2.c: Same.
* gcc.dg/cpp/line3.c: Same.
* gcc.dg/array-10.c: Same.
* gcc.dg/c99-vla-jump-1.c: Same.
* gcc.dg/pr20368-1.c: Same.
* gcc.dg/Wshadow-3.c: Same.
* gcc.dg/c90-const-expr-8.c: Same.
* gcc.dg/label-decl-2.c: Same.
* gcc.dg/dremf-type-compat-2.c: Same.
* gcc.dg/c90-const-expr-5.c: Same.
* gcc.dg/builtins-30.c: Same.
* gcc.dg/Warray-bounds.c: Same.
* gcc.dg/Wcxx-compat-2.c: Same.
* gcc.dg/tree-ssa/col-1.c: Same.
* gcc.dg/old-style-prom-2.c: Same.
* gcc.dg/cast-function-1.c: Same.
* gcc.dg/pr15698-1.c: Same.
* gcc.dg/dremf-type-compat-3.c: Same.
* gcc.dg/vla-8.c: Same.
* gcc.dg/gomp/pr27415.c: Move firstprivate diagnostics to correct
line.
* gcc.dg/label-decl-2.c: Move label diagnostic to correct line.
* gcc.dg/old-style-prom-3.c: Check for error on the correct line.
* gcc.dg/enum-compat-1.c: Same.
* gcc.dg/dremf-type-compat-2.c: Same.
* gcc.dg/old-style-prom-2.c: Same.
* gcc.dg/pr15698-1.c: Same.
* gcc.dg/pr20368-1.c: Same.
* gcc.dg/dremf-type-compat-3.c: Same.
* gcc.dg/builtins-30.c: Same. Test for columns.
gcc/objcp/
* objcp-decl.h (c_end_compound_stmt): New argument.
* objcp-decl.c (objcp_start_struct): Add argument.
(objcp_finish_struct): Same.
gcc/cp/
* typeck.c (cp_build_binary_op): Pass location to overflow_warning.
(build_modify_expr): New arg.
* semantics.c (finish_unary_op_expr): Pass location to
overflow_warning.
(handle_omp_for_class_iterator): Pass location to build_modify_expr.
* typeck.c (cxx_sizeof_or_alignof_type): Pass location to
c_sizeof_or_alignof_type.
(build_array_ref): New argument.
(build_compound_expr): Same.
(build_const_cast): Same.
(build_ptrmemfunc): Pass location to build_c_cast.
* init.c (avoid_placement_new_aliasing): Pass location to
build_stmt.
(build_vec_delete_1): Pass location to cp_build_modify_expr,
build_compound_expr.
* class.c (build_vtbl_ref_1): Pass location to build_array_ref.
* decl.c (poplevel): Pass location to c_build_bind_expr.
(finish_case_label): Pass location to build_case_label.
(finish_constructor_body): Same.
(finish_destructor_body): Pass location to build_stmt.
(cxx_maybe_build_cleanup): Same, but to build_compound_expr.
* call.c (build_new_op): Pass location to build_array_ref.
(build_x_va_arg): Pass location to build_va_arg.
* except.c (expand_end_catch_block): Pass location to
build_stmt.
* cp-tree.h (build_array_ref): New argument.
(build_compound_expr): Same.
(build_c_cast): Same.
* cp-gimplify.c (gimplify_if_stmt): Pass location on down.
(gimplify_switch_stmt): Same.
* typeck2.c (split_nonconstant_init_1): Same.
* pt.c (tsubst_copy): Same.
* semantics.c (add_decl_expr): Same.
(do_poplevel): Same.
(push_cleanup): Same.
(finish_goto_stmt): Same.
(finish_expr_stmt): Same.
(begin_if_stmt): Same.
(begin_while_stmt): Same.
(begin_do_stmt): Same.
(finish_return_stmt): Same.
(begin_for_stmt): Same.
(finish_break_stmt): Same.
(finish_continue_stmt): Same.
(begin_switch_stmt): Same.
(begin_try_block): Same.
(begin_handler): Same.
(finish_asm_stmt): Same.
(finish_label_stmt): Same.
(finish_stmt_expr_expr): Same.
(finalize_nrv_r): Same.
(finish_omp_atomic): Same.
* name-lookup.c (do_using_directive): Same.
* decl2.c (grok_array_decl): Same.
* parser.c (cp_parser_cast_expression): Same.
(cp_parser_selection_statement): Same.
(cp_parser_implicitly_scoped_statement): Same.
(cp_parser_objc_selector_expression): Same.
(cp_parser_objc_synchronized_statement): Same.
(cp_parser_objc_throw_statement): Same.
(cp_parser_omp_critical): Same.
(cp_parser_omp_master): Same.
* typeck.c (build_function_call): Add location argument.
* init.c: Add location argument to all build_decl calls.
* class.c: Same.
* method.c: Same.
* rtti.c: Same.
* tree.c: Same.
* pt.c: Same.
* semantics.c: Same.
* lex.c: Same.
* decl2.c: Same.
* cp-gimplify.c: Same.
* decl.c: Same.
(cp_make_fname_decl): Add location argument. Pass location ot
build_decl.
(finish_case_label): Same.
* cp-tree.h (finish_case_label): Add location argument.
* parser.c (cp_parser_label_for_labeled_statement): Pass location to
finish_case_label.
gcc/fortran/
* trans-array.c (gfc_trans_allocate_array_storage): Pass
location on down.
(gfc_trans_array_constructor_value): Same.
(gfc_trans_scalarized_loop_end): Same.
(gfc_conv_ss_startstride): Same.
(gfc_trans_g77_array): Same.
(gfc_trans_dummy_array_bias): Same.
(gfc_conv_array_parameter): Same.
(structure_alloc_comps): Same.
* trans-expr.c (gfc_conv_function_call): Same.
(fill_with_spaces): Same.
(gfc_trans_string_copy): Same.
(gfc_trans_scalar_assign): Same.
* trans-stmt.c (gfc_trans_goto): Same.
(gfc_trans_if_1): Same.
(gfc_trans_simple_do): Same.
(gfc_trans_do): Same.
(gfc_trans_do_while): Same.
(gfc_trans_logical_select): Same.
(gfc_trans_select): Same.
(gfc_trans_forall_loop): Same.
(gfc_trans_nested_forall_loop): Same.
(generate_loop_for_temp_to_lhs): Same.
(generate_loop_for_rhs_to_temp): Same.
(gfc_trans_forall_1): Same.
(gfc_trans_where_assign): Same.
(gfc_trans_where_3): Same.
(gfc_trans_allocate): Same.
* trans.c (gfc_finish_block): Same.
(gfc_trans_runtime_check): Same.
(gfc_call_malloc): Same.
(gfc_allocate_with_status): Same.
(gfc_call_free): Same.
(gfc_deallocate_with_status): Same.
(gfc_call_realloc): Same.
(gfc_trans_code): Same.
* trans-decl.c (gfc_init_default_dt): Same.
(gfc_generate_constructors): Same.
* trans-io.c (gfc_trans_io_runtime_check): Same.
* trans-intrinsic.c (gfc_conv_intrinsic_ctime): Same.
(gfc_conv_intrinsic_fdate): Same.
(gfc_conv_intrinsic_ttynam): Same.
(gfc_conv_intrinsic_minmax): Same.
(gfc_conv_intrinsic_minmax_char): Same.
(gfc_conv_intrinsic_anyall): Same.
(gfc_conv_intrinsic_count): Same.
(gfc_conv_intrinsic_arith): Same.
(gfc_conv_intrinsic_minmaxloc): Same.
(gfc_conv_intrinsic_minmaxval): Same.
(gfc_conv_intrinsic_rrspacing): Same.
(gfc_conv_intrinsic_array_transfer): Same.
(gfc_conv_intrinsic_trim): Same.
(gfc_conv_intrinsic_repeat): Same.
From-SVN: r148442
2009-06-13 00:06:47 +02:00
|
|
|
|
guard = build_decl (DECL_SOURCE_LOCATION (decl),
|
|
|
|
|
VAR_DECL, sname, guard_type);
|
2005-06-14 22:01:59 +02:00
|
|
|
|
|
2002-09-13 13:33:47 +02:00
|
|
|
|
/* The guard should have the same linkage as what it guards. */
|
2001-01-11 14:34:00 +01:00
|
|
|
|
TREE_PUBLIC (guard) = TREE_PUBLIC (decl);
|
|
|
|
|
TREE_STATIC (guard) = TREE_STATIC (decl);
|
|
|
|
|
DECL_COMMON (guard) = DECL_COMMON (decl);
|
2009-12-01 22:58:04 +01:00
|
|
|
|
DECL_COMDAT (guard) = DECL_COMDAT (decl);
|
2009-12-04 01:26:35 +01:00
|
|
|
|
if (DECL_ONE_ONLY (decl))
|
|
|
|
|
make_decl_one_only (guard, cxx_comdat_group (guard));
|
2001-01-11 14:34:00 +01:00
|
|
|
|
if (TREE_PUBLIC (decl))
|
2005-06-15 02:41:35 +02:00
|
|
|
|
DECL_WEAK (guard) = DECL_WEAK (decl);
|
2007-09-07 05:56:41 +02:00
|
|
|
|
DECL_VISIBILITY (guard) = DECL_VISIBILITY (decl);
|
|
|
|
|
DECL_VISIBILITY_SPECIFIED (guard) = DECL_VISIBILITY_SPECIFIED (decl);
|
2005-06-14 22:01:59 +02:00
|
|
|
|
|
2000-06-30 09:16:35 +02:00
|
|
|
|
DECL_ARTIFICIAL (guard) = 1;
|
2005-01-01 02:43:12 +01:00
|
|
|
|
DECL_IGNORED_P (guard) = 1;
|
2000-06-30 09:16:35 +02:00
|
|
|
|
TREE_USED (guard) = 1;
|
2003-06-20 02:48:44 +02:00
|
|
|
|
pushdecl_top_level_and_finish (guard, NULL_TREE);
|
2000-06-30 09:16:35 +02:00
|
|
|
|
}
|
|
|
|
|
return guard;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Return those bits of the GUARD variable that should be set when the
|
|
|
|
|
guarded entity is actually initialized. */
|
|
|
|
|
|
|
|
|
|
static tree
|
Remove traditional C constructs 4/n.
* decl2.c (grok_method_quals, warn_if_unknown_interface,
grok_x_components, cp_build_parm_decl, build_artificial_parm,
maybe_retrofit_in_chrg, grokclassfn, grok_array_decl,
delete_sanity, check_member_template, check_java_method,
check_classfn, finish_static_data_member_decl, grokfield,
grokbitfield, grokoptypename, grok_function_init,
cplus_decl_attributes, constructor_name, defer_fn,
build_anon_union_vars, finish_anon_union, coerce_new_type,
coerce_delete_type, comdat_linkage, maybe_make_one_only,
key_method, import_export_vtable, import_export_class,
output_vtable_inherit, import_export_decl, import_export_tinfo,
build_cleanup, get_guard, get_guard_bits, get_guard_cond,
set_guard, start_objects, finish_objects,
start_static_storage_duration_function,
finish_static_storage_duration_function, get_priority_info,
start_static_initialization_or_destruction,
finish_static_initialization_or_destruction,
do_static_initialization, do_static_destruction,
prune_vars_needing_no_initialization, write_out_vars,
reparse_decl_as_expr, finish_decl_parsing, namespace_ancestor,
add_using_namespace, merge_functions, ambiguous_decl,
lookup_using_namespace, lookup_using_namespace,
qualified_lookup_using_namespace, set_decl_namespace,
decl_namespace, current_decl_namespace, push_decl_namespace,
pop_decl_namespace, push_scope, pop_scope, add_function,
arg_assoc_namespace, arg_assoc_template_arg, arg_assoc,
lookup_arg_dependent, do_namespace_alias,
validate_nonmember_using_decl, do_nonmember_using_decl,
do_toplevel_using_decl, do_local_using_decl,
do_class_using_decl, do_using_directive, check_default_args,
mark_used, handle_class_head): Use C90 prototypings. Use booleans.
* parser.c (cp_parser_class_head): Use booleanss.
* decl.c (walk_globals, walk_vtables): Likewise.
* cp-tree.h (walk_globals_pred, walk_globals_fn, walk_vtables,
walk_globals): Change return type from 'int' to 'bool'.
* rtti.c (init_rtti_processing, build_headof, throw_bad_cast
throw_bad_typeid, get_tinfo_decl_dynamic, typeid_ok_p,
build_typeid, tinfo_name, get_tinfo_decl, get_tinfo_ptr,
get_typeid, ifnonnull, build_dynamic_cast_1, build_dynamic_cast,
qualifier_flags, tinfo_base_init, generic_initializer,
ptr_initializer, dfs_class_hint_mark, ptm_initializer,
dfs_class_hint_unmark, class_hint_flags, class_initializer,
typeinfo_in_lib_p, get_pseudo_ti_init, create_pseudo_type_info,
get_pseudo_ti_desc, create_tinfo_types, emit_support_tinfos,
unemitted_tinfo_decl_p, emit_tinfo_decl): Likewise.
* repo.c (repo_compile_flags, repo_template_declared,
repo_template_defined, repo_class_defined, repo_get_id,
repo_template_used, repo_vtable_used, repo_inline_used,
repo_tinfo_used, repo_template_instantiated, extract_string,
open_repo_file, afgets, init_repo, reopen_repo_file_for_write,
finish_repo): Likewise.
* ptree.c (cxx_print_decl, cxx_print_type, cxx_print_identifier,
cxx_print_xnode): Likewise..
* cp-lang.c (ok_to_generate_alias_set_for_type, cxx_get_alias_set,
cxx_warn_unused_global_decl, cp_expr_size): Likewise.
* cxxfilt.c (demangle_it, print_demangler_list, usage,
standard_symbol_characters, hp_symbol_characters, main, fatal):
Likewise.
(strip_underscore): Change type from 'int' to 'bool'.
(main): Use boolean constants.
From-SVN: r60601
2002-12-29 15:53:05 +01:00
|
|
|
|
get_guard_bits (tree guard)
|
2000-06-30 09:16:35 +02:00
|
|
|
|
{
|
2004-06-25 19:15:46 +02:00
|
|
|
|
if (!targetm.cxx.guard_mask_bit ())
|
|
|
|
|
{
|
|
|
|
|
/* We only set the first byte of the guard, in order to leave room
|
|
|
|
|
for a mutex in the high-order bits. */
|
2005-06-14 22:01:59 +02:00
|
|
|
|
guard = build1 (ADDR_EXPR,
|
2004-06-25 19:15:46 +02:00
|
|
|
|
build_pointer_type (TREE_TYPE (guard)),
|
|
|
|
|
guard);
|
2005-06-14 22:01:59 +02:00
|
|
|
|
guard = build1 (NOP_EXPR,
|
|
|
|
|
build_pointer_type (char_type_node),
|
2004-06-25 19:15:46 +02:00
|
|
|
|
guard);
|
|
|
|
|
guard = build1 (INDIRECT_REF, char_type_node, guard);
|
|
|
|
|
}
|
2000-06-30 09:16:35 +02:00
|
|
|
|
|
|
|
|
|
return guard;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Return an expression which determines whether or not the GUARD
|
|
|
|
|
variable has already been initialized. */
|
|
|
|
|
|
|
|
|
|
tree
|
Remove traditional C constructs 4/n.
* decl2.c (grok_method_quals, warn_if_unknown_interface,
grok_x_components, cp_build_parm_decl, build_artificial_parm,
maybe_retrofit_in_chrg, grokclassfn, grok_array_decl,
delete_sanity, check_member_template, check_java_method,
check_classfn, finish_static_data_member_decl, grokfield,
grokbitfield, grokoptypename, grok_function_init,
cplus_decl_attributes, constructor_name, defer_fn,
build_anon_union_vars, finish_anon_union, coerce_new_type,
coerce_delete_type, comdat_linkage, maybe_make_one_only,
key_method, import_export_vtable, import_export_class,
output_vtable_inherit, import_export_decl, import_export_tinfo,
build_cleanup, get_guard, get_guard_bits, get_guard_cond,
set_guard, start_objects, finish_objects,
start_static_storage_duration_function,
finish_static_storage_duration_function, get_priority_info,
start_static_initialization_or_destruction,
finish_static_initialization_or_destruction,
do_static_initialization, do_static_destruction,
prune_vars_needing_no_initialization, write_out_vars,
reparse_decl_as_expr, finish_decl_parsing, namespace_ancestor,
add_using_namespace, merge_functions, ambiguous_decl,
lookup_using_namespace, lookup_using_namespace,
qualified_lookup_using_namespace, set_decl_namespace,
decl_namespace, current_decl_namespace, push_decl_namespace,
pop_decl_namespace, push_scope, pop_scope, add_function,
arg_assoc_namespace, arg_assoc_template_arg, arg_assoc,
lookup_arg_dependent, do_namespace_alias,
validate_nonmember_using_decl, do_nonmember_using_decl,
do_toplevel_using_decl, do_local_using_decl,
do_class_using_decl, do_using_directive, check_default_args,
mark_used, handle_class_head): Use C90 prototypings. Use booleans.
* parser.c (cp_parser_class_head): Use booleanss.
* decl.c (walk_globals, walk_vtables): Likewise.
* cp-tree.h (walk_globals_pred, walk_globals_fn, walk_vtables,
walk_globals): Change return type from 'int' to 'bool'.
* rtti.c (init_rtti_processing, build_headof, throw_bad_cast
throw_bad_typeid, get_tinfo_decl_dynamic, typeid_ok_p,
build_typeid, tinfo_name, get_tinfo_decl, get_tinfo_ptr,
get_typeid, ifnonnull, build_dynamic_cast_1, build_dynamic_cast,
qualifier_flags, tinfo_base_init, generic_initializer,
ptr_initializer, dfs_class_hint_mark, ptm_initializer,
dfs_class_hint_unmark, class_hint_flags, class_initializer,
typeinfo_in_lib_p, get_pseudo_ti_init, create_pseudo_type_info,
get_pseudo_ti_desc, create_tinfo_types, emit_support_tinfos,
unemitted_tinfo_decl_p, emit_tinfo_decl): Likewise.
* repo.c (repo_compile_flags, repo_template_declared,
repo_template_defined, repo_class_defined, repo_get_id,
repo_template_used, repo_vtable_used, repo_inline_used,
repo_tinfo_used, repo_template_instantiated, extract_string,
open_repo_file, afgets, init_repo, reopen_repo_file_for_write,
finish_repo): Likewise.
* ptree.c (cxx_print_decl, cxx_print_type, cxx_print_identifier,
cxx_print_xnode): Likewise..
* cp-lang.c (ok_to_generate_alias_set_for_type, cxx_get_alias_set,
cxx_warn_unused_global_decl, cp_expr_size): Likewise.
* cxxfilt.c (demangle_it, print_demangler_list, usage,
standard_symbol_characters, hp_symbol_characters, main, fatal):
Likewise.
(strip_underscore): Change type from 'int' to 'bool'.
(main): Use boolean constants.
From-SVN: r60601
2002-12-29 15:53:05 +01:00
|
|
|
|
get_guard_cond (tree guard)
|
2000-06-30 09:16:35 +02:00
|
|
|
|
{
|
|
|
|
|
tree guard_value;
|
|
|
|
|
|
|
|
|
|
/* Check to see if the GUARD is zero. */
|
|
|
|
|
guard = get_guard_bits (guard);
|
2004-06-25 19:15:46 +02:00
|
|
|
|
|
|
|
|
|
/* Mask off all but the low bit. */
|
|
|
|
|
if (targetm.cxx.guard_mask_bit ())
|
|
|
|
|
{
|
|
|
|
|
guard_value = integer_one_node;
|
|
|
|
|
if (!same_type_p (TREE_TYPE (guard_value), TREE_TYPE (guard)))
|
|
|
|
|
guard_value = convert (TREE_TYPE (guard), guard_value);
|
2008-09-23 16:55:14 +02:00
|
|
|
|
guard = cp_build_binary_op (input_location,
|
|
|
|
|
BIT_AND_EXPR, guard, guard_value,
|
2008-03-25 14:53:58 +01:00
|
|
|
|
tf_warning_or_error);
|
2004-06-25 19:15:46 +02:00
|
|
|
|
}
|
|
|
|
|
|
2000-06-30 09:16:35 +02:00
|
|
|
|
guard_value = integer_zero_node;
|
|
|
|
|
if (!same_type_p (TREE_TYPE (guard_value), TREE_TYPE (guard)))
|
|
|
|
|
guard_value = convert (TREE_TYPE (guard), guard_value);
|
2008-09-23 16:55:14 +02:00
|
|
|
|
return cp_build_binary_op (input_location,
|
|
|
|
|
EQ_EXPR, guard, guard_value,
|
2008-03-25 14:53:58 +01:00
|
|
|
|
tf_warning_or_error);
|
2000-06-30 09:16:35 +02:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Return an expression which sets the GUARD variable, indicating that
|
|
|
|
|
the variable being guarded has been initialized. */
|
|
|
|
|
|
|
|
|
|
tree
|
Remove traditional C constructs 4/n.
* decl2.c (grok_method_quals, warn_if_unknown_interface,
grok_x_components, cp_build_parm_decl, build_artificial_parm,
maybe_retrofit_in_chrg, grokclassfn, grok_array_decl,
delete_sanity, check_member_template, check_java_method,
check_classfn, finish_static_data_member_decl, grokfield,
grokbitfield, grokoptypename, grok_function_init,
cplus_decl_attributes, constructor_name, defer_fn,
build_anon_union_vars, finish_anon_union, coerce_new_type,
coerce_delete_type, comdat_linkage, maybe_make_one_only,
key_method, import_export_vtable, import_export_class,
output_vtable_inherit, import_export_decl, import_export_tinfo,
build_cleanup, get_guard, get_guard_bits, get_guard_cond,
set_guard, start_objects, finish_objects,
start_static_storage_duration_function,
finish_static_storage_duration_function, get_priority_info,
start_static_initialization_or_destruction,
finish_static_initialization_or_destruction,
do_static_initialization, do_static_destruction,
prune_vars_needing_no_initialization, write_out_vars,
reparse_decl_as_expr, finish_decl_parsing, namespace_ancestor,
add_using_namespace, merge_functions, ambiguous_decl,
lookup_using_namespace, lookup_using_namespace,
qualified_lookup_using_namespace, set_decl_namespace,
decl_namespace, current_decl_namespace, push_decl_namespace,
pop_decl_namespace, push_scope, pop_scope, add_function,
arg_assoc_namespace, arg_assoc_template_arg, arg_assoc,
lookup_arg_dependent, do_namespace_alias,
validate_nonmember_using_decl, do_nonmember_using_decl,
do_toplevel_using_decl, do_local_using_decl,
do_class_using_decl, do_using_directive, check_default_args,
mark_used, handle_class_head): Use C90 prototypings. Use booleans.
* parser.c (cp_parser_class_head): Use booleanss.
* decl.c (walk_globals, walk_vtables): Likewise.
* cp-tree.h (walk_globals_pred, walk_globals_fn, walk_vtables,
walk_globals): Change return type from 'int' to 'bool'.
* rtti.c (init_rtti_processing, build_headof, throw_bad_cast
throw_bad_typeid, get_tinfo_decl_dynamic, typeid_ok_p,
build_typeid, tinfo_name, get_tinfo_decl, get_tinfo_ptr,
get_typeid, ifnonnull, build_dynamic_cast_1, build_dynamic_cast,
qualifier_flags, tinfo_base_init, generic_initializer,
ptr_initializer, dfs_class_hint_mark, ptm_initializer,
dfs_class_hint_unmark, class_hint_flags, class_initializer,
typeinfo_in_lib_p, get_pseudo_ti_init, create_pseudo_type_info,
get_pseudo_ti_desc, create_tinfo_types, emit_support_tinfos,
unemitted_tinfo_decl_p, emit_tinfo_decl): Likewise.
* repo.c (repo_compile_flags, repo_template_declared,
repo_template_defined, repo_class_defined, repo_get_id,
repo_template_used, repo_vtable_used, repo_inline_used,
repo_tinfo_used, repo_template_instantiated, extract_string,
open_repo_file, afgets, init_repo, reopen_repo_file_for_write,
finish_repo): Likewise.
* ptree.c (cxx_print_decl, cxx_print_type, cxx_print_identifier,
cxx_print_xnode): Likewise..
* cp-lang.c (ok_to_generate_alias_set_for_type, cxx_get_alias_set,
cxx_warn_unused_global_decl, cp_expr_size): Likewise.
* cxxfilt.c (demangle_it, print_demangler_list, usage,
standard_symbol_characters, hp_symbol_characters, main, fatal):
Likewise.
(strip_underscore): Change type from 'int' to 'bool'.
(main): Use boolean constants.
From-SVN: r60601
2002-12-29 15:53:05 +01:00
|
|
|
|
set_guard (tree guard)
|
2000-06-30 09:16:35 +02:00
|
|
|
|
{
|
|
|
|
|
tree guard_init;
|
|
|
|
|
|
|
|
|
|
/* Set the GUARD to one. */
|
|
|
|
|
guard = get_guard_bits (guard);
|
|
|
|
|
guard_init = integer_one_node;
|
|
|
|
|
if (!same_type_p (TREE_TYPE (guard_init), TREE_TYPE (guard)))
|
|
|
|
|
guard_init = convert (TREE_TYPE (guard), guard_init);
|
2008-03-25 14:53:58 +01:00
|
|
|
|
return cp_build_modify_expr (guard, NOP_EXPR, guard_init,
|
|
|
|
|
tf_warning_or_error);
|
1996-04-24 20:30:21 +02:00
|
|
|
|
}
|
|
|
|
|
|
1998-05-20 04:46:16 +02:00
|
|
|
|
/* Start the process of running a particular set of global constructors
|
|
|
|
|
or destructors. Subroutine of do_[cd]tors. */
|
|
|
|
|
|
1999-09-24 03:29:29 +02:00
|
|
|
|
static tree
|
Remove traditional C constructs 4/n.
* decl2.c (grok_method_quals, warn_if_unknown_interface,
grok_x_components, cp_build_parm_decl, build_artificial_parm,
maybe_retrofit_in_chrg, grokclassfn, grok_array_decl,
delete_sanity, check_member_template, check_java_method,
check_classfn, finish_static_data_member_decl, grokfield,
grokbitfield, grokoptypename, grok_function_init,
cplus_decl_attributes, constructor_name, defer_fn,
build_anon_union_vars, finish_anon_union, coerce_new_type,
coerce_delete_type, comdat_linkage, maybe_make_one_only,
key_method, import_export_vtable, import_export_class,
output_vtable_inherit, import_export_decl, import_export_tinfo,
build_cleanup, get_guard, get_guard_bits, get_guard_cond,
set_guard, start_objects, finish_objects,
start_static_storage_duration_function,
finish_static_storage_duration_function, get_priority_info,
start_static_initialization_or_destruction,
finish_static_initialization_or_destruction,
do_static_initialization, do_static_destruction,
prune_vars_needing_no_initialization, write_out_vars,
reparse_decl_as_expr, finish_decl_parsing, namespace_ancestor,
add_using_namespace, merge_functions, ambiguous_decl,
lookup_using_namespace, lookup_using_namespace,
qualified_lookup_using_namespace, set_decl_namespace,
decl_namespace, current_decl_namespace, push_decl_namespace,
pop_decl_namespace, push_scope, pop_scope, add_function,
arg_assoc_namespace, arg_assoc_template_arg, arg_assoc,
lookup_arg_dependent, do_namespace_alias,
validate_nonmember_using_decl, do_nonmember_using_decl,
do_toplevel_using_decl, do_local_using_decl,
do_class_using_decl, do_using_directive, check_default_args,
mark_used, handle_class_head): Use C90 prototypings. Use booleans.
* parser.c (cp_parser_class_head): Use booleanss.
* decl.c (walk_globals, walk_vtables): Likewise.
* cp-tree.h (walk_globals_pred, walk_globals_fn, walk_vtables,
walk_globals): Change return type from 'int' to 'bool'.
* rtti.c (init_rtti_processing, build_headof, throw_bad_cast
throw_bad_typeid, get_tinfo_decl_dynamic, typeid_ok_p,
build_typeid, tinfo_name, get_tinfo_decl, get_tinfo_ptr,
get_typeid, ifnonnull, build_dynamic_cast_1, build_dynamic_cast,
qualifier_flags, tinfo_base_init, generic_initializer,
ptr_initializer, dfs_class_hint_mark, ptm_initializer,
dfs_class_hint_unmark, class_hint_flags, class_initializer,
typeinfo_in_lib_p, get_pseudo_ti_init, create_pseudo_type_info,
get_pseudo_ti_desc, create_tinfo_types, emit_support_tinfos,
unemitted_tinfo_decl_p, emit_tinfo_decl): Likewise.
* repo.c (repo_compile_flags, repo_template_declared,
repo_template_defined, repo_class_defined, repo_get_id,
repo_template_used, repo_vtable_used, repo_inline_used,
repo_tinfo_used, repo_template_instantiated, extract_string,
open_repo_file, afgets, init_repo, reopen_repo_file_for_write,
finish_repo): Likewise.
* ptree.c (cxx_print_decl, cxx_print_type, cxx_print_identifier,
cxx_print_xnode): Likewise..
* cp-lang.c (ok_to_generate_alias_set_for_type, cxx_get_alias_set,
cxx_warn_unused_global_decl, cp_expr_size): Likewise.
* cxxfilt.c (demangle_it, print_demangler_list, usage,
standard_symbol_characters, hp_symbol_characters, main, fatal):
Likewise.
(strip_underscore): Change type from 'int' to 'bool'.
(main): Use boolean constants.
From-SVN: r60601
2002-12-29 15:53:05 +01:00
|
|
|
|
start_objects (int method_type, int initp)
|
1998-05-20 04:46:16 +02:00
|
|
|
|
{
|
1999-09-24 03:29:29 +02:00
|
|
|
|
tree body;
|
2004-06-22 09:18:38 +02:00
|
|
|
|
tree fndecl;
|
1998-08-13 19:29:30 +02:00
|
|
|
|
char type[10];
|
1998-05-20 04:46:16 +02:00
|
|
|
|
|
|
|
|
|
/* Make ctor or dtor function. METHOD_TYPE may be 'I' or 'D'. */
|
|
|
|
|
|
1999-02-05 03:47:00 +01:00
|
|
|
|
if (initp != DEFAULT_INIT_PRIORITY)
|
1998-08-13 19:29:30 +02:00
|
|
|
|
{
|
1998-10-10 11:24:06 +02:00
|
|
|
|
char joiner;
|
|
|
|
|
|
|
|
|
|
#ifdef JOINER
|
|
|
|
|
joiner = JOINER;
|
|
|
|
|
#else
|
|
|
|
|
joiner = '_';
|
|
|
|
|
#endif
|
1998-08-13 19:29:30 +02:00
|
|
|
|
|
1998-10-10 11:24:06 +02:00
|
|
|
|
sprintf (type, "%c%c%.5u", method_type, joiner, initp);
|
1998-08-13 19:29:30 +02:00
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
sprintf (type, "%c", method_type);
|
|
|
|
|
|
2005-06-14 22:01:59 +02:00
|
|
|
|
fndecl = build_lang_decl (FUNCTION_DECL,
|
2006-11-01 06:06:12 +01:00
|
|
|
|
get_file_function_name (type),
|
2010-06-09 17:18:40 +02:00
|
|
|
|
build_function_type_list (void_type_node,
|
|
|
|
|
NULL_TREE));
|
2004-06-22 09:18:38 +02:00
|
|
|
|
start_preparsed_function (fndecl, /*attrs=*/NULL_TREE, SF_PRE_PARSED);
|
1998-05-20 04:46:16 +02:00
|
|
|
|
|
semantics.c (expand_or_defer_fn): Do not call c_record_cdtor_fn.
* semantics.c (expand_or_defer_fn): Do not call c_record_cdtor_fn.
* decl2.c (start_objects): ctors and dtors are no longer public.
(cp_write_global_declarations): Do not call c_build_cdtor_fns.
* cgraphunit.c: Include gt-cgraphunit.h
(static_ctors, static_dtors): New static vars.
(record_cdtor_fn, build_cdtor, cgraph_build_cdtor_fns): New functions,
based on implementation in c-common.c
(cgraph_finalize_function): Call record_cdtor_fn.
(cgraph_optimize): Call cgraph_build_cdtor_fns.
* decl.c (finish_function): Do not call c_record_cdtor_fn.
(c_write_global_declarations): Do not call c_build_cdtor_fns.
* c-common.c (static_ctors, static_dtors, c_record_cdtor_fn,
build_cdtor, c_build_cdtor_fns): Remove.
* c-common.h (static_ctors, static_dtors, c_record_cdtor_fn,
c_build_cdtor_fns): Remove prototype.
From-SVN: r124618
2007-05-11 14:18:17 +02:00
|
|
|
|
TREE_PUBLIC (current_function_decl) = 0;
|
1999-02-21 20:42:18 +01:00
|
|
|
|
|
2007-06-28 20:31:53 +02:00
|
|
|
|
/* Mark as artificial because it's not explicitly in the user's
|
|
|
|
|
source code. */
|
|
|
|
|
DECL_ARTIFICIAL (current_function_decl) = 1;
|
|
|
|
|
|
1999-09-23 04:04:33 +02:00
|
|
|
|
/* Mark this declaration as used to avoid spurious warnings. */
|
|
|
|
|
TREE_USED (current_function_decl) = 1;
|
|
|
|
|
|
1999-10-01 02:43:27 +02:00
|
|
|
|
/* Mark this function as a global constructor or destructor. */
|
|
|
|
|
if (method_type == 'I')
|
|
|
|
|
DECL_GLOBAL_CTOR_P (current_function_decl) = 1;
|
|
|
|
|
else
|
|
|
|
|
DECL_GLOBAL_DTOR_P (current_function_decl) = 1;
|
|
|
|
|
|
c-common.c (lang_gimplify_stmt): Remove next_p argument.
* c-common.c (lang_gimplify_stmt): Remove next_p argument.
(if_elt, if_stack, if_stack_space, c_expand_start_cond, c_finish_then,
c_expand_end_cond, c_expand_start_else, c_finish_else, c_begin_if_stmt,
c_begin_while_stmt, c_finish_while_stmt_cond): Move to c-typeck.c.
(finish_fname_decls, fname_decl): Use statement_lists.
(c_expand_expr_stmt): Don't set last_expr_type.
(c_type_hash): Fix indentation.
(c_safe_from_p): Don't follow TREE_CHAIN.
(c_tree_chain_matters_p): Remove.
* c-common.def (SCOPE_STMT): Remove.
(CLEANUP_STMT): Redefine to contain its own body.
* c-common.h (struct stmt_tree_s): Remove x_last_stmt,
x_last_expr_type, x_last_expr_filename, x_scope_stmt_stack.
Add x_cur_stmt_list.
(last_tree, last_expr_type, last_expr_filename, RECHAIN_STMTS): Remove.
(cur_stmt_list): New.
(STATEMENT_LIST_STMT_EXPR): New.
(SCOPE_BEGIN_P, SCOPE_END_P, SCOPE_STMT_BLOCK, SCOPE_NULLIFIED_P,
SCOPE_NO_CLEANUPS_P, SCOPE_PARTIAL_P, NEW_FOR_SCOPE_P): Remove.
(CLEANUP_BODY): New.
(CLEANUP_DECL): Move to operand 2.
(c_common_stmt_codes): Remove SCOPE_STMT.
(COMPOUND_STMT_NO_SCOPE, COMPOUND_STMT_BODY_BLOCK): Remove.
* c-decl.c (c_scope_stmt_stack, current_scope_stmt_stack): Remove.
(c_push_function_context, c_pop_function_context): Don't save it.
(finish_decl): Set TREE_USED on the decl for a cleanup.
Use push_cleanup.
(store_parm_decls): Use statement lists.
(finish_function): Remove compstmt rule workaround. Use statement
lists. Call finish_fname_decls after finalizing the body.
(c_begin_compound_stmt): Move to c-typeck.c.
* c-dump.c (c_dump_tree): Remove SCOPE_STMT.
* c-gimplify.c (gimplify_cleanup_stmt, gimplify_cleanup_stmts): New.
(c_genericize): Invoke them.
(c_gimplify_stmt): Don't look through TREE_CHAIN. Kill SCOPE_STMT.
(c_build_bind_expr): Export.
(gimplify_block, gimplify_cleanup): Remove.
(gimplify_condition): Use gimplify_stmt.
(gimplify_for_stmt): Remove FOR_INIT_STMT chaining hack.
(gimplify_if_stmt): Remove recursion hack.
(c_gimplify_expr): Remove STMT_EXPR handling.
(stmt_expr_last_stmt, gimplify_stmt_expr): Remove.
(is_last_stmt_of_scope): Remove.
* c-lang.c (LANG_HOOKS_TREE_INLINING_TREE_CHAIN_MATTERS_P): Remove.
* c-mudflap.c (mflang_flush_calls): Use c_begin_compound_stmt,
c_end_compound_stmt.
* c-objc-common.c (build_cdtor): Likewise.
* c-parse.in (primary): Use c_finish_stmt_expr.
(push_scope, pop_scope): Remove.
(c99_block_start, compstmt_start): Use c_begin_compound_stmt.
(c99_block_end, compstmt): Use c_end_compound_stmt.
(c99_block_lineno_labeled_stmt): Likewise.
(compstmt_primary_start): Use c_begin_stmt_expr.
(simple_if, select_or_iter_stmt): Update calls to stmt builders.
(do_stmt_start): Fill in body directly.
(lineno_stmt): Avoid setting lineno on constants.
* c-pretty-print.c (pp_c_statement): Handle STATEMENT_LIST.
Remove SCOPE_STMT.
* c-semantics.c (begin_stmt_tree): Remove.
(push_stmt_list, re_push_stmt_list, pop_stmt_list): New.
(add_stmt): Use statement lists.
(add_scope_stmt, finish_stmt_tree): Remove.
(push_cleanup): New.
* c-tree.h: Move some decls from c-common.h.
* c-typeck.c (c_tree_expr_nonnegative_p): Simplify for statement lists.
(do_case, c_finish_case): Likewise.
(c_finish_then): Take body for then as argument.
(c_finish_else): Similarly.
(c_begin_for_stmt, c_finish_for_stmt_init, c_finish_for_stmt_cond,
c_finish_for_stmt_incr, c_finish_for_stmt): New.
(c_begin_stmt_expr, c_finish_stmt_expr): New.
(c_begin_compound_stmt): Do scope management.
(c_end_compound_stmt): New.
* fold-const.c (tree_expr_nonnegative_p): Fix BIND_EXPR.
* gimplify.c (voidify_wrapper_expr): Accept temporary argument.
Look through exception handling constructs.
(gimplify_bind_expr): Accept temporary argument.
(gimplify_target_expr): Special case BIND_EXPR bodies.
(gimplify_expr): Handle fallback == fb_none like a statement.
* langhooks-def.h (LANG_HOOKS_TREE_INLINING_TREE_CHAIN_MATTERS_P): Kill.
* langhooks.c (lhd_tree_inlining_tree_chain_matters_p): Remove.
* langhooks.h (tree_chain_matters_p): Remove.
* stub-objc.c (objc_clear_super_receiver): New.
* tree-gimple.h (voidify_wrapper_expr): Update decl.
(append_to_statement_list, append_to_statement_list_force): Move
to tree-iterator.h.
* tree-inline.c (expand_call_inline): Update call.
(clone_body): Use statement lists.
(walk_tree): Don't check tree_chain_matters_p.
(copy_tree_r): Likewise.
* tree-iterator.c (alloc_stmt_list): Clear lang bits.
(tsi_link_before, tsi_link_after): Set TREE_SIDE_EFFECTS properly.
* tree-iterator.h (append_to_statement_list,
append_to_statement_list_force): Moved from tree-gimple.h.
* tree-pretty-print.c (dump_generic_node): Clean up TARGET_EXPR dump.
* objc/objc-act.c (build_module_descriptor): Use c_begin_compound_stmt.
(objc_enter_block): Likewise.
(objc_exit_block): Use c_end_compound_stmt.
(objc_build_try_enter_fragment): Add #error and comment for
rewriting for OBJCPLUS.
(objc_build_extract_fragment, objc_build_try_epilogue,
objc_build_catch_stmt, objc_build_finally_prologue,
objc_build_finally_epilogue): Update for C statement builders.
* objc/objc-lang.c (LANG_HOOKS_TREE_INLINING_TREE_CHAIN_MATTERS_P):
Remove.
cp/
* call.c (initialize_reference): Don't build CLEANUP_STMT here.
* cp-gimplify.c (cp_gimplify_stmt): Remove next_p argument.
(genericize_try_block): Use gimplify_stmt.
(genericize_catch_block, genericize_eh_spec_block): Likewise.
(cp_gimplify_init_expr): Remove STMT_EXPR special case.
(gimplify_must_not_throw_expr): Update voidify_wrapper_expr call.
* cp-lang.c (LANG_HOOKS_TREE_INLINING_TREE_CHAIN_MATTERS_P): Remove.
(cp_tree_chain_matters_p): Remove.
* cp-tree.h (COMPOUND_STMT_TRY_BLOCK): New.
(COMPOUND_STMT_BODY_BLOCK): New.
(STATEMENT_LIST_NO_SCOPE, STATEMENT_LIST_TRY_BLOCK): New.
(EXPR_STMT_STMT_EXPR_RESULT): New.
(building_stmt_tree): Check cur_stmt_list.
(tf_stmt_expr_cmpd, tf_stmt_expr_body): Remove.
(BCS_NO_SCOPE, BCS_TRY_BLOCK, BCS_FN_BODY): New.
* decl.c (poplevel): Use pop_stmt_list for minding cleanups.
(cp_finish_decl): Use push_cleanup.
(start_function, finish_function): Use statement lists.
(finish_stmt): Do nothing.
* except.c (begin_eh_spec_block): Use statement lists.
(check_handlers_1, check_handlers): Likewise.
* init.c (construct_virtual_base): Don't add extra compound stmts.
(build_vec_init): Likewise.
* name-lookup.c (maybe_push_cleanup_level): Use statement lists.
* name-lookup.h (struct cp_binding_level): Add statement_list.
* parser.c (cp_parser_statement): Take the STMT_EXPR node, not a bool.
(cp_parser_labeled_statement, cp_parser_expression_statement,
cp_parser_statement_seq_opt): Likewise.
(cp_parser_compound_statement): Likewise. Take bool for try block.
(cp_parser_selection_statement): Tidy if processing.
(cp_parser_already_scoped_statement): Rewrite to do what it says.
* pt.c (tsubst_copy): Move STMT_EXPR to tsubst_expr.
(tsubst_expr): Rewrite STMT_EXPR processing. Handle STATEMENT_LIST.
Mind COMPOUND_STMT_TRY_BLOCK, EXPR_STMT_STMT_EXPR_RESULT.
* semantics.c (do_poplevel, do_pushlevel): Use statement lists.
(finish_cond): New, rewritten from FINISH_COND.
(simplify_loop_decl_cond): New.
(finish_expr_stmt): Avoid nested EXPR_STMTs.
(begin_if_stmt, finish_if_stmt_cond, finish_then_clause,
begin_else_clause, finish_else_clause, finish_if_stmt,
begin_while_stmt, finish_while_stmt_cond, finish_while_stmt,
begin_do_stmt, finish_do_body, begin_for_stmt, finish_for_init_stmt,
finish_for_cond, finish_for_stmt, begin_switch_stmt,
finish_switch_cond, finish_switch_stmt, begin_try_block,
finish_try_block, finish_cleanup_try_block, finish_function_try_block,
finish_handler_sequence, finish_function_handler_sequence,
begin_handler, finish_handler_parms, finish_handler,
begin_stmt_expr, finish_stmt_expr_expr, finish_stmt_expr): Rewrite
using statement lists.
(begin_compound_stmt): Replace has_no_scope argument with flags.
Update all callers. Use statement lists.
(finish_compound_stmt): Likewise.
(finish_decl_cleanup, finish_eh_cleanup): Use push_cleanup.
(current_scope_stmt_stack): Remove.
(simplify_aggr_init_expr): Don't muck with TREE_CHAIN.
* typeck2.c (split_nonconstant_init_1, split_nonconstant_init):
Rewrite with statement lists.
testsuite/
* g++.dg/ext/stmtexpr1.C: XFAIL.
* gcc.dg/20030612-1.c: XFAIL.
From-SVN: r83221
2004-06-16 03:21:38 +02:00
|
|
|
|
body = begin_compound_stmt (BCS_FN_BODY);
|
1999-05-05 13:50:03 +02:00
|
|
|
|
|
1999-09-24 03:29:29 +02:00
|
|
|
|
return body;
|
1998-05-20 04:46:16 +02:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Finish the process of running a particular set of global constructors
|
|
|
|
|
or destructors. Subroutine of do_[cd]tors. */
|
|
|
|
|
|
|
|
|
|
static void
|
Remove traditional C constructs 4/n.
* decl2.c (grok_method_quals, warn_if_unknown_interface,
grok_x_components, cp_build_parm_decl, build_artificial_parm,
maybe_retrofit_in_chrg, grokclassfn, grok_array_decl,
delete_sanity, check_member_template, check_java_method,
check_classfn, finish_static_data_member_decl, grokfield,
grokbitfield, grokoptypename, grok_function_init,
cplus_decl_attributes, constructor_name, defer_fn,
build_anon_union_vars, finish_anon_union, coerce_new_type,
coerce_delete_type, comdat_linkage, maybe_make_one_only,
key_method, import_export_vtable, import_export_class,
output_vtable_inherit, import_export_decl, import_export_tinfo,
build_cleanup, get_guard, get_guard_bits, get_guard_cond,
set_guard, start_objects, finish_objects,
start_static_storage_duration_function,
finish_static_storage_duration_function, get_priority_info,
start_static_initialization_or_destruction,
finish_static_initialization_or_destruction,
do_static_initialization, do_static_destruction,
prune_vars_needing_no_initialization, write_out_vars,
reparse_decl_as_expr, finish_decl_parsing, namespace_ancestor,
add_using_namespace, merge_functions, ambiguous_decl,
lookup_using_namespace, lookup_using_namespace,
qualified_lookup_using_namespace, set_decl_namespace,
decl_namespace, current_decl_namespace, push_decl_namespace,
pop_decl_namespace, push_scope, pop_scope, add_function,
arg_assoc_namespace, arg_assoc_template_arg, arg_assoc,
lookup_arg_dependent, do_namespace_alias,
validate_nonmember_using_decl, do_nonmember_using_decl,
do_toplevel_using_decl, do_local_using_decl,
do_class_using_decl, do_using_directive, check_default_args,
mark_used, handle_class_head): Use C90 prototypings. Use booleans.
* parser.c (cp_parser_class_head): Use booleanss.
* decl.c (walk_globals, walk_vtables): Likewise.
* cp-tree.h (walk_globals_pred, walk_globals_fn, walk_vtables,
walk_globals): Change return type from 'int' to 'bool'.
* rtti.c (init_rtti_processing, build_headof, throw_bad_cast
throw_bad_typeid, get_tinfo_decl_dynamic, typeid_ok_p,
build_typeid, tinfo_name, get_tinfo_decl, get_tinfo_ptr,
get_typeid, ifnonnull, build_dynamic_cast_1, build_dynamic_cast,
qualifier_flags, tinfo_base_init, generic_initializer,
ptr_initializer, dfs_class_hint_mark, ptm_initializer,
dfs_class_hint_unmark, class_hint_flags, class_initializer,
typeinfo_in_lib_p, get_pseudo_ti_init, create_pseudo_type_info,
get_pseudo_ti_desc, create_tinfo_types, emit_support_tinfos,
unemitted_tinfo_decl_p, emit_tinfo_decl): Likewise.
* repo.c (repo_compile_flags, repo_template_declared,
repo_template_defined, repo_class_defined, repo_get_id,
repo_template_used, repo_vtable_used, repo_inline_used,
repo_tinfo_used, repo_template_instantiated, extract_string,
open_repo_file, afgets, init_repo, reopen_repo_file_for_write,
finish_repo): Likewise.
* ptree.c (cxx_print_decl, cxx_print_type, cxx_print_identifier,
cxx_print_xnode): Likewise..
* cp-lang.c (ok_to_generate_alias_set_for_type, cxx_get_alias_set,
cxx_warn_unused_global_decl, cp_expr_size): Likewise.
* cxxfilt.c (demangle_it, print_demangler_list, usage,
standard_symbol_characters, hp_symbol_characters, main, fatal):
Likewise.
(strip_underscore): Change type from 'int' to 'bool'.
(main): Use boolean constants.
From-SVN: r60601
2002-12-29 15:53:05 +01:00
|
|
|
|
finish_objects (int method_type, int initp, tree body)
|
1998-05-20 04:46:16 +02:00
|
|
|
|
{
|
1999-09-24 03:29:29 +02:00
|
|
|
|
tree fn;
|
1998-05-20 04:46:16 +02:00
|
|
|
|
|
2000-08-30 12:20:22 +02:00
|
|
|
|
/* Finish up. */
|
cp-tree.h (begin_compound_stmt): No scope arg is a bool.
* cp-tree.h (begin_compound_stmt): No scope arg is a bool.
(finish_compound_stmt): Remove no scope arg.
* decl.c (register_dtor_fn): Adjust begin_compound_stmt and
end_compound_stmt calls.
(expand_static_init, begin_destructor_body, begin_function_body,
finish_function_body): Likewise.
* decl2.c (start_objects, finish_objects,
start_static_storage_duration_function,
finish_static_storage_duration_function): Likewise.
* init.c (begin_init_stmts, finish_init_stmts,
construct_virtual_base, build_vec_init): Likewise.
* method.c (do_build_assign_ref, synthesize_method): Likewise.
* parser.c (cp_parser_compound_statement,
cp_parser_implicitly_scoped_statement,
cp_parser_already_scoped_statement): Likewise.
* pt.c (tsubst_expr): Likewise.
* semantics.c (begin_compound_stmt): No scope arg is a bool.
(finish_compound_stmt): Remove no scope arg.
* error.c (dump_expr) <COMPOUND_EXPR case>: A compound expr is
always dyadic.
From-SVN: r69882
2003-07-28 13:06:31 +02:00
|
|
|
|
finish_compound_stmt (body);
|
2000-04-11 18:27:42 +02:00
|
|
|
|
fn = finish_function (0);
|
1999-09-29 10:06:21 +02:00
|
|
|
|
|
2007-04-23 12:10:20 +02:00
|
|
|
|
if (method_type == 'I')
|
2001-08-10 00:33:35 +02:00
|
|
|
|
{
|
2007-04-23 12:10:20 +02:00
|
|
|
|
DECL_STATIC_CONSTRUCTOR (fn) = 1;
|
|
|
|
|
decl_init_priority_insert (fn, initp);
|
2001-08-10 00:33:35 +02:00
|
|
|
|
}
|
2007-04-23 12:10:20 +02:00
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
DECL_STATIC_DESTRUCTOR (fn) = 1;
|
|
|
|
|
decl_fini_priority_insert (fn, initp);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
expand_or_defer_fn (fn);
|
1998-05-20 04:46:16 +02:00
|
|
|
|
}
|
|
|
|
|
|
1999-04-23 01:13:12 +02:00
|
|
|
|
/* The names of the parameters to the function created to handle
|
|
|
|
|
initializations and destructions for objects with static storage
|
|
|
|
|
duration. */
|
|
|
|
|
#define INITIALIZE_P_IDENTIFIER "__initialize_p"
|
|
|
|
|
#define PRIORITY_IDENTIFIER "__priority"
|
|
|
|
|
|
|
|
|
|
/* The name of the function we create to handle initializations and
|
|
|
|
|
destructions for objects with static storage duration. */
|
|
|
|
|
#define SSDF_IDENTIFIER "__static_initialization_and_destruction"
|
|
|
|
|
|
|
|
|
|
/* The declaration for the __INITIALIZE_P argument. */
|
2002-06-04 09:11:05 +02:00
|
|
|
|
static GTY(()) tree initialize_p_decl;
|
1999-04-23 01:13:12 +02:00
|
|
|
|
|
|
|
|
|
/* The declaration for the __PRIORITY argument. */
|
2002-06-04 09:11:05 +02:00
|
|
|
|
static GTY(()) tree priority_decl;
|
1999-04-23 01:13:12 +02:00
|
|
|
|
|
|
|
|
|
/* The declaration for the static storage duration function. */
|
2002-06-04 09:11:05 +02:00
|
|
|
|
static GTY(()) tree ssdf_decl;
|
1999-04-23 01:13:12 +02:00
|
|
|
|
|
1999-04-30 18:14:58 +02:00
|
|
|
|
/* All the static storage duration functions created in this
|
|
|
|
|
translation unit. */
|
2005-05-06 16:24:20 +02:00
|
|
|
|
static GTY(()) VEC(tree,gc) *ssdf_decls;
|
1999-04-30 18:14:58 +02:00
|
|
|
|
|
1999-04-23 01:13:12 +02:00
|
|
|
|
/* A map from priority levels to information about that priority
|
|
|
|
|
level. There may be many such levels, so efficient lookup is
|
|
|
|
|
important. */
|
|
|
|
|
static splay_tree priority_info_map;
|
|
|
|
|
|
|
|
|
|
/* Begins the generation of the function that will handle all
|
|
|
|
|
initialization and destruction of objects with static storage
|
|
|
|
|
duration. The function generated takes two parameters of type
|
|
|
|
|
`int': __INITIALIZE_P and __PRIORITY. If __INITIALIZE_P is
|
2002-09-21 14:51:56 +02:00
|
|
|
|
nonzero, it performs initializations. Otherwise, it performs
|
1999-04-23 01:13:12 +02:00
|
|
|
|
destructions. It only performs those initializations or
|
|
|
|
|
destructions with the indicated __PRIORITY. The generated function
|
2005-06-14 22:01:59 +02:00
|
|
|
|
returns no value.
|
1999-04-23 01:13:12 +02:00
|
|
|
|
|
|
|
|
|
It is assumed that this function will only be called once per
|
|
|
|
|
translation unit. */
|
1998-05-20 04:46:16 +02:00
|
|
|
|
|
1999-09-30 17:48:19 +02:00
|
|
|
|
static tree
|
2003-04-20 13:57:38 +02:00
|
|
|
|
start_static_storage_duration_function (unsigned count)
|
1998-05-20 04:46:16 +02:00
|
|
|
|
{
|
1999-04-23 01:13:12 +02:00
|
|
|
|
tree type;
|
1999-09-30 17:48:19 +02:00
|
|
|
|
tree body;
|
1999-04-30 18:14:58 +02:00
|
|
|
|
char id[sizeof (SSDF_IDENTIFIER) + 1 /* '\0' */ + 32];
|
|
|
|
|
|
|
|
|
|
/* Create the identifier for this function. It will be of the form
|
|
|
|
|
SSDF_IDENTIFIER_<number>. */
|
2003-04-20 13:57:38 +02:00
|
|
|
|
sprintf (id, "%s_%u", SSDF_IDENTIFIER, count);
|
1999-04-23 01:13:12 +02:00
|
|
|
|
|
2010-06-09 17:18:40 +02:00
|
|
|
|
type = build_function_type_list (void_type_node,
|
|
|
|
|
integer_type_node, integer_type_node,
|
|
|
|
|
NULL_TREE);
|
1999-04-23 01:13:12 +02:00
|
|
|
|
|
|
|
|
|
/* Create the FUNCTION_DECL itself. */
|
2005-06-14 22:01:59 +02:00
|
|
|
|
ssdf_decl = build_lang_decl (FUNCTION_DECL,
|
1999-04-30 18:14:58 +02:00
|
|
|
|
get_identifier (id),
|
1999-04-23 01:13:12 +02:00
|
|
|
|
type);
|
|
|
|
|
TREE_PUBLIC (ssdf_decl) = 0;
|
|
|
|
|
DECL_ARTIFICIAL (ssdf_decl) = 1;
|
1999-04-30 18:14:58 +02:00
|
|
|
|
|
|
|
|
|
/* Put this function in the list of functions to be called from the
|
|
|
|
|
static constructors and destructors. */
|
|
|
|
|
if (!ssdf_decls)
|
|
|
|
|
{
|
2005-05-06 16:24:20 +02:00
|
|
|
|
ssdf_decls = VEC_alloc (tree, gc, 32);
|
1999-04-30 18:14:58 +02:00
|
|
|
|
|
|
|
|
|
/* Take this opportunity to initialize the map from priority
|
2002-09-13 13:33:47 +02:00
|
|
|
|
numbers to information about that priority level. */
|
1999-04-30 18:14:58 +02:00
|
|
|
|
priority_info_map = splay_tree_new (splay_tree_compare_ints,
|
|
|
|
|
/*delete_key_fn=*/0,
|
|
|
|
|
/*delete_value_fn=*/
|
|
|
|
|
(splay_tree_delete_value_fn) &free);
|
|
|
|
|
|
|
|
|
|
/* We always need to generate functions for the
|
|
|
|
|
DEFAULT_INIT_PRIORITY so enter it now. That way when we walk
|
|
|
|
|
priorities later, we'll be sure to find the
|
|
|
|
|
DEFAULT_INIT_PRIORITY. */
|
|
|
|
|
get_priority_info (DEFAULT_INIT_PRIORITY);
|
|
|
|
|
}
|
|
|
|
|
|
2005-05-06 16:24:20 +02:00
|
|
|
|
VEC_safe_push (tree, gc, ssdf_decls, ssdf_decl);
|
1999-04-23 01:13:12 +02:00
|
|
|
|
|
|
|
|
|
/* Create the argument list. */
|
2002-07-26 22:10:43 +02:00
|
|
|
|
initialize_p_decl = cp_build_parm_decl
|
|
|
|
|
(get_identifier (INITIALIZE_P_IDENTIFIER), integer_type_node);
|
1999-04-23 01:13:12 +02:00
|
|
|
|
DECL_CONTEXT (initialize_p_decl) = ssdf_decl;
|
|
|
|
|
TREE_USED (initialize_p_decl) = 1;
|
2002-07-26 22:10:43 +02:00
|
|
|
|
priority_decl = cp_build_parm_decl
|
|
|
|
|
(get_identifier (PRIORITY_IDENTIFIER), integer_type_node);
|
1999-04-23 01:13:12 +02:00
|
|
|
|
DECL_CONTEXT (priority_decl) = ssdf_decl;
|
|
|
|
|
TREE_USED (priority_decl) = 1;
|
|
|
|
|
|
2010-07-15 16:31:28 +02:00
|
|
|
|
DECL_CHAIN (initialize_p_decl) = priority_decl;
|
1999-04-23 01:13:12 +02:00
|
|
|
|
DECL_ARGUMENTS (ssdf_decl) = initialize_p_decl;
|
|
|
|
|
|
1999-10-06 08:18:18 +02:00
|
|
|
|
/* Put the function in the global scope. */
|
|
|
|
|
pushdecl (ssdf_decl);
|
|
|
|
|
|
2003-10-21 04:16:17 +02:00
|
|
|
|
/* Start the function itself. This is equivalent to declaring the
|
1999-04-23 01:13:12 +02:00
|
|
|
|
function as:
|
|
|
|
|
|
1999-05-19 13:24:18 +02:00
|
|
|
|
static void __ssdf (int __initialize_p, init __priority_p);
|
2005-06-14 22:01:59 +02:00
|
|
|
|
|
1999-04-23 01:13:12 +02:00
|
|
|
|
It is static because we only need to call this function from the
|
|
|
|
|
various constructor and destructor functions for this module. */
|
2004-06-22 09:18:38 +02:00
|
|
|
|
start_preparsed_function (ssdf_decl,
|
|
|
|
|
/*attrs=*/NULL_TREE,
|
|
|
|
|
SF_PRE_PARSED);
|
1999-04-23 01:13:12 +02:00
|
|
|
|
|
|
|
|
|
/* Set up the scope of the outermost block in the function. */
|
c-common.c (lang_gimplify_stmt): Remove next_p argument.
* c-common.c (lang_gimplify_stmt): Remove next_p argument.
(if_elt, if_stack, if_stack_space, c_expand_start_cond, c_finish_then,
c_expand_end_cond, c_expand_start_else, c_finish_else, c_begin_if_stmt,
c_begin_while_stmt, c_finish_while_stmt_cond): Move to c-typeck.c.
(finish_fname_decls, fname_decl): Use statement_lists.
(c_expand_expr_stmt): Don't set last_expr_type.
(c_type_hash): Fix indentation.
(c_safe_from_p): Don't follow TREE_CHAIN.
(c_tree_chain_matters_p): Remove.
* c-common.def (SCOPE_STMT): Remove.
(CLEANUP_STMT): Redefine to contain its own body.
* c-common.h (struct stmt_tree_s): Remove x_last_stmt,
x_last_expr_type, x_last_expr_filename, x_scope_stmt_stack.
Add x_cur_stmt_list.
(last_tree, last_expr_type, last_expr_filename, RECHAIN_STMTS): Remove.
(cur_stmt_list): New.
(STATEMENT_LIST_STMT_EXPR): New.
(SCOPE_BEGIN_P, SCOPE_END_P, SCOPE_STMT_BLOCK, SCOPE_NULLIFIED_P,
SCOPE_NO_CLEANUPS_P, SCOPE_PARTIAL_P, NEW_FOR_SCOPE_P): Remove.
(CLEANUP_BODY): New.
(CLEANUP_DECL): Move to operand 2.
(c_common_stmt_codes): Remove SCOPE_STMT.
(COMPOUND_STMT_NO_SCOPE, COMPOUND_STMT_BODY_BLOCK): Remove.
* c-decl.c (c_scope_stmt_stack, current_scope_stmt_stack): Remove.
(c_push_function_context, c_pop_function_context): Don't save it.
(finish_decl): Set TREE_USED on the decl for a cleanup.
Use push_cleanup.
(store_parm_decls): Use statement lists.
(finish_function): Remove compstmt rule workaround. Use statement
lists. Call finish_fname_decls after finalizing the body.
(c_begin_compound_stmt): Move to c-typeck.c.
* c-dump.c (c_dump_tree): Remove SCOPE_STMT.
* c-gimplify.c (gimplify_cleanup_stmt, gimplify_cleanup_stmts): New.
(c_genericize): Invoke them.
(c_gimplify_stmt): Don't look through TREE_CHAIN. Kill SCOPE_STMT.
(c_build_bind_expr): Export.
(gimplify_block, gimplify_cleanup): Remove.
(gimplify_condition): Use gimplify_stmt.
(gimplify_for_stmt): Remove FOR_INIT_STMT chaining hack.
(gimplify_if_stmt): Remove recursion hack.
(c_gimplify_expr): Remove STMT_EXPR handling.
(stmt_expr_last_stmt, gimplify_stmt_expr): Remove.
(is_last_stmt_of_scope): Remove.
* c-lang.c (LANG_HOOKS_TREE_INLINING_TREE_CHAIN_MATTERS_P): Remove.
* c-mudflap.c (mflang_flush_calls): Use c_begin_compound_stmt,
c_end_compound_stmt.
* c-objc-common.c (build_cdtor): Likewise.
* c-parse.in (primary): Use c_finish_stmt_expr.
(push_scope, pop_scope): Remove.
(c99_block_start, compstmt_start): Use c_begin_compound_stmt.
(c99_block_end, compstmt): Use c_end_compound_stmt.
(c99_block_lineno_labeled_stmt): Likewise.
(compstmt_primary_start): Use c_begin_stmt_expr.
(simple_if, select_or_iter_stmt): Update calls to stmt builders.
(do_stmt_start): Fill in body directly.
(lineno_stmt): Avoid setting lineno on constants.
* c-pretty-print.c (pp_c_statement): Handle STATEMENT_LIST.
Remove SCOPE_STMT.
* c-semantics.c (begin_stmt_tree): Remove.
(push_stmt_list, re_push_stmt_list, pop_stmt_list): New.
(add_stmt): Use statement lists.
(add_scope_stmt, finish_stmt_tree): Remove.
(push_cleanup): New.
* c-tree.h: Move some decls from c-common.h.
* c-typeck.c (c_tree_expr_nonnegative_p): Simplify for statement lists.
(do_case, c_finish_case): Likewise.
(c_finish_then): Take body for then as argument.
(c_finish_else): Similarly.
(c_begin_for_stmt, c_finish_for_stmt_init, c_finish_for_stmt_cond,
c_finish_for_stmt_incr, c_finish_for_stmt): New.
(c_begin_stmt_expr, c_finish_stmt_expr): New.
(c_begin_compound_stmt): Do scope management.
(c_end_compound_stmt): New.
* fold-const.c (tree_expr_nonnegative_p): Fix BIND_EXPR.
* gimplify.c (voidify_wrapper_expr): Accept temporary argument.
Look through exception handling constructs.
(gimplify_bind_expr): Accept temporary argument.
(gimplify_target_expr): Special case BIND_EXPR bodies.
(gimplify_expr): Handle fallback == fb_none like a statement.
* langhooks-def.h (LANG_HOOKS_TREE_INLINING_TREE_CHAIN_MATTERS_P): Kill.
* langhooks.c (lhd_tree_inlining_tree_chain_matters_p): Remove.
* langhooks.h (tree_chain_matters_p): Remove.
* stub-objc.c (objc_clear_super_receiver): New.
* tree-gimple.h (voidify_wrapper_expr): Update decl.
(append_to_statement_list, append_to_statement_list_force): Move
to tree-iterator.h.
* tree-inline.c (expand_call_inline): Update call.
(clone_body): Use statement lists.
(walk_tree): Don't check tree_chain_matters_p.
(copy_tree_r): Likewise.
* tree-iterator.c (alloc_stmt_list): Clear lang bits.
(tsi_link_before, tsi_link_after): Set TREE_SIDE_EFFECTS properly.
* tree-iterator.h (append_to_statement_list,
append_to_statement_list_force): Moved from tree-gimple.h.
* tree-pretty-print.c (dump_generic_node): Clean up TARGET_EXPR dump.
* objc/objc-act.c (build_module_descriptor): Use c_begin_compound_stmt.
(objc_enter_block): Likewise.
(objc_exit_block): Use c_end_compound_stmt.
(objc_build_try_enter_fragment): Add #error and comment for
rewriting for OBJCPLUS.
(objc_build_extract_fragment, objc_build_try_epilogue,
objc_build_catch_stmt, objc_build_finally_prologue,
objc_build_finally_epilogue): Update for C statement builders.
* objc/objc-lang.c (LANG_HOOKS_TREE_INLINING_TREE_CHAIN_MATTERS_P):
Remove.
cp/
* call.c (initialize_reference): Don't build CLEANUP_STMT here.
* cp-gimplify.c (cp_gimplify_stmt): Remove next_p argument.
(genericize_try_block): Use gimplify_stmt.
(genericize_catch_block, genericize_eh_spec_block): Likewise.
(cp_gimplify_init_expr): Remove STMT_EXPR special case.
(gimplify_must_not_throw_expr): Update voidify_wrapper_expr call.
* cp-lang.c (LANG_HOOKS_TREE_INLINING_TREE_CHAIN_MATTERS_P): Remove.
(cp_tree_chain_matters_p): Remove.
* cp-tree.h (COMPOUND_STMT_TRY_BLOCK): New.
(COMPOUND_STMT_BODY_BLOCK): New.
(STATEMENT_LIST_NO_SCOPE, STATEMENT_LIST_TRY_BLOCK): New.
(EXPR_STMT_STMT_EXPR_RESULT): New.
(building_stmt_tree): Check cur_stmt_list.
(tf_stmt_expr_cmpd, tf_stmt_expr_body): Remove.
(BCS_NO_SCOPE, BCS_TRY_BLOCK, BCS_FN_BODY): New.
* decl.c (poplevel): Use pop_stmt_list for minding cleanups.
(cp_finish_decl): Use push_cleanup.
(start_function, finish_function): Use statement lists.
(finish_stmt): Do nothing.
* except.c (begin_eh_spec_block): Use statement lists.
(check_handlers_1, check_handlers): Likewise.
* init.c (construct_virtual_base): Don't add extra compound stmts.
(build_vec_init): Likewise.
* name-lookup.c (maybe_push_cleanup_level): Use statement lists.
* name-lookup.h (struct cp_binding_level): Add statement_list.
* parser.c (cp_parser_statement): Take the STMT_EXPR node, not a bool.
(cp_parser_labeled_statement, cp_parser_expression_statement,
cp_parser_statement_seq_opt): Likewise.
(cp_parser_compound_statement): Likewise. Take bool for try block.
(cp_parser_selection_statement): Tidy if processing.
(cp_parser_already_scoped_statement): Rewrite to do what it says.
* pt.c (tsubst_copy): Move STMT_EXPR to tsubst_expr.
(tsubst_expr): Rewrite STMT_EXPR processing. Handle STATEMENT_LIST.
Mind COMPOUND_STMT_TRY_BLOCK, EXPR_STMT_STMT_EXPR_RESULT.
* semantics.c (do_poplevel, do_pushlevel): Use statement lists.
(finish_cond): New, rewritten from FINISH_COND.
(simplify_loop_decl_cond): New.
(finish_expr_stmt): Avoid nested EXPR_STMTs.
(begin_if_stmt, finish_if_stmt_cond, finish_then_clause,
begin_else_clause, finish_else_clause, finish_if_stmt,
begin_while_stmt, finish_while_stmt_cond, finish_while_stmt,
begin_do_stmt, finish_do_body, begin_for_stmt, finish_for_init_stmt,
finish_for_cond, finish_for_stmt, begin_switch_stmt,
finish_switch_cond, finish_switch_stmt, begin_try_block,
finish_try_block, finish_cleanup_try_block, finish_function_try_block,
finish_handler_sequence, finish_function_handler_sequence,
begin_handler, finish_handler_parms, finish_handler,
begin_stmt_expr, finish_stmt_expr_expr, finish_stmt_expr): Rewrite
using statement lists.
(begin_compound_stmt): Replace has_no_scope argument with flags.
Update all callers. Use statement lists.
(finish_compound_stmt): Likewise.
(finish_decl_cleanup, finish_eh_cleanup): Use push_cleanup.
(current_scope_stmt_stack): Remove.
(simplify_aggr_init_expr): Don't muck with TREE_CHAIN.
* typeck2.c (split_nonconstant_init_1, split_nonconstant_init):
Rewrite with statement lists.
testsuite/
* g++.dg/ext/stmtexpr1.C: XFAIL.
* gcc.dg/20030612-1.c: XFAIL.
From-SVN: r83221
2004-06-16 03:21:38 +02:00
|
|
|
|
body = begin_compound_stmt (BCS_FN_BODY);
|
1998-08-13 19:29:30 +02:00
|
|
|
|
|
1999-09-30 17:48:19 +02:00
|
|
|
|
return body;
|
1998-05-20 04:46:16 +02:00
|
|
|
|
}
|
|
|
|
|
|
1999-04-23 01:13:12 +02:00
|
|
|
|
/* Finish the generation of the function which performs initialization
|
|
|
|
|
and destruction of objects with static storage duration. After
|
|
|
|
|
this point, no more such objects can be created. */
|
1998-05-20 04:46:16 +02:00
|
|
|
|
|
|
|
|
|
static void
|
Remove traditional C constructs 4/n.
* decl2.c (grok_method_quals, warn_if_unknown_interface,
grok_x_components, cp_build_parm_decl, build_artificial_parm,
maybe_retrofit_in_chrg, grokclassfn, grok_array_decl,
delete_sanity, check_member_template, check_java_method,
check_classfn, finish_static_data_member_decl, grokfield,
grokbitfield, grokoptypename, grok_function_init,
cplus_decl_attributes, constructor_name, defer_fn,
build_anon_union_vars, finish_anon_union, coerce_new_type,
coerce_delete_type, comdat_linkage, maybe_make_one_only,
key_method, import_export_vtable, import_export_class,
output_vtable_inherit, import_export_decl, import_export_tinfo,
build_cleanup, get_guard, get_guard_bits, get_guard_cond,
set_guard, start_objects, finish_objects,
start_static_storage_duration_function,
finish_static_storage_duration_function, get_priority_info,
start_static_initialization_or_destruction,
finish_static_initialization_or_destruction,
do_static_initialization, do_static_destruction,
prune_vars_needing_no_initialization, write_out_vars,
reparse_decl_as_expr, finish_decl_parsing, namespace_ancestor,
add_using_namespace, merge_functions, ambiguous_decl,
lookup_using_namespace, lookup_using_namespace,
qualified_lookup_using_namespace, set_decl_namespace,
decl_namespace, current_decl_namespace, push_decl_namespace,
pop_decl_namespace, push_scope, pop_scope, add_function,
arg_assoc_namespace, arg_assoc_template_arg, arg_assoc,
lookup_arg_dependent, do_namespace_alias,
validate_nonmember_using_decl, do_nonmember_using_decl,
do_toplevel_using_decl, do_local_using_decl,
do_class_using_decl, do_using_directive, check_default_args,
mark_used, handle_class_head): Use C90 prototypings. Use booleans.
* parser.c (cp_parser_class_head): Use booleanss.
* decl.c (walk_globals, walk_vtables): Likewise.
* cp-tree.h (walk_globals_pred, walk_globals_fn, walk_vtables,
walk_globals): Change return type from 'int' to 'bool'.
* rtti.c (init_rtti_processing, build_headof, throw_bad_cast
throw_bad_typeid, get_tinfo_decl_dynamic, typeid_ok_p,
build_typeid, tinfo_name, get_tinfo_decl, get_tinfo_ptr,
get_typeid, ifnonnull, build_dynamic_cast_1, build_dynamic_cast,
qualifier_flags, tinfo_base_init, generic_initializer,
ptr_initializer, dfs_class_hint_mark, ptm_initializer,
dfs_class_hint_unmark, class_hint_flags, class_initializer,
typeinfo_in_lib_p, get_pseudo_ti_init, create_pseudo_type_info,
get_pseudo_ti_desc, create_tinfo_types, emit_support_tinfos,
unemitted_tinfo_decl_p, emit_tinfo_decl): Likewise.
* repo.c (repo_compile_flags, repo_template_declared,
repo_template_defined, repo_class_defined, repo_get_id,
repo_template_used, repo_vtable_used, repo_inline_used,
repo_tinfo_used, repo_template_instantiated, extract_string,
open_repo_file, afgets, init_repo, reopen_repo_file_for_write,
finish_repo): Likewise.
* ptree.c (cxx_print_decl, cxx_print_type, cxx_print_identifier,
cxx_print_xnode): Likewise..
* cp-lang.c (ok_to_generate_alias_set_for_type, cxx_get_alias_set,
cxx_warn_unused_global_decl, cp_expr_size): Likewise.
* cxxfilt.c (demangle_it, print_demangler_list, usage,
standard_symbol_characters, hp_symbol_characters, main, fatal):
Likewise.
(strip_underscore): Change type from 'int' to 'bool'.
(main): Use boolean constants.
From-SVN: r60601
2002-12-29 15:53:05 +01:00
|
|
|
|
finish_static_storage_duration_function (tree body)
|
1998-05-20 04:46:16 +02:00
|
|
|
|
{
|
1999-04-23 01:13:12 +02:00
|
|
|
|
/* Close out the function. */
|
cp-tree.h (begin_compound_stmt): No scope arg is a bool.
* cp-tree.h (begin_compound_stmt): No scope arg is a bool.
(finish_compound_stmt): Remove no scope arg.
* decl.c (register_dtor_fn): Adjust begin_compound_stmt and
end_compound_stmt calls.
(expand_static_init, begin_destructor_body, begin_function_body,
finish_function_body): Likewise.
* decl2.c (start_objects, finish_objects,
start_static_storage_duration_function,
finish_static_storage_duration_function): Likewise.
* init.c (begin_init_stmts, finish_init_stmts,
construct_virtual_base, build_vec_init): Likewise.
* method.c (do_build_assign_ref, synthesize_method): Likewise.
* parser.c (cp_parser_compound_statement,
cp_parser_implicitly_scoped_statement,
cp_parser_already_scoped_statement): Likewise.
* pt.c (tsubst_expr): Likewise.
* semantics.c (begin_compound_stmt): No scope arg is a bool.
(finish_compound_stmt): Remove no scope arg.
* error.c (dump_expr) <COMPOUND_EXPR case>: A compound expr is
always dyadic.
From-SVN: r69882
2003-07-28 13:06:31 +02:00
|
|
|
|
finish_compound_stmt (body);
|
2003-07-02 02:12:10 +02:00
|
|
|
|
expand_or_defer_fn (finish_function (0));
|
1999-04-23 01:13:12 +02:00
|
|
|
|
}
|
1998-05-20 04:46:16 +02:00
|
|
|
|
|
1999-04-23 01:13:12 +02:00
|
|
|
|
/* Return the information about the indicated PRIORITY level. If no
|
|
|
|
|
code to handle this level has yet been generated, generate the
|
|
|
|
|
appropriate prologue. */
|
1998-05-20 04:46:16 +02:00
|
|
|
|
|
1999-04-23 01:13:12 +02:00
|
|
|
|
static priority_info
|
Remove traditional C constructs 4/n.
* decl2.c (grok_method_quals, warn_if_unknown_interface,
grok_x_components, cp_build_parm_decl, build_artificial_parm,
maybe_retrofit_in_chrg, grokclassfn, grok_array_decl,
delete_sanity, check_member_template, check_java_method,
check_classfn, finish_static_data_member_decl, grokfield,
grokbitfield, grokoptypename, grok_function_init,
cplus_decl_attributes, constructor_name, defer_fn,
build_anon_union_vars, finish_anon_union, coerce_new_type,
coerce_delete_type, comdat_linkage, maybe_make_one_only,
key_method, import_export_vtable, import_export_class,
output_vtable_inherit, import_export_decl, import_export_tinfo,
build_cleanup, get_guard, get_guard_bits, get_guard_cond,
set_guard, start_objects, finish_objects,
start_static_storage_duration_function,
finish_static_storage_duration_function, get_priority_info,
start_static_initialization_or_destruction,
finish_static_initialization_or_destruction,
do_static_initialization, do_static_destruction,
prune_vars_needing_no_initialization, write_out_vars,
reparse_decl_as_expr, finish_decl_parsing, namespace_ancestor,
add_using_namespace, merge_functions, ambiguous_decl,
lookup_using_namespace, lookup_using_namespace,
qualified_lookup_using_namespace, set_decl_namespace,
decl_namespace, current_decl_namespace, push_decl_namespace,
pop_decl_namespace, push_scope, pop_scope, add_function,
arg_assoc_namespace, arg_assoc_template_arg, arg_assoc,
lookup_arg_dependent, do_namespace_alias,
validate_nonmember_using_decl, do_nonmember_using_decl,
do_toplevel_using_decl, do_local_using_decl,
do_class_using_decl, do_using_directive, check_default_args,
mark_used, handle_class_head): Use C90 prototypings. Use booleans.
* parser.c (cp_parser_class_head): Use booleanss.
* decl.c (walk_globals, walk_vtables): Likewise.
* cp-tree.h (walk_globals_pred, walk_globals_fn, walk_vtables,
walk_globals): Change return type from 'int' to 'bool'.
* rtti.c (init_rtti_processing, build_headof, throw_bad_cast
throw_bad_typeid, get_tinfo_decl_dynamic, typeid_ok_p,
build_typeid, tinfo_name, get_tinfo_decl, get_tinfo_ptr,
get_typeid, ifnonnull, build_dynamic_cast_1, build_dynamic_cast,
qualifier_flags, tinfo_base_init, generic_initializer,
ptr_initializer, dfs_class_hint_mark, ptm_initializer,
dfs_class_hint_unmark, class_hint_flags, class_initializer,
typeinfo_in_lib_p, get_pseudo_ti_init, create_pseudo_type_info,
get_pseudo_ti_desc, create_tinfo_types, emit_support_tinfos,
unemitted_tinfo_decl_p, emit_tinfo_decl): Likewise.
* repo.c (repo_compile_flags, repo_template_declared,
repo_template_defined, repo_class_defined, repo_get_id,
repo_template_used, repo_vtable_used, repo_inline_used,
repo_tinfo_used, repo_template_instantiated, extract_string,
open_repo_file, afgets, init_repo, reopen_repo_file_for_write,
finish_repo): Likewise.
* ptree.c (cxx_print_decl, cxx_print_type, cxx_print_identifier,
cxx_print_xnode): Likewise..
* cp-lang.c (ok_to_generate_alias_set_for_type, cxx_get_alias_set,
cxx_warn_unused_global_decl, cp_expr_size): Likewise.
* cxxfilt.c (demangle_it, print_demangler_list, usage,
standard_symbol_characters, hp_symbol_characters, main, fatal):
Likewise.
(strip_underscore): Change type from 'int' to 'bool'.
(main): Use boolean constants.
From-SVN: r60601
2002-12-29 15:53:05 +01:00
|
|
|
|
get_priority_info (int priority)
|
1999-04-23 01:13:12 +02:00
|
|
|
|
{
|
|
|
|
|
priority_info pi;
|
|
|
|
|
splay_tree_node n;
|
|
|
|
|
|
2005-06-14 22:01:59 +02:00
|
|
|
|
n = splay_tree_lookup (priority_info_map,
|
1999-04-23 01:13:12 +02:00
|
|
|
|
(splay_tree_key) priority);
|
|
|
|
|
if (!n)
|
|
|
|
|
{
|
|
|
|
|
/* Create a new priority information structure, and insert it
|
|
|
|
|
into the map. */
|
2005-12-02 12:21:28 +01:00
|
|
|
|
pi = XNEW (struct priority_info_s);
|
1999-04-30 18:14:58 +02:00
|
|
|
|
pi->initializations_p = 0;
|
|
|
|
|
pi->destructions_p = 0;
|
1999-04-23 01:13:12 +02:00
|
|
|
|
splay_tree_insert (priority_info_map,
|
|
|
|
|
(splay_tree_key) priority,
|
|
|
|
|
(splay_tree_value) pi);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
pi = (priority_info) n->value;
|
1998-05-20 04:46:16 +02:00
|
|
|
|
|
1999-04-23 01:13:12 +02:00
|
|
|
|
return pi;
|
|
|
|
|
}
|
1998-05-20 04:46:16 +02:00
|
|
|
|
|
2005-09-26 10:42:57 +02:00
|
|
|
|
/* The effective initialization priority of a DECL. */
|
|
|
|
|
|
|
|
|
|
#define DECL_EFFECTIVE_INIT_PRIORITY(decl) \
|
|
|
|
|
((!DECL_HAS_INIT_PRIORITY_P (decl) || DECL_INIT_PRIORITY (decl) == 0) \
|
|
|
|
|
? DEFAULT_INIT_PRIORITY : DECL_INIT_PRIORITY (decl))
|
|
|
|
|
|
2005-11-05 21:34:08 +01:00
|
|
|
|
/* Whether a DECL needs a guard to protect it against multiple
|
2005-09-26 10:42:57 +02:00
|
|
|
|
initialization. */
|
|
|
|
|
|
|
|
|
|
#define NEEDS_GUARD_P(decl) (TREE_PUBLIC (decl) && (DECL_COMMON (decl) \
|
|
|
|
|
|| DECL_ONE_ONLY (decl) \
|
|
|
|
|
|| DECL_WEAK (decl)))
|
|
|
|
|
|
2008-07-30 15:07:50 +02:00
|
|
|
|
/* Called from one_static_initialization_or_destruction(),
|
|
|
|
|
via walk_tree.
|
|
|
|
|
Walks the initializer list of a global variable and looks for
|
|
|
|
|
temporary variables (DECL_NAME() == NULL and DECL_ARTIFICIAL != 0)
|
|
|
|
|
and that have their DECL_CONTEXT() == NULL.
|
|
|
|
|
For each such temporary variable, set their DECL_CONTEXT() to
|
|
|
|
|
the current function. This is necessary because otherwise
|
|
|
|
|
some optimizers (enabled by -O2 -fprofile-arcs) might crash
|
|
|
|
|
when trying to refer to a temporary variable that does not have
|
|
|
|
|
it's DECL_CONTECT() properly set. */
|
|
|
|
|
static tree
|
|
|
|
|
fix_temporary_vars_context_r (tree *node,
|
|
|
|
|
int *unused ATTRIBUTE_UNUSED,
|
|
|
|
|
void *unused1 ATTRIBUTE_UNUSED)
|
|
|
|
|
{
|
|
|
|
|
gcc_assert (current_function_decl);
|
|
|
|
|
|
|
|
|
|
if (TREE_CODE (*node) == BIND_EXPR)
|
|
|
|
|
{
|
|
|
|
|
tree var;
|
|
|
|
|
|
2010-07-15 16:31:28 +02:00
|
|
|
|
for (var = BIND_EXPR_VARS (*node); var; var = DECL_CHAIN (var))
|
2008-07-30 15:07:50 +02:00
|
|
|
|
if (TREE_CODE (var) == VAR_DECL
|
|
|
|
|
&& !DECL_NAME (var)
|
|
|
|
|
&& DECL_ARTIFICIAL (var)
|
|
|
|
|
&& !DECL_CONTEXT (var))
|
|
|
|
|
DECL_CONTEXT (var) = current_function_decl;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return NULL_TREE;
|
|
|
|
|
}
|
|
|
|
|
|
1999-09-30 17:48:19 +02:00
|
|
|
|
/* Set up to handle the initialization or destruction of DECL. If
|
2002-09-21 14:51:56 +02:00
|
|
|
|
INITP is nonzero, we are initializing the variable. Otherwise, we
|
1999-09-30 17:48:19 +02:00
|
|
|
|
are destroying it. */
|
|
|
|
|
|
2005-09-26 10:42:57 +02:00
|
|
|
|
static void
|
|
|
|
|
one_static_initialization_or_destruction (tree decl, tree init, bool initp)
|
1999-09-30 17:48:19 +02:00
|
|
|
|
{
|
2000-06-30 09:16:35 +02:00
|
|
|
|
tree guard_if_stmt = NULL_TREE;
|
|
|
|
|
tree guard;
|
1999-09-30 17:48:19 +02:00
|
|
|
|
|
2005-09-26 10:42:57 +02:00
|
|
|
|
/* If we are supposed to destruct and there's a trivial destructor,
|
|
|
|
|
nothing has to be done. */
|
|
|
|
|
if (!initp
|
|
|
|
|
&& TYPE_HAS_TRIVIAL_DESTRUCTOR (TREE_TYPE (decl)))
|
|
|
|
|
return;
|
1999-09-30 17:48:19 +02:00
|
|
|
|
|
|
|
|
|
/* Trick the compiler into thinking we are at the file and line
|
|
|
|
|
where DECL was declared so that error-messages make sense, and so
|
|
|
|
|
that the debugger will show somewhat sensible file and line
|
|
|
|
|
information. */
|
2003-09-22 07:09:32 +02:00
|
|
|
|
input_location = DECL_SOURCE_LOCATION (decl);
|
1999-09-30 17:48:19 +02:00
|
|
|
|
|
2008-07-30 15:07:50 +02:00
|
|
|
|
/* Make sure temporary variables in the initialiser all have
|
|
|
|
|
their DECL_CONTEXT() set to a value different from NULL_TREE.
|
|
|
|
|
This can happen when global variables initialisers are built.
|
|
|
|
|
In that case, the DECL_CONTEXT() of the global variables _AND_ of all
|
|
|
|
|
the temporary variables that might have been generated in the
|
|
|
|
|
accompagning initialisers is NULL_TREE, meaning the variables have been
|
|
|
|
|
declared in the global namespace.
|
|
|
|
|
What we want to do here is to fix that and make sure the DECL_CONTEXT()
|
|
|
|
|
of the temporaries are set to the current function decl. */
|
|
|
|
|
cp_walk_tree_without_duplicates (&init,
|
|
|
|
|
fix_temporary_vars_context_r,
|
|
|
|
|
NULL);
|
|
|
|
|
|
1999-09-30 17:48:19 +02:00
|
|
|
|
/* Because of:
|
|
|
|
|
|
|
|
|
|
[class.access.spec]
|
|
|
|
|
|
|
|
|
|
Access control for implicit calls to the constructors,
|
|
|
|
|
the conversion functions, or the destructor called to
|
|
|
|
|
create and destroy a static data member is performed as
|
|
|
|
|
if these calls appeared in the scope of the member's
|
2005-06-14 22:01:59 +02:00
|
|
|
|
class.
|
1999-09-30 17:48:19 +02:00
|
|
|
|
|
|
|
|
|
we pretend we are in a static member function of the class of
|
|
|
|
|
which the DECL is a member. */
|
|
|
|
|
if (member_p (decl))
|
|
|
|
|
{
|
Make DECL_CONTEXT mean the class in which a member function was declared, even for a virtual function.
Make DECL_CONTEXT mean the class in which a member function was
declared, even for a virtual function.
* cp-tree.h (DECL_CLASS_CONTEXT): Adjust.
(DECL_FRIEND_CONTEXT): New macro.
(DECL_REAL_CONTEXT): Remove.
(SET_DECL_FRIEND_CONTEXT): Likewise.
(DECL_VIRTUAL_CONTEXT): Adjust.
(DECL_CLASS_SCOPE_P): Use TYPE_P.
(add_friends): Remove.
(hack_decl_function_context): Likewise.
* call.c (build_new_function_call): Replace DECL_REAL_CONTEXT with
CP_DECL_CONTEXT.
(build_over_call): Fix indentation. Use DECL_CONTEXT
instead of DECL_CLASS_CONTEXT.
* class.c (dfs_build_vcall_offset_vtbl_entries): Likewise.
(add_method): Set DECL_VIRTUAL_CONTEXT, not DECL_CLASS_CONTEXT.
(strictly_overrides): Use DECL_CONTEXT, not DECL_CLASS_CONTEXT.
(build_vtbl_or_vbase_field): Don't set DECL_CLASS_CONTEXT.
(build_base_field): Likewise.
(finish_struct_1): Likewise.
(build_self_reference): Likewise.
* decl.c (push_class_binding): Use CP_DECL_CONTEXT, not
DECL_REAL_CONTEXT.
(pushtag): Use decl_function_context, not
hack_decl_function_context.
(decls_match): Use CP_DECL_CONTEXT, not DECL_REAL_CONTEXT.
(duplicate_decls): Use DECL_VIRTUAL_CONTEXT.
(pushdecl): Remove bogus code.
(start_decl): Use DECL_CONTEXT rather than DECL_CLASS_CONTEXT.
(cp_finish_decl): Use CP_DECL_CONTEXT, not DECL_REAL_CONTEXT.
(grokfndecl): Use DECL_CONTEXT, not DECL_CLASS_CONTEXT.
Use decl_function_context, nothack_decl_function_context.
(grokvardecl): Don't set DECL_CLASS_CONTEXT.
(grokdeclarator): Likewise. Use decl_function_context, not
hack_decl_function_context.
(copy_args_p): Document. Don't use DECL_CLASS_CONTEXT.
(start_function): Use DECL_FRIEND_CONTEXT, not
DECL_CLASS_CONTEXT. Use decl_function_context, not
hack_decl_function_context.
(finish_function): Use decl_function_context, not
hack_decl_function_context.
(maybe_retrofit_in_chrg): Use DECL_CONTEXT, not
DECL_CLASS_CONTEXT.
(grokclassfn): Set DECL_VIRTUAL_CONTEXT, not DECL_CONTEXT.
(finish_static_data_member_decl): Don't set DECL_CLASS_CONTEXT.
(grokfield): Likewise.
(finish_builtin_type): Likewise.
(finish_vtable_vardec): Use decl_function_context, not
hack_decl_function_context.
(import_export_decl): Use DECL_CONTEXT, not DECL_CLASS_CONTEXT.
(start_static_initialization_or_destruction): Likewise.
(finish_static_initialization_or_destruction): Likewise.
(mark_used): Adjust logic for deciding when to synthesize methods.
* dump.c (dequeue_and_dump): Use CP_DECL_CONTEXT, not
DECL_REAL_CONTEXT.
* error.c (dump_function_decl): Use DECL_CONTEXT, not
DECL_CLASS_CONTEXT.
* friend.c (is_friend): Likewise.
(add_friends): Remove.
(do_friend): Use SET_DECL_FRIEND_CONTEXT.
* lex.c (begin_definition_of_inclass_inline): Use
decl_function_context, not hack_decl_function_context.
(process_next_inline): Likewise.
(do_identifier): Use CP_DECL_CONTEXT, not DECL_REAL_CONTEXT.
* method.c (set_mangled_name_for_decl): Use DECL_CONTEXT, not
DECL_CLASSS_CONTEXT.
(hack_identifier): Likewise.
(synthesize_method): Use decl_function_context, not
hack_decl_function_context.
* pt.c (template_class_depth_real): Use CP_DECL_CONTEXT, not
DECL_REAL_CONTEXT.
(is_member_template): Use decl_function_context, not
hack_decl_function_context. Use DECL_CONTEXT, not
DECL_CLASS_CONTEXT.
(build_template_decl): Set DECL_VIRTUAL_CONTEXT, not
DECL_CLASS_CONTEXT.
(check_default_tmpl_args): Use CP_DECL_CONTEXT, not
DECL_REAL_CONTEXT.
(push_template_decl_real): Likewise.
(instantiate_class_template): Don't call add_friends.
(tsubst_default_argument): Use DECL_CONTEXT, not
DECL_REAL_CONTEXT.
(tsubst_decl): Set DECL_VIRTUAL_CONTEXT, not DECL_CLASS_CONTEXT.
Use DECL_CONTEXT, not DECL_CLASS_CONTEXT.
(set_meangled_name_for_template_decl): Use DECL_CONTEXT, not
DECL_CLASS_CONTEXT.
* repo.c (repo_inline_used): Likewise.
* search.c (current_scope): Adjust for new _CONTEXT macros.
(context_for_name_lookup): Use CP_DECL_CONTEXT, not
DECL_REAL_CONTEXT.
(friend_accessible_p): Use DECL_CONTEXT, not DECL_CLASS_CONTEXT.
(lookup_fnfields_here):Likewise.
(check_final_overrider): Likewise.
(init_vbase_pointers): Likewise.
(virtual_context): Likewise.
* semantics.c (finish_member_declaration): Just set DECL_CONTEXT.
(expand_body): Use decl_function_context, not
hack_decl_function_context.
* tree.c (hack_decl_function_context): Remove.
* typeck.c (build_x_function_call): Use DECL_CONTEXT, not
DECL_CLASS_CONTEXT.
* typeck2.c (error_not_base_type): Likewise.
From-SVN: r32018
2000-02-17 00:54:23 +01:00
|
|
|
|
DECL_CONTEXT (current_function_decl) = DECL_CONTEXT (decl);
|
1999-09-30 17:48:19 +02:00
|
|
|
|
DECL_STATIC_FUNCTION_P (current_function_decl) = 1;
|
|
|
|
|
}
|
2005-06-14 22:01:59 +02:00
|
|
|
|
|
2000-06-30 09:16:35 +02:00
|
|
|
|
/* Assume we don't need a guard. */
|
|
|
|
|
guard = NULL_TREE;
|
|
|
|
|
/* We need a guard if this is an object with external linkage that
|
2000-06-04 23:12:27 +02:00
|
|
|
|
might be initialized in more than one place. (For example, a
|
|
|
|
|
static data member of a template, when the data member requires
|
|
|
|
|
construction.) */
|
2005-09-26 10:42:57 +02:00
|
|
|
|
if (NEEDS_GUARD_P (decl))
|
1999-09-30 17:48:19 +02:00
|
|
|
|
{
|
2000-06-30 09:16:35 +02:00
|
|
|
|
tree guard_cond;
|
1999-09-30 17:48:19 +02:00
|
|
|
|
|
2000-06-30 09:16:35 +02:00
|
|
|
|
guard = get_guard (decl);
|
1999-09-30 17:48:19 +02:00
|
|
|
|
|
2000-06-30 09:16:35 +02:00
|
|
|
|
/* When using __cxa_atexit, we just check the GUARD as we would
|
|
|
|
|
for a local static. */
|
|
|
|
|
if (flag_use_cxa_atexit)
|
|
|
|
|
{
|
|
|
|
|
/* When using __cxa_atexit, we never try to destroy
|
|
|
|
|
anything from a static destructor. */
|
call.c (validate_conversion_obstack): Replace my_friendly_assert with gcc_assert or gcc_unreachable.
* call.c (validate_conversion_obstack): Replace
my_friendly_assert with gcc_assert or gcc_unreachable.
(direct_reference_binding, merge_conversion_sequences,
build_user_type_conversion_1, perform_overload_resolution,
build_op_delete_call, enforce_access, call_builtin_trap,
build_over_call, build_special_member_call, build_new_method_call,
initialize_reference): Likewise.
* class.c (build_base_path, build_primary_vtable, alter_access,
check_bases, update_vtable_entry_for_fn, layout_empty_base,
clone_function_decl, adjust_clone_args,
type_requires_array_cookie, include_empty_classes,
finish_struct_1, resolve_address_of_overloaded_function,
instantiate_type, get_vtbl_decl_for_binfo, build_vtt_inits,
dfs_build_secondary_vptr_vtt_inits, build_ctor_vtbl_group,
accumulate_vtbl_inits, build_vtbl_initializer,
build_vbase_offset_vtbl_entries, build_rtti_vtbl_entries): Likewise.
* cvt.c (build_up_reference, convert_to_reference): Likewise.
* decl.c (poplevel, duplicate_decls, make_typename_type,
cxx_init_decl_processing, reshape_init, check_initializer,
make_rtl_for_nonlocal_decl, initialize_local_var, cp_finish_decl,
expand_static_init, grokfndecl, grokvardecl, build_ptrmem_type,
grokdeclarator, copy_fn_p, grok_op_properties, xref_tag,
xref_basetypes, start_preparsed_function, save_function_data,
finish_function, finish_method, maybe_register_incomplete_var,
complete_vars): Likewise.
* decl2.c (grok_array_decl, check_member_template,
check_classfn, finish_static_data_member_decl, coerce_new_type,
coerce_delete_type, import_export_class, decl_needed_p,
determine_visibility, import_export_decl, build_cleanup,
start_static_initialization_or_destructi, do_static_destruction,
prune_vars_needing_no_initialization,
build_offset_ref_call_from_tree): Likewise.
* error.c (dump_decl, dump_expr): Likewise.
* init.c (finish_init_stmts, build_zero_init,
expand_virtual_init, expand_default_init, expand_aggr_init_1,
build_offset_ref, build_new_1, build_delete, build_vbase_delete):
Likewise.
* mangle.c (write_method_parms, write_template_args,
write_expression, write_template_arg): Likewise.
* method.c (make_thunk, finish_thunk, use_thunk): Likewise.
* name-lookup.c (pop_binding, begin_scope, leave_scope,
resume_scope, push_using_decl, validate_nonmember_using_decl,
is_ancestor, poplevel_class, set_inherited_value_binding_p,
push_class_level_binding, do_class_using_decl, push_namespace,
pop_namespace, add_using_namespace, ambiguous_decl,
lookup_namespace_name, lookup_type_current_level,
maybe_process_template_type_declaration): Likewise.
* parser.c (cp_lexer_peek_nth_token,
cp_parser_parse_and_diagnose_invalid_typ,
cp_parser_translation_unit, cp_parser_template_id,
cp_parser_lookup_name, cp_parser_late_parsing_for_member): Likewise.
* pt.c (push_access_scope, finish_member_template_decl,
push_inline_template_parms_recursive, add_outermost_template_args,
get_innermost_template_args, begin_explicit_instantiation,
end_explicit_instantiation, retrieve_specialization,
is_specialization_of, is_specialization_of_friend,
register_specialization, check_explicit_specialization,
comp_template_parms, process_template_parm,
process_partial_specialization, convert_nontype_argument,
coerce_template_template_parms, coerce_template_parms,
mangle_class_name_for_template, lookup_template_function,
lookup_template_class, instantiate_class_template, tsubst_decl,
tsubst_function_type, tsubst, tsubst_qualified_id, tsubst_copy,
instantiate_template, fn_type_unification, type_unification_real,
get_template_base, regenerate_decl_from_template,
template_for_substitution, instantiate_decl,
get_mostly_instantiated_function_type, dependent_scope_ref_p,
value_dependent_expression_p, resolve_typename_type): Likewise.
* repo.c (repo_emit_p): Likewise.
* rtti.c (build_headof, get_tinfo_decl, get_pseudo_ti_init,
create_tinfo_types, emit_tinfo_decl): Likewise.
* search.c (lookup_base_r, lookup_base, lookup_field_1,
dfs_access_in_type, build_baselink, lookup_member,
adjust_result_of_qualified_name_lookup, copied_binfo): Likewise.
* semantics.c (perform_or_defer_access_check,
finish_non_static_data_member, finish_stmt_expr_expr,
finish_stmt_expr, finish_call_expr, finish_pseudo_destructor_expr,
finish_template_template_parm, finish_member_declaration,
emit_associated_thunks): Likewise.
* tree.c (build_target_expr_with_type, force_target_expr,
copy_binfo, get_first_fn, cp_tree_equal): Likewise.
* typeck.c (type_after_usual_arithmetic_conversions, comptypes,
cxx_sizeof_or_alignof_type, perform_integral_promotions,
build_class_member_access_expr, finish_class_member_access_expr,
build_ptrmemfunc_access_expr, build_unary_op,
unary_complex_lvalue, cxx_mark_addressable, build_modify_expr,
build_ptrmemfunc, expand_ptrmemfunc_cst, check_return_expr
* typeck2.c (complete_type_check_abstract,
abstract_virtuals_error, process_init_constructor,
add_exception_specifier): Likewise.
From-SVN: r86669
2004-08-27 19:59:33 +02:00
|
|
|
|
gcc_assert (initp);
|
2000-06-30 09:16:35 +02:00
|
|
|
|
guard_cond = get_guard_cond (guard);
|
|
|
|
|
}
|
2001-05-01 00:20:03 +02:00
|
|
|
|
/* If we don't have __cxa_atexit, then we will be running
|
|
|
|
|
destructors from .fini sections, or their equivalents. So,
|
|
|
|
|
we need to know how many times we've tried to initialize this
|
|
|
|
|
object. We do initializations only if the GUARD is zero,
|
|
|
|
|
i.e., if we are the first to initialize the variable. We do
|
|
|
|
|
destructions only if the GUARD is one, i.e., if we are the
|
|
|
|
|
last to destroy the variable. */
|
2000-06-30 09:16:35 +02:00
|
|
|
|
else if (initp)
|
2005-06-14 22:01:59 +02:00
|
|
|
|
guard_cond
|
2008-09-23 16:55:14 +02:00
|
|
|
|
= cp_build_binary_op (input_location,
|
|
|
|
|
EQ_EXPR,
|
2008-03-25 14:53:58 +01:00
|
|
|
|
cp_build_unary_op (PREINCREMENT_EXPR,
|
2008-09-23 16:55:14 +02:00
|
|
|
|
guard,
|
|
|
|
|
/*noconvert=*/1,
|
|
|
|
|
tf_warning_or_error),
|
2008-03-25 14:53:58 +01:00
|
|
|
|
integer_one_node,
|
|
|
|
|
tf_warning_or_error);
|
1999-09-30 17:48:19 +02:00
|
|
|
|
else
|
2005-06-14 22:01:59 +02:00
|
|
|
|
guard_cond
|
2008-09-23 16:55:14 +02:00
|
|
|
|
= cp_build_binary_op (input_location,
|
|
|
|
|
EQ_EXPR,
|
2008-03-25 14:53:58 +01:00
|
|
|
|
cp_build_unary_op (PREDECREMENT_EXPR,
|
2008-09-23 16:55:14 +02:00
|
|
|
|
guard,
|
|
|
|
|
/*noconvert=*/1,
|
|
|
|
|
tf_warning_or_error),
|
2008-03-25 14:53:58 +01:00
|
|
|
|
integer_zero_node,
|
|
|
|
|
tf_warning_or_error);
|
2000-06-30 02:26:03 +02:00
|
|
|
|
|
2005-09-26 10:42:57 +02:00
|
|
|
|
guard_if_stmt = begin_if_stmt ();
|
|
|
|
|
finish_if_stmt_cond (guard_cond, guard_if_stmt);
|
1999-09-30 17:48:19 +02:00
|
|
|
|
}
|
|
|
|
|
|
2000-06-30 09:16:35 +02:00
|
|
|
|
|
2001-05-01 00:20:03 +02:00
|
|
|
|
/* If we're using __cxa_atexit, we have not already set the GUARD,
|
|
|
|
|
so we must do so now. */
|
|
|
|
|
if (guard && initp && flag_use_cxa_atexit)
|
2000-06-30 09:16:35 +02:00
|
|
|
|
finish_expr_stmt (set_guard (guard));
|
1999-09-30 17:48:19 +02:00
|
|
|
|
|
2005-09-26 10:42:57 +02:00
|
|
|
|
/* Perform the initialization or destruction. */
|
|
|
|
|
if (initp)
|
|
|
|
|
{
|
|
|
|
|
if (init)
|
2006-06-06 13:44:09 +02:00
|
|
|
|
finish_expr_stmt (init);
|
1999-09-30 17:48:19 +02:00
|
|
|
|
|
2005-09-26 10:42:57 +02:00
|
|
|
|
/* If we're using __cxa_atexit, register a function that calls the
|
2006-06-06 13:44:09 +02:00
|
|
|
|
destructor for the object. */
|
2005-09-26 10:42:57 +02:00
|
|
|
|
if (flag_use_cxa_atexit)
|
2006-06-06 13:44:09 +02:00
|
|
|
|
finish_expr_stmt (register_dtor_fn (decl));
|
2005-09-26 10:42:57 +02:00
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
finish_expr_stmt (build_cleanup (decl));
|
1999-09-30 17:48:19 +02:00
|
|
|
|
|
2005-09-26 10:42:57 +02:00
|
|
|
|
/* Finish the guard if-stmt, if necessary. */
|
|
|
|
|
if (guard)
|
|
|
|
|
{
|
|
|
|
|
finish_then_clause (guard_if_stmt);
|
|
|
|
|
finish_if_stmt (guard_if_stmt);
|
|
|
|
|
}
|
1999-09-30 17:48:19 +02:00
|
|
|
|
|
|
|
|
|
/* Now that we're done with DECL we don't need to pretend to be a
|
|
|
|
|
member of its class any longer. */
|
Make DECL_CONTEXT mean the class in which a member function was declared, even for a virtual function.
Make DECL_CONTEXT mean the class in which a member function was
declared, even for a virtual function.
* cp-tree.h (DECL_CLASS_CONTEXT): Adjust.
(DECL_FRIEND_CONTEXT): New macro.
(DECL_REAL_CONTEXT): Remove.
(SET_DECL_FRIEND_CONTEXT): Likewise.
(DECL_VIRTUAL_CONTEXT): Adjust.
(DECL_CLASS_SCOPE_P): Use TYPE_P.
(add_friends): Remove.
(hack_decl_function_context): Likewise.
* call.c (build_new_function_call): Replace DECL_REAL_CONTEXT with
CP_DECL_CONTEXT.
(build_over_call): Fix indentation. Use DECL_CONTEXT
instead of DECL_CLASS_CONTEXT.
* class.c (dfs_build_vcall_offset_vtbl_entries): Likewise.
(add_method): Set DECL_VIRTUAL_CONTEXT, not DECL_CLASS_CONTEXT.
(strictly_overrides): Use DECL_CONTEXT, not DECL_CLASS_CONTEXT.
(build_vtbl_or_vbase_field): Don't set DECL_CLASS_CONTEXT.
(build_base_field): Likewise.
(finish_struct_1): Likewise.
(build_self_reference): Likewise.
* decl.c (push_class_binding): Use CP_DECL_CONTEXT, not
DECL_REAL_CONTEXT.
(pushtag): Use decl_function_context, not
hack_decl_function_context.
(decls_match): Use CP_DECL_CONTEXT, not DECL_REAL_CONTEXT.
(duplicate_decls): Use DECL_VIRTUAL_CONTEXT.
(pushdecl): Remove bogus code.
(start_decl): Use DECL_CONTEXT rather than DECL_CLASS_CONTEXT.
(cp_finish_decl): Use CP_DECL_CONTEXT, not DECL_REAL_CONTEXT.
(grokfndecl): Use DECL_CONTEXT, not DECL_CLASS_CONTEXT.
Use decl_function_context, nothack_decl_function_context.
(grokvardecl): Don't set DECL_CLASS_CONTEXT.
(grokdeclarator): Likewise. Use decl_function_context, not
hack_decl_function_context.
(copy_args_p): Document. Don't use DECL_CLASS_CONTEXT.
(start_function): Use DECL_FRIEND_CONTEXT, not
DECL_CLASS_CONTEXT. Use decl_function_context, not
hack_decl_function_context.
(finish_function): Use decl_function_context, not
hack_decl_function_context.
(maybe_retrofit_in_chrg): Use DECL_CONTEXT, not
DECL_CLASS_CONTEXT.
(grokclassfn): Set DECL_VIRTUAL_CONTEXT, not DECL_CONTEXT.
(finish_static_data_member_decl): Don't set DECL_CLASS_CONTEXT.
(grokfield): Likewise.
(finish_builtin_type): Likewise.
(finish_vtable_vardec): Use decl_function_context, not
hack_decl_function_context.
(import_export_decl): Use DECL_CONTEXT, not DECL_CLASS_CONTEXT.
(start_static_initialization_or_destruction): Likewise.
(finish_static_initialization_or_destruction): Likewise.
(mark_used): Adjust logic for deciding when to synthesize methods.
* dump.c (dequeue_and_dump): Use CP_DECL_CONTEXT, not
DECL_REAL_CONTEXT.
* error.c (dump_function_decl): Use DECL_CONTEXT, not
DECL_CLASS_CONTEXT.
* friend.c (is_friend): Likewise.
(add_friends): Remove.
(do_friend): Use SET_DECL_FRIEND_CONTEXT.
* lex.c (begin_definition_of_inclass_inline): Use
decl_function_context, not hack_decl_function_context.
(process_next_inline): Likewise.
(do_identifier): Use CP_DECL_CONTEXT, not DECL_REAL_CONTEXT.
* method.c (set_mangled_name_for_decl): Use DECL_CONTEXT, not
DECL_CLASSS_CONTEXT.
(hack_identifier): Likewise.
(synthesize_method): Use decl_function_context, not
hack_decl_function_context.
* pt.c (template_class_depth_real): Use CP_DECL_CONTEXT, not
DECL_REAL_CONTEXT.
(is_member_template): Use decl_function_context, not
hack_decl_function_context. Use DECL_CONTEXT, not
DECL_CLASS_CONTEXT.
(build_template_decl): Set DECL_VIRTUAL_CONTEXT, not
DECL_CLASS_CONTEXT.
(check_default_tmpl_args): Use CP_DECL_CONTEXT, not
DECL_REAL_CONTEXT.
(push_template_decl_real): Likewise.
(instantiate_class_template): Don't call add_friends.
(tsubst_default_argument): Use DECL_CONTEXT, not
DECL_REAL_CONTEXT.
(tsubst_decl): Set DECL_VIRTUAL_CONTEXT, not DECL_CLASS_CONTEXT.
Use DECL_CONTEXT, not DECL_CLASS_CONTEXT.
(set_meangled_name_for_template_decl): Use DECL_CONTEXT, not
DECL_CLASS_CONTEXT.
* repo.c (repo_inline_used): Likewise.
* search.c (current_scope): Adjust for new _CONTEXT macros.
(context_for_name_lookup): Use CP_DECL_CONTEXT, not
DECL_REAL_CONTEXT.
(friend_accessible_p): Use DECL_CONTEXT, not DECL_CLASS_CONTEXT.
(lookup_fnfields_here):Likewise.
(check_final_overrider): Likewise.
(init_vbase_pointers): Likewise.
(virtual_context): Likewise.
* semantics.c (finish_member_declaration): Just set DECL_CONTEXT.
(expand_body): Use decl_function_context, not
hack_decl_function_context.
* tree.c (hack_decl_function_context): Remove.
* typeck.c (build_x_function_call): Use DECL_CONTEXT, not
DECL_CLASS_CONTEXT.
* typeck2.c (error_not_base_type): Likewise.
From-SVN: r32018
2000-02-17 00:54:23 +01:00
|
|
|
|
DECL_CONTEXT (current_function_decl) = NULL_TREE;
|
1999-09-30 17:48:19 +02:00
|
|
|
|
DECL_STATIC_FUNCTION_P (current_function_decl) = 0;
|
|
|
|
|
}
|
|
|
|
|
|
2005-09-26 10:42:57 +02:00
|
|
|
|
/* Generate code to do the initialization or destruction of the decls in VARS,
|
|
|
|
|
a TREE_LIST of VAR_DECL with static storage duration.
|
|
|
|
|
Whether initialization or destruction is performed is specified by INITP. */
|
1998-05-20 04:46:16 +02:00
|
|
|
|
|
1999-04-23 01:13:12 +02:00
|
|
|
|
static void
|
2005-09-26 10:42:57 +02:00
|
|
|
|
do_static_initialization_or_destruction (tree vars, bool initp)
|
1999-04-23 01:13:12 +02:00
|
|
|
|
{
|
2005-09-26 10:42:57 +02:00
|
|
|
|
tree node, init_if_stmt, cond;
|
1999-04-23 01:13:12 +02:00
|
|
|
|
|
2005-09-26 10:42:57 +02:00
|
|
|
|
/* Build the outer if-stmt to check for initialization or destruction. */
|
|
|
|
|
init_if_stmt = begin_if_stmt ();
|
|
|
|
|
cond = initp ? integer_one_node : integer_zero_node;
|
2008-09-23 16:55:14 +02:00
|
|
|
|
cond = cp_build_binary_op (input_location,
|
|
|
|
|
EQ_EXPR,
|
2008-03-25 14:53:58 +01:00
|
|
|
|
initialize_p_decl,
|
|
|
|
|
cond,
|
|
|
|
|
tf_warning_or_error);
|
2005-09-26 10:42:57 +02:00
|
|
|
|
finish_if_stmt_cond (cond, init_if_stmt);
|
|
|
|
|
|
|
|
|
|
node = vars;
|
|
|
|
|
do {
|
|
|
|
|
tree decl = TREE_VALUE (node);
|
|
|
|
|
tree priority_if_stmt;
|
|
|
|
|
int priority;
|
|
|
|
|
priority_info pi;
|
|
|
|
|
|
|
|
|
|
/* If we don't need a destructor, there's nothing to do. Avoid
|
|
|
|
|
creating a possibly empty if-stmt. */
|
|
|
|
|
if (!initp && TYPE_HAS_TRIVIAL_DESTRUCTOR (TREE_TYPE (decl)))
|
|
|
|
|
{
|
|
|
|
|
node = TREE_CHAIN (node);
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Remember that we had an initialization or finalization at this
|
|
|
|
|
priority. */
|
|
|
|
|
priority = DECL_EFFECTIVE_INIT_PRIORITY (decl);
|
|
|
|
|
pi = get_priority_info (priority);
|
|
|
|
|
if (initp)
|
|
|
|
|
pi->initializations_p = 1;
|
|
|
|
|
else
|
|
|
|
|
pi->destructions_p = 1;
|
|
|
|
|
|
|
|
|
|
/* Conditionalize this initialization on being in the right priority
|
|
|
|
|
and being initializing/finalizing appropriately. */
|
|
|
|
|
priority_if_stmt = begin_if_stmt ();
|
2008-09-23 16:55:14 +02:00
|
|
|
|
cond = cp_build_binary_op (input_location,
|
|
|
|
|
EQ_EXPR,
|
2005-09-26 10:42:57 +02:00
|
|
|
|
priority_decl,
|
2008-03-25 14:53:58 +01:00
|
|
|
|
build_int_cst (NULL_TREE, priority),
|
|
|
|
|
tf_warning_or_error);
|
2005-09-26 10:42:57 +02:00
|
|
|
|
finish_if_stmt_cond (cond, priority_if_stmt);
|
|
|
|
|
|
|
|
|
|
/* Process initializers with same priority. */
|
|
|
|
|
for (; node
|
|
|
|
|
&& DECL_EFFECTIVE_INIT_PRIORITY (TREE_VALUE (node)) == priority;
|
|
|
|
|
node = TREE_CHAIN (node))
|
|
|
|
|
/* Do one initialization or destruction. */
|
|
|
|
|
one_static_initialization_or_destruction (TREE_VALUE (node),
|
2006-06-06 13:44:09 +02:00
|
|
|
|
TREE_PURPOSE (node), initp);
|
2005-09-26 10:42:57 +02:00
|
|
|
|
|
|
|
|
|
/* Finish up the priority if-stmt body. */
|
|
|
|
|
finish_then_clause (priority_if_stmt);
|
|
|
|
|
finish_if_stmt (priority_if_stmt);
|
|
|
|
|
|
|
|
|
|
} while (node);
|
|
|
|
|
|
|
|
|
|
/* Finish up the init/destruct if-stmt body. */
|
|
|
|
|
finish_then_clause (init_if_stmt);
|
|
|
|
|
finish_if_stmt (init_if_stmt);
|
1998-05-20 04:46:16 +02:00
|
|
|
|
}
|
|
|
|
|
|
1999-09-30 17:48:19 +02:00
|
|
|
|
/* VARS is a list of variables with static storage duration which may
|
|
|
|
|
need initialization and/or finalization. Remove those variables
|
|
|
|
|
that don't really need to be initialized or finalized, and return
|
|
|
|
|
the resulting list. The order in which the variables appear in
|
|
|
|
|
VARS is in reverse order of the order in which they should actually
|
|
|
|
|
be initialized. The list we return is in the unreversed order;
|
|
|
|
|
i.e., the first variable should be initialized first. */
|
1994-02-24 02:02:37 +01:00
|
|
|
|
|
1999-09-30 17:48:19 +02:00
|
|
|
|
static tree
|
2003-02-26 06:39:01 +01:00
|
|
|
|
prune_vars_needing_no_initialization (tree *vars)
|
1994-02-24 02:02:37 +01:00
|
|
|
|
{
|
2003-02-26 06:39:01 +01:00
|
|
|
|
tree *var = vars;
|
|
|
|
|
tree result = NULL_TREE;
|
1994-02-24 02:02:37 +01:00
|
|
|
|
|
2003-02-26 06:39:01 +01:00
|
|
|
|
while (*var)
|
1999-09-30 17:48:19 +02:00
|
|
|
|
{
|
2003-02-26 06:39:01 +01:00
|
|
|
|
tree t = *var;
|
|
|
|
|
tree decl = TREE_VALUE (t);
|
|
|
|
|
tree init = TREE_PURPOSE (t);
|
1994-05-06 11:27:46 +02:00
|
|
|
|
|
1999-09-30 17:48:19 +02:00
|
|
|
|
/* Deal gracefully with error. */
|
|
|
|
|
if (decl == error_mark_node)
|
2003-02-26 06:39:01 +01:00
|
|
|
|
{
|
|
|
|
|
var = &TREE_CHAIN (t);
|
|
|
|
|
continue;
|
|
|
|
|
}
|
1996-02-28 23:01:56 +01:00
|
|
|
|
|
1999-09-30 17:48:19 +02:00
|
|
|
|
/* The only things that can be initialized are variables. */
|
call.c (validate_conversion_obstack): Replace my_friendly_assert with gcc_assert or gcc_unreachable.
* call.c (validate_conversion_obstack): Replace
my_friendly_assert with gcc_assert or gcc_unreachable.
(direct_reference_binding, merge_conversion_sequences,
build_user_type_conversion_1, perform_overload_resolution,
build_op_delete_call, enforce_access, call_builtin_trap,
build_over_call, build_special_member_call, build_new_method_call,
initialize_reference): Likewise.
* class.c (build_base_path, build_primary_vtable, alter_access,
check_bases, update_vtable_entry_for_fn, layout_empty_base,
clone_function_decl, adjust_clone_args,
type_requires_array_cookie, include_empty_classes,
finish_struct_1, resolve_address_of_overloaded_function,
instantiate_type, get_vtbl_decl_for_binfo, build_vtt_inits,
dfs_build_secondary_vptr_vtt_inits, build_ctor_vtbl_group,
accumulate_vtbl_inits, build_vtbl_initializer,
build_vbase_offset_vtbl_entries, build_rtti_vtbl_entries): Likewise.
* cvt.c (build_up_reference, convert_to_reference): Likewise.
* decl.c (poplevel, duplicate_decls, make_typename_type,
cxx_init_decl_processing, reshape_init, check_initializer,
make_rtl_for_nonlocal_decl, initialize_local_var, cp_finish_decl,
expand_static_init, grokfndecl, grokvardecl, build_ptrmem_type,
grokdeclarator, copy_fn_p, grok_op_properties, xref_tag,
xref_basetypes, start_preparsed_function, save_function_data,
finish_function, finish_method, maybe_register_incomplete_var,
complete_vars): Likewise.
* decl2.c (grok_array_decl, check_member_template,
check_classfn, finish_static_data_member_decl, coerce_new_type,
coerce_delete_type, import_export_class, decl_needed_p,
determine_visibility, import_export_decl, build_cleanup,
start_static_initialization_or_destructi, do_static_destruction,
prune_vars_needing_no_initialization,
build_offset_ref_call_from_tree): Likewise.
* error.c (dump_decl, dump_expr): Likewise.
* init.c (finish_init_stmts, build_zero_init,
expand_virtual_init, expand_default_init, expand_aggr_init_1,
build_offset_ref, build_new_1, build_delete, build_vbase_delete):
Likewise.
* mangle.c (write_method_parms, write_template_args,
write_expression, write_template_arg): Likewise.
* method.c (make_thunk, finish_thunk, use_thunk): Likewise.
* name-lookup.c (pop_binding, begin_scope, leave_scope,
resume_scope, push_using_decl, validate_nonmember_using_decl,
is_ancestor, poplevel_class, set_inherited_value_binding_p,
push_class_level_binding, do_class_using_decl, push_namespace,
pop_namespace, add_using_namespace, ambiguous_decl,
lookup_namespace_name, lookup_type_current_level,
maybe_process_template_type_declaration): Likewise.
* parser.c (cp_lexer_peek_nth_token,
cp_parser_parse_and_diagnose_invalid_typ,
cp_parser_translation_unit, cp_parser_template_id,
cp_parser_lookup_name, cp_parser_late_parsing_for_member): Likewise.
* pt.c (push_access_scope, finish_member_template_decl,
push_inline_template_parms_recursive, add_outermost_template_args,
get_innermost_template_args, begin_explicit_instantiation,
end_explicit_instantiation, retrieve_specialization,
is_specialization_of, is_specialization_of_friend,
register_specialization, check_explicit_specialization,
comp_template_parms, process_template_parm,
process_partial_specialization, convert_nontype_argument,
coerce_template_template_parms, coerce_template_parms,
mangle_class_name_for_template, lookup_template_function,
lookup_template_class, instantiate_class_template, tsubst_decl,
tsubst_function_type, tsubst, tsubst_qualified_id, tsubst_copy,
instantiate_template, fn_type_unification, type_unification_real,
get_template_base, regenerate_decl_from_template,
template_for_substitution, instantiate_decl,
get_mostly_instantiated_function_type, dependent_scope_ref_p,
value_dependent_expression_p, resolve_typename_type): Likewise.
* repo.c (repo_emit_p): Likewise.
* rtti.c (build_headof, get_tinfo_decl, get_pseudo_ti_init,
create_tinfo_types, emit_tinfo_decl): Likewise.
* search.c (lookup_base_r, lookup_base, lookup_field_1,
dfs_access_in_type, build_baselink, lookup_member,
adjust_result_of_qualified_name_lookup, copied_binfo): Likewise.
* semantics.c (perform_or_defer_access_check,
finish_non_static_data_member, finish_stmt_expr_expr,
finish_stmt_expr, finish_call_expr, finish_pseudo_destructor_expr,
finish_template_template_parm, finish_member_declaration,
emit_associated_thunks): Likewise.
* tree.c (build_target_expr_with_type, force_target_expr,
copy_binfo, get_first_fn, cp_tree_equal): Likewise.
* typeck.c (type_after_usual_arithmetic_conversions, comptypes,
cxx_sizeof_or_alignof_type, perform_integral_promotions,
build_class_member_access_expr, finish_class_member_access_expr,
build_ptrmemfunc_access_expr, build_unary_op,
unary_complex_lvalue, cxx_mark_addressable, build_modify_expr,
build_ptrmemfunc, expand_ptrmemfunc_cst, check_return_expr
* typeck2.c (complete_type_check_abstract,
abstract_virtuals_error, process_init_constructor,
add_exception_specifier): Likewise.
From-SVN: r86669
2004-08-27 19:59:33 +02:00
|
|
|
|
gcc_assert (TREE_CODE (decl) == VAR_DECL);
|
1994-02-24 02:02:37 +01:00
|
|
|
|
|
1999-09-30 17:48:19 +02:00
|
|
|
|
/* If this object is not defined, we don't need to do anything
|
|
|
|
|
here. */
|
|
|
|
|
if (DECL_EXTERNAL (decl))
|
2003-02-26 06:39:01 +01:00
|
|
|
|
{
|
|
|
|
|
var = &TREE_CHAIN (t);
|
|
|
|
|
continue;
|
|
|
|
|
}
|
1994-02-24 02:02:37 +01:00
|
|
|
|
|
1999-09-30 17:48:19 +02:00
|
|
|
|
/* Also, if the initializer already contains errors, we can bail
|
|
|
|
|
out now. */
|
2005-06-14 22:01:59 +02:00
|
|
|
|
if (init && TREE_CODE (init) == TREE_LIST
|
1999-09-30 17:48:19 +02:00
|
|
|
|
&& value_member (error_mark_node, init))
|
2003-02-26 06:39:01 +01:00
|
|
|
|
{
|
|
|
|
|
var = &TREE_CHAIN (t);
|
|
|
|
|
continue;
|
|
|
|
|
}
|
1995-01-31 23:18:02 +01:00
|
|
|
|
|
1999-09-30 17:48:19 +02:00
|
|
|
|
/* This variable is going to need initialization and/or
|
|
|
|
|
finalization, so we add it to the list. */
|
2003-02-26 06:39:01 +01:00
|
|
|
|
*var = TREE_CHAIN (t);
|
|
|
|
|
TREE_CHAIN (t) = result;
|
|
|
|
|
result = t;
|
1999-09-30 17:48:19 +02:00
|
|
|
|
}
|
1998-05-23 04:18:33 +02:00
|
|
|
|
|
1999-09-30 17:48:19 +02:00
|
|
|
|
return result;
|
|
|
|
|
}
|
1998-05-23 04:18:33 +02:00
|
|
|
|
|
1999-09-30 17:48:19 +02:00
|
|
|
|
/* Make sure we have told the back end about all the variables in
|
|
|
|
|
VARS. */
|
1999-04-23 01:13:12 +02:00
|
|
|
|
|
1999-09-30 17:48:19 +02:00
|
|
|
|
static void
|
Remove traditional C constructs 4/n.
* decl2.c (grok_method_quals, warn_if_unknown_interface,
grok_x_components, cp_build_parm_decl, build_artificial_parm,
maybe_retrofit_in_chrg, grokclassfn, grok_array_decl,
delete_sanity, check_member_template, check_java_method,
check_classfn, finish_static_data_member_decl, grokfield,
grokbitfield, grokoptypename, grok_function_init,
cplus_decl_attributes, constructor_name, defer_fn,
build_anon_union_vars, finish_anon_union, coerce_new_type,
coerce_delete_type, comdat_linkage, maybe_make_one_only,
key_method, import_export_vtable, import_export_class,
output_vtable_inherit, import_export_decl, import_export_tinfo,
build_cleanup, get_guard, get_guard_bits, get_guard_cond,
set_guard, start_objects, finish_objects,
start_static_storage_duration_function,
finish_static_storage_duration_function, get_priority_info,
start_static_initialization_or_destruction,
finish_static_initialization_or_destruction,
do_static_initialization, do_static_destruction,
prune_vars_needing_no_initialization, write_out_vars,
reparse_decl_as_expr, finish_decl_parsing, namespace_ancestor,
add_using_namespace, merge_functions, ambiguous_decl,
lookup_using_namespace, lookup_using_namespace,
qualified_lookup_using_namespace, set_decl_namespace,
decl_namespace, current_decl_namespace, push_decl_namespace,
pop_decl_namespace, push_scope, pop_scope, add_function,
arg_assoc_namespace, arg_assoc_template_arg, arg_assoc,
lookup_arg_dependent, do_namespace_alias,
validate_nonmember_using_decl, do_nonmember_using_decl,
do_toplevel_using_decl, do_local_using_decl,
do_class_using_decl, do_using_directive, check_default_args,
mark_used, handle_class_head): Use C90 prototypings. Use booleans.
* parser.c (cp_parser_class_head): Use booleanss.
* decl.c (walk_globals, walk_vtables): Likewise.
* cp-tree.h (walk_globals_pred, walk_globals_fn, walk_vtables,
walk_globals): Change return type from 'int' to 'bool'.
* rtti.c (init_rtti_processing, build_headof, throw_bad_cast
throw_bad_typeid, get_tinfo_decl_dynamic, typeid_ok_p,
build_typeid, tinfo_name, get_tinfo_decl, get_tinfo_ptr,
get_typeid, ifnonnull, build_dynamic_cast_1, build_dynamic_cast,
qualifier_flags, tinfo_base_init, generic_initializer,
ptr_initializer, dfs_class_hint_mark, ptm_initializer,
dfs_class_hint_unmark, class_hint_flags, class_initializer,
typeinfo_in_lib_p, get_pseudo_ti_init, create_pseudo_type_info,
get_pseudo_ti_desc, create_tinfo_types, emit_support_tinfos,
unemitted_tinfo_decl_p, emit_tinfo_decl): Likewise.
* repo.c (repo_compile_flags, repo_template_declared,
repo_template_defined, repo_class_defined, repo_get_id,
repo_template_used, repo_vtable_used, repo_inline_used,
repo_tinfo_used, repo_template_instantiated, extract_string,
open_repo_file, afgets, init_repo, reopen_repo_file_for_write,
finish_repo): Likewise.
* ptree.c (cxx_print_decl, cxx_print_type, cxx_print_identifier,
cxx_print_xnode): Likewise..
* cp-lang.c (ok_to_generate_alias_set_for_type, cxx_get_alias_set,
cxx_warn_unused_global_decl, cp_expr_size): Likewise.
* cxxfilt.c (demangle_it, print_demangler_list, usage,
standard_symbol_characters, hp_symbol_characters, main, fatal):
Likewise.
(strip_underscore): Change type from 'int' to 'bool'.
(main): Use boolean constants.
From-SVN: r60601
2002-12-29 15:53:05 +01:00
|
|
|
|
write_out_vars (tree vars)
|
1999-09-30 17:48:19 +02:00
|
|
|
|
{
|
|
|
|
|
tree v;
|
1999-04-23 01:13:12 +02:00
|
|
|
|
|
1999-09-30 17:48:19 +02:00
|
|
|
|
for (v = vars; v; v = TREE_CHAIN (v))
|
2004-07-29 19:59:31 +02:00
|
|
|
|
{
|
|
|
|
|
tree var = TREE_VALUE (v);
|
|
|
|
|
if (!var_finalized_p (var))
|
|
|
|
|
{
|
|
|
|
|
import_export_decl (var);
|
2004-08-05 07:52:01 +02:00
|
|
|
|
rest_of_decl_compilation (var, 1, 1);
|
2004-07-29 19:59:31 +02:00
|
|
|
|
}
|
|
|
|
|
}
|
1999-04-23 01:13:12 +02:00
|
|
|
|
}
|
1996-03-23 00:11:55 +01:00
|
|
|
|
|
1999-04-23 01:13:12 +02:00
|
|
|
|
/* Generate a static constructor (if CONSTRUCTOR_P) or destructor
|
2006-12-28 07:48:38 +01:00
|
|
|
|
(otherwise) that will initialize all global objects with static
|
1999-04-23 01:13:12 +02:00
|
|
|
|
storage duration having the indicated PRIORITY. */
|
1996-08-13 17:39:22 +02:00
|
|
|
|
|
1999-04-23 01:13:12 +02:00
|
|
|
|
static void
|
2003-04-20 13:57:38 +02:00
|
|
|
|
generate_ctor_or_dtor_function (bool constructor_p, int priority,
|
|
|
|
|
location_t *locus)
|
1999-04-23 01:13:12 +02:00
|
|
|
|
{
|
|
|
|
|
char function_key;
|
2003-06-12 00:29:41 +02:00
|
|
|
|
tree fndecl;
|
1999-09-24 03:29:29 +02:00
|
|
|
|
tree body;
|
1999-04-30 18:14:58 +02:00
|
|
|
|
size_t i;
|
1996-08-13 17:39:22 +02:00
|
|
|
|
|
2003-05-03 13:37:22 +02:00
|
|
|
|
input_location = *locus;
|
2004-06-30 20:23:35 +02:00
|
|
|
|
/* ??? */
|
2008-02-26 17:05:24 +01:00
|
|
|
|
/* Was: locus->line++; */
|
2005-06-14 22:01:59 +02:00
|
|
|
|
|
1999-04-23 01:13:12 +02:00
|
|
|
|
/* We use `I' to indicate initialization and `D' to indicate
|
|
|
|
|
destruction. */
|
2003-06-12 00:29:41 +02:00
|
|
|
|
function_key = constructor_p ? 'I' : 'D';
|
1996-08-13 17:39:22 +02:00
|
|
|
|
|
2003-06-12 00:29:41 +02:00
|
|
|
|
/* We emit the function lazily, to avoid generating empty
|
|
|
|
|
global constructors and destructors. */
|
|
|
|
|
body = NULL_TREE;
|
1998-05-08 04:06:26 +02:00
|
|
|
|
|
2005-05-17 22:05:24 +02:00
|
|
|
|
/* For Objective-C++, we may need to initialize metadata found in this module.
|
|
|
|
|
This must be done _before_ any other static initializations. */
|
|
|
|
|
if (c_dialect_objc () && (priority == DEFAULT_INIT_PRIORITY)
|
|
|
|
|
&& constructor_p && objc_static_init_needed_p ())
|
|
|
|
|
{
|
|
|
|
|
body = start_objects (function_key, priority);
|
2007-02-25 19:47:05 +01:00
|
|
|
|
objc_generate_static_init_call (NULL_TREE);
|
2005-05-17 22:05:24 +02:00
|
|
|
|
}
|
|
|
|
|
|
1999-04-23 01:13:12 +02:00
|
|
|
|
/* Call the static storage duration function with appropriate
|
|
|
|
|
arguments. */
|
2010-08-20 14:48:59 +02:00
|
|
|
|
FOR_EACH_VEC_ELT (tree, ssdf_decls, i, fndecl)
|
2005-05-06 16:24:20 +02:00
|
|
|
|
{
|
|
|
|
|
/* Calls to pure or const functions will expand to nothing. */
|
|
|
|
|
if (! (flags_from_decl_or_type (fndecl) & (ECF_CONST | ECF_PURE)))
|
|
|
|
|
{
|
2010-05-30 05:03:14 +02:00
|
|
|
|
tree call;
|
|
|
|
|
|
2005-05-06 16:24:20 +02:00
|
|
|
|
if (! body)
|
|
|
|
|
body = start_objects (function_key, priority);
|
|
|
|
|
|
2010-05-30 05:03:14 +02:00
|
|
|
|
call = cp_build_function_call_nary (fndecl, tf_warning_or_error,
|
|
|
|
|
build_int_cst (NULL_TREE,
|
|
|
|
|
constructor_p),
|
|
|
|
|
build_int_cst (NULL_TREE,
|
|
|
|
|
priority),
|
|
|
|
|
NULL_TREE);
|
|
|
|
|
finish_expr_stmt (call);
|
2005-05-06 16:24:20 +02:00
|
|
|
|
}
|
|
|
|
|
}
|
1996-03-23 00:11:55 +01:00
|
|
|
|
|
1999-04-23 01:13:12 +02:00
|
|
|
|
/* Close out the function. */
|
2003-06-12 00:29:41 +02:00
|
|
|
|
if (body)
|
|
|
|
|
finish_objects (function_key, priority, body);
|
1999-04-23 01:13:12 +02:00
|
|
|
|
}
|
1995-04-18 21:23:38 +02:00
|
|
|
|
|
1999-04-23 01:13:12 +02:00
|
|
|
|
/* Generate constructor and destructor functions for the priority
|
1999-04-30 18:14:58 +02:00
|
|
|
|
indicated by N. */
|
1995-04-18 21:23:38 +02:00
|
|
|
|
|
1999-04-23 01:13:12 +02:00
|
|
|
|
static int
|
2003-04-20 13:57:38 +02:00
|
|
|
|
generate_ctor_and_dtor_functions_for_priority (splay_tree_node n, void * data)
|
1999-04-23 01:13:12 +02:00
|
|
|
|
{
|
2006-01-29 10:10:48 +01:00
|
|
|
|
location_t *locus = (location_t *) data;
|
1999-04-23 01:13:12 +02:00
|
|
|
|
int priority = (int) n->key;
|
|
|
|
|
priority_info pi = (priority_info) n->value;
|
|
|
|
|
|
|
|
|
|
/* Generate the functions themselves, but only if they are really
|
|
|
|
|
needed. */
|
2007-02-25 19:47:05 +01:00
|
|
|
|
if (pi->initializations_p)
|
2003-04-20 13:57:38 +02:00
|
|
|
|
generate_ctor_or_dtor_function (/*constructor_p=*/true, priority, locus);
|
2007-02-25 19:47:05 +01:00
|
|
|
|
if (pi->destructions_p)
|
2003-04-20 13:57:38 +02:00
|
|
|
|
generate_ctor_or_dtor_function (/*constructor_p=*/false, priority, locus);
|
1999-04-23 01:13:12 +02:00
|
|
|
|
|
|
|
|
|
/* Keep iterating. */
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
1998-08-13 19:29:30 +02:00
|
|
|
|
|
2003-09-10 21:16:20 +02:00
|
|
|
|
/* Called via LANGHOOK_CALLGRAPH_ANALYZE_EXPR. It is supposed to mark
|
class.c, [...]: Follow spelling conventions.
* class.c, cp-tree.h, decl.c, decl2.c, g++spec.c, init.c,
parser.c, pt.c, tree.c, typeck.c: Follow spelling conventions.
From-SVN: r121566
2007-02-04 05:24:53 +01:00
|
|
|
|
decls referenced from front-end specific constructs; it will be called
|
2003-09-10 21:16:20 +02:00
|
|
|
|
only for language-specific tree nodes.
|
|
|
|
|
|
|
|
|
|
Here we must deal with member pointers. */
|
|
|
|
|
|
|
|
|
|
tree
|
2007-11-02 12:12:30 +01:00
|
|
|
|
cxx_callgraph_analyze_expr (tree *tp, int *walk_subtrees ATTRIBUTE_UNUSED)
|
2003-07-02 02:12:10 +02:00
|
|
|
|
{
|
2003-09-10 02:09:09 +02:00
|
|
|
|
tree t = *tp;
|
|
|
|
|
|
2004-07-29 19:59:31 +02:00
|
|
|
|
switch (TREE_CODE (t))
|
|
|
|
|
{
|
|
|
|
|
case PTRMEM_CST:
|
|
|
|
|
if (TYPE_PTRMEMFUNC_P (TREE_TYPE (t)))
|
2009-05-10 17:11:01 +02:00
|
|
|
|
cgraph_mark_address_taken_node (cgraph_node (PTRMEM_CST_MEMBER (t)));
|
2004-07-29 19:59:31 +02:00
|
|
|
|
break;
|
|
|
|
|
case BASELINK:
|
|
|
|
|
if (TREE_CODE (BASELINK_FUNCTIONS (t)) == FUNCTION_DECL)
|
2009-05-10 17:11:01 +02:00
|
|
|
|
cgraph_mark_address_taken_node (cgraph_node (BASELINK_FUNCTIONS (t)));
|
2004-07-29 19:59:31 +02:00
|
|
|
|
break;
|
|
|
|
|
case VAR_DECL:
|
2010-05-22 16:48:40 +02:00
|
|
|
|
if (DECL_CONTEXT (t)
|
|
|
|
|
&& flag_use_repository
|
|
|
|
|
&& TREE_CODE (DECL_CONTEXT (t)) == FUNCTION_DECL)
|
2004-07-29 19:59:31 +02:00
|
|
|
|
/* If we need a static variable in a function, then we
|
|
|
|
|
need the containing function. */
|
|
|
|
|
mark_decl_referenced (DECL_CONTEXT (t));
|
|
|
|
|
break;
|
|
|
|
|
default:
|
|
|
|
|
break;
|
|
|
|
|
}
|
2003-09-10 02:09:09 +02:00
|
|
|
|
|
2003-09-10 21:16:20 +02:00
|
|
|
|
return NULL;
|
2003-07-02 02:12:10 +02:00
|
|
|
|
}
|
|
|
|
|
|
2005-05-26 00:08:31 +02:00
|
|
|
|
/* Java requires that we be able to reference a local address for a
|
|
|
|
|
method, and not be confused by PLT entries. If hidden aliases are
|
2009-09-03 06:07:12 +02:00
|
|
|
|
supported, collect and return all the functions for which we should
|
|
|
|
|
emit a hidden alias. */
|
2005-05-26 00:08:31 +02:00
|
|
|
|
|
2009-09-03 06:07:12 +02:00
|
|
|
|
static struct pointer_set_t *
|
|
|
|
|
collect_candidates_for_java_method_aliases (void)
|
2005-05-26 00:08:31 +02:00
|
|
|
|
{
|
|
|
|
|
struct cgraph_node *node;
|
2009-09-03 06:07:12 +02:00
|
|
|
|
struct pointer_set_t *candidates = NULL;
|
2005-05-26 00:08:31 +02:00
|
|
|
|
|
|
|
|
|
#ifndef HAVE_GAS_HIDDEN
|
2009-09-03 06:07:12 +02:00
|
|
|
|
return candidates;
|
2005-05-26 00:08:31 +02:00
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
for (node = cgraph_nodes; node ; node = node->next)
|
|
|
|
|
{
|
|
|
|
|
tree fndecl = node->decl;
|
|
|
|
|
|
2009-09-03 06:07:12 +02:00
|
|
|
|
if (DECL_CONTEXT (fndecl)
|
2005-05-26 00:08:31 +02:00
|
|
|
|
&& TYPE_P (DECL_CONTEXT (fndecl))
|
|
|
|
|
&& TYPE_FOR_JAVA (DECL_CONTEXT (fndecl))
|
|
|
|
|
&& TARGET_USE_LOCAL_THUNK_ALIAS_P (fndecl))
|
2009-09-03 06:07:12 +02:00
|
|
|
|
{
|
|
|
|
|
if (candidates == NULL)
|
|
|
|
|
candidates = pointer_set_create ();
|
|
|
|
|
pointer_set_insert (candidates, fndecl);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return candidates;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* Java requires that we be able to reference a local address for a
|
|
|
|
|
method, and not be confused by PLT entries. If hidden aliases are
|
|
|
|
|
supported, emit one for each java function that we've emitted.
|
|
|
|
|
CANDIDATES is the set of FUNCTION_DECLs that were gathered
|
|
|
|
|
by collect_candidates_for_java_method_aliases. */
|
|
|
|
|
|
|
|
|
|
static void
|
|
|
|
|
build_java_method_aliases (struct pointer_set_t *candidates)
|
|
|
|
|
{
|
|
|
|
|
struct cgraph_node *node;
|
|
|
|
|
|
|
|
|
|
#ifndef HAVE_GAS_HIDDEN
|
|
|
|
|
return;
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
for (node = cgraph_nodes; node ; node = node->next)
|
|
|
|
|
{
|
|
|
|
|
tree fndecl = node->decl;
|
|
|
|
|
|
|
|
|
|
if (TREE_ASM_WRITTEN (fndecl)
|
|
|
|
|
&& pointer_set_contains (candidates, fndecl))
|
2005-05-26 00:08:31 +02:00
|
|
|
|
{
|
|
|
|
|
/* Mangle the name in a predictable way; we need to reference
|
|
|
|
|
this from a java compiled object file. */
|
|
|
|
|
tree oid, nid, alias;
|
|
|
|
|
const char *oname;
|
|
|
|
|
char *nname;
|
|
|
|
|
|
|
|
|
|
oid = DECL_ASSEMBLER_NAME (fndecl);
|
|
|
|
|
oname = IDENTIFIER_POINTER (oid);
|
|
|
|
|
gcc_assert (oname[0] == '_' && oname[1] == 'Z');
|
|
|
|
|
nname = ACONCAT (("_ZGA", oname+2, NULL));
|
|
|
|
|
nid = get_identifier (nname);
|
|
|
|
|
|
|
|
|
|
alias = make_alias_for (fndecl, nid);
|
|
|
|
|
TREE_PUBLIC (alias) = 1;
|
|
|
|
|
DECL_VISIBILITY (alias) = VISIBILITY_HIDDEN;
|
|
|
|
|
|
|
|
|
|
assemble_alias (alias, oid);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2010-06-01 15:00:50 +02:00
|
|
|
|
/* Return C++ property of T, based on given operation OP. */
|
|
|
|
|
|
|
|
|
|
static int
|
|
|
|
|
cpp_check (tree t, cpp_operation op)
|
|
|
|
|
{
|
|
|
|
|
switch (op)
|
|
|
|
|
{
|
|
|
|
|
case IS_ABSTRACT:
|
|
|
|
|
return DECL_PURE_VIRTUAL_P (t);
|
|
|
|
|
case IS_CONSTRUCTOR:
|
|
|
|
|
return DECL_CONSTRUCTOR_P (t);
|
|
|
|
|
case IS_DESTRUCTOR:
|
|
|
|
|
return DECL_DESTRUCTOR_P (t);
|
|
|
|
|
case IS_COPY_CONSTRUCTOR:
|
|
|
|
|
return DECL_COPY_CONSTRUCTOR_P (t);
|
|
|
|
|
case IS_TEMPLATE:
|
|
|
|
|
return TREE_CODE (t) == TEMPLATE_DECL;
|
|
|
|
|
default:
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Collect source file references recursively, starting from NAMESPC. */
|
|
|
|
|
|
|
|
|
|
static void
|
|
|
|
|
collect_source_refs (tree namespc)
|
|
|
|
|
{
|
|
|
|
|
tree t;
|
|
|
|
|
|
|
|
|
|
if (!namespc)
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
/* Iterate over names in this name space. */
|
|
|
|
|
for (t = NAMESPACE_LEVEL (namespc)->names; t; t = TREE_CHAIN (t))
|
|
|
|
|
if (!DECL_IS_BUILTIN (t) )
|
|
|
|
|
collect_source_ref (DECL_SOURCE_FILE (t));
|
|
|
|
|
|
|
|
|
|
/* Dump siblings, if any */
|
|
|
|
|
collect_source_refs (TREE_CHAIN (namespc));
|
|
|
|
|
|
|
|
|
|
/* Dump children, if any */
|
|
|
|
|
collect_source_refs (NAMESPACE_LEVEL (namespc)->namespaces);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Collect decls relevant to SOURCE_FILE from all namespaces recursively,
|
|
|
|
|
starting from NAMESPC. */
|
|
|
|
|
|
|
|
|
|
static void
|
|
|
|
|
collect_ada_namespace (tree namespc, const char *source_file)
|
|
|
|
|
{
|
|
|
|
|
if (!namespc)
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
/* Collect decls from this namespace */
|
|
|
|
|
collect_ada_nodes (NAMESPACE_LEVEL (namespc)->names, source_file);
|
|
|
|
|
|
|
|
|
|
/* Collect siblings, if any */
|
|
|
|
|
collect_ada_namespace (TREE_CHAIN (namespc), source_file);
|
|
|
|
|
|
|
|
|
|
/* Collect children, if any */
|
|
|
|
|
collect_ada_namespace (NAMESPACE_LEVEL (namespc)->namespaces, source_file);
|
|
|
|
|
}
|
|
|
|
|
|
2009-08-10 22:47:55 +02:00
|
|
|
|
/* Returns true iff there is a definition available for variable or
|
|
|
|
|
function DECL. */
|
|
|
|
|
|
|
|
|
|
static bool
|
|
|
|
|
decl_defined_p (tree decl)
|
|
|
|
|
{
|
|
|
|
|
if (TREE_CODE (decl) == FUNCTION_DECL)
|
|
|
|
|
return (DECL_INITIAL (decl) != NULL_TREE);
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
gcc_assert (TREE_CODE (decl) == VAR_DECL);
|
|
|
|
|
return !DECL_EXTERNAL (decl);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2010-11-02 02:30:39 +01:00
|
|
|
|
/* Nonzero for a VAR_DECL whose value can be used in a constant expression.
|
|
|
|
|
|
|
|
|
|
[expr.const]
|
|
|
|
|
|
|
|
|
|
An integral constant-expression can only involve ... const
|
|
|
|
|
variables of integral or enumeration types initialized with
|
|
|
|
|
constant expressions ...
|
|
|
|
|
|
|
|
|
|
C++0x also allows constexpr variables and temporaries initialized
|
|
|
|
|
with constant expressions. We handle the former here, but the latter
|
|
|
|
|
are just folded away in cxx_eval_constant_expression.
|
|
|
|
|
|
|
|
|
|
The standard does not require that the expression be non-volatile.
|
|
|
|
|
G++ implements the proposed correction in DR 457. */
|
|
|
|
|
|
|
|
|
|
bool
|
|
|
|
|
decl_constant_var_p (tree decl)
|
|
|
|
|
{
|
|
|
|
|
bool ret;
|
|
|
|
|
tree type = TREE_TYPE (decl);
|
|
|
|
|
if (TREE_CODE (decl) != VAR_DECL)
|
|
|
|
|
return false;
|
|
|
|
|
if (DECL_DECLARED_CONSTEXPR_P (decl))
|
|
|
|
|
ret = true;
|
|
|
|
|
else if (CP_TYPE_CONST_NON_VOLATILE_P (type)
|
|
|
|
|
&& INTEGRAL_OR_ENUMERATION_TYPE_P (type))
|
|
|
|
|
{
|
|
|
|
|
/* We don't know if a template static data member is initialized with
|
|
|
|
|
a constant expression until we instantiate its initializer. */
|
|
|
|
|
mark_used (decl);
|
|
|
|
|
ret = DECL_INITIALIZED_BY_CONSTANT_EXPRESSION_P (decl);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
ret = false;
|
|
|
|
|
|
|
|
|
|
gcc_assert (!ret || DECL_INITIAL (decl));
|
|
|
|
|
return ret;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Returns true if DECL could be a symbolic constant variable, depending on
|
|
|
|
|
its initializer. */
|
|
|
|
|
|
|
|
|
|
bool
|
|
|
|
|
decl_maybe_constant_var_p (tree decl)
|
|
|
|
|
{
|
|
|
|
|
tree type = TREE_TYPE (decl);
|
|
|
|
|
if (TREE_CODE (decl) != VAR_DECL)
|
|
|
|
|
return false;
|
|
|
|
|
if (DECL_DECLARED_CONSTEXPR_P (decl))
|
|
|
|
|
return true;
|
|
|
|
|
return (CP_TYPE_CONST_NON_VOLATILE_P (type)
|
|
|
|
|
&& INTEGRAL_OR_ENUMERATION_TYPE_P (type));
|
|
|
|
|
}
|
|
|
|
|
|
2009-08-10 22:47:55 +02:00
|
|
|
|
/* Complain that DECL uses a type with no linkage but is never defined. */
|
|
|
|
|
|
|
|
|
|
static void
|
|
|
|
|
no_linkage_error (tree decl)
|
|
|
|
|
{
|
|
|
|
|
tree t = no_linkage_check (TREE_TYPE (decl), /*relaxed_p=*/false);
|
|
|
|
|
if (TYPE_ANONYMOUS_P (t))
|
|
|
|
|
{
|
|
|
|
|
permerror (0, "%q+#D, declared using anonymous type, "
|
|
|
|
|
"is used but never defined", decl);
|
|
|
|
|
if (is_typedef_decl (TYPE_NAME (t)))
|
|
|
|
|
permerror (0, "%q+#D does not refer to the unqualified type, "
|
|
|
|
|
"so it is not used for linkage", TYPE_NAME (t));
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
permerror (0, "%q+#D, declared using local type %qT, "
|
|
|
|
|
"is used but never defined", decl, t);
|
|
|
|
|
}
|
|
|
|
|
|
2010-06-01 15:00:50 +02:00
|
|
|
|
/* Collect declarations from all namespaces relevant to SOURCE_FILE. */
|
|
|
|
|
|
|
|
|
|
static void
|
|
|
|
|
collect_all_refs (const char *source_file)
|
|
|
|
|
{
|
|
|
|
|
collect_ada_namespace (global_namespace, source_file);
|
|
|
|
|
}
|
|
|
|
|
|
2006-11-01 06:16:14 +01:00
|
|
|
|
/* This routine is called at the end of compilation.
|
1999-04-23 01:13:12 +02:00
|
|
|
|
Its job is to create all the code needed to initialize and
|
|
|
|
|
destroy the global aggregates. We do the destruction
|
|
|
|
|
first, since that way we only need to reverse the decls once. */
|
1995-04-18 21:23:38 +02:00
|
|
|
|
|
1999-04-23 01:13:12 +02:00
|
|
|
|
void
|
2006-11-01 06:16:14 +01:00
|
|
|
|
cp_write_global_declarations (void)
|
1999-04-23 01:13:12 +02:00
|
|
|
|
{
|
|
|
|
|
tree vars;
|
Remove traditional C constructs 4/n.
* decl2.c (grok_method_quals, warn_if_unknown_interface,
grok_x_components, cp_build_parm_decl, build_artificial_parm,
maybe_retrofit_in_chrg, grokclassfn, grok_array_decl,
delete_sanity, check_member_template, check_java_method,
check_classfn, finish_static_data_member_decl, grokfield,
grokbitfield, grokoptypename, grok_function_init,
cplus_decl_attributes, constructor_name, defer_fn,
build_anon_union_vars, finish_anon_union, coerce_new_type,
coerce_delete_type, comdat_linkage, maybe_make_one_only,
key_method, import_export_vtable, import_export_class,
output_vtable_inherit, import_export_decl, import_export_tinfo,
build_cleanup, get_guard, get_guard_bits, get_guard_cond,
set_guard, start_objects, finish_objects,
start_static_storage_duration_function,
finish_static_storage_duration_function, get_priority_info,
start_static_initialization_or_destruction,
finish_static_initialization_or_destruction,
do_static_initialization, do_static_destruction,
prune_vars_needing_no_initialization, write_out_vars,
reparse_decl_as_expr, finish_decl_parsing, namespace_ancestor,
add_using_namespace, merge_functions, ambiguous_decl,
lookup_using_namespace, lookup_using_namespace,
qualified_lookup_using_namespace, set_decl_namespace,
decl_namespace, current_decl_namespace, push_decl_namespace,
pop_decl_namespace, push_scope, pop_scope, add_function,
arg_assoc_namespace, arg_assoc_template_arg, arg_assoc,
lookup_arg_dependent, do_namespace_alias,
validate_nonmember_using_decl, do_nonmember_using_decl,
do_toplevel_using_decl, do_local_using_decl,
do_class_using_decl, do_using_directive, check_default_args,
mark_used, handle_class_head): Use C90 prototypings. Use booleans.
* parser.c (cp_parser_class_head): Use booleanss.
* decl.c (walk_globals, walk_vtables): Likewise.
* cp-tree.h (walk_globals_pred, walk_globals_fn, walk_vtables,
walk_globals): Change return type from 'int' to 'bool'.
* rtti.c (init_rtti_processing, build_headof, throw_bad_cast
throw_bad_typeid, get_tinfo_decl_dynamic, typeid_ok_p,
build_typeid, tinfo_name, get_tinfo_decl, get_tinfo_ptr,
get_typeid, ifnonnull, build_dynamic_cast_1, build_dynamic_cast,
qualifier_flags, tinfo_base_init, generic_initializer,
ptr_initializer, dfs_class_hint_mark, ptm_initializer,
dfs_class_hint_unmark, class_hint_flags, class_initializer,
typeinfo_in_lib_p, get_pseudo_ti_init, create_pseudo_type_info,
get_pseudo_ti_desc, create_tinfo_types, emit_support_tinfos,
unemitted_tinfo_decl_p, emit_tinfo_decl): Likewise.
* repo.c (repo_compile_flags, repo_template_declared,
repo_template_defined, repo_class_defined, repo_get_id,
repo_template_used, repo_vtable_used, repo_inline_used,
repo_tinfo_used, repo_template_instantiated, extract_string,
open_repo_file, afgets, init_repo, reopen_repo_file_for_write,
finish_repo): Likewise.
* ptree.c (cxx_print_decl, cxx_print_type, cxx_print_identifier,
cxx_print_xnode): Likewise..
* cp-lang.c (ok_to_generate_alias_set_for_type, cxx_get_alias_set,
cxx_warn_unused_global_decl, cp_expr_size): Likewise.
* cxxfilt.c (demangle_it, print_demangler_list, usage,
standard_symbol_characters, hp_symbol_characters, main, fatal):
Likewise.
(strip_underscore): Change type from 'int' to 'bool'.
(main): Use boolean constants.
From-SVN: r60601
2002-12-29 15:53:05 +01:00
|
|
|
|
bool reconsider;
|
1999-04-23 01:13:12 +02:00
|
|
|
|
size_t i;
|
2003-04-20 13:57:38 +02:00
|
|
|
|
location_t locus;
|
|
|
|
|
unsigned ssdf_count = 0;
|
2004-08-16 16:29:27 +02:00
|
|
|
|
int retries = 0;
|
2005-05-05 23:57:46 +02:00
|
|
|
|
tree decl;
|
2009-09-03 06:07:12 +02:00
|
|
|
|
struct pointer_set_t *candidates;
|
1994-02-24 02:02:37 +01:00
|
|
|
|
|
2003-05-03 13:37:22 +02:00
|
|
|
|
locus = input_location;
|
1999-04-23 01:13:12 +02:00
|
|
|
|
at_eof = 1;
|
1995-04-03 21:28:01 +02:00
|
|
|
|
|
1999-04-23 01:13:12 +02:00
|
|
|
|
/* Bad parse errors. Just forget about it. */
|
2010-06-09 17:34:07 +02:00
|
|
|
|
if (! global_bindings_p () || current_class_type
|
|
|
|
|
|| !VEC_empty (tree,decl_namespace_list))
|
1999-04-23 01:13:12 +02:00
|
|
|
|
return;
|
1994-02-24 02:02:37 +01:00
|
|
|
|
|
2003-01-10 03:22:34 +01:00
|
|
|
|
if (pch_file)
|
|
|
|
|
c_common_write_pch ();
|
|
|
|
|
|
2010-06-01 15:00:50 +02:00
|
|
|
|
/* Handle -fdump-ada-spec[-slim] */
|
|
|
|
|
if (dump_enabled_p (TDI_ada))
|
|
|
|
|
{
|
|
|
|
|
if (get_dump_file_info (TDI_ada)->flags & TDF_SLIM)
|
|
|
|
|
collect_source_ref (main_input_filename);
|
|
|
|
|
else
|
|
|
|
|
collect_source_refs (global_namespace);
|
|
|
|
|
|
|
|
|
|
dump_ada_specs (collect_all_refs, cpp_check);
|
|
|
|
|
}
|
|
|
|
|
|
2008-02-26 17:05:24 +01:00
|
|
|
|
/* FIXME - huh? was input_line -= 1;*/
|
1996-02-28 23:01:56 +01:00
|
|
|
|
|
1999-04-23 01:13:12 +02:00
|
|
|
|
/* We now have to write out all the stuff we put off writing out.
|
|
|
|
|
These include:
|
1996-12-18 03:46:25 +01:00
|
|
|
|
|
1999-04-23 01:13:12 +02:00
|
|
|
|
o Template specializations that we have not yet instantiated,
|
2005-06-15 02:41:35 +02:00
|
|
|
|
but which are needed.
|
1999-04-23 01:13:12 +02:00
|
|
|
|
o Initialization and destruction for non-local objects with
|
2005-06-15 02:41:35 +02:00
|
|
|
|
static storage duration. (Local objects with static storage
|
1999-04-23 01:13:12 +02:00
|
|
|
|
duration are initialized when their scope is first entered,
|
|
|
|
|
and are cleaned up via atexit.)
|
2005-06-14 22:01:59 +02:00
|
|
|
|
o Virtual function tables.
|
1999-03-23 03:33:34 +01:00
|
|
|
|
|
1999-04-23 01:13:12 +02:00
|
|
|
|
All of these may cause others to be needed. For example,
|
|
|
|
|
instantiating one function may cause another to be needed, and
|
2002-11-06 01:44:49 +01:00
|
|
|
|
generating the initializer for an object may cause templates to be
|
1999-04-23 01:13:12 +02:00
|
|
|
|
instantiated, etc., etc. */
|
1994-02-24 02:02:37 +01:00
|
|
|
|
|
Makefile.in (OBJS): Add timevar.o.
hangeLog:
* Makefile.in (OBJS): Add timevar.o.
(toplev.o): Depend on timevar.h.
(ggc-simple.o): Likewise.
(ggc-page.o): Likewise.
(timevar.o): New rule.
(timevar.h): New rule.
* timevar.h: New file.
* timevar.c: Likewise.
* timevar.def: Likewise.
* toplev.h (gc_time, parse_time, varconst_time): Remove.
* toplev.c: Use timevar_push and timevar_pop instead of TIMEVAR
throughout.
(TIMEVAR): Remove macro.
(gc_time, parse_time, varconst_time, integration_time, jump_time,
cse_time, gcse_time, loop_time, cse2_time, branch_prob_time,
flow_time, combine_time, regmove_time, sched_time,
local_alloc_time, global_alloc_time, flow2_time, peephole2_time,
sched2_time, dbr_sched_time, reorder_blocks_time,
rename_registers_time, shorten_branch_time, stack_reg_time,
to_ssa_time, from_ssa_time, final_time, symout_time, dump_time,
all_time): Remove.
(compile_file): Don't initialize time variables. Call
init_timevar and start TV_TOTAL timer. Call timevar_print instead
of many calls to print_time.
(rest_of_compilation): Add timing for reload_cse_regs.
(get_run_time): Removed to timevar.c.
(print_time): Likewise.
(get_run_time): Implement using TV_TOTAL time variable.
(print_time): Get total run time from get_run_time.
* ggc-page.c (ggc_collect): Push and pop TV_GC instead of
computing elapsed time explicitly.
* ggc-simple.c (ggc_collect): Likewise.
(gc_time): Remove declaration.
cp/ChangeLog:
* lex.c (my_get_run_time): Remove.
(init_filename_times): Use get_run_time instead of my_get_run_time.
(check_newline): Likewise.
(dump_time_statistics): Likewise.
* decl2.c (finish_file): Push and pop timevar TV_VARCONST instead
of computing elapsed time explicitly.
From-SVN: r33496
2000-04-28 02:59:40 +02:00
|
|
|
|
timevar_push (TV_VARCONST);
|
1994-02-24 02:02:37 +01:00
|
|
|
|
|
2001-02-18 21:31:44 +01:00
|
|
|
|
emit_support_tinfos ();
|
2004-05-13 08:41:07 +02:00
|
|
|
|
|
2005-06-14 22:01:59 +02:00
|
|
|
|
do
|
1999-04-23 01:13:12 +02:00
|
|
|
|
{
|
2002-11-04 02:45:58 +01:00
|
|
|
|
tree t;
|
2005-05-06 21:03:35 +02:00
|
|
|
|
tree decl;
|
2002-11-04 02:45:58 +01:00
|
|
|
|
|
Remove traditional C constructs 4/n.
* decl2.c (grok_method_quals, warn_if_unknown_interface,
grok_x_components, cp_build_parm_decl, build_artificial_parm,
maybe_retrofit_in_chrg, grokclassfn, grok_array_decl,
delete_sanity, check_member_template, check_java_method,
check_classfn, finish_static_data_member_decl, grokfield,
grokbitfield, grokoptypename, grok_function_init,
cplus_decl_attributes, constructor_name, defer_fn,
build_anon_union_vars, finish_anon_union, coerce_new_type,
coerce_delete_type, comdat_linkage, maybe_make_one_only,
key_method, import_export_vtable, import_export_class,
output_vtable_inherit, import_export_decl, import_export_tinfo,
build_cleanup, get_guard, get_guard_bits, get_guard_cond,
set_guard, start_objects, finish_objects,
start_static_storage_duration_function,
finish_static_storage_duration_function, get_priority_info,
start_static_initialization_or_destruction,
finish_static_initialization_or_destruction,
do_static_initialization, do_static_destruction,
prune_vars_needing_no_initialization, write_out_vars,
reparse_decl_as_expr, finish_decl_parsing, namespace_ancestor,
add_using_namespace, merge_functions, ambiguous_decl,
lookup_using_namespace, lookup_using_namespace,
qualified_lookup_using_namespace, set_decl_namespace,
decl_namespace, current_decl_namespace, push_decl_namespace,
pop_decl_namespace, push_scope, pop_scope, add_function,
arg_assoc_namespace, arg_assoc_template_arg, arg_assoc,
lookup_arg_dependent, do_namespace_alias,
validate_nonmember_using_decl, do_nonmember_using_decl,
do_toplevel_using_decl, do_local_using_decl,
do_class_using_decl, do_using_directive, check_default_args,
mark_used, handle_class_head): Use C90 prototypings. Use booleans.
* parser.c (cp_parser_class_head): Use booleanss.
* decl.c (walk_globals, walk_vtables): Likewise.
* cp-tree.h (walk_globals_pred, walk_globals_fn, walk_vtables,
walk_globals): Change return type from 'int' to 'bool'.
* rtti.c (init_rtti_processing, build_headof, throw_bad_cast
throw_bad_typeid, get_tinfo_decl_dynamic, typeid_ok_p,
build_typeid, tinfo_name, get_tinfo_decl, get_tinfo_ptr,
get_typeid, ifnonnull, build_dynamic_cast_1, build_dynamic_cast,
qualifier_flags, tinfo_base_init, generic_initializer,
ptr_initializer, dfs_class_hint_mark, ptm_initializer,
dfs_class_hint_unmark, class_hint_flags, class_initializer,
typeinfo_in_lib_p, get_pseudo_ti_init, create_pseudo_type_info,
get_pseudo_ti_desc, create_tinfo_types, emit_support_tinfos,
unemitted_tinfo_decl_p, emit_tinfo_decl): Likewise.
* repo.c (repo_compile_flags, repo_template_declared,
repo_template_defined, repo_class_defined, repo_get_id,
repo_template_used, repo_vtable_used, repo_inline_used,
repo_tinfo_used, repo_template_instantiated, extract_string,
open_repo_file, afgets, init_repo, reopen_repo_file_for_write,
finish_repo): Likewise.
* ptree.c (cxx_print_decl, cxx_print_type, cxx_print_identifier,
cxx_print_xnode): Likewise..
* cp-lang.c (ok_to_generate_alias_set_for_type, cxx_get_alias_set,
cxx_warn_unused_global_decl, cp_expr_size): Likewise.
* cxxfilt.c (demangle_it, print_demangler_list, usage,
standard_symbol_characters, hp_symbol_characters, main, fatal):
Likewise.
(strip_underscore): Change type from 'int' to 'bool'.
(main): Use boolean constants.
From-SVN: r60601
2002-12-29 15:53:05 +01:00
|
|
|
|
reconsider = false;
|
1999-04-23 01:13:12 +02:00
|
|
|
|
|
1999-04-30 00:39:31 +02:00
|
|
|
|
/* If there are templates that we've put off instantiating, do
|
|
|
|
|
them now. */
|
2004-08-16 16:29:27 +02:00
|
|
|
|
instantiate_pending_templates (retries);
|
2004-01-14 00:59:19 +01:00
|
|
|
|
ggc_collect ();
|
1999-04-23 01:13:12 +02:00
|
|
|
|
|
extend.texi (C++ Signatures): Remove node.
* extend.texi (C++ Signatures): Remove node.
* invoke.texi: Remove discussion of -fhandle-signatures,
signature, sigof, __signature__, and __sigof__.
* Make-lang.in (CXX_SRCS): Remove sig.c.
* Makefile.in (CXX_OBJS): Remove sig.o.
(sig.o): Remove.
* cp-tree.h (CPTI_OPAQUE_TYPE): Remove.
(CPTI_SIGNATURE_TYPE): Likewise.
(CPTI_SIGTABLE_ENTRY_TYPE): Likewise.
(opaque_type_node): Likewise.
(signature_type_node): Likewise.
(sigtable_entry_type): Likewise.
(flag_handle_signatures): Likewise.
(lang_type): Remove is_signature, is_signature_pointer,
is_signature_reference, has_opaque_typedecls,
sigtables_has_been_generated. Adjust dummy. Remove signature,
signature_pointer_to, signature_reference_to.
(IS_SIGNATURE): Remove.
(SET_SIGNATURE): Remove.
(CLEAR_SIGNATURE): Remove.
(IS_SIGNATURE_POINTER): Remove.
(IS_SIGNATURE_REFERENCE): Remove.
(SIGNATURE_HAS_OPAQUE_TYPEDECLS): Remove.
(SIGTABLE_HAS_BEEN_GENERATED): Remove.
(CLASSTYPE_SIGNATURE): Remove.
(SIGNATURE_TYPE): Remove.
(SIGNATURE_METHOD_VEC): Remove.
(SIGNATURE_POINTER_TO): Remove.
(SIGNATURE_REFERENCE_TO): Remove.
(lang_decl_flags): Remove is_default_implementation. Rename
memfunc_pointer_to to saved_tree.
(IS_DEFAULT_IMPLEMENTATION): Remove.
(DECL_MEMFUNC_POINTER_TO): Remove.
(DECL_MEMFUNC_POINTING_TO): Remove.
(DECL_SAVED_TREE): Adjust definition.
(tag_types): Remove signature_type_node.
(SIGNATURE_FIELD_NAME): Remove.
(SIGNATURE_FIELD_NAME_FORMAT): Likewise.
(SIGNATURE_OPTR_NAME): Likewise.
(SIGNATURE_SPTR_NAME): Likewise.
(SIGNATURE_POINTER_NAME): Likewise.
(SIGNATURE_POINTER_NAME_FORMAT): Likewise.
(SIGNATURE_REFERENCE_NAME): Likewise.
(SIGNATURE_REFERNECE_NAME_FORMAT): Likewise.
(SIGTABLE_PTR_TYPE): Likewise.
(SIGTABLE_NAME_FORMAT): Likewise.
(SIGTABLE_NAME_FORMAT_LONG): Likewise.
(SIGTABLE_TAG_NAME): Likewise.
(SIGTABLE_VB_OFF_NAME): Likewise.
(SIGTABLE_VT_OFF_NAME): Likewise.
(finish_base_specifiers): Change prototype.
(build_signature_pointer_type): Remove.
(build_signature_reference_type): Remove.
(build_signature_pointer_constructor): Remove.
(build_signature_method_call): Remove.
(build_optr_ref): Likewise.
(append_signature_fields): Likewise.
(signature_error): Likewise.
* call.c (build_this): Remove signature support.
(build_over_call): Likewise.
(build_new_method_call): Likewise.
* class.c (add_implicitly_declared_members): Likewise.
(finish_struct_1): Likewise.
(finish_struct): Likewise.
* cvt.c (cp_convert_to_pointer): Likewise.
(convert_to_pointer_force): Likewise.
(ocp_convert): Likewise.
* decl.c (sigtable_decl_p): Remove.
(init_decl_processing): Remove support for signatures.
(cp_finish_decl): Likewise.
(grokdeclarator): Likewise.
(grokparms): Likewise.
(xref_tag): Likewise.
(start_function): Likewise.
(start_method): Likewise.
* decl2.c (finish_sigtable_vardecl): Remove.
(flag_handle_signatures): Remove.
(lang_f_options): Remove handle-signatures.
(grokfield): Remove support for signatures.
(grokbitfield): Likewise.
(finish_file): Likewise.
(reparse_absdcl_as_casts): Likewise.
* error.c (dump_type_real): Likewise.
(dump_function_decl): Likewise.
* friend.c (make_friend_class): Likewise.
* gxx.gperf: Remove __signature__, signature, __sigof__, sigof.
* hash.h: Regenerated.
* init.c (build_new_1): Remove support for signatures.
* lang-options.h: Remove -fhandle-signatures,
-fno-handle-signatures.
* lex.c (init_parse): Remove support for signatures.
(yyprint): Likewise.
* lex.h (rid): Remove RID_SIGNATURE.
* method.c (build_decl_overload_real): Remove support for
signatures.
(hack_identifier): Likewise.
* parse.y (base_class): Likewise.
(base_class.1): Likewise.
(access_specifier): Likewise.
* search.c (lookup_member): Likewise.
* semantics.c (finish_qualified_object_call_expr): Likewise.
(finish_template_type_parm): Likewise.
(begin_class_definition): Likewise.
(finish_base_specifier): Likewise.
* sig.c: Remove.
* tree.c (build_cplus_method_type): Remove support for signatures.
* typeck.c (require_complete_type): Likewise.
(c_sizeof): Likewise.
(c_alignof): Likewise.
(build_object_ref): Likewise.
(build_component_ref): Likewise.
(build_indirect_ref): Likewise.
(build_c_cast): Likewise.
(build_modify_expr): Likewise.
(convert_for_initialization): Likewise.
* typeck2.c (signature_error): Remove.
(store_init_value): Remove support for signatures.
(digest_init): Likewise.
(build_x_arrow): Likewise.
(build_functional_cast): Likewise.
* xref.c (GNU_xref_decl): Likewise.
From-SVN: r28677
1999-08-11 22:22:41 +02:00
|
|
|
|
/* Write out virtual tables as required. Note that writing out
|
2005-06-15 02:41:35 +02:00
|
|
|
|
the virtual table for a template class may cause the
|
|
|
|
|
instantiation of members of that class. If we write out
|
|
|
|
|
vtables then we remove the class from our list so we don't
|
|
|
|
|
have to look at it again. */
|
2004-08-16 16:29:27 +02:00
|
|
|
|
|
2003-01-03 20:48:55 +01:00
|
|
|
|
while (keyed_classes != NULL_TREE
|
2005-06-15 02:41:35 +02:00
|
|
|
|
&& maybe_emit_vtables (TREE_VALUE (keyed_classes)))
|
|
|
|
|
{
|
|
|
|
|
reconsider = true;
|
|
|
|
|
keyed_classes = TREE_CHAIN (keyed_classes);
|
|
|
|
|
}
|
2005-06-14 22:01:59 +02:00
|
|
|
|
|
2003-01-03 20:48:55 +01:00
|
|
|
|
t = keyed_classes;
|
|
|
|
|
if (t != NULL_TREE)
|
2005-06-15 02:41:35 +02:00
|
|
|
|
{
|
|
|
|
|
tree next = TREE_CHAIN (t);
|
|
|
|
|
|
|
|
|
|
while (next)
|
|
|
|
|
{
|
|
|
|
|
if (maybe_emit_vtables (TREE_VALUE (next)))
|
|
|
|
|
{
|
|
|
|
|
reconsider = true;
|
|
|
|
|
TREE_CHAIN (t) = TREE_CHAIN (next);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
t = next;
|
|
|
|
|
|
|
|
|
|
next = TREE_CHAIN (t);
|
|
|
|
|
}
|
|
|
|
|
}
|
2004-08-16 16:29:27 +02:00
|
|
|
|
|
2003-03-20 22:14:30 +01:00
|
|
|
|
/* Write out needed type info variables. We have to be careful
|
2005-06-15 02:41:35 +02:00
|
|
|
|
looping through unemitted decls, because emit_tinfo_decl may
|
|
|
|
|
cause other variables to be needed. New elements will be
|
|
|
|
|
appended, and we remove from the vector those that actually
|
|
|
|
|
get emitted. */
|
2004-09-22 20:12:10 +02:00
|
|
|
|
for (i = VEC_length (tree, unemitted_tinfo_decls);
|
|
|
|
|
VEC_iterate (tree, unemitted_tinfo_decls, --i, t);)
|
|
|
|
|
if (emit_tinfo_decl (t))
|
|
|
|
|
{
|
|
|
|
|
reconsider = true;
|
|
|
|
|
VEC_unordered_remove (tree, unemitted_tinfo_decls, i);
|
|
|
|
|
}
|
2000-01-28 14:30:13 +01:00
|
|
|
|
|
1999-04-23 01:13:12 +02:00
|
|
|
|
/* The list of objects with static storage duration is built up
|
1999-09-30 17:48:19 +02:00
|
|
|
|
in reverse order. We clear STATIC_AGGREGATES so that any new
|
|
|
|
|
aggregates added during the initialization of these will be
|
|
|
|
|
initialized in the correct order when we next come around the
|
|
|
|
|
loop. */
|
2003-02-26 06:39:01 +01:00
|
|
|
|
vars = prune_vars_needing_no_initialization (&static_aggregates);
|
1999-05-19 13:24:18 +02:00
|
|
|
|
|
1999-09-30 17:48:19 +02:00
|
|
|
|
if (vars)
|
|
|
|
|
{
|
|
|
|
|
/* We need to start a new initialization function each time
|
|
|
|
|
through the loop. That's because we need to know which
|
|
|
|
|
vtables have been referenced, and TREE_SYMBOL_REFERENCED
|
|
|
|
|
isn't computed until a function is finished, and written
|
class.c, [...]: Follow spelling conventions.
* class.c, cp-tree.h, decl.c, decl2.c, g++spec.c, init.c,
parser.c, pt.c, tree.c, typeck.c: Follow spelling conventions.
From-SVN: r121566
2007-02-04 05:24:53 +01:00
|
|
|
|
out. That's a deficiency in the back end. When this is
|
1999-09-30 17:48:19 +02:00
|
|
|
|
fixed, these initialization functions could all become
|
|
|
|
|
inline, with resulting performance improvements. */
|
2003-04-20 13:57:38 +02:00
|
|
|
|
tree ssdf_body;
|
|
|
|
|
|
|
|
|
|
/* Set the line and file, so that it is obviously not from
|
|
|
|
|
the source file. */
|
2003-05-03 13:37:22 +02:00
|
|
|
|
input_location = locus;
|
2003-04-20 13:57:38 +02:00
|
|
|
|
ssdf_body = start_static_storage_duration_function (ssdf_count);
|
1999-09-30 17:48:19 +02:00
|
|
|
|
|
|
|
|
|
/* Make sure the back end knows about all the variables. */
|
|
|
|
|
write_out_vars (vars);
|
|
|
|
|
|
|
|
|
|
/* First generate code to do all the initializations. */
|
2005-09-26 10:42:57 +02:00
|
|
|
|
if (vars)
|
|
|
|
|
do_static_initialization_or_destruction (vars, /*initp=*/true);
|
1999-09-30 17:48:19 +02:00
|
|
|
|
|
|
|
|
|
/* Then, generate code to do all the destructions. Do these
|
|
|
|
|
in reverse order so that the most recently constructed
|
2000-01-23 19:40:20 +01:00
|
|
|
|
variable is the first destroyed. If we're using
|
|
|
|
|
__cxa_atexit, then we don't need to do this; functions
|
2000-05-01 03:43:24 +02:00
|
|
|
|
were registered at initialization time to destroy the
|
2000-01-23 19:40:20 +01:00
|
|
|
|
local statics. */
|
2005-09-26 10:42:57 +02:00
|
|
|
|
if (!flag_use_cxa_atexit && vars)
|
2000-01-23 19:40:20 +01:00
|
|
|
|
{
|
|
|
|
|
vars = nreverse (vars);
|
2005-09-26 10:42:57 +02:00
|
|
|
|
do_static_initialization_or_destruction (vars, /*initp=*/false);
|
2000-01-23 19:40:20 +01:00
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
vars = NULL_TREE;
|
1999-09-30 17:48:19 +02:00
|
|
|
|
|
|
|
|
|
/* Finish up the static storage duration function for this
|
|
|
|
|
round. */
|
2003-05-03 13:37:22 +02:00
|
|
|
|
input_location = locus;
|
1999-09-30 17:48:19 +02:00
|
|
|
|
finish_static_storage_duration_function (ssdf_body);
|
|
|
|
|
|
|
|
|
|
/* All those initializations and finalizations might cause
|
|
|
|
|
us to need more inline functions, more template
|
|
|
|
|
instantiations, etc. */
|
Remove traditional C constructs 4/n.
* decl2.c (grok_method_quals, warn_if_unknown_interface,
grok_x_components, cp_build_parm_decl, build_artificial_parm,
maybe_retrofit_in_chrg, grokclassfn, grok_array_decl,
delete_sanity, check_member_template, check_java_method,
check_classfn, finish_static_data_member_decl, grokfield,
grokbitfield, grokoptypename, grok_function_init,
cplus_decl_attributes, constructor_name, defer_fn,
build_anon_union_vars, finish_anon_union, coerce_new_type,
coerce_delete_type, comdat_linkage, maybe_make_one_only,
key_method, import_export_vtable, import_export_class,
output_vtable_inherit, import_export_decl, import_export_tinfo,
build_cleanup, get_guard, get_guard_bits, get_guard_cond,
set_guard, start_objects, finish_objects,
start_static_storage_duration_function,
finish_static_storage_duration_function, get_priority_info,
start_static_initialization_or_destruction,
finish_static_initialization_or_destruction,
do_static_initialization, do_static_destruction,
prune_vars_needing_no_initialization, write_out_vars,
reparse_decl_as_expr, finish_decl_parsing, namespace_ancestor,
add_using_namespace, merge_functions, ambiguous_decl,
lookup_using_namespace, lookup_using_namespace,
qualified_lookup_using_namespace, set_decl_namespace,
decl_namespace, current_decl_namespace, push_decl_namespace,
pop_decl_namespace, push_scope, pop_scope, add_function,
arg_assoc_namespace, arg_assoc_template_arg, arg_assoc,
lookup_arg_dependent, do_namespace_alias,
validate_nonmember_using_decl, do_nonmember_using_decl,
do_toplevel_using_decl, do_local_using_decl,
do_class_using_decl, do_using_directive, check_default_args,
mark_used, handle_class_head): Use C90 prototypings. Use booleans.
* parser.c (cp_parser_class_head): Use booleanss.
* decl.c (walk_globals, walk_vtables): Likewise.
* cp-tree.h (walk_globals_pred, walk_globals_fn, walk_vtables,
walk_globals): Change return type from 'int' to 'bool'.
* rtti.c (init_rtti_processing, build_headof, throw_bad_cast
throw_bad_typeid, get_tinfo_decl_dynamic, typeid_ok_p,
build_typeid, tinfo_name, get_tinfo_decl, get_tinfo_ptr,
get_typeid, ifnonnull, build_dynamic_cast_1, build_dynamic_cast,
qualifier_flags, tinfo_base_init, generic_initializer,
ptr_initializer, dfs_class_hint_mark, ptm_initializer,
dfs_class_hint_unmark, class_hint_flags, class_initializer,
typeinfo_in_lib_p, get_pseudo_ti_init, create_pseudo_type_info,
get_pseudo_ti_desc, create_tinfo_types, emit_support_tinfos,
unemitted_tinfo_decl_p, emit_tinfo_decl): Likewise.
* repo.c (repo_compile_flags, repo_template_declared,
repo_template_defined, repo_class_defined, repo_get_id,
repo_template_used, repo_vtable_used, repo_inline_used,
repo_tinfo_used, repo_template_instantiated, extract_string,
open_repo_file, afgets, init_repo, reopen_repo_file_for_write,
finish_repo): Likewise.
* ptree.c (cxx_print_decl, cxx_print_type, cxx_print_identifier,
cxx_print_xnode): Likewise..
* cp-lang.c (ok_to_generate_alias_set_for_type, cxx_get_alias_set,
cxx_warn_unused_global_decl, cp_expr_size): Likewise.
* cxxfilt.c (demangle_it, print_demangler_list, usage,
standard_symbol_characters, hp_symbol_characters, main, fatal):
Likewise.
(strip_underscore): Change type from 'int' to 'bool'.
(main): Use boolean constants.
From-SVN: r60601
2002-12-29 15:53:05 +01:00
|
|
|
|
reconsider = true;
|
2003-04-20 13:57:38 +02:00
|
|
|
|
ssdf_count++;
|
2008-02-26 17:05:24 +01:00
|
|
|
|
/* ??? was: locus.line++; */
|
1999-04-23 01:13:12 +02:00
|
|
|
|
}
|
2005-06-14 22:01:59 +02:00
|
|
|
|
|
2004-07-29 19:59:31 +02:00
|
|
|
|
/* Go through the set of inline functions whose bodies have not
|
|
|
|
|
been emitted yet. If out-of-line copies of these functions
|
|
|
|
|
are required, emit them. */
|
2010-08-20 14:48:59 +02:00
|
|
|
|
FOR_EACH_VEC_ELT (tree, deferred_fns, i, decl)
|
1999-04-23 01:13:12 +02:00
|
|
|
|
{
|
2002-12-26 19:20:14 +01:00
|
|
|
|
/* Does it need synthesizing? */
|
2009-02-12 03:01:07 +01:00
|
|
|
|
if (DECL_DEFAULTED_FN (decl) && ! DECL_INITIAL (decl)
|
2008-07-25 23:03:34 +02:00
|
|
|
|
&& (! DECL_REALLY_EXTERN (decl) || possibly_inlined_p (decl)))
|
1999-04-23 01:13:12 +02:00
|
|
|
|
{
|
|
|
|
|
/* Even though we're already at the top-level, we push
|
|
|
|
|
there again. That way, when we pop back a few lines
|
|
|
|
|
hence, all of our state is restored. Otherwise,
|
|
|
|
|
finish_function doesn't clean things up, and we end
|
|
|
|
|
up with CURRENT_FUNCTION_DECL set. */
|
|
|
|
|
push_to_top_level ();
|
2005-06-02 19:52:28 +02:00
|
|
|
|
/* The decl's location will mark where it was first
|
2005-06-15 02:41:35 +02:00
|
|
|
|
needed. Save that so synthesize method can indicate
|
|
|
|
|
where it was needed from, in case of error */
|
2005-06-02 19:52:28 +02:00
|
|
|
|
input_location = DECL_SOURCE_LOCATION (decl);
|
2001-02-12 10:58:18 +01:00
|
|
|
|
synthesize_method (decl);
|
1999-04-23 01:13:12 +02:00
|
|
|
|
pop_from_top_level ();
|
Remove traditional C constructs 4/n.
* decl2.c (grok_method_quals, warn_if_unknown_interface,
grok_x_components, cp_build_parm_decl, build_artificial_parm,
maybe_retrofit_in_chrg, grokclassfn, grok_array_decl,
delete_sanity, check_member_template, check_java_method,
check_classfn, finish_static_data_member_decl, grokfield,
grokbitfield, grokoptypename, grok_function_init,
cplus_decl_attributes, constructor_name, defer_fn,
build_anon_union_vars, finish_anon_union, coerce_new_type,
coerce_delete_type, comdat_linkage, maybe_make_one_only,
key_method, import_export_vtable, import_export_class,
output_vtable_inherit, import_export_decl, import_export_tinfo,
build_cleanup, get_guard, get_guard_bits, get_guard_cond,
set_guard, start_objects, finish_objects,
start_static_storage_duration_function,
finish_static_storage_duration_function, get_priority_info,
start_static_initialization_or_destruction,
finish_static_initialization_or_destruction,
do_static_initialization, do_static_destruction,
prune_vars_needing_no_initialization, write_out_vars,
reparse_decl_as_expr, finish_decl_parsing, namespace_ancestor,
add_using_namespace, merge_functions, ambiguous_decl,
lookup_using_namespace, lookup_using_namespace,
qualified_lookup_using_namespace, set_decl_namespace,
decl_namespace, current_decl_namespace, push_decl_namespace,
pop_decl_namespace, push_scope, pop_scope, add_function,
arg_assoc_namespace, arg_assoc_template_arg, arg_assoc,
lookup_arg_dependent, do_namespace_alias,
validate_nonmember_using_decl, do_nonmember_using_decl,
do_toplevel_using_decl, do_local_using_decl,
do_class_using_decl, do_using_directive, check_default_args,
mark_used, handle_class_head): Use C90 prototypings. Use booleans.
* parser.c (cp_parser_class_head): Use booleanss.
* decl.c (walk_globals, walk_vtables): Likewise.
* cp-tree.h (walk_globals_pred, walk_globals_fn, walk_vtables,
walk_globals): Change return type from 'int' to 'bool'.
* rtti.c (init_rtti_processing, build_headof, throw_bad_cast
throw_bad_typeid, get_tinfo_decl_dynamic, typeid_ok_p,
build_typeid, tinfo_name, get_tinfo_decl, get_tinfo_ptr,
get_typeid, ifnonnull, build_dynamic_cast_1, build_dynamic_cast,
qualifier_flags, tinfo_base_init, generic_initializer,
ptr_initializer, dfs_class_hint_mark, ptm_initializer,
dfs_class_hint_unmark, class_hint_flags, class_initializer,
typeinfo_in_lib_p, get_pseudo_ti_init, create_pseudo_type_info,
get_pseudo_ti_desc, create_tinfo_types, emit_support_tinfos,
unemitted_tinfo_decl_p, emit_tinfo_decl): Likewise.
* repo.c (repo_compile_flags, repo_template_declared,
repo_template_defined, repo_class_defined, repo_get_id,
repo_template_used, repo_vtable_used, repo_inline_used,
repo_tinfo_used, repo_template_instantiated, extract_string,
open_repo_file, afgets, init_repo, reopen_repo_file_for_write,
finish_repo): Likewise.
* ptree.c (cxx_print_decl, cxx_print_type, cxx_print_identifier,
cxx_print_xnode): Likewise..
* cp-lang.c (ok_to_generate_alias_set_for_type, cxx_get_alias_set,
cxx_warn_unused_global_decl, cp_expr_size): Likewise.
* cxxfilt.c (demangle_it, print_demangler_list, usage,
standard_symbol_characters, hp_symbol_characters, main, fatal):
Likewise.
(strip_underscore): Change type from 'int' to 'bool'.
(main): Use boolean constants.
From-SVN: r60601
2002-12-29 15:53:05 +01:00
|
|
|
|
reconsider = true;
|
1999-04-23 01:13:12 +02:00
|
|
|
|
}
|
|
|
|
|
|
2009-07-17 17:49:34 +02:00
|
|
|
|
if (!DECL_SAVED_TREE (decl))
|
2004-06-17 23:11:38 +02:00
|
|
|
|
continue;
|
2003-04-26 03:27:09 +02:00
|
|
|
|
|
class.c, [...]: Follow spelling conventions.
* class.c, cp-tree.h, decl.c, decl2.c, g++spec.c, init.c,
parser.c, pt.c, tree.c, typeck.c: Follow spelling conventions.
From-SVN: r121566
2007-02-04 05:24:53 +01:00
|
|
|
|
/* We lie to the back end, pretending that some functions
|
2002-12-26 19:20:14 +01:00
|
|
|
|
are not defined when they really are. This keeps these
|
|
|
|
|
functions from being put out unnecessarily. But, we must
|
|
|
|
|
stop lying when the functions are referenced, or if they
|
2005-09-09 20:56:16 +02:00
|
|
|
|
are not comdat since they need to be put out now. If
|
|
|
|
|
DECL_INTERFACE_KNOWN, then we have already set
|
|
|
|
|
DECL_EXTERNAL appropriately, so there's no need to check
|
|
|
|
|
again, and we do not want to clear DECL_EXTERNAL if a
|
|
|
|
|
previous call to import_export_decl set it.
|
2006-06-06 13:44:09 +02:00
|
|
|
|
|
2005-09-09 20:56:16 +02:00
|
|
|
|
This is done in a separate for cycle, because if some
|
|
|
|
|
deferred function is contained in another deferred
|
|
|
|
|
function later in deferred_fns varray,
|
|
|
|
|
rest_of_compilation would skip this function and we
|
|
|
|
|
really cannot expand the same function twice. */
|
|
|
|
|
import_export_decl (decl);
|
1999-04-23 18:58:01 +02:00
|
|
|
|
if (DECL_NOT_REALLY_EXTERN (decl)
|
|
|
|
|
&& DECL_INITIAL (decl)
|
2004-07-29 19:59:31 +02:00
|
|
|
|
&& decl_needed_p (decl))
|
2009-11-18 10:53:52 +01:00
|
|
|
|
{
|
2009-12-10 22:58:49 +01:00
|
|
|
|
struct cgraph_node *node = cgraph_get_node (decl), *alias, *next;
|
2009-11-18 10:53:52 +01:00
|
|
|
|
|
|
|
|
|
DECL_EXTERNAL (decl) = 0;
|
|
|
|
|
/* If we mark !DECL_EXTERNAL one of the same body aliases,
|
|
|
|
|
we need to mark all of them that way. */
|
|
|
|
|
if (node && node->same_body)
|
|
|
|
|
{
|
|
|
|
|
DECL_EXTERNAL (node->decl) = 0;
|
|
|
|
|
for (alias = node->same_body; alias; alias = alias->next)
|
|
|
|
|
DECL_EXTERNAL (alias->decl) = 0;
|
|
|
|
|
}
|
2009-12-10 22:58:49 +01:00
|
|
|
|
/* If we mark !DECL_EXTERNAL one of the symbols in some comdat
|
|
|
|
|
group, we need to mark all symbols in the same comdat group
|
|
|
|
|
that way. */
|
|
|
|
|
if (node->same_comdat_group)
|
|
|
|
|
for (next = node->same_comdat_group;
|
|
|
|
|
next != node;
|
|
|
|
|
next = next->same_comdat_group)
|
|
|
|
|
{
|
|
|
|
|
DECL_EXTERNAL (next->decl) = 0;
|
|
|
|
|
if (next->same_body)
|
|
|
|
|
{
|
|
|
|
|
for (alias = next->same_body;
|
|
|
|
|
alias;
|
|
|
|
|
alias = alias->next)
|
|
|
|
|
DECL_EXTERNAL (alias->decl) = 0;
|
|
|
|
|
}
|
|
|
|
|
}
|
2009-11-18 10:53:52 +01:00
|
|
|
|
}
|
1999-11-27 19:01:48 +01:00
|
|
|
|
|
|
|
|
|
/* If we're going to need to write this function out, and
|
|
|
|
|
there's already a body for it, create RTL for it now.
|
|
|
|
|
(There might be no body if this is a method we haven't
|
|
|
|
|
gotten around to synthesizing yet.) */
|
|
|
|
|
if (!DECL_EXTERNAL (decl)
|
2004-07-29 19:59:31 +02:00
|
|
|
|
&& decl_needed_p (decl)
|
2003-07-02 02:12:10 +02:00
|
|
|
|
&& !TREE_ASM_WRITTEN (decl)
|
2004-07-29 19:59:31 +02:00
|
|
|
|
&& !cgraph_node (decl)->local.finalized)
|
1999-11-27 19:01:48 +01:00
|
|
|
|
{
|
2003-07-02 02:12:10 +02:00
|
|
|
|
/* We will output the function; no longer consider it in this
|
|
|
|
|
loop. */
|
|
|
|
|
DECL_DEFER_OUTPUT (decl) = 0;
|
1999-11-27 19:01:48 +01:00
|
|
|
|
/* Generate RTL for this function now that we know we
|
|
|
|
|
need it. */
|
2003-07-02 02:12:10 +02:00
|
|
|
|
expand_or_defer_fn (decl);
|
1999-11-27 19:01:48 +01:00
|
|
|
|
/* If we're compiling -fsyntax-only pretend that this
|
|
|
|
|
function has been written out so that we don't try to
|
|
|
|
|
expand it again. */
|
|
|
|
|
if (flag_syntax_only)
|
|
|
|
|
TREE_ASM_WRITTEN (decl) = 1;
|
Remove traditional C constructs 4/n.
* decl2.c (grok_method_quals, warn_if_unknown_interface,
grok_x_components, cp_build_parm_decl, build_artificial_parm,
maybe_retrofit_in_chrg, grokclassfn, grok_array_decl,
delete_sanity, check_member_template, check_java_method,
check_classfn, finish_static_data_member_decl, grokfield,
grokbitfield, grokoptypename, grok_function_init,
cplus_decl_attributes, constructor_name, defer_fn,
build_anon_union_vars, finish_anon_union, coerce_new_type,
coerce_delete_type, comdat_linkage, maybe_make_one_only,
key_method, import_export_vtable, import_export_class,
output_vtable_inherit, import_export_decl, import_export_tinfo,
build_cleanup, get_guard, get_guard_bits, get_guard_cond,
set_guard, start_objects, finish_objects,
start_static_storage_duration_function,
finish_static_storage_duration_function, get_priority_info,
start_static_initialization_or_destruction,
finish_static_initialization_or_destruction,
do_static_initialization, do_static_destruction,
prune_vars_needing_no_initialization, write_out_vars,
reparse_decl_as_expr, finish_decl_parsing, namespace_ancestor,
add_using_namespace, merge_functions, ambiguous_decl,
lookup_using_namespace, lookup_using_namespace,
qualified_lookup_using_namespace, set_decl_namespace,
decl_namespace, current_decl_namespace, push_decl_namespace,
pop_decl_namespace, push_scope, pop_scope, add_function,
arg_assoc_namespace, arg_assoc_template_arg, arg_assoc,
lookup_arg_dependent, do_namespace_alias,
validate_nonmember_using_decl, do_nonmember_using_decl,
do_toplevel_using_decl, do_local_using_decl,
do_class_using_decl, do_using_directive, check_default_args,
mark_used, handle_class_head): Use C90 prototypings. Use booleans.
* parser.c (cp_parser_class_head): Use booleanss.
* decl.c (walk_globals, walk_vtables): Likewise.
* cp-tree.h (walk_globals_pred, walk_globals_fn, walk_vtables,
walk_globals): Change return type from 'int' to 'bool'.
* rtti.c (init_rtti_processing, build_headof, throw_bad_cast
throw_bad_typeid, get_tinfo_decl_dynamic, typeid_ok_p,
build_typeid, tinfo_name, get_tinfo_decl, get_tinfo_ptr,
get_typeid, ifnonnull, build_dynamic_cast_1, build_dynamic_cast,
qualifier_flags, tinfo_base_init, generic_initializer,
ptr_initializer, dfs_class_hint_mark, ptm_initializer,
dfs_class_hint_unmark, class_hint_flags, class_initializer,
typeinfo_in_lib_p, get_pseudo_ti_init, create_pseudo_type_info,
get_pseudo_ti_desc, create_tinfo_types, emit_support_tinfos,
unemitted_tinfo_decl_p, emit_tinfo_decl): Likewise.
* repo.c (repo_compile_flags, repo_template_declared,
repo_template_defined, repo_class_defined, repo_get_id,
repo_template_used, repo_vtable_used, repo_inline_used,
repo_tinfo_used, repo_template_instantiated, extract_string,
open_repo_file, afgets, init_repo, reopen_repo_file_for_write,
finish_repo): Likewise.
* ptree.c (cxx_print_decl, cxx_print_type, cxx_print_identifier,
cxx_print_xnode): Likewise..
* cp-lang.c (ok_to_generate_alias_set_for_type, cxx_get_alias_set,
cxx_warn_unused_global_decl, cp_expr_size): Likewise.
* cxxfilt.c (demangle_it, print_demangler_list, usage,
standard_symbol_characters, hp_symbol_characters, main, fatal):
Likewise.
(strip_underscore): Change type from 'int' to 'bool'.
(main): Use boolean constants.
From-SVN: r60601
2002-12-29 15:53:05 +01:00
|
|
|
|
reconsider = true;
|
1999-11-27 19:01:48 +01:00
|
|
|
|
}
|
1999-04-23 18:58:01 +02:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (walk_namespaces (wrapup_globals_for_namespace, /*data=*/0))
|
Remove traditional C constructs 4/n.
* decl2.c (grok_method_quals, warn_if_unknown_interface,
grok_x_components, cp_build_parm_decl, build_artificial_parm,
maybe_retrofit_in_chrg, grokclassfn, grok_array_decl,
delete_sanity, check_member_template, check_java_method,
check_classfn, finish_static_data_member_decl, grokfield,
grokbitfield, grokoptypename, grok_function_init,
cplus_decl_attributes, constructor_name, defer_fn,
build_anon_union_vars, finish_anon_union, coerce_new_type,
coerce_delete_type, comdat_linkage, maybe_make_one_only,
key_method, import_export_vtable, import_export_class,
output_vtable_inherit, import_export_decl, import_export_tinfo,
build_cleanup, get_guard, get_guard_bits, get_guard_cond,
set_guard, start_objects, finish_objects,
start_static_storage_duration_function,
finish_static_storage_duration_function, get_priority_info,
start_static_initialization_or_destruction,
finish_static_initialization_or_destruction,
do_static_initialization, do_static_destruction,
prune_vars_needing_no_initialization, write_out_vars,
reparse_decl_as_expr, finish_decl_parsing, namespace_ancestor,
add_using_namespace, merge_functions, ambiguous_decl,
lookup_using_namespace, lookup_using_namespace,
qualified_lookup_using_namespace, set_decl_namespace,
decl_namespace, current_decl_namespace, push_decl_namespace,
pop_decl_namespace, push_scope, pop_scope, add_function,
arg_assoc_namespace, arg_assoc_template_arg, arg_assoc,
lookup_arg_dependent, do_namespace_alias,
validate_nonmember_using_decl, do_nonmember_using_decl,
do_toplevel_using_decl, do_local_using_decl,
do_class_using_decl, do_using_directive, check_default_args,
mark_used, handle_class_head): Use C90 prototypings. Use booleans.
* parser.c (cp_parser_class_head): Use booleanss.
* decl.c (walk_globals, walk_vtables): Likewise.
* cp-tree.h (walk_globals_pred, walk_globals_fn, walk_vtables,
walk_globals): Change return type from 'int' to 'bool'.
* rtti.c (init_rtti_processing, build_headof, throw_bad_cast
throw_bad_typeid, get_tinfo_decl_dynamic, typeid_ok_p,
build_typeid, tinfo_name, get_tinfo_decl, get_tinfo_ptr,
get_typeid, ifnonnull, build_dynamic_cast_1, build_dynamic_cast,
qualifier_flags, tinfo_base_init, generic_initializer,
ptr_initializer, dfs_class_hint_mark, ptm_initializer,
dfs_class_hint_unmark, class_hint_flags, class_initializer,
typeinfo_in_lib_p, get_pseudo_ti_init, create_pseudo_type_info,
get_pseudo_ti_desc, create_tinfo_types, emit_support_tinfos,
unemitted_tinfo_decl_p, emit_tinfo_decl): Likewise.
* repo.c (repo_compile_flags, repo_template_declared,
repo_template_defined, repo_class_defined, repo_get_id,
repo_template_used, repo_vtable_used, repo_inline_used,
repo_tinfo_used, repo_template_instantiated, extract_string,
open_repo_file, afgets, init_repo, reopen_repo_file_for_write,
finish_repo): Likewise.
* ptree.c (cxx_print_decl, cxx_print_type, cxx_print_identifier,
cxx_print_xnode): Likewise..
* cp-lang.c (ok_to_generate_alias_set_for_type, cxx_get_alias_set,
cxx_warn_unused_global_decl, cp_expr_size): Likewise.
* cxxfilt.c (demangle_it, print_demangler_list, usage,
standard_symbol_characters, hp_symbol_characters, main, fatal):
Likewise.
(strip_underscore): Change type from 'int' to 'bool'.
(main): Use boolean constants.
From-SVN: r60601
2002-12-29 15:53:05 +01:00
|
|
|
|
reconsider = true;
|
1999-04-23 01:13:12 +02:00
|
|
|
|
|
|
|
|
|
/* Static data members are just like namespace-scope globals. */
|
2010-08-20 14:48:59 +02:00
|
|
|
|
FOR_EACH_VEC_ELT (tree, pending_statics, i, decl)
|
1999-04-23 01:13:12 +02:00
|
|
|
|
{
|
2008-02-10 19:12:01 +01:00
|
|
|
|
if (var_finalized_p (decl) || DECL_REALLY_EXTERN (decl)
|
|
|
|
|
/* Don't write it out if we haven't seen a definition. */
|
|
|
|
|
|| DECL_IN_AGGR_P (decl))
|
1999-04-23 01:13:12 +02:00
|
|
|
|
continue;
|
|
|
|
|
import_export_decl (decl);
|
2004-07-29 19:59:31 +02:00
|
|
|
|
/* If this static data member is needed, provide it to the
|
|
|
|
|
back end. */
|
|
|
|
|
if (DECL_NOT_REALLY_EXTERN (decl) && decl_needed_p (decl))
|
2007-12-11 09:22:10 +01:00
|
|
|
|
DECL_EXTERNAL (decl) = 0;
|
1999-04-23 01:13:12 +02:00
|
|
|
|
}
|
2005-05-06 21:03:35 +02:00
|
|
|
|
if (VEC_length (tree, pending_statics) != 0
|
|
|
|
|
&& wrapup_global_declarations (VEC_address (tree, pending_statics),
|
|
|
|
|
VEC_length (tree, pending_statics)))
|
Remove traditional C constructs 4/n.
* decl2.c (grok_method_quals, warn_if_unknown_interface,
grok_x_components, cp_build_parm_decl, build_artificial_parm,
maybe_retrofit_in_chrg, grokclassfn, grok_array_decl,
delete_sanity, check_member_template, check_java_method,
check_classfn, finish_static_data_member_decl, grokfield,
grokbitfield, grokoptypename, grok_function_init,
cplus_decl_attributes, constructor_name, defer_fn,
build_anon_union_vars, finish_anon_union, coerce_new_type,
coerce_delete_type, comdat_linkage, maybe_make_one_only,
key_method, import_export_vtable, import_export_class,
output_vtable_inherit, import_export_decl, import_export_tinfo,
build_cleanup, get_guard, get_guard_bits, get_guard_cond,
set_guard, start_objects, finish_objects,
start_static_storage_duration_function,
finish_static_storage_duration_function, get_priority_info,
start_static_initialization_or_destruction,
finish_static_initialization_or_destruction,
do_static_initialization, do_static_destruction,
prune_vars_needing_no_initialization, write_out_vars,
reparse_decl_as_expr, finish_decl_parsing, namespace_ancestor,
add_using_namespace, merge_functions, ambiguous_decl,
lookup_using_namespace, lookup_using_namespace,
qualified_lookup_using_namespace, set_decl_namespace,
decl_namespace, current_decl_namespace, push_decl_namespace,
pop_decl_namespace, push_scope, pop_scope, add_function,
arg_assoc_namespace, arg_assoc_template_arg, arg_assoc,
lookup_arg_dependent, do_namespace_alias,
validate_nonmember_using_decl, do_nonmember_using_decl,
do_toplevel_using_decl, do_local_using_decl,
do_class_using_decl, do_using_directive, check_default_args,
mark_used, handle_class_head): Use C90 prototypings. Use booleans.
* parser.c (cp_parser_class_head): Use booleanss.
* decl.c (walk_globals, walk_vtables): Likewise.
* cp-tree.h (walk_globals_pred, walk_globals_fn, walk_vtables,
walk_globals): Change return type from 'int' to 'bool'.
* rtti.c (init_rtti_processing, build_headof, throw_bad_cast
throw_bad_typeid, get_tinfo_decl_dynamic, typeid_ok_p,
build_typeid, tinfo_name, get_tinfo_decl, get_tinfo_ptr,
get_typeid, ifnonnull, build_dynamic_cast_1, build_dynamic_cast,
qualifier_flags, tinfo_base_init, generic_initializer,
ptr_initializer, dfs_class_hint_mark, ptm_initializer,
dfs_class_hint_unmark, class_hint_flags, class_initializer,
typeinfo_in_lib_p, get_pseudo_ti_init, create_pseudo_type_info,
get_pseudo_ti_desc, create_tinfo_types, emit_support_tinfos,
unemitted_tinfo_decl_p, emit_tinfo_decl): Likewise.
* repo.c (repo_compile_flags, repo_template_declared,
repo_template_defined, repo_class_defined, repo_get_id,
repo_template_used, repo_vtable_used, repo_inline_used,
repo_tinfo_used, repo_template_instantiated, extract_string,
open_repo_file, afgets, init_repo, reopen_repo_file_for_write,
finish_repo): Likewise.
* ptree.c (cxx_print_decl, cxx_print_type, cxx_print_identifier,
cxx_print_xnode): Likewise..
* cp-lang.c (ok_to_generate_alias_set_for_type, cxx_get_alias_set,
cxx_warn_unused_global_decl, cp_expr_size): Likewise.
* cxxfilt.c (demangle_it, print_demangler_list, usage,
standard_symbol_characters, hp_symbol_characters, main, fatal):
Likewise.
(strip_underscore): Change type from 'int' to 'bool'.
(main): Use boolean constants.
From-SVN: r60601
2002-12-29 15:53:05 +01:00
|
|
|
|
reconsider = true;
|
2003-09-13 16:18:47 +02:00
|
|
|
|
|
2004-08-16 16:29:27 +02:00
|
|
|
|
retries++;
|
2005-06-14 22:01:59 +02:00
|
|
|
|
}
|
1999-04-23 01:13:12 +02:00
|
|
|
|
while (reconsider);
|
1995-03-23 01:44:31 +01:00
|
|
|
|
|
2003-07-07 01:23:46 +02:00
|
|
|
|
/* All used inline functions must have a definition at this point. */
|
2010-08-20 14:48:59 +02:00
|
|
|
|
FOR_EACH_VEC_ELT (tree, deferred_fns, i, decl)
|
2002-12-26 19:20:14 +01:00
|
|
|
|
{
|
2004-07-29 19:59:31 +02:00
|
|
|
|
if (/* Check online inline functions that were actually used. */
|
2009-08-24 23:31:54 +02:00
|
|
|
|
DECL_ODR_USED (decl) && DECL_DECLARED_INLINE_P (decl)
|
2005-09-09 20:56:16 +02:00
|
|
|
|
/* If the definition actually was available here, then the
|
|
|
|
|
fact that the function was not defined merely represents
|
|
|
|
|
that for some reason (use of a template repository,
|
|
|
|
|
#pragma interface, etc.) we decided not to emit the
|
|
|
|
|
definition here. */
|
|
|
|
|
&& !DECL_INITIAL (decl)
|
2004-06-17 23:11:38 +02:00
|
|
|
|
/* An explicit instantiation can be used to specify
|
|
|
|
|
that the body is in another unit. It will have
|
|
|
|
|
already verified there was a definition. */
|
|
|
|
|
&& !DECL_EXPLICIT_INSTANTIATION (decl))
|
2002-12-31 20:43:16 +01:00
|
|
|
|
{
|
toplev.c (default_tree_printer): Handle setting location with '+' flag.
2005-07-02 Zack Weinberg <zack@codesourcery.com>
Joseph S. Myers <joseph@codesourcery.com>
* toplev.c (default_tree_printer): Handle setting location with
'+' flag.
* c-objc.common.c (c_tree_printer): Likewise.
* c-format.c (gcc_diag_flag_specs): Add '+'.
(gcc_cdiag_char_table): Allow '+' flag for tree formats.
(format_types_orig): Allow '+' flag for gcc_diag and gcc_cdiag
formats.
* c-common.c, c-decl.c, c-objc-common.c, c-pragma.c,
config/arm/pe.c, config/i386/winnt.c, config/ia64/ia64.c,
config/mcore/mcore.c, config/sh/symbian.c, config/sol2.c,
config/v850/v850.c, function.c, stor-layout.c, toplev.c,
tree-inline.c, tree-optimize.c, tree.c, varasm.c: Use '+' flag
instead of %J or %H. Use 'q' flag for quoting. Avoid '.' at end
of diagnostics. Use %q+D not %s for a decl. Do not pass excess
format arguments where %J is used without %D.
cp:
* error.c (location_of): Add comment.
(locate_error, cp_error_at, cp_warning_at, cp_pedwarn_at): Remove.
* cp-tree.h (cp_error_at, cp_warning_at, cp_pedwarn_at): Remove.
* call.c, class.c, decl.c, decl2.c, friend.c, init.c,
name-lookup.c, parser.c, pt.c, search.c, semantics.c, typeck.c,
typeck2.c: Use '+' flag instead of %J, cp_error_at, cp_warning_at
or cp_pedwarn_at. Mark up some diagnostic strings with N_.
java:
* class.c, decl.c, expr.c: Use '+' flag instead of %J. Use 'q'
flag for quoting.
objc:
* objc-act.c: Use '+' flag instead of %J. Use 'q' flag for
quoting.
testsuite:
* gcc.dg/format/gcc_diag-1.c: Update.
From-SVN: r101532
2005-07-02 12:55:32 +02:00
|
|
|
|
warning (0, "inline function %q+D used but never defined", decl);
|
2005-11-07 07:17:47 +01:00
|
|
|
|
/* Avoid a duplicate warning from check_global_declaration_1. */
|
|
|
|
|
TREE_NO_WARNING (decl) = 1;
|
2002-12-31 20:43:16 +01:00
|
|
|
|
}
|
2002-12-26 19:20:14 +01:00
|
|
|
|
}
|
2005-06-14 22:01:59 +02:00
|
|
|
|
|
2009-08-10 22:47:55 +02:00
|
|
|
|
/* So must decls that use a type with no linkage. */
|
2010-08-20 14:48:59 +02:00
|
|
|
|
FOR_EACH_VEC_ELT (tree, no_linkage_decls, i, decl)
|
2009-08-10 22:47:55 +02:00
|
|
|
|
if (!decl_defined_p (decl))
|
|
|
|
|
no_linkage_error (decl);
|
|
|
|
|
|
2010-10-20 11:08:57 +02:00
|
|
|
|
/* Then, do the Objective-C stuff. This is where all the
|
|
|
|
|
Objective-C module stuff gets generated (symtab,
|
|
|
|
|
class/protocol/selector lists etc). This must be done after C++
|
|
|
|
|
templates, destructors etc. so that selectors used in C++
|
|
|
|
|
templates are properly allocated. */
|
|
|
|
|
if (c_dialect_objc ())
|
|
|
|
|
objc_write_global_declarations ();
|
|
|
|
|
|
1999-04-30 18:14:58 +02:00
|
|
|
|
/* We give C linkage to static constructors and destructors. */
|
|
|
|
|
push_lang_context (lang_name_c);
|
|
|
|
|
|
|
|
|
|
/* Generate initialization and destruction functions for all
|
|
|
|
|
priorities for which they are required. */
|
|
|
|
|
if (priority_info_map)
|
2005-06-14 22:01:59 +02:00
|
|
|
|
splay_tree_foreach (priority_info_map,
|
1999-04-30 18:14:58 +02:00
|
|
|
|
generate_ctor_and_dtor_functions_for_priority,
|
2003-04-20 13:57:38 +02:00
|
|
|
|
/*data=*/&locus);
|
2007-02-25 19:47:05 +01:00
|
|
|
|
else if (c_dialect_objc () && objc_static_init_needed_p ())
|
|
|
|
|
/* If this is obj-c++ and we need a static init, call
|
|
|
|
|
generate_ctor_or_dtor_function. */
|
|
|
|
|
generate_ctor_or_dtor_function (/*constructor_p=*/true,
|
|
|
|
|
DEFAULT_INIT_PRIORITY, &locus);
|
1999-04-30 18:14:58 +02:00
|
|
|
|
|
|
|
|
|
/* We're done with the splay-tree now. */
|
|
|
|
|
if (priority_info_map)
|
|
|
|
|
splay_tree_delete (priority_info_map);
|
|
|
|
|
|
2004-11-29 19:54:06 +01:00
|
|
|
|
/* Generate any missing aliases. */
|
|
|
|
|
maybe_apply_pending_pragma_weaks ();
|
|
|
|
|
|
1999-04-30 18:14:58 +02:00
|
|
|
|
/* We're done with static constructors, so we can go back to "C++"
|
|
|
|
|
linkage now. */
|
|
|
|
|
pop_lang_context ();
|
|
|
|
|
|
2009-09-03 06:07:12 +02:00
|
|
|
|
/* Collect candidates for Java hidden aliases. */
|
|
|
|
|
candidates = collect_candidates_for_java_method_aliases ();
|
|
|
|
|
|
2004-07-29 19:59:31 +02:00
|
|
|
|
cgraph_finalize_compilation_unit ();
|
2003-07-02 02:12:10 +02:00
|
|
|
|
|
1999-04-23 01:13:12 +02:00
|
|
|
|
/* Now, issue warnings about static, but not defined, functions,
|
1999-09-16 19:48:20 +02:00
|
|
|
|
etc., and emit debugging information. */
|
1999-04-23 01:13:12 +02:00
|
|
|
|
walk_namespaces (wrapup_globals_for_namespace, /*data=*/&reconsider);
|
2005-05-06 21:03:35 +02:00
|
|
|
|
if (VEC_length (tree, pending_statics) != 0)
|
2005-09-09 02:47:05 +02:00
|
|
|
|
{
|
|
|
|
|
check_global_declarations (VEC_address (tree, pending_statics),
|
2006-06-06 13:44:09 +02:00
|
|
|
|
VEC_length (tree, pending_statics));
|
2005-09-09 02:47:05 +02:00
|
|
|
|
emit_debug_global_declarations (VEC_address (tree, pending_statics),
|
|
|
|
|
VEC_length (tree, pending_statics));
|
|
|
|
|
}
|
1995-03-16 00:03:59 +01:00
|
|
|
|
|
2010-08-19 18:59:37 +02:00
|
|
|
|
perform_deferred_noexcept_checks ();
|
|
|
|
|
|
2005-05-26 00:08:31 +02:00
|
|
|
|
/* Generate hidden aliases for Java. */
|
2009-09-03 06:07:12 +02:00
|
|
|
|
if (candidates)
|
|
|
|
|
{
|
|
|
|
|
build_java_method_aliases (candidates);
|
|
|
|
|
pointer_set_destroy (candidates);
|
|
|
|
|
}
|
2005-05-26 00:08:31 +02:00
|
|
|
|
|
1995-04-03 21:28:01 +02:00
|
|
|
|
finish_repo ();
|
|
|
|
|
|
1999-08-03 03:37:47 +02:00
|
|
|
|
/* The entire file is now complete. If requested, dump everything
|
2002-09-13 13:33:47 +02:00
|
|
|
|
to a file. */
|
c-common.h (flag_dump_translation_unit): Remove.
* c-common.h (flag_dump_translation_unit): Remove.
(enum tree_dump_index): Define.
(TDF_ADDRESS, TDF_SLIM): New #defines.
(dump_node_to_file): Remove.
(dump_node): Make extern. Add flags.
(dump_flag, dump_enabled_p, dump_begin, dump_end,
dump_switch_p): Prototype.
* c-common.c (flag_dump_translation_unit): Remove.
* c-decl.c (c_decode_option): Remove -fdump-translation-unit
logic. Use dump_switch_p.
* c-dump.h (struct dump_info): Add node and user fields.
(dump_pointer): Declare.
* c-dump.c (dump_node): Make extern. Add flags.
(SOL_COLUMN, EOL_COLUMN, COLUMN_ALIGNMENT): New #defines.
(dump_new_line, dump_maybe_newline): Use them.
(dump_pointer): New function.
(dequeue_and_dump): Check TDF_SLIM before dumping a _DECL's
chain or function's body. Dump address, if TDF_ADDRESS set.
(dump_flag): Define.
(dump_node_to_file): Remove.
(struct dump_file_info): New struct.
(dump_files): New array.
(dump_begin, dump_end, dump_enabled_p, dump_switch_p): Define.
* c-lang.c (finish_file): Adjust dumping.
* toplev.h (dump_base_name): Make extern.
* invoke.texi: Document new flags.
cp:
* class.c (maybe_indent_hierarchy): New function.
(dump_class_hierarchy_r): Add flags. Dump extra binfo
information, if enabled. Use maybe_indent_hierarchy. Adjust
output format.
(dump_class_hierarchy): Adjust prototype. Adjust output format.
(dump_array, dump_vtable, dump_vtt): New functions.
(finish_struct_1): Adjust hierarchy dumping.
(initialize_vtable): Call dump_vtable.
(build_vtt): Call dump_vtt.
(build_ctor_vtbl_group): Call dump_vtable.
* decl2.c (flag_dump_class_layout): Remove.
(cxx_decode_option): Remove dump translation unit
and dump class hierarchy check. Call dump_switch_p.
(finish_file): Adjust dumping.
(dump.c): Only dump base classes if not TDF_SLIM.
Only dump namespace members if not TDF_SLIM.
* optimize.c (dump_function): New function.
(optimize_function): Call dump_function.
* semantics.c (expand_body): Use dump_enabled_p.
From-SVN: r42896
2001-06-05 10:03:45 +02:00
|
|
|
|
{
|
|
|
|
|
int flags;
|
2004-05-13 08:41:07 +02:00
|
|
|
|
FILE *stream = dump_begin (TDI_tu, &flags);
|
c-common.h (flag_dump_translation_unit): Remove.
* c-common.h (flag_dump_translation_unit): Remove.
(enum tree_dump_index): Define.
(TDF_ADDRESS, TDF_SLIM): New #defines.
(dump_node_to_file): Remove.
(dump_node): Make extern. Add flags.
(dump_flag, dump_enabled_p, dump_begin, dump_end,
dump_switch_p): Prototype.
* c-common.c (flag_dump_translation_unit): Remove.
* c-decl.c (c_decode_option): Remove -fdump-translation-unit
logic. Use dump_switch_p.
* c-dump.h (struct dump_info): Add node and user fields.
(dump_pointer): Declare.
* c-dump.c (dump_node): Make extern. Add flags.
(SOL_COLUMN, EOL_COLUMN, COLUMN_ALIGNMENT): New #defines.
(dump_new_line, dump_maybe_newline): Use them.
(dump_pointer): New function.
(dequeue_and_dump): Check TDF_SLIM before dumping a _DECL's
chain or function's body. Dump address, if TDF_ADDRESS set.
(dump_flag): Define.
(dump_node_to_file): Remove.
(struct dump_file_info): New struct.
(dump_files): New array.
(dump_begin, dump_end, dump_enabled_p, dump_switch_p): Define.
* c-lang.c (finish_file): Adjust dumping.
* toplev.h (dump_base_name): Make extern.
* invoke.texi: Document new flags.
cp:
* class.c (maybe_indent_hierarchy): New function.
(dump_class_hierarchy_r): Add flags. Dump extra binfo
information, if enabled. Use maybe_indent_hierarchy. Adjust
output format.
(dump_class_hierarchy): Adjust prototype. Adjust output format.
(dump_array, dump_vtable, dump_vtt): New functions.
(finish_struct_1): Adjust hierarchy dumping.
(initialize_vtable): Call dump_vtable.
(build_vtt): Call dump_vtt.
(build_ctor_vtbl_group): Call dump_vtable.
* decl2.c (flag_dump_class_layout): Remove.
(cxx_decode_option): Remove dump translation unit
and dump class hierarchy check. Call dump_switch_p.
(finish_file): Adjust dumping.
(dump.c): Only dump base classes if not TDF_SLIM.
Only dump namespace members if not TDF_SLIM.
* optimize.c (dump_function): New function.
(optimize_function): Call dump_function.
* semantics.c (expand_body): Use dump_enabled_p.
From-SVN: r42896
2001-06-05 10:03:45 +02:00
|
|
|
|
|
|
|
|
|
if (stream)
|
|
|
|
|
{
|
|
|
|
|
dump_node (global_namespace, flags & ~TDF_SLIM, stream);
|
2004-05-13 08:41:07 +02:00
|
|
|
|
dump_end (TDI_tu, stream);
|
c-common.h (flag_dump_translation_unit): Remove.
* c-common.h (flag_dump_translation_unit): Remove.
(enum tree_dump_index): Define.
(TDF_ADDRESS, TDF_SLIM): New #defines.
(dump_node_to_file): Remove.
(dump_node): Make extern. Add flags.
(dump_flag, dump_enabled_p, dump_begin, dump_end,
dump_switch_p): Prototype.
* c-common.c (flag_dump_translation_unit): Remove.
* c-decl.c (c_decode_option): Remove -fdump-translation-unit
logic. Use dump_switch_p.
* c-dump.h (struct dump_info): Add node and user fields.
(dump_pointer): Declare.
* c-dump.c (dump_node): Make extern. Add flags.
(SOL_COLUMN, EOL_COLUMN, COLUMN_ALIGNMENT): New #defines.
(dump_new_line, dump_maybe_newline): Use them.
(dump_pointer): New function.
(dequeue_and_dump): Check TDF_SLIM before dumping a _DECL's
chain or function's body. Dump address, if TDF_ADDRESS set.
(dump_flag): Define.
(dump_node_to_file): Remove.
(struct dump_file_info): New struct.
(dump_files): New array.
(dump_begin, dump_end, dump_enabled_p, dump_switch_p): Define.
* c-lang.c (finish_file): Adjust dumping.
* toplev.h (dump_base_name): Make extern.
* invoke.texi: Document new flags.
cp:
* class.c (maybe_indent_hierarchy): New function.
(dump_class_hierarchy_r): Add flags. Dump extra binfo
information, if enabled. Use maybe_indent_hierarchy. Adjust
output format.
(dump_class_hierarchy): Adjust prototype. Adjust output format.
(dump_array, dump_vtable, dump_vtt): New functions.
(finish_struct_1): Adjust hierarchy dumping.
(initialize_vtable): Call dump_vtable.
(build_vtt): Call dump_vtt.
(build_ctor_vtbl_group): Call dump_vtable.
* decl2.c (flag_dump_class_layout): Remove.
(cxx_decode_option): Remove dump translation unit
and dump class hierarchy check. Call dump_switch_p.
(finish_file): Adjust dumping.
(dump.c): Only dump base classes if not TDF_SLIM.
Only dump namespace members if not TDF_SLIM.
* optimize.c (dump_function): New function.
(optimize_function): Call dump_function.
* semantics.c (expand_body): Use dump_enabled_p.
From-SVN: r42896
2001-06-05 10:03:45 +02:00
|
|
|
|
}
|
|
|
|
|
}
|
2005-06-14 22:01:59 +02:00
|
|
|
|
|
Makefile.in (OBJS): Add timevar.o.
hangeLog:
* Makefile.in (OBJS): Add timevar.o.
(toplev.o): Depend on timevar.h.
(ggc-simple.o): Likewise.
(ggc-page.o): Likewise.
(timevar.o): New rule.
(timevar.h): New rule.
* timevar.h: New file.
* timevar.c: Likewise.
* timevar.def: Likewise.
* toplev.h (gc_time, parse_time, varconst_time): Remove.
* toplev.c: Use timevar_push and timevar_pop instead of TIMEVAR
throughout.
(TIMEVAR): Remove macro.
(gc_time, parse_time, varconst_time, integration_time, jump_time,
cse_time, gcse_time, loop_time, cse2_time, branch_prob_time,
flow_time, combine_time, regmove_time, sched_time,
local_alloc_time, global_alloc_time, flow2_time, peephole2_time,
sched2_time, dbr_sched_time, reorder_blocks_time,
rename_registers_time, shorten_branch_time, stack_reg_time,
to_ssa_time, from_ssa_time, final_time, symout_time, dump_time,
all_time): Remove.
(compile_file): Don't initialize time variables. Call
init_timevar and start TV_TOTAL timer. Call timevar_print instead
of many calls to print_time.
(rest_of_compilation): Add timing for reload_cse_regs.
(get_run_time): Removed to timevar.c.
(print_time): Likewise.
(get_run_time): Implement using TV_TOTAL time variable.
(print_time): Get total run time from get_run_time.
* ggc-page.c (ggc_collect): Push and pop TV_GC instead of
computing elapsed time explicitly.
* ggc-simple.c (ggc_collect): Likewise.
(gc_time): Remove declaration.
cp/ChangeLog:
* lex.c (my_get_run_time): Remove.
(init_filename_times): Use get_run_time instead of my_get_run_time.
(check_newline): Likewise.
(dump_time_statistics): Likewise.
* decl2.c (finish_file): Push and pop timevar TV_VARCONST instead
of computing elapsed time explicitly.
From-SVN: r33496
2000-04-28 02:59:40 +02:00
|
|
|
|
timevar_pop (TV_VARCONST);
|
1994-02-24 02:02:37 +01:00
|
|
|
|
|
|
|
|
|
if (flag_detailed_statistics)
|
1997-10-06 18:37:44 +02:00
|
|
|
|
{
|
|
|
|
|
dump_tree_statistics ();
|
|
|
|
|
dump_time_statistics ();
|
|
|
|
|
}
|
2003-05-03 13:37:22 +02:00
|
|
|
|
input_location = locus;
|
2004-02-13 08:19:25 +01:00
|
|
|
|
|
|
|
|
|
#ifdef ENABLE_CHECKING
|
|
|
|
|
validate_conversion_obstack ();
|
|
|
|
|
#endif /* ENABLE_CHECKING */
|
1994-02-24 02:02:37 +01:00
|
|
|
|
}
|
1994-03-24 00:33:53 +01:00
|
|
|
|
|
2003-08-15 14:15:56 +02:00
|
|
|
|
/* FN is an OFFSET_REF, DOTSTAR_EXPR or MEMBER_REF indicating the
|
|
|
|
|
function to call in parse-tree form; it has not yet been
|
|
|
|
|
semantically analyzed. ARGS are the arguments to the function.
|
tree.c (build_tree_list_vec_stat): New function.
./: * tree.c (build_tree_list_vec_stat): New function.
(ctor_to_vec): New function.
(build_nt_call_vec): New function.
(build_call_array): Change args to be a const pointer.
(build_call_vec): New function.
* tree.h (build_nt_call_vec): Declare.
(build_tree_list_vec_stat): Declare.
(build_tree_list_vec): Define.
(build_call_array): Update declaration.
(build_call_vec): Declare.
(ctor_to_vec): Declare.
* c-common.c (tree_vector_cache): New static variable.
(make_tree_vector): New function.
(release_tree_vector): New function.
(make_tree_vector_single): New function.
(make_tree_vector_copy): New function.
* c-common.h (tree_vector_cache, make_tree_vector): Declare.
(make_tree_vector_single, make_tree_vector_copy): Declare.
* c-parser.c (cached_expr_list_1, cached_expr_list_2): Remove.
(c_parser_expr_list): Don't manage cache here, instead call
make_tree_vector.
(c_parser_release_expr_list): Remove static function.
(c_parser_vec_to_tree_list): Remove static function.
(c_parser_attributes): Call build_tree_list_vec instead of
c_parser_vec_to_tree_list. Call release_tree_vector instead of
c_parser_release_expr_list.
(c_parser_postfix_expression_after_primary): Likewise.
(c_parser_objc_keywordexpr): Likewise.
cp/:
* parser.c (cp_parser_postfix_expression): Change args to a vec.
Release it when done.
(tree_vector): Define typedef. Define VEC functions.
(cp_parser_parenthesized_expression_list): Change return type to
vec. Change all callers.
(cp_parser_new_expression): Change placement and initializer to
vecs. Release them when done.
(cp_parser_new_placement): Change return type to vec. Change all
callers.
(cp_parser_new_initializer): Likewise.
* typeck.c (build_function_call_vec): Just call
cp_build_function_call_vec.
(cp_build_function_call): Just build a vec and call
cp_build_function_call_vec.
(cp_build_function_call_vec): New function based on old
cp_build_function_call.
(convert_arguments): Remove nargs and argarray parameters. Change
values to a vec. Change caller.
(build_x_compound_expr_from_vec): New function.
(cp_build_modify_expr): Build vec to pass to
build_special_member_call.
* call.c (struct z_candidate): Add first_arg field. Change args
field to vec.
(convert_class_to_reference): Handle first argument separately.
(add_candidate): Add first_arg parameter. Change args parameter
to vec. Change all callers.
(add_function_candidate, add_conv_candidate): Likewise.
(add_template_candidate_real, add_template_candidate): Likewise.
(add_template_conv_candidate): Likewise.
(build_user_type_conversion_1): Handle first argument separately.
(resolve_args): Change return type and parameter type to vecs.
Change all callers.
(perform_overload_resolution): Change args parameter to vec.
Change all callers.
(build_new_function_call, build_operator_new_call): Likewise.
(add_candidates): Likewise.
(build_op_call): New globally visible function, built from and
replacing static function build_object_call.
(build_new_op): Don't handle CALL_EXPR. Build vec, not tree_list,
of arguments.
(build_op_delete_call): Build vec to pass to
cp_build_function_call_vec.
(build_temp): Build vec to pass to build_special_member_call.
(convert_like_real): Likewise.
(perform_direct_initialization_if_possible): Likewise.
(build_over_call): Handle first_arg field. Use build_call_array
rather than build_call_list.
(build_special_member_call): Change args parameter to vec. Change
all callers.
(build_new_method_call): Likewise.
* init.c (expand_default_init): Change parms to vec.
(build_raw_new_expr): Change placement and init to vecs. Change
all callers.
(build_new_1, build_new): Likewise.
* class.c (resolve_address_of_overloaded_function): Build array to
pass to fn_type_unification.
* pt.c (tsubst_copy_and_build): For NEW_EXPR build vecs to pass to
build_new. For CALL_EXPR create a vec rather than a tree_list;
expand a pack if necessary.
(fn_type_unification): Change args parameter to const tree *. Add
nargs parameter. Change all callers.
(type_unification_real): Likewise.
(unify): Build array to pass to type_unification_real.
(get_bindings): Build array to pass to fn_type_unification.
(any_type_dependent_arguments_p): Change args parameter to a vec.
Change all callers.
(make_args_non_dependent): Renamed from build_non_dependent_args.
Change return type to void. Change parameter type to vec. Change
all callers.
(do_auto_deduction): Pass an array to type_unification_real.
* semantics.c (perform_koenig_lookup): Change args to vec. Change
all callers.
(finish_call_expr): Change args to vec. Change all callers. Call
build_op_call instead of passing CALL_EXPR to build_new_op.
(cxx_omp_create_clause_info): Allocate vec to pass to
build_special_member_call.
* decl2.c (build_offset_ref_call_from_tree): Change args parameter
to vec. Change all callers.
* name-lookup.c (lookup_function_nonclass): Likewise.
(struct arg_lookup): Change args to vec.
(arg_assoc_namespace): Handle args as a vec.
(arg_assoc_args_vec): New static function.
(lookup_arg_dependent): Change args parameter to vec. Change all
callers.
* method.c (do_build_assign_ref): Allocate vec to pass to
build_special_member_call.
* except.c (build_throw): Likewise.
* typeck2.c (build_functional_cast): Likewise.
* cvt.c (ocp_convert): Likewise.
* tree.c (build_min_non_dep_call_vec): Change last parameter to
vec. Change all callers.
* cp-tree.h: Update declarations.
* name-lookup.h: Update declarations.
objc/:
* objc-act.c (objc_generate_cxx_ctor_or_dtor): Pass NULL rather
than NULL_TREE to build_special_member_call.
From-SVN: r147759
2009-05-21 07:58:39 +02:00
|
|
|
|
They have already been semantically analyzed. This may change
|
|
|
|
|
ARGS. */
|
2002-08-01 06:46:23 +02:00
|
|
|
|
|
|
|
|
|
tree
|
tree.c (build_tree_list_vec_stat): New function.
./: * tree.c (build_tree_list_vec_stat): New function.
(ctor_to_vec): New function.
(build_nt_call_vec): New function.
(build_call_array): Change args to be a const pointer.
(build_call_vec): New function.
* tree.h (build_nt_call_vec): Declare.
(build_tree_list_vec_stat): Declare.
(build_tree_list_vec): Define.
(build_call_array): Update declaration.
(build_call_vec): Declare.
(ctor_to_vec): Declare.
* c-common.c (tree_vector_cache): New static variable.
(make_tree_vector): New function.
(release_tree_vector): New function.
(make_tree_vector_single): New function.
(make_tree_vector_copy): New function.
* c-common.h (tree_vector_cache, make_tree_vector): Declare.
(make_tree_vector_single, make_tree_vector_copy): Declare.
* c-parser.c (cached_expr_list_1, cached_expr_list_2): Remove.
(c_parser_expr_list): Don't manage cache here, instead call
make_tree_vector.
(c_parser_release_expr_list): Remove static function.
(c_parser_vec_to_tree_list): Remove static function.
(c_parser_attributes): Call build_tree_list_vec instead of
c_parser_vec_to_tree_list. Call release_tree_vector instead of
c_parser_release_expr_list.
(c_parser_postfix_expression_after_primary): Likewise.
(c_parser_objc_keywordexpr): Likewise.
cp/:
* parser.c (cp_parser_postfix_expression): Change args to a vec.
Release it when done.
(tree_vector): Define typedef. Define VEC functions.
(cp_parser_parenthesized_expression_list): Change return type to
vec. Change all callers.
(cp_parser_new_expression): Change placement and initializer to
vecs. Release them when done.
(cp_parser_new_placement): Change return type to vec. Change all
callers.
(cp_parser_new_initializer): Likewise.
* typeck.c (build_function_call_vec): Just call
cp_build_function_call_vec.
(cp_build_function_call): Just build a vec and call
cp_build_function_call_vec.
(cp_build_function_call_vec): New function based on old
cp_build_function_call.
(convert_arguments): Remove nargs and argarray parameters. Change
values to a vec. Change caller.
(build_x_compound_expr_from_vec): New function.
(cp_build_modify_expr): Build vec to pass to
build_special_member_call.
* call.c (struct z_candidate): Add first_arg field. Change args
field to vec.
(convert_class_to_reference): Handle first argument separately.
(add_candidate): Add first_arg parameter. Change args parameter
to vec. Change all callers.
(add_function_candidate, add_conv_candidate): Likewise.
(add_template_candidate_real, add_template_candidate): Likewise.
(add_template_conv_candidate): Likewise.
(build_user_type_conversion_1): Handle first argument separately.
(resolve_args): Change return type and parameter type to vecs.
Change all callers.
(perform_overload_resolution): Change args parameter to vec.
Change all callers.
(build_new_function_call, build_operator_new_call): Likewise.
(add_candidates): Likewise.
(build_op_call): New globally visible function, built from and
replacing static function build_object_call.
(build_new_op): Don't handle CALL_EXPR. Build vec, not tree_list,
of arguments.
(build_op_delete_call): Build vec to pass to
cp_build_function_call_vec.
(build_temp): Build vec to pass to build_special_member_call.
(convert_like_real): Likewise.
(perform_direct_initialization_if_possible): Likewise.
(build_over_call): Handle first_arg field. Use build_call_array
rather than build_call_list.
(build_special_member_call): Change args parameter to vec. Change
all callers.
(build_new_method_call): Likewise.
* init.c (expand_default_init): Change parms to vec.
(build_raw_new_expr): Change placement and init to vecs. Change
all callers.
(build_new_1, build_new): Likewise.
* class.c (resolve_address_of_overloaded_function): Build array to
pass to fn_type_unification.
* pt.c (tsubst_copy_and_build): For NEW_EXPR build vecs to pass to
build_new. For CALL_EXPR create a vec rather than a tree_list;
expand a pack if necessary.
(fn_type_unification): Change args parameter to const tree *. Add
nargs parameter. Change all callers.
(type_unification_real): Likewise.
(unify): Build array to pass to type_unification_real.
(get_bindings): Build array to pass to fn_type_unification.
(any_type_dependent_arguments_p): Change args parameter to a vec.
Change all callers.
(make_args_non_dependent): Renamed from build_non_dependent_args.
Change return type to void. Change parameter type to vec. Change
all callers.
(do_auto_deduction): Pass an array to type_unification_real.
* semantics.c (perform_koenig_lookup): Change args to vec. Change
all callers.
(finish_call_expr): Change args to vec. Change all callers. Call
build_op_call instead of passing CALL_EXPR to build_new_op.
(cxx_omp_create_clause_info): Allocate vec to pass to
build_special_member_call.
* decl2.c (build_offset_ref_call_from_tree): Change args parameter
to vec. Change all callers.
* name-lookup.c (lookup_function_nonclass): Likewise.
(struct arg_lookup): Change args to vec.
(arg_assoc_namespace): Handle args as a vec.
(arg_assoc_args_vec): New static function.
(lookup_arg_dependent): Change args parameter to vec. Change all
callers.
* method.c (do_build_assign_ref): Allocate vec to pass to
build_special_member_call.
* except.c (build_throw): Likewise.
* typeck2.c (build_functional_cast): Likewise.
* cvt.c (ocp_convert): Likewise.
* tree.c (build_min_non_dep_call_vec): Change last parameter to
vec. Change all callers.
* cp-tree.h: Update declarations.
* name-lookup.h: Update declarations.
objc/:
* objc-act.c (objc_generate_cxx_ctor_or_dtor): Pass NULL rather
than NULL_TREE to build_special_member_call.
From-SVN: r147759
2009-05-21 07:58:39 +02:00
|
|
|
|
build_offset_ref_call_from_tree (tree fn, VEC(tree,gc) **args)
|
2002-08-01 06:46:23 +02:00
|
|
|
|
{
|
2003-07-09 10:48:08 +02:00
|
|
|
|
tree orig_fn;
|
tree.c (build_tree_list_vec_stat): New function.
./: * tree.c (build_tree_list_vec_stat): New function.
(ctor_to_vec): New function.
(build_nt_call_vec): New function.
(build_call_array): Change args to be a const pointer.
(build_call_vec): New function.
* tree.h (build_nt_call_vec): Declare.
(build_tree_list_vec_stat): Declare.
(build_tree_list_vec): Define.
(build_call_array): Update declaration.
(build_call_vec): Declare.
(ctor_to_vec): Declare.
* c-common.c (tree_vector_cache): New static variable.
(make_tree_vector): New function.
(release_tree_vector): New function.
(make_tree_vector_single): New function.
(make_tree_vector_copy): New function.
* c-common.h (tree_vector_cache, make_tree_vector): Declare.
(make_tree_vector_single, make_tree_vector_copy): Declare.
* c-parser.c (cached_expr_list_1, cached_expr_list_2): Remove.
(c_parser_expr_list): Don't manage cache here, instead call
make_tree_vector.
(c_parser_release_expr_list): Remove static function.
(c_parser_vec_to_tree_list): Remove static function.
(c_parser_attributes): Call build_tree_list_vec instead of
c_parser_vec_to_tree_list. Call release_tree_vector instead of
c_parser_release_expr_list.
(c_parser_postfix_expression_after_primary): Likewise.
(c_parser_objc_keywordexpr): Likewise.
cp/:
* parser.c (cp_parser_postfix_expression): Change args to a vec.
Release it when done.
(tree_vector): Define typedef. Define VEC functions.
(cp_parser_parenthesized_expression_list): Change return type to
vec. Change all callers.
(cp_parser_new_expression): Change placement and initializer to
vecs. Release them when done.
(cp_parser_new_placement): Change return type to vec. Change all
callers.
(cp_parser_new_initializer): Likewise.
* typeck.c (build_function_call_vec): Just call
cp_build_function_call_vec.
(cp_build_function_call): Just build a vec and call
cp_build_function_call_vec.
(cp_build_function_call_vec): New function based on old
cp_build_function_call.
(convert_arguments): Remove nargs and argarray parameters. Change
values to a vec. Change caller.
(build_x_compound_expr_from_vec): New function.
(cp_build_modify_expr): Build vec to pass to
build_special_member_call.
* call.c (struct z_candidate): Add first_arg field. Change args
field to vec.
(convert_class_to_reference): Handle first argument separately.
(add_candidate): Add first_arg parameter. Change args parameter
to vec. Change all callers.
(add_function_candidate, add_conv_candidate): Likewise.
(add_template_candidate_real, add_template_candidate): Likewise.
(add_template_conv_candidate): Likewise.
(build_user_type_conversion_1): Handle first argument separately.
(resolve_args): Change return type and parameter type to vecs.
Change all callers.
(perform_overload_resolution): Change args parameter to vec.
Change all callers.
(build_new_function_call, build_operator_new_call): Likewise.
(add_candidates): Likewise.
(build_op_call): New globally visible function, built from and
replacing static function build_object_call.
(build_new_op): Don't handle CALL_EXPR. Build vec, not tree_list,
of arguments.
(build_op_delete_call): Build vec to pass to
cp_build_function_call_vec.
(build_temp): Build vec to pass to build_special_member_call.
(convert_like_real): Likewise.
(perform_direct_initialization_if_possible): Likewise.
(build_over_call): Handle first_arg field. Use build_call_array
rather than build_call_list.
(build_special_member_call): Change args parameter to vec. Change
all callers.
(build_new_method_call): Likewise.
* init.c (expand_default_init): Change parms to vec.
(build_raw_new_expr): Change placement and init to vecs. Change
all callers.
(build_new_1, build_new): Likewise.
* class.c (resolve_address_of_overloaded_function): Build array to
pass to fn_type_unification.
* pt.c (tsubst_copy_and_build): For NEW_EXPR build vecs to pass to
build_new. For CALL_EXPR create a vec rather than a tree_list;
expand a pack if necessary.
(fn_type_unification): Change args parameter to const tree *. Add
nargs parameter. Change all callers.
(type_unification_real): Likewise.
(unify): Build array to pass to type_unification_real.
(get_bindings): Build array to pass to fn_type_unification.
(any_type_dependent_arguments_p): Change args parameter to a vec.
Change all callers.
(make_args_non_dependent): Renamed from build_non_dependent_args.
Change return type to void. Change parameter type to vec. Change
all callers.
(do_auto_deduction): Pass an array to type_unification_real.
* semantics.c (perform_koenig_lookup): Change args to vec. Change
all callers.
(finish_call_expr): Change args to vec. Change all callers. Call
build_op_call instead of passing CALL_EXPR to build_new_op.
(cxx_omp_create_clause_info): Allocate vec to pass to
build_special_member_call.
* decl2.c (build_offset_ref_call_from_tree): Change args parameter
to vec. Change all callers.
* name-lookup.c (lookup_function_nonclass): Likewise.
(struct arg_lookup): Change args to vec.
(arg_assoc_namespace): Handle args as a vec.
(arg_assoc_args_vec): New static function.
(lookup_arg_dependent): Change args parameter to vec. Change all
callers.
* method.c (do_build_assign_ref): Allocate vec to pass to
build_special_member_call.
* except.c (build_throw): Likewise.
* typeck2.c (build_functional_cast): Likewise.
* cvt.c (ocp_convert): Likewise.
* tree.c (build_min_non_dep_call_vec): Change last parameter to
vec. Change all callers.
* cp-tree.h: Update declarations.
* name-lookup.h: Update declarations.
objc/:
* objc-act.c (objc_generate_cxx_ctor_or_dtor): Pass NULL rather
than NULL_TREE to build_special_member_call.
From-SVN: r147759
2009-05-21 07:58:39 +02:00
|
|
|
|
VEC(tree,gc) *orig_args = NULL;
|
2003-07-09 10:48:08 +02:00
|
|
|
|
tree expr;
|
2003-08-15 14:15:56 +02:00
|
|
|
|
tree object;
|
2002-08-01 06:46:23 +02:00
|
|
|
|
|
2003-07-09 10:48:08 +02:00
|
|
|
|
orig_fn = fn;
|
2003-08-15 14:15:56 +02:00
|
|
|
|
object = TREE_OPERAND (fn, 0);
|
2003-07-09 10:48:08 +02:00
|
|
|
|
|
|
|
|
|
if (processing_template_decl)
|
|
|
|
|
{
|
call.c (validate_conversion_obstack): Replace my_friendly_assert with gcc_assert or gcc_unreachable.
* call.c (validate_conversion_obstack): Replace
my_friendly_assert with gcc_assert or gcc_unreachable.
(direct_reference_binding, merge_conversion_sequences,
build_user_type_conversion_1, perform_overload_resolution,
build_op_delete_call, enforce_access, call_builtin_trap,
build_over_call, build_special_member_call, build_new_method_call,
initialize_reference): Likewise.
* class.c (build_base_path, build_primary_vtable, alter_access,
check_bases, update_vtable_entry_for_fn, layout_empty_base,
clone_function_decl, adjust_clone_args,
type_requires_array_cookie, include_empty_classes,
finish_struct_1, resolve_address_of_overloaded_function,
instantiate_type, get_vtbl_decl_for_binfo, build_vtt_inits,
dfs_build_secondary_vptr_vtt_inits, build_ctor_vtbl_group,
accumulate_vtbl_inits, build_vtbl_initializer,
build_vbase_offset_vtbl_entries, build_rtti_vtbl_entries): Likewise.
* cvt.c (build_up_reference, convert_to_reference): Likewise.
* decl.c (poplevel, duplicate_decls, make_typename_type,
cxx_init_decl_processing, reshape_init, check_initializer,
make_rtl_for_nonlocal_decl, initialize_local_var, cp_finish_decl,
expand_static_init, grokfndecl, grokvardecl, build_ptrmem_type,
grokdeclarator, copy_fn_p, grok_op_properties, xref_tag,
xref_basetypes, start_preparsed_function, save_function_data,
finish_function, finish_method, maybe_register_incomplete_var,
complete_vars): Likewise.
* decl2.c (grok_array_decl, check_member_template,
check_classfn, finish_static_data_member_decl, coerce_new_type,
coerce_delete_type, import_export_class, decl_needed_p,
determine_visibility, import_export_decl, build_cleanup,
start_static_initialization_or_destructi, do_static_destruction,
prune_vars_needing_no_initialization,
build_offset_ref_call_from_tree): Likewise.
* error.c (dump_decl, dump_expr): Likewise.
* init.c (finish_init_stmts, build_zero_init,
expand_virtual_init, expand_default_init, expand_aggr_init_1,
build_offset_ref, build_new_1, build_delete, build_vbase_delete):
Likewise.
* mangle.c (write_method_parms, write_template_args,
write_expression, write_template_arg): Likewise.
* method.c (make_thunk, finish_thunk, use_thunk): Likewise.
* name-lookup.c (pop_binding, begin_scope, leave_scope,
resume_scope, push_using_decl, validate_nonmember_using_decl,
is_ancestor, poplevel_class, set_inherited_value_binding_p,
push_class_level_binding, do_class_using_decl, push_namespace,
pop_namespace, add_using_namespace, ambiguous_decl,
lookup_namespace_name, lookup_type_current_level,
maybe_process_template_type_declaration): Likewise.
* parser.c (cp_lexer_peek_nth_token,
cp_parser_parse_and_diagnose_invalid_typ,
cp_parser_translation_unit, cp_parser_template_id,
cp_parser_lookup_name, cp_parser_late_parsing_for_member): Likewise.
* pt.c (push_access_scope, finish_member_template_decl,
push_inline_template_parms_recursive, add_outermost_template_args,
get_innermost_template_args, begin_explicit_instantiation,
end_explicit_instantiation, retrieve_specialization,
is_specialization_of, is_specialization_of_friend,
register_specialization, check_explicit_specialization,
comp_template_parms, process_template_parm,
process_partial_specialization, convert_nontype_argument,
coerce_template_template_parms, coerce_template_parms,
mangle_class_name_for_template, lookup_template_function,
lookup_template_class, instantiate_class_template, tsubst_decl,
tsubst_function_type, tsubst, tsubst_qualified_id, tsubst_copy,
instantiate_template, fn_type_unification, type_unification_real,
get_template_base, regenerate_decl_from_template,
template_for_substitution, instantiate_decl,
get_mostly_instantiated_function_type, dependent_scope_ref_p,
value_dependent_expression_p, resolve_typename_type): Likewise.
* repo.c (repo_emit_p): Likewise.
* rtti.c (build_headof, get_tinfo_decl, get_pseudo_ti_init,
create_tinfo_types, emit_tinfo_decl): Likewise.
* search.c (lookup_base_r, lookup_base, lookup_field_1,
dfs_access_in_type, build_baselink, lookup_member,
adjust_result_of_qualified_name_lookup, copied_binfo): Likewise.
* semantics.c (perform_or_defer_access_check,
finish_non_static_data_member, finish_stmt_expr_expr,
finish_stmt_expr, finish_call_expr, finish_pseudo_destructor_expr,
finish_template_template_parm, finish_member_declaration,
emit_associated_thunks): Likewise.
* tree.c (build_target_expr_with_type, force_target_expr,
copy_binfo, get_first_fn, cp_tree_equal): Likewise.
* typeck.c (type_after_usual_arithmetic_conversions, comptypes,
cxx_sizeof_or_alignof_type, perform_integral_promotions,
build_class_member_access_expr, finish_class_member_access_expr,
build_ptrmemfunc_access_expr, build_unary_op,
unary_complex_lvalue, cxx_mark_addressable, build_modify_expr,
build_ptrmemfunc, expand_ptrmemfunc_cst, check_return_expr
* typeck2.c (complete_type_check_abstract,
abstract_virtuals_error, process_init_constructor,
add_exception_specifier): Likewise.
From-SVN: r86669
2004-08-27 19:59:33 +02:00
|
|
|
|
gcc_assert (TREE_CODE (fn) == DOTSTAR_EXPR
|
|
|
|
|
|| TREE_CODE (fn) == MEMBER_REF);
|
2003-07-09 10:48:08 +02:00
|
|
|
|
if (type_dependent_expression_p (fn)
|
tree.c (build_tree_list_vec_stat): New function.
./: * tree.c (build_tree_list_vec_stat): New function.
(ctor_to_vec): New function.
(build_nt_call_vec): New function.
(build_call_array): Change args to be a const pointer.
(build_call_vec): New function.
* tree.h (build_nt_call_vec): Declare.
(build_tree_list_vec_stat): Declare.
(build_tree_list_vec): Define.
(build_call_array): Update declaration.
(build_call_vec): Declare.
(ctor_to_vec): Declare.
* c-common.c (tree_vector_cache): New static variable.
(make_tree_vector): New function.
(release_tree_vector): New function.
(make_tree_vector_single): New function.
(make_tree_vector_copy): New function.
* c-common.h (tree_vector_cache, make_tree_vector): Declare.
(make_tree_vector_single, make_tree_vector_copy): Declare.
* c-parser.c (cached_expr_list_1, cached_expr_list_2): Remove.
(c_parser_expr_list): Don't manage cache here, instead call
make_tree_vector.
(c_parser_release_expr_list): Remove static function.
(c_parser_vec_to_tree_list): Remove static function.
(c_parser_attributes): Call build_tree_list_vec instead of
c_parser_vec_to_tree_list. Call release_tree_vector instead of
c_parser_release_expr_list.
(c_parser_postfix_expression_after_primary): Likewise.
(c_parser_objc_keywordexpr): Likewise.
cp/:
* parser.c (cp_parser_postfix_expression): Change args to a vec.
Release it when done.
(tree_vector): Define typedef. Define VEC functions.
(cp_parser_parenthesized_expression_list): Change return type to
vec. Change all callers.
(cp_parser_new_expression): Change placement and initializer to
vecs. Release them when done.
(cp_parser_new_placement): Change return type to vec. Change all
callers.
(cp_parser_new_initializer): Likewise.
* typeck.c (build_function_call_vec): Just call
cp_build_function_call_vec.
(cp_build_function_call): Just build a vec and call
cp_build_function_call_vec.
(cp_build_function_call_vec): New function based on old
cp_build_function_call.
(convert_arguments): Remove nargs and argarray parameters. Change
values to a vec. Change caller.
(build_x_compound_expr_from_vec): New function.
(cp_build_modify_expr): Build vec to pass to
build_special_member_call.
* call.c (struct z_candidate): Add first_arg field. Change args
field to vec.
(convert_class_to_reference): Handle first argument separately.
(add_candidate): Add first_arg parameter. Change args parameter
to vec. Change all callers.
(add_function_candidate, add_conv_candidate): Likewise.
(add_template_candidate_real, add_template_candidate): Likewise.
(add_template_conv_candidate): Likewise.
(build_user_type_conversion_1): Handle first argument separately.
(resolve_args): Change return type and parameter type to vecs.
Change all callers.
(perform_overload_resolution): Change args parameter to vec.
Change all callers.
(build_new_function_call, build_operator_new_call): Likewise.
(add_candidates): Likewise.
(build_op_call): New globally visible function, built from and
replacing static function build_object_call.
(build_new_op): Don't handle CALL_EXPR. Build vec, not tree_list,
of arguments.
(build_op_delete_call): Build vec to pass to
cp_build_function_call_vec.
(build_temp): Build vec to pass to build_special_member_call.
(convert_like_real): Likewise.
(perform_direct_initialization_if_possible): Likewise.
(build_over_call): Handle first_arg field. Use build_call_array
rather than build_call_list.
(build_special_member_call): Change args parameter to vec. Change
all callers.
(build_new_method_call): Likewise.
* init.c (expand_default_init): Change parms to vec.
(build_raw_new_expr): Change placement and init to vecs. Change
all callers.
(build_new_1, build_new): Likewise.
* class.c (resolve_address_of_overloaded_function): Build array to
pass to fn_type_unification.
* pt.c (tsubst_copy_and_build): For NEW_EXPR build vecs to pass to
build_new. For CALL_EXPR create a vec rather than a tree_list;
expand a pack if necessary.
(fn_type_unification): Change args parameter to const tree *. Add
nargs parameter. Change all callers.
(type_unification_real): Likewise.
(unify): Build array to pass to type_unification_real.
(get_bindings): Build array to pass to fn_type_unification.
(any_type_dependent_arguments_p): Change args parameter to a vec.
Change all callers.
(make_args_non_dependent): Renamed from build_non_dependent_args.
Change return type to void. Change parameter type to vec. Change
all callers.
(do_auto_deduction): Pass an array to type_unification_real.
* semantics.c (perform_koenig_lookup): Change args to vec. Change
all callers.
(finish_call_expr): Change args to vec. Change all callers. Call
build_op_call instead of passing CALL_EXPR to build_new_op.
(cxx_omp_create_clause_info): Allocate vec to pass to
build_special_member_call.
* decl2.c (build_offset_ref_call_from_tree): Change args parameter
to vec. Change all callers.
* name-lookup.c (lookup_function_nonclass): Likewise.
(struct arg_lookup): Change args to vec.
(arg_assoc_namespace): Handle args as a vec.
(arg_assoc_args_vec): New static function.
(lookup_arg_dependent): Change args parameter to vec. Change all
callers.
* method.c (do_build_assign_ref): Allocate vec to pass to
build_special_member_call.
* except.c (build_throw): Likewise.
* typeck2.c (build_functional_cast): Likewise.
* cvt.c (ocp_convert): Likewise.
* tree.c (build_min_non_dep_call_vec): Change last parameter to
vec. Change all callers.
* cp-tree.h: Update declarations.
* name-lookup.h: Update declarations.
objc/:
* objc-act.c (objc_generate_cxx_ctor_or_dtor): Pass NULL rather
than NULL_TREE to build_special_member_call.
From-SVN: r147759
2009-05-21 07:58:39 +02:00
|
|
|
|
|| any_type_dependent_arguments_p (*args))
|
|
|
|
|
return build_nt_call_vec (fn, *args);
|
|
|
|
|
|
|
|
|
|
orig_args = make_tree_vector_copy (*args);
|
2003-07-09 10:48:08 +02:00
|
|
|
|
|
|
|
|
|
/* Transform the arguments and add the implicit "this"
|
|
|
|
|
parameter. That must be done before the FN is transformed
|
|
|
|
|
because we depend on the form of FN. */
|
tree.c (build_tree_list_vec_stat): New function.
./: * tree.c (build_tree_list_vec_stat): New function.
(ctor_to_vec): New function.
(build_nt_call_vec): New function.
(build_call_array): Change args to be a const pointer.
(build_call_vec): New function.
* tree.h (build_nt_call_vec): Declare.
(build_tree_list_vec_stat): Declare.
(build_tree_list_vec): Define.
(build_call_array): Update declaration.
(build_call_vec): Declare.
(ctor_to_vec): Declare.
* c-common.c (tree_vector_cache): New static variable.
(make_tree_vector): New function.
(release_tree_vector): New function.
(make_tree_vector_single): New function.
(make_tree_vector_copy): New function.
* c-common.h (tree_vector_cache, make_tree_vector): Declare.
(make_tree_vector_single, make_tree_vector_copy): Declare.
* c-parser.c (cached_expr_list_1, cached_expr_list_2): Remove.
(c_parser_expr_list): Don't manage cache here, instead call
make_tree_vector.
(c_parser_release_expr_list): Remove static function.
(c_parser_vec_to_tree_list): Remove static function.
(c_parser_attributes): Call build_tree_list_vec instead of
c_parser_vec_to_tree_list. Call release_tree_vector instead of
c_parser_release_expr_list.
(c_parser_postfix_expression_after_primary): Likewise.
(c_parser_objc_keywordexpr): Likewise.
cp/:
* parser.c (cp_parser_postfix_expression): Change args to a vec.
Release it when done.
(tree_vector): Define typedef. Define VEC functions.
(cp_parser_parenthesized_expression_list): Change return type to
vec. Change all callers.
(cp_parser_new_expression): Change placement and initializer to
vecs. Release them when done.
(cp_parser_new_placement): Change return type to vec. Change all
callers.
(cp_parser_new_initializer): Likewise.
* typeck.c (build_function_call_vec): Just call
cp_build_function_call_vec.
(cp_build_function_call): Just build a vec and call
cp_build_function_call_vec.
(cp_build_function_call_vec): New function based on old
cp_build_function_call.
(convert_arguments): Remove nargs and argarray parameters. Change
values to a vec. Change caller.
(build_x_compound_expr_from_vec): New function.
(cp_build_modify_expr): Build vec to pass to
build_special_member_call.
* call.c (struct z_candidate): Add first_arg field. Change args
field to vec.
(convert_class_to_reference): Handle first argument separately.
(add_candidate): Add first_arg parameter. Change args parameter
to vec. Change all callers.
(add_function_candidate, add_conv_candidate): Likewise.
(add_template_candidate_real, add_template_candidate): Likewise.
(add_template_conv_candidate): Likewise.
(build_user_type_conversion_1): Handle first argument separately.
(resolve_args): Change return type and parameter type to vecs.
Change all callers.
(perform_overload_resolution): Change args parameter to vec.
Change all callers.
(build_new_function_call, build_operator_new_call): Likewise.
(add_candidates): Likewise.
(build_op_call): New globally visible function, built from and
replacing static function build_object_call.
(build_new_op): Don't handle CALL_EXPR. Build vec, not tree_list,
of arguments.
(build_op_delete_call): Build vec to pass to
cp_build_function_call_vec.
(build_temp): Build vec to pass to build_special_member_call.
(convert_like_real): Likewise.
(perform_direct_initialization_if_possible): Likewise.
(build_over_call): Handle first_arg field. Use build_call_array
rather than build_call_list.
(build_special_member_call): Change args parameter to vec. Change
all callers.
(build_new_method_call): Likewise.
* init.c (expand_default_init): Change parms to vec.
(build_raw_new_expr): Change placement and init to vecs. Change
all callers.
(build_new_1, build_new): Likewise.
* class.c (resolve_address_of_overloaded_function): Build array to
pass to fn_type_unification.
* pt.c (tsubst_copy_and_build): For NEW_EXPR build vecs to pass to
build_new. For CALL_EXPR create a vec rather than a tree_list;
expand a pack if necessary.
(fn_type_unification): Change args parameter to const tree *. Add
nargs parameter. Change all callers.
(type_unification_real): Likewise.
(unify): Build array to pass to type_unification_real.
(get_bindings): Build array to pass to fn_type_unification.
(any_type_dependent_arguments_p): Change args parameter to a vec.
Change all callers.
(make_args_non_dependent): Renamed from build_non_dependent_args.
Change return type to void. Change parameter type to vec. Change
all callers.
(do_auto_deduction): Pass an array to type_unification_real.
* semantics.c (perform_koenig_lookup): Change args to vec. Change
all callers.
(finish_call_expr): Change args to vec. Change all callers. Call
build_op_call instead of passing CALL_EXPR to build_new_op.
(cxx_omp_create_clause_info): Allocate vec to pass to
build_special_member_call.
* decl2.c (build_offset_ref_call_from_tree): Change args parameter
to vec. Change all callers.
* name-lookup.c (lookup_function_nonclass): Likewise.
(struct arg_lookup): Change args to vec.
(arg_assoc_namespace): Handle args as a vec.
(arg_assoc_args_vec): New static function.
(lookup_arg_dependent): Change args parameter to vec. Change all
callers.
* method.c (do_build_assign_ref): Allocate vec to pass to
build_special_member_call.
* except.c (build_throw): Likewise.
* typeck2.c (build_functional_cast): Likewise.
* cvt.c (ocp_convert): Likewise.
* tree.c (build_min_non_dep_call_vec): Change last parameter to
vec. Change all callers.
* cp-tree.h: Update declarations.
* name-lookup.h: Update declarations.
objc/:
* objc-act.c (objc_generate_cxx_ctor_or_dtor): Pass NULL rather
than NULL_TREE to build_special_member_call.
From-SVN: r147759
2009-05-21 07:58:39 +02:00
|
|
|
|
make_args_non_dependent (*args);
|
2007-10-30 23:37:53 +01:00
|
|
|
|
object = build_non_dependent_expr (object);
|
2003-07-09 10:48:08 +02:00
|
|
|
|
if (TREE_CODE (fn) == DOTSTAR_EXPR)
|
Require lvalues as specified by the standard.
* typeck.c (lvalue_or_else): Use real_lvalue_p.
(cp_build_addr_expr_1): Split out of cp_build_unary_op.
(cp_build_addr_expr, cp_build_addr_expr_strict): Interfaces.
(decay_conversion, get_member_function_from_ptrfunc): Adjust.
(build_x_unary_op, build_reinterpret_cast_1): Adjust.
(build_const_cast_1): Adjust.
* cp-tree.h: Declare new fns.
* call.c (build_this, convert_like_real, build_over_call): Adjust.
(initialize_reference): Adjust.
* class.c (build_base_path, convert_to_base_statically): Adjust.
(build_vfn_ref, resolve_address_of_overloaded_function): Adjust.
* cvt.c (build_up_reference, convert_to_reference): Adjust.
* decl.c (register_dtor_fn): Adjust.
* decl2.c (build_offset_ref_call_from_tree): Adjust.
* except.c (initialize_handler_parm): Adjust.
* init.c (build_offset_ref, build_delete, build_vec_delete): Adjust.
* rtti.c (build_dynamic_cast_1, tinfo_base_init): Adjust.
* tree.c (stabilize_expr): Adjust.
From-SVN: r164666
2010-09-27 22:05:34 +02:00
|
|
|
|
object = cp_build_addr_expr (object, tf_warning_or_error);
|
tree.c (build_tree_list_vec_stat): New function.
./: * tree.c (build_tree_list_vec_stat): New function.
(ctor_to_vec): New function.
(build_nt_call_vec): New function.
(build_call_array): Change args to be a const pointer.
(build_call_vec): New function.
* tree.h (build_nt_call_vec): Declare.
(build_tree_list_vec_stat): Declare.
(build_tree_list_vec): Define.
(build_call_array): Update declaration.
(build_call_vec): Declare.
(ctor_to_vec): Declare.
* c-common.c (tree_vector_cache): New static variable.
(make_tree_vector): New function.
(release_tree_vector): New function.
(make_tree_vector_single): New function.
(make_tree_vector_copy): New function.
* c-common.h (tree_vector_cache, make_tree_vector): Declare.
(make_tree_vector_single, make_tree_vector_copy): Declare.
* c-parser.c (cached_expr_list_1, cached_expr_list_2): Remove.
(c_parser_expr_list): Don't manage cache here, instead call
make_tree_vector.
(c_parser_release_expr_list): Remove static function.
(c_parser_vec_to_tree_list): Remove static function.
(c_parser_attributes): Call build_tree_list_vec instead of
c_parser_vec_to_tree_list. Call release_tree_vector instead of
c_parser_release_expr_list.
(c_parser_postfix_expression_after_primary): Likewise.
(c_parser_objc_keywordexpr): Likewise.
cp/:
* parser.c (cp_parser_postfix_expression): Change args to a vec.
Release it when done.
(tree_vector): Define typedef. Define VEC functions.
(cp_parser_parenthesized_expression_list): Change return type to
vec. Change all callers.
(cp_parser_new_expression): Change placement and initializer to
vecs. Release them when done.
(cp_parser_new_placement): Change return type to vec. Change all
callers.
(cp_parser_new_initializer): Likewise.
* typeck.c (build_function_call_vec): Just call
cp_build_function_call_vec.
(cp_build_function_call): Just build a vec and call
cp_build_function_call_vec.
(cp_build_function_call_vec): New function based on old
cp_build_function_call.
(convert_arguments): Remove nargs and argarray parameters. Change
values to a vec. Change caller.
(build_x_compound_expr_from_vec): New function.
(cp_build_modify_expr): Build vec to pass to
build_special_member_call.
* call.c (struct z_candidate): Add first_arg field. Change args
field to vec.
(convert_class_to_reference): Handle first argument separately.
(add_candidate): Add first_arg parameter. Change args parameter
to vec. Change all callers.
(add_function_candidate, add_conv_candidate): Likewise.
(add_template_candidate_real, add_template_candidate): Likewise.
(add_template_conv_candidate): Likewise.
(build_user_type_conversion_1): Handle first argument separately.
(resolve_args): Change return type and parameter type to vecs.
Change all callers.
(perform_overload_resolution): Change args parameter to vec.
Change all callers.
(build_new_function_call, build_operator_new_call): Likewise.
(add_candidates): Likewise.
(build_op_call): New globally visible function, built from and
replacing static function build_object_call.
(build_new_op): Don't handle CALL_EXPR. Build vec, not tree_list,
of arguments.
(build_op_delete_call): Build vec to pass to
cp_build_function_call_vec.
(build_temp): Build vec to pass to build_special_member_call.
(convert_like_real): Likewise.
(perform_direct_initialization_if_possible): Likewise.
(build_over_call): Handle first_arg field. Use build_call_array
rather than build_call_list.
(build_special_member_call): Change args parameter to vec. Change
all callers.
(build_new_method_call): Likewise.
* init.c (expand_default_init): Change parms to vec.
(build_raw_new_expr): Change placement and init to vecs. Change
all callers.
(build_new_1, build_new): Likewise.
* class.c (resolve_address_of_overloaded_function): Build array to
pass to fn_type_unification.
* pt.c (tsubst_copy_and_build): For NEW_EXPR build vecs to pass to
build_new. For CALL_EXPR create a vec rather than a tree_list;
expand a pack if necessary.
(fn_type_unification): Change args parameter to const tree *. Add
nargs parameter. Change all callers.
(type_unification_real): Likewise.
(unify): Build array to pass to type_unification_real.
(get_bindings): Build array to pass to fn_type_unification.
(any_type_dependent_arguments_p): Change args parameter to a vec.
Change all callers.
(make_args_non_dependent): Renamed from build_non_dependent_args.
Change return type to void. Change parameter type to vec. Change
all callers.
(do_auto_deduction): Pass an array to type_unification_real.
* semantics.c (perform_koenig_lookup): Change args to vec. Change
all callers.
(finish_call_expr): Change args to vec. Change all callers. Call
build_op_call instead of passing CALL_EXPR to build_new_op.
(cxx_omp_create_clause_info): Allocate vec to pass to
build_special_member_call.
* decl2.c (build_offset_ref_call_from_tree): Change args parameter
to vec. Change all callers.
* name-lookup.c (lookup_function_nonclass): Likewise.
(struct arg_lookup): Change args to vec.
(arg_assoc_namespace): Handle args as a vec.
(arg_assoc_args_vec): New static function.
(lookup_arg_dependent): Change args parameter to vec. Change all
callers.
* method.c (do_build_assign_ref): Allocate vec to pass to
build_special_member_call.
* except.c (build_throw): Likewise.
* typeck2.c (build_functional_cast): Likewise.
* cvt.c (ocp_convert): Likewise.
* tree.c (build_min_non_dep_call_vec): Change last parameter to
vec. Change all callers.
* cp-tree.h: Update declarations.
* name-lookup.h: Update declarations.
objc/:
* objc-act.c (objc_generate_cxx_ctor_or_dtor): Pass NULL rather
than NULL_TREE to build_special_member_call.
From-SVN: r147759
2009-05-21 07:58:39 +02:00
|
|
|
|
VEC_safe_insert (tree, gc, *args, 0, object);
|
2003-07-09 10:48:08 +02:00
|
|
|
|
/* Now that the arguments are done, transform FN. */
|
|
|
|
|
fn = build_non_dependent_expr (fn);
|
|
|
|
|
}
|
2002-08-01 06:46:23 +02:00
|
|
|
|
|
2003-07-08 03:38:44 +02:00
|
|
|
|
/* A qualified name corresponding to a bound pointer-to-member is
|
|
|
|
|
represented as an OFFSET_REF:
|
2002-08-01 06:46:23 +02:00
|
|
|
|
|
|
|
|
|
struct B { void g(); };
|
|
|
|
|
void (B::*p)();
|
|
|
|
|
void B::g() { (this->*p)(); } */
|
2003-07-09 10:48:08 +02:00
|
|
|
|
if (TREE_CODE (fn) == OFFSET_REF)
|
2002-08-01 06:46:23 +02:00
|
|
|
|
{
|
Require lvalues as specified by the standard.
* typeck.c (lvalue_or_else): Use real_lvalue_p.
(cp_build_addr_expr_1): Split out of cp_build_unary_op.
(cp_build_addr_expr, cp_build_addr_expr_strict): Interfaces.
(decay_conversion, get_member_function_from_ptrfunc): Adjust.
(build_x_unary_op, build_reinterpret_cast_1): Adjust.
(build_const_cast_1): Adjust.
* cp-tree.h: Declare new fns.
* call.c (build_this, convert_like_real, build_over_call): Adjust.
(initialize_reference): Adjust.
* class.c (build_base_path, convert_to_base_statically): Adjust.
(build_vfn_ref, resolve_address_of_overloaded_function): Adjust.
* cvt.c (build_up_reference, convert_to_reference): Adjust.
* decl.c (register_dtor_fn): Adjust.
* decl2.c (build_offset_ref_call_from_tree): Adjust.
* except.c (initialize_handler_parm): Adjust.
* init.c (build_offset_ref, build_delete, build_vec_delete): Adjust.
* rtti.c (build_dynamic_cast_1, tinfo_base_init): Adjust.
* tree.c (stabilize_expr): Adjust.
From-SVN: r164666
2010-09-27 22:05:34 +02:00
|
|
|
|
tree object_addr = cp_build_addr_expr (object, tf_warning_or_error);
|
2002-08-01 06:46:23 +02:00
|
|
|
|
fn = TREE_OPERAND (fn, 1);
|
|
|
|
|
fn = get_member_function_from_ptrfunc (&object_addr, fn);
|
tree.c (build_tree_list_vec_stat): New function.
./: * tree.c (build_tree_list_vec_stat): New function.
(ctor_to_vec): New function.
(build_nt_call_vec): New function.
(build_call_array): Change args to be a const pointer.
(build_call_vec): New function.
* tree.h (build_nt_call_vec): Declare.
(build_tree_list_vec_stat): Declare.
(build_tree_list_vec): Define.
(build_call_array): Update declaration.
(build_call_vec): Declare.
(ctor_to_vec): Declare.
* c-common.c (tree_vector_cache): New static variable.
(make_tree_vector): New function.
(release_tree_vector): New function.
(make_tree_vector_single): New function.
(make_tree_vector_copy): New function.
* c-common.h (tree_vector_cache, make_tree_vector): Declare.
(make_tree_vector_single, make_tree_vector_copy): Declare.
* c-parser.c (cached_expr_list_1, cached_expr_list_2): Remove.
(c_parser_expr_list): Don't manage cache here, instead call
make_tree_vector.
(c_parser_release_expr_list): Remove static function.
(c_parser_vec_to_tree_list): Remove static function.
(c_parser_attributes): Call build_tree_list_vec instead of
c_parser_vec_to_tree_list. Call release_tree_vector instead of
c_parser_release_expr_list.
(c_parser_postfix_expression_after_primary): Likewise.
(c_parser_objc_keywordexpr): Likewise.
cp/:
* parser.c (cp_parser_postfix_expression): Change args to a vec.
Release it when done.
(tree_vector): Define typedef. Define VEC functions.
(cp_parser_parenthesized_expression_list): Change return type to
vec. Change all callers.
(cp_parser_new_expression): Change placement and initializer to
vecs. Release them when done.
(cp_parser_new_placement): Change return type to vec. Change all
callers.
(cp_parser_new_initializer): Likewise.
* typeck.c (build_function_call_vec): Just call
cp_build_function_call_vec.
(cp_build_function_call): Just build a vec and call
cp_build_function_call_vec.
(cp_build_function_call_vec): New function based on old
cp_build_function_call.
(convert_arguments): Remove nargs and argarray parameters. Change
values to a vec. Change caller.
(build_x_compound_expr_from_vec): New function.
(cp_build_modify_expr): Build vec to pass to
build_special_member_call.
* call.c (struct z_candidate): Add first_arg field. Change args
field to vec.
(convert_class_to_reference): Handle first argument separately.
(add_candidate): Add first_arg parameter. Change args parameter
to vec. Change all callers.
(add_function_candidate, add_conv_candidate): Likewise.
(add_template_candidate_real, add_template_candidate): Likewise.
(add_template_conv_candidate): Likewise.
(build_user_type_conversion_1): Handle first argument separately.
(resolve_args): Change return type and parameter type to vecs.
Change all callers.
(perform_overload_resolution): Change args parameter to vec.
Change all callers.
(build_new_function_call, build_operator_new_call): Likewise.
(add_candidates): Likewise.
(build_op_call): New globally visible function, built from and
replacing static function build_object_call.
(build_new_op): Don't handle CALL_EXPR. Build vec, not tree_list,
of arguments.
(build_op_delete_call): Build vec to pass to
cp_build_function_call_vec.
(build_temp): Build vec to pass to build_special_member_call.
(convert_like_real): Likewise.
(perform_direct_initialization_if_possible): Likewise.
(build_over_call): Handle first_arg field. Use build_call_array
rather than build_call_list.
(build_special_member_call): Change args parameter to vec. Change
all callers.
(build_new_method_call): Likewise.
* init.c (expand_default_init): Change parms to vec.
(build_raw_new_expr): Change placement and init to vecs. Change
all callers.
(build_new_1, build_new): Likewise.
* class.c (resolve_address_of_overloaded_function): Build array to
pass to fn_type_unification.
* pt.c (tsubst_copy_and_build): For NEW_EXPR build vecs to pass to
build_new. For CALL_EXPR create a vec rather than a tree_list;
expand a pack if necessary.
(fn_type_unification): Change args parameter to const tree *. Add
nargs parameter. Change all callers.
(type_unification_real): Likewise.
(unify): Build array to pass to type_unification_real.
(get_bindings): Build array to pass to fn_type_unification.
(any_type_dependent_arguments_p): Change args parameter to a vec.
Change all callers.
(make_args_non_dependent): Renamed from build_non_dependent_args.
Change return type to void. Change parameter type to vec. Change
all callers.
(do_auto_deduction): Pass an array to type_unification_real.
* semantics.c (perform_koenig_lookup): Change args to vec. Change
all callers.
(finish_call_expr): Change args to vec. Change all callers. Call
build_op_call instead of passing CALL_EXPR to build_new_op.
(cxx_omp_create_clause_info): Allocate vec to pass to
build_special_member_call.
* decl2.c (build_offset_ref_call_from_tree): Change args parameter
to vec. Change all callers.
* name-lookup.c (lookup_function_nonclass): Likewise.
(struct arg_lookup): Change args to vec.
(arg_assoc_namespace): Handle args as a vec.
(arg_assoc_args_vec): New static function.
(lookup_arg_dependent): Change args parameter to vec. Change all
callers.
* method.c (do_build_assign_ref): Allocate vec to pass to
build_special_member_call.
* except.c (build_throw): Likewise.
* typeck2.c (build_functional_cast): Likewise.
* cvt.c (ocp_convert): Likewise.
* tree.c (build_min_non_dep_call_vec): Change last parameter to
vec. Change all callers.
* cp-tree.h: Update declarations.
* name-lookup.h: Update declarations.
objc/:
* objc-act.c (objc_generate_cxx_ctor_or_dtor): Pass NULL rather
than NULL_TREE to build_special_member_call.
From-SVN: r147759
2009-05-21 07:58:39 +02:00
|
|
|
|
VEC_safe_insert (tree, gc, *args, 0, object_addr);
|
2002-08-01 06:46:23 +02:00
|
|
|
|
}
|
|
|
|
|
|
tree.c (build_tree_list_vec_stat): New function.
./: * tree.c (build_tree_list_vec_stat): New function.
(ctor_to_vec): New function.
(build_nt_call_vec): New function.
(build_call_array): Change args to be a const pointer.
(build_call_vec): New function.
* tree.h (build_nt_call_vec): Declare.
(build_tree_list_vec_stat): Declare.
(build_tree_list_vec): Define.
(build_call_array): Update declaration.
(build_call_vec): Declare.
(ctor_to_vec): Declare.
* c-common.c (tree_vector_cache): New static variable.
(make_tree_vector): New function.
(release_tree_vector): New function.
(make_tree_vector_single): New function.
(make_tree_vector_copy): New function.
* c-common.h (tree_vector_cache, make_tree_vector): Declare.
(make_tree_vector_single, make_tree_vector_copy): Declare.
* c-parser.c (cached_expr_list_1, cached_expr_list_2): Remove.
(c_parser_expr_list): Don't manage cache here, instead call
make_tree_vector.
(c_parser_release_expr_list): Remove static function.
(c_parser_vec_to_tree_list): Remove static function.
(c_parser_attributes): Call build_tree_list_vec instead of
c_parser_vec_to_tree_list. Call release_tree_vector instead of
c_parser_release_expr_list.
(c_parser_postfix_expression_after_primary): Likewise.
(c_parser_objc_keywordexpr): Likewise.
cp/:
* parser.c (cp_parser_postfix_expression): Change args to a vec.
Release it when done.
(tree_vector): Define typedef. Define VEC functions.
(cp_parser_parenthesized_expression_list): Change return type to
vec. Change all callers.
(cp_parser_new_expression): Change placement and initializer to
vecs. Release them when done.
(cp_parser_new_placement): Change return type to vec. Change all
callers.
(cp_parser_new_initializer): Likewise.
* typeck.c (build_function_call_vec): Just call
cp_build_function_call_vec.
(cp_build_function_call): Just build a vec and call
cp_build_function_call_vec.
(cp_build_function_call_vec): New function based on old
cp_build_function_call.
(convert_arguments): Remove nargs and argarray parameters. Change
values to a vec. Change caller.
(build_x_compound_expr_from_vec): New function.
(cp_build_modify_expr): Build vec to pass to
build_special_member_call.
* call.c (struct z_candidate): Add first_arg field. Change args
field to vec.
(convert_class_to_reference): Handle first argument separately.
(add_candidate): Add first_arg parameter. Change args parameter
to vec. Change all callers.
(add_function_candidate, add_conv_candidate): Likewise.
(add_template_candidate_real, add_template_candidate): Likewise.
(add_template_conv_candidate): Likewise.
(build_user_type_conversion_1): Handle first argument separately.
(resolve_args): Change return type and parameter type to vecs.
Change all callers.
(perform_overload_resolution): Change args parameter to vec.
Change all callers.
(build_new_function_call, build_operator_new_call): Likewise.
(add_candidates): Likewise.
(build_op_call): New globally visible function, built from and
replacing static function build_object_call.
(build_new_op): Don't handle CALL_EXPR. Build vec, not tree_list,
of arguments.
(build_op_delete_call): Build vec to pass to
cp_build_function_call_vec.
(build_temp): Build vec to pass to build_special_member_call.
(convert_like_real): Likewise.
(perform_direct_initialization_if_possible): Likewise.
(build_over_call): Handle first_arg field. Use build_call_array
rather than build_call_list.
(build_special_member_call): Change args parameter to vec. Change
all callers.
(build_new_method_call): Likewise.
* init.c (expand_default_init): Change parms to vec.
(build_raw_new_expr): Change placement and init to vecs. Change
all callers.
(build_new_1, build_new): Likewise.
* class.c (resolve_address_of_overloaded_function): Build array to
pass to fn_type_unification.
* pt.c (tsubst_copy_and_build): For NEW_EXPR build vecs to pass to
build_new. For CALL_EXPR create a vec rather than a tree_list;
expand a pack if necessary.
(fn_type_unification): Change args parameter to const tree *. Add
nargs parameter. Change all callers.
(type_unification_real): Likewise.
(unify): Build array to pass to type_unification_real.
(get_bindings): Build array to pass to fn_type_unification.
(any_type_dependent_arguments_p): Change args parameter to a vec.
Change all callers.
(make_args_non_dependent): Renamed from build_non_dependent_args.
Change return type to void. Change parameter type to vec. Change
all callers.
(do_auto_deduction): Pass an array to type_unification_real.
* semantics.c (perform_koenig_lookup): Change args to vec. Change
all callers.
(finish_call_expr): Change args to vec. Change all callers. Call
build_op_call instead of passing CALL_EXPR to build_new_op.
(cxx_omp_create_clause_info): Allocate vec to pass to
build_special_member_call.
* decl2.c (build_offset_ref_call_from_tree): Change args parameter
to vec. Change all callers.
* name-lookup.c (lookup_function_nonclass): Likewise.
(struct arg_lookup): Change args to vec.
(arg_assoc_namespace): Handle args as a vec.
(arg_assoc_args_vec): New static function.
(lookup_arg_dependent): Change args parameter to vec. Change all
callers.
* method.c (do_build_assign_ref): Allocate vec to pass to
build_special_member_call.
* except.c (build_throw): Likewise.
* typeck2.c (build_functional_cast): Likewise.
* cvt.c (ocp_convert): Likewise.
* tree.c (build_min_non_dep_call_vec): Change last parameter to
vec. Change all callers.
* cp-tree.h: Update declarations.
* name-lookup.h: Update declarations.
objc/:
* objc-act.c (objc_generate_cxx_ctor_or_dtor): Pass NULL rather
than NULL_TREE to build_special_member_call.
From-SVN: r147759
2009-05-21 07:58:39 +02:00
|
|
|
|
expr = cp_build_function_call_vec (fn, args, tf_warning_or_error);
|
2003-07-09 10:48:08 +02:00
|
|
|
|
if (processing_template_decl && expr != error_mark_node)
|
tree.c (build_tree_list_vec_stat): New function.
./: * tree.c (build_tree_list_vec_stat): New function.
(ctor_to_vec): New function.
(build_nt_call_vec): New function.
(build_call_array): Change args to be a const pointer.
(build_call_vec): New function.
* tree.h (build_nt_call_vec): Declare.
(build_tree_list_vec_stat): Declare.
(build_tree_list_vec): Define.
(build_call_array): Update declaration.
(build_call_vec): Declare.
(ctor_to_vec): Declare.
* c-common.c (tree_vector_cache): New static variable.
(make_tree_vector): New function.
(release_tree_vector): New function.
(make_tree_vector_single): New function.
(make_tree_vector_copy): New function.
* c-common.h (tree_vector_cache, make_tree_vector): Declare.
(make_tree_vector_single, make_tree_vector_copy): Declare.
* c-parser.c (cached_expr_list_1, cached_expr_list_2): Remove.
(c_parser_expr_list): Don't manage cache here, instead call
make_tree_vector.
(c_parser_release_expr_list): Remove static function.
(c_parser_vec_to_tree_list): Remove static function.
(c_parser_attributes): Call build_tree_list_vec instead of
c_parser_vec_to_tree_list. Call release_tree_vector instead of
c_parser_release_expr_list.
(c_parser_postfix_expression_after_primary): Likewise.
(c_parser_objc_keywordexpr): Likewise.
cp/:
* parser.c (cp_parser_postfix_expression): Change args to a vec.
Release it when done.
(tree_vector): Define typedef. Define VEC functions.
(cp_parser_parenthesized_expression_list): Change return type to
vec. Change all callers.
(cp_parser_new_expression): Change placement and initializer to
vecs. Release them when done.
(cp_parser_new_placement): Change return type to vec. Change all
callers.
(cp_parser_new_initializer): Likewise.
* typeck.c (build_function_call_vec): Just call
cp_build_function_call_vec.
(cp_build_function_call): Just build a vec and call
cp_build_function_call_vec.
(cp_build_function_call_vec): New function based on old
cp_build_function_call.
(convert_arguments): Remove nargs and argarray parameters. Change
values to a vec. Change caller.
(build_x_compound_expr_from_vec): New function.
(cp_build_modify_expr): Build vec to pass to
build_special_member_call.
* call.c (struct z_candidate): Add first_arg field. Change args
field to vec.
(convert_class_to_reference): Handle first argument separately.
(add_candidate): Add first_arg parameter. Change args parameter
to vec. Change all callers.
(add_function_candidate, add_conv_candidate): Likewise.
(add_template_candidate_real, add_template_candidate): Likewise.
(add_template_conv_candidate): Likewise.
(build_user_type_conversion_1): Handle first argument separately.
(resolve_args): Change return type and parameter type to vecs.
Change all callers.
(perform_overload_resolution): Change args parameter to vec.
Change all callers.
(build_new_function_call, build_operator_new_call): Likewise.
(add_candidates): Likewise.
(build_op_call): New globally visible function, built from and
replacing static function build_object_call.
(build_new_op): Don't handle CALL_EXPR. Build vec, not tree_list,
of arguments.
(build_op_delete_call): Build vec to pass to
cp_build_function_call_vec.
(build_temp): Build vec to pass to build_special_member_call.
(convert_like_real): Likewise.
(perform_direct_initialization_if_possible): Likewise.
(build_over_call): Handle first_arg field. Use build_call_array
rather than build_call_list.
(build_special_member_call): Change args parameter to vec. Change
all callers.
(build_new_method_call): Likewise.
* init.c (expand_default_init): Change parms to vec.
(build_raw_new_expr): Change placement and init to vecs. Change
all callers.
(build_new_1, build_new): Likewise.
* class.c (resolve_address_of_overloaded_function): Build array to
pass to fn_type_unification.
* pt.c (tsubst_copy_and_build): For NEW_EXPR build vecs to pass to
build_new. For CALL_EXPR create a vec rather than a tree_list;
expand a pack if necessary.
(fn_type_unification): Change args parameter to const tree *. Add
nargs parameter. Change all callers.
(type_unification_real): Likewise.
(unify): Build array to pass to type_unification_real.
(get_bindings): Build array to pass to fn_type_unification.
(any_type_dependent_arguments_p): Change args parameter to a vec.
Change all callers.
(make_args_non_dependent): Renamed from build_non_dependent_args.
Change return type to void. Change parameter type to vec. Change
all callers.
(do_auto_deduction): Pass an array to type_unification_real.
* semantics.c (perform_koenig_lookup): Change args to vec. Change
all callers.
(finish_call_expr): Change args to vec. Change all callers. Call
build_op_call instead of passing CALL_EXPR to build_new_op.
(cxx_omp_create_clause_info): Allocate vec to pass to
build_special_member_call.
* decl2.c (build_offset_ref_call_from_tree): Change args parameter
to vec. Change all callers.
* name-lookup.c (lookup_function_nonclass): Likewise.
(struct arg_lookup): Change args to vec.
(arg_assoc_namespace): Handle args as a vec.
(arg_assoc_args_vec): New static function.
(lookup_arg_dependent): Change args parameter to vec. Change all
callers.
* method.c (do_build_assign_ref): Allocate vec to pass to
build_special_member_call.
* except.c (build_throw): Likewise.
* typeck2.c (build_functional_cast): Likewise.
* cvt.c (ocp_convert): Likewise.
* tree.c (build_min_non_dep_call_vec): Change last parameter to
vec. Change all callers.
* cp-tree.h: Update declarations.
* name-lookup.h: Update declarations.
objc/:
* objc-act.c (objc_generate_cxx_ctor_or_dtor): Pass NULL rather
than NULL_TREE to build_special_member_call.
From-SVN: r147759
2009-05-21 07:58:39 +02:00
|
|
|
|
expr = build_min_non_dep_call_vec (expr, orig_fn, orig_args);
|
|
|
|
|
|
|
|
|
|
if (orig_args != NULL)
|
|
|
|
|
release_tree_vector (orig_args);
|
|
|
|
|
|
2003-07-09 10:48:08 +02:00
|
|
|
|
return expr;
|
2002-08-01 06:46:23 +02:00
|
|
|
|
}
|
2005-06-14 22:01:59 +02:00
|
|
|
|
|
1995-10-12 03:33:51 +01:00
|
|
|
|
|
|
|
|
|
void
|
Remove traditional C constructs 4/n.
* decl2.c (grok_method_quals, warn_if_unknown_interface,
grok_x_components, cp_build_parm_decl, build_artificial_parm,
maybe_retrofit_in_chrg, grokclassfn, grok_array_decl,
delete_sanity, check_member_template, check_java_method,
check_classfn, finish_static_data_member_decl, grokfield,
grokbitfield, grokoptypename, grok_function_init,
cplus_decl_attributes, constructor_name, defer_fn,
build_anon_union_vars, finish_anon_union, coerce_new_type,
coerce_delete_type, comdat_linkage, maybe_make_one_only,
key_method, import_export_vtable, import_export_class,
output_vtable_inherit, import_export_decl, import_export_tinfo,
build_cleanup, get_guard, get_guard_bits, get_guard_cond,
set_guard, start_objects, finish_objects,
start_static_storage_duration_function,
finish_static_storage_duration_function, get_priority_info,
start_static_initialization_or_destruction,
finish_static_initialization_or_destruction,
do_static_initialization, do_static_destruction,
prune_vars_needing_no_initialization, write_out_vars,
reparse_decl_as_expr, finish_decl_parsing, namespace_ancestor,
add_using_namespace, merge_functions, ambiguous_decl,
lookup_using_namespace, lookup_using_namespace,
qualified_lookup_using_namespace, set_decl_namespace,
decl_namespace, current_decl_namespace, push_decl_namespace,
pop_decl_namespace, push_scope, pop_scope, add_function,
arg_assoc_namespace, arg_assoc_template_arg, arg_assoc,
lookup_arg_dependent, do_namespace_alias,
validate_nonmember_using_decl, do_nonmember_using_decl,
do_toplevel_using_decl, do_local_using_decl,
do_class_using_decl, do_using_directive, check_default_args,
mark_used, handle_class_head): Use C90 prototypings. Use booleans.
* parser.c (cp_parser_class_head): Use booleanss.
* decl.c (walk_globals, walk_vtables): Likewise.
* cp-tree.h (walk_globals_pred, walk_globals_fn, walk_vtables,
walk_globals): Change return type from 'int' to 'bool'.
* rtti.c (init_rtti_processing, build_headof, throw_bad_cast
throw_bad_typeid, get_tinfo_decl_dynamic, typeid_ok_p,
build_typeid, tinfo_name, get_tinfo_decl, get_tinfo_ptr,
get_typeid, ifnonnull, build_dynamic_cast_1, build_dynamic_cast,
qualifier_flags, tinfo_base_init, generic_initializer,
ptr_initializer, dfs_class_hint_mark, ptm_initializer,
dfs_class_hint_unmark, class_hint_flags, class_initializer,
typeinfo_in_lib_p, get_pseudo_ti_init, create_pseudo_type_info,
get_pseudo_ti_desc, create_tinfo_types, emit_support_tinfos,
unemitted_tinfo_decl_p, emit_tinfo_decl): Likewise.
* repo.c (repo_compile_flags, repo_template_declared,
repo_template_defined, repo_class_defined, repo_get_id,
repo_template_used, repo_vtable_used, repo_inline_used,
repo_tinfo_used, repo_template_instantiated, extract_string,
open_repo_file, afgets, init_repo, reopen_repo_file_for_write,
finish_repo): Likewise.
* ptree.c (cxx_print_decl, cxx_print_type, cxx_print_identifier,
cxx_print_xnode): Likewise..
* cp-lang.c (ok_to_generate_alias_set_for_type, cxx_get_alias_set,
cxx_warn_unused_global_decl, cp_expr_size): Likewise.
* cxxfilt.c (demangle_it, print_demangler_list, usage,
standard_symbol_characters, hp_symbol_characters, main, fatal):
Likewise.
(strip_underscore): Change type from 'int' to 'bool'.
(main): Use boolean constants.
From-SVN: r60601
2002-12-29 15:53:05 +01:00
|
|
|
|
check_default_args (tree x)
|
1995-10-12 03:33:51 +01:00
|
|
|
|
{
|
|
|
|
|
tree arg = TYPE_ARG_TYPES (TREE_TYPE (x));
|
Remove traditional C constructs 4/n.
* decl2.c (grok_method_quals, warn_if_unknown_interface,
grok_x_components, cp_build_parm_decl, build_artificial_parm,
maybe_retrofit_in_chrg, grokclassfn, grok_array_decl,
delete_sanity, check_member_template, check_java_method,
check_classfn, finish_static_data_member_decl, grokfield,
grokbitfield, grokoptypename, grok_function_init,
cplus_decl_attributes, constructor_name, defer_fn,
build_anon_union_vars, finish_anon_union, coerce_new_type,
coerce_delete_type, comdat_linkage, maybe_make_one_only,
key_method, import_export_vtable, import_export_class,
output_vtable_inherit, import_export_decl, import_export_tinfo,
build_cleanup, get_guard, get_guard_bits, get_guard_cond,
set_guard, start_objects, finish_objects,
start_static_storage_duration_function,
finish_static_storage_duration_function, get_priority_info,
start_static_initialization_or_destruction,
finish_static_initialization_or_destruction,
do_static_initialization, do_static_destruction,
prune_vars_needing_no_initialization, write_out_vars,
reparse_decl_as_expr, finish_decl_parsing, namespace_ancestor,
add_using_namespace, merge_functions, ambiguous_decl,
lookup_using_namespace, lookup_using_namespace,
qualified_lookup_using_namespace, set_decl_namespace,
decl_namespace, current_decl_namespace, push_decl_namespace,
pop_decl_namespace, push_scope, pop_scope, add_function,
arg_assoc_namespace, arg_assoc_template_arg, arg_assoc,
lookup_arg_dependent, do_namespace_alias,
validate_nonmember_using_decl, do_nonmember_using_decl,
do_toplevel_using_decl, do_local_using_decl,
do_class_using_decl, do_using_directive, check_default_args,
mark_used, handle_class_head): Use C90 prototypings. Use booleans.
* parser.c (cp_parser_class_head): Use booleanss.
* decl.c (walk_globals, walk_vtables): Likewise.
* cp-tree.h (walk_globals_pred, walk_globals_fn, walk_vtables,
walk_globals): Change return type from 'int' to 'bool'.
* rtti.c (init_rtti_processing, build_headof, throw_bad_cast
throw_bad_typeid, get_tinfo_decl_dynamic, typeid_ok_p,
build_typeid, tinfo_name, get_tinfo_decl, get_tinfo_ptr,
get_typeid, ifnonnull, build_dynamic_cast_1, build_dynamic_cast,
qualifier_flags, tinfo_base_init, generic_initializer,
ptr_initializer, dfs_class_hint_mark, ptm_initializer,
dfs_class_hint_unmark, class_hint_flags, class_initializer,
typeinfo_in_lib_p, get_pseudo_ti_init, create_pseudo_type_info,
get_pseudo_ti_desc, create_tinfo_types, emit_support_tinfos,
unemitted_tinfo_decl_p, emit_tinfo_decl): Likewise.
* repo.c (repo_compile_flags, repo_template_declared,
repo_template_defined, repo_class_defined, repo_get_id,
repo_template_used, repo_vtable_used, repo_inline_used,
repo_tinfo_used, repo_template_instantiated, extract_string,
open_repo_file, afgets, init_repo, reopen_repo_file_for_write,
finish_repo): Likewise.
* ptree.c (cxx_print_decl, cxx_print_type, cxx_print_identifier,
cxx_print_xnode): Likewise..
* cp-lang.c (ok_to_generate_alias_set_for_type, cxx_get_alias_set,
cxx_warn_unused_global_decl, cp_expr_size): Likewise.
* cxxfilt.c (demangle_it, print_demangler_list, usage,
standard_symbol_characters, hp_symbol_characters, main, fatal):
Likewise.
(strip_underscore): Change type from 'int' to 'bool'.
(main): Use boolean constants.
From-SVN: r60601
2002-12-29 15:53:05 +01:00
|
|
|
|
bool saw_def = false;
|
|
|
|
|
int i = 0 - (TREE_CODE (TREE_TYPE (x)) == METHOD_TYPE);
|
1995-10-12 03:33:51 +01:00
|
|
|
|
for (; arg && arg != void_list_node; arg = TREE_CHAIN (arg), ++i)
|
|
|
|
|
{
|
|
|
|
|
if (TREE_PURPOSE (arg))
|
Remove traditional C constructs 4/n.
* decl2.c (grok_method_quals, warn_if_unknown_interface,
grok_x_components, cp_build_parm_decl, build_artificial_parm,
maybe_retrofit_in_chrg, grokclassfn, grok_array_decl,
delete_sanity, check_member_template, check_java_method,
check_classfn, finish_static_data_member_decl, grokfield,
grokbitfield, grokoptypename, grok_function_init,
cplus_decl_attributes, constructor_name, defer_fn,
build_anon_union_vars, finish_anon_union, coerce_new_type,
coerce_delete_type, comdat_linkage, maybe_make_one_only,
key_method, import_export_vtable, import_export_class,
output_vtable_inherit, import_export_decl, import_export_tinfo,
build_cleanup, get_guard, get_guard_bits, get_guard_cond,
set_guard, start_objects, finish_objects,
start_static_storage_duration_function,
finish_static_storage_duration_function, get_priority_info,
start_static_initialization_or_destruction,
finish_static_initialization_or_destruction,
do_static_initialization, do_static_destruction,
prune_vars_needing_no_initialization, write_out_vars,
reparse_decl_as_expr, finish_decl_parsing, namespace_ancestor,
add_using_namespace, merge_functions, ambiguous_decl,
lookup_using_namespace, lookup_using_namespace,
qualified_lookup_using_namespace, set_decl_namespace,
decl_namespace, current_decl_namespace, push_decl_namespace,
pop_decl_namespace, push_scope, pop_scope, add_function,
arg_assoc_namespace, arg_assoc_template_arg, arg_assoc,
lookup_arg_dependent, do_namespace_alias,
validate_nonmember_using_decl, do_nonmember_using_decl,
do_toplevel_using_decl, do_local_using_decl,
do_class_using_decl, do_using_directive, check_default_args,
mark_used, handle_class_head): Use C90 prototypings. Use booleans.
* parser.c (cp_parser_class_head): Use booleanss.
* decl.c (walk_globals, walk_vtables): Likewise.
* cp-tree.h (walk_globals_pred, walk_globals_fn, walk_vtables,
walk_globals): Change return type from 'int' to 'bool'.
* rtti.c (init_rtti_processing, build_headof, throw_bad_cast
throw_bad_typeid, get_tinfo_decl_dynamic, typeid_ok_p,
build_typeid, tinfo_name, get_tinfo_decl, get_tinfo_ptr,
get_typeid, ifnonnull, build_dynamic_cast_1, build_dynamic_cast,
qualifier_flags, tinfo_base_init, generic_initializer,
ptr_initializer, dfs_class_hint_mark, ptm_initializer,
dfs_class_hint_unmark, class_hint_flags, class_initializer,
typeinfo_in_lib_p, get_pseudo_ti_init, create_pseudo_type_info,
get_pseudo_ti_desc, create_tinfo_types, emit_support_tinfos,
unemitted_tinfo_decl_p, emit_tinfo_decl): Likewise.
* repo.c (repo_compile_flags, repo_template_declared,
repo_template_defined, repo_class_defined, repo_get_id,
repo_template_used, repo_vtable_used, repo_inline_used,
repo_tinfo_used, repo_template_instantiated, extract_string,
open_repo_file, afgets, init_repo, reopen_repo_file_for_write,
finish_repo): Likewise.
* ptree.c (cxx_print_decl, cxx_print_type, cxx_print_identifier,
cxx_print_xnode): Likewise..
* cp-lang.c (ok_to_generate_alias_set_for_type, cxx_get_alias_set,
cxx_warn_unused_global_decl, cp_expr_size): Likewise.
* cxxfilt.c (demangle_it, print_demangler_list, usage,
standard_symbol_characters, hp_symbol_characters, main, fatal):
Likewise.
(strip_underscore): Change type from 'int' to 'bool'.
(main): Use boolean constants.
From-SVN: r60601
2002-12-29 15:53:05 +01:00
|
|
|
|
saw_def = true;
|
1995-10-12 03:33:51 +01:00
|
|
|
|
else if (saw_def)
|
|
|
|
|
{
|
toplev.c (default_tree_printer): Handle setting location with '+' flag.
2005-07-02 Zack Weinberg <zack@codesourcery.com>
Joseph S. Myers <joseph@codesourcery.com>
* toplev.c (default_tree_printer): Handle setting location with
'+' flag.
* c-objc.common.c (c_tree_printer): Likewise.
* c-format.c (gcc_diag_flag_specs): Add '+'.
(gcc_cdiag_char_table): Allow '+' flag for tree formats.
(format_types_orig): Allow '+' flag for gcc_diag and gcc_cdiag
formats.
* c-common.c, c-decl.c, c-objc-common.c, c-pragma.c,
config/arm/pe.c, config/i386/winnt.c, config/ia64/ia64.c,
config/mcore/mcore.c, config/sh/symbian.c, config/sol2.c,
config/v850/v850.c, function.c, stor-layout.c, toplev.c,
tree-inline.c, tree-optimize.c, tree.c, varasm.c: Use '+' flag
instead of %J or %H. Use 'q' flag for quoting. Avoid '.' at end
of diagnostics. Use %q+D not %s for a decl. Do not pass excess
format arguments where %J is used without %D.
cp:
* error.c (location_of): Add comment.
(locate_error, cp_error_at, cp_warning_at, cp_pedwarn_at): Remove.
* cp-tree.h (cp_error_at, cp_warning_at, cp_pedwarn_at): Remove.
* call.c, class.c, decl.c, decl2.c, friend.c, init.c,
name-lookup.c, parser.c, pt.c, search.c, semantics.c, typeck.c,
typeck2.c: Use '+' flag instead of %J, cp_error_at, cp_warning_at
or cp_pedwarn_at. Mark up some diagnostic strings with N_.
java:
* class.c, decl.c, expr.c: Use '+' flag instead of %J. Use 'q'
flag for quoting.
objc:
* objc-act.c: Use '+' flag instead of %J. Use 'q' flag for
quoting.
testsuite:
* gcc.dg/format/gcc_diag-1.c: Update.
From-SVN: r101532
2005-07-02 12:55:32 +02:00
|
|
|
|
error ("default argument missing for parameter %P of %q+#D", i, x);
|
2006-01-19 10:51:57 +01:00
|
|
|
|
TREE_PURPOSE (arg) = error_mark_node;
|
1995-10-12 03:33:51 +01:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
1995-12-19 07:51:14 +01:00
|
|
|
|
|
2008-07-25 23:03:34 +02:00
|
|
|
|
/* Return true if function DECL can be inlined. This is used to force
|
|
|
|
|
instantiation of methods that might be interesting for inlining. */
|
|
|
|
|
bool
|
|
|
|
|
possibly_inlined_p (tree decl)
|
|
|
|
|
{
|
|
|
|
|
gcc_assert (TREE_CODE (decl) == FUNCTION_DECL);
|
|
|
|
|
if (DECL_UNINLINABLE (decl))
|
|
|
|
|
return false;
|
2009-03-26 16:17:26 +01:00
|
|
|
|
if (!optimize || pragma_java_exceptions)
|
2008-07-25 23:03:34 +02:00
|
|
|
|
return DECL_DECLARED_INLINE_P (decl);
|
|
|
|
|
/* When optimizing, we might inline everything when flatten
|
|
|
|
|
attribute or heuristics inlining for size or autoinlining
|
|
|
|
|
is used. */
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
2006-01-02 18:53:44 +01:00
|
|
|
|
/* Mark DECL (either a _DECL or a BASELINK) as "used" in the program.
|
2005-12-23 08:40:04 +01:00
|
|
|
|
If DECL is a specialization or implicitly declared class member,
|
|
|
|
|
generate the actual definition. */
|
2005-09-08 20:56:42 +02:00
|
|
|
|
|
1995-12-19 07:51:14 +01:00
|
|
|
|
void
|
Remove traditional C constructs 4/n.
* decl2.c (grok_method_quals, warn_if_unknown_interface,
grok_x_components, cp_build_parm_decl, build_artificial_parm,
maybe_retrofit_in_chrg, grokclassfn, grok_array_decl,
delete_sanity, check_member_template, check_java_method,
check_classfn, finish_static_data_member_decl, grokfield,
grokbitfield, grokoptypename, grok_function_init,
cplus_decl_attributes, constructor_name, defer_fn,
build_anon_union_vars, finish_anon_union, coerce_new_type,
coerce_delete_type, comdat_linkage, maybe_make_one_only,
key_method, import_export_vtable, import_export_class,
output_vtable_inherit, import_export_decl, import_export_tinfo,
build_cleanup, get_guard, get_guard_bits, get_guard_cond,
set_guard, start_objects, finish_objects,
start_static_storage_duration_function,
finish_static_storage_duration_function, get_priority_info,
start_static_initialization_or_destruction,
finish_static_initialization_or_destruction,
do_static_initialization, do_static_destruction,
prune_vars_needing_no_initialization, write_out_vars,
reparse_decl_as_expr, finish_decl_parsing, namespace_ancestor,
add_using_namespace, merge_functions, ambiguous_decl,
lookup_using_namespace, lookup_using_namespace,
qualified_lookup_using_namespace, set_decl_namespace,
decl_namespace, current_decl_namespace, push_decl_namespace,
pop_decl_namespace, push_scope, pop_scope, add_function,
arg_assoc_namespace, arg_assoc_template_arg, arg_assoc,
lookup_arg_dependent, do_namespace_alias,
validate_nonmember_using_decl, do_nonmember_using_decl,
do_toplevel_using_decl, do_local_using_decl,
do_class_using_decl, do_using_directive, check_default_args,
mark_used, handle_class_head): Use C90 prototypings. Use booleans.
* parser.c (cp_parser_class_head): Use booleanss.
* decl.c (walk_globals, walk_vtables): Likewise.
* cp-tree.h (walk_globals_pred, walk_globals_fn, walk_vtables,
walk_globals): Change return type from 'int' to 'bool'.
* rtti.c (init_rtti_processing, build_headof, throw_bad_cast
throw_bad_typeid, get_tinfo_decl_dynamic, typeid_ok_p,
build_typeid, tinfo_name, get_tinfo_decl, get_tinfo_ptr,
get_typeid, ifnonnull, build_dynamic_cast_1, build_dynamic_cast,
qualifier_flags, tinfo_base_init, generic_initializer,
ptr_initializer, dfs_class_hint_mark, ptm_initializer,
dfs_class_hint_unmark, class_hint_flags, class_initializer,
typeinfo_in_lib_p, get_pseudo_ti_init, create_pseudo_type_info,
get_pseudo_ti_desc, create_tinfo_types, emit_support_tinfos,
unemitted_tinfo_decl_p, emit_tinfo_decl): Likewise.
* repo.c (repo_compile_flags, repo_template_declared,
repo_template_defined, repo_class_defined, repo_get_id,
repo_template_used, repo_vtable_used, repo_inline_used,
repo_tinfo_used, repo_template_instantiated, extract_string,
open_repo_file, afgets, init_repo, reopen_repo_file_for_write,
finish_repo): Likewise.
* ptree.c (cxx_print_decl, cxx_print_type, cxx_print_identifier,
cxx_print_xnode): Likewise..
* cp-lang.c (ok_to_generate_alias_set_for_type, cxx_get_alias_set,
cxx_warn_unused_global_decl, cp_expr_size): Likewise.
* cxxfilt.c (demangle_it, print_demangler_list, usage,
standard_symbol_characters, hp_symbol_characters, main, fatal):
Likewise.
(strip_underscore): Change type from 'int' to 'bool'.
(main): Use boolean constants.
From-SVN: r60601
2002-12-29 15:53:05 +01:00
|
|
|
|
mark_used (tree decl)
|
1995-12-19 07:51:14 +01:00
|
|
|
|
{
|
2005-12-23 08:40:04 +01:00
|
|
|
|
/* If DECL is a BASELINK for a single function, then treat it just
|
|
|
|
|
like the DECL for the function. Otherwise, if the BASELINK is
|
|
|
|
|
for an overloaded function, we don't know which function was
|
|
|
|
|
actually used until after overload resolution. */
|
|
|
|
|
if (TREE_CODE (decl) == BASELINK)
|
|
|
|
|
{
|
|
|
|
|
decl = BASELINK_FUNCTIONS (decl);
|
|
|
|
|
if (really_overloaded_fn (decl))
|
|
|
|
|
return;
|
|
|
|
|
decl = OVL_CURRENT (decl);
|
|
|
|
|
}
|
|
|
|
|
|
2009-08-24 23:31:54 +02:00
|
|
|
|
/* Set TREE_USED for the benefit of -Wunused. */
|
|
|
|
|
TREE_USED (decl) = 1;
|
|
|
|
|
if (DECL_CLONED_FUNCTION_P (decl))
|
|
|
|
|
TREE_USED (DECL_CLONED_FUNCTION (decl)) = 1;
|
|
|
|
|
|
2008-09-03 06:10:27 +02:00
|
|
|
|
if (TREE_CODE (decl) == FUNCTION_DECL
|
|
|
|
|
&& DECL_DELETED_FN (decl))
|
|
|
|
|
{
|
2010-03-23 23:29:53 +01:00
|
|
|
|
if (DECL_ARTIFICIAL (decl))
|
|
|
|
|
{
|
|
|
|
|
if (DECL_OVERLOADED_OPERATOR_P (decl) == TYPE_EXPR
|
|
|
|
|
&& LAMBDA_TYPE_P (DECL_CONTEXT (decl)))
|
|
|
|
|
{
|
|
|
|
|
/* We mark a lambda conversion op as deleted if we can't
|
|
|
|
|
generate it properly; see maybe_add_lambda_conv_op. */
|
|
|
|
|
sorry ("converting lambda which uses %<...%> to "
|
|
|
|
|
"function pointer");
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
}
|
2010-06-30 02:51:13 +02:00
|
|
|
|
error ("use of deleted function %qD", decl);
|
|
|
|
|
if (!maybe_explain_implicit_delete (decl))
|
|
|
|
|
error_at (DECL_SOURCE_LOCATION (decl), "declared here");
|
2009-06-09 20:18:45 +02:00
|
|
|
|
return;
|
2008-09-03 06:10:27 +02:00
|
|
|
|
}
|
2008-09-03 22:33:21 +02:00
|
|
|
|
|
2009-08-24 23:31:54 +02:00
|
|
|
|
/* We can only check DECL_ODR_USED on variables or functions with
|
|
|
|
|
DECL_LANG_SPECIFIC set, and these are also the only decls that we
|
|
|
|
|
might need special handling for. */
|
|
|
|
|
if ((TREE_CODE (decl) != VAR_DECL && TREE_CODE (decl) != FUNCTION_DECL)
|
2009-08-24 23:32:12 +02:00
|
|
|
|
|| DECL_LANG_SPECIFIC (decl) == NULL
|
|
|
|
|
|| DECL_THUNK_P (decl))
|
2009-08-24 23:31:54 +02:00
|
|
|
|
return;
|
|
|
|
|
|
2009-08-16 19:42:56 +02:00
|
|
|
|
/* We only want to do this processing once. We don't need to keep trying
|
|
|
|
|
to instantiate inline templates, because unit-at-a-time will make sure
|
|
|
|
|
we get them compiled before functions that want to inline them. */
|
2009-08-24 23:31:54 +02:00
|
|
|
|
if (DECL_ODR_USED (decl))
|
2009-08-16 19:42:56 +02:00
|
|
|
|
return;
|
|
|
|
|
|
2008-09-03 22:33:21 +02:00
|
|
|
|
/* If within finish_function, defer the rest until that function
|
|
|
|
|
finishes, otherwise it might recurse. */
|
|
|
|
|
if (defer_mark_used_calls)
|
|
|
|
|
{
|
|
|
|
|
VEC_safe_push (tree, gc, deferred_mark_used_calls, decl);
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
2010-11-02 02:30:39 +01:00
|
|
|
|
/* Normally, we can wait until instantiation-time to synthesize DECL.
|
|
|
|
|
However, if DECL is a static data member initialized with a constant
|
|
|
|
|
or a constexpr function, we need it right now because a reference to
|
|
|
|
|
such a data member or a call to such function is not value-dependent. */
|
|
|
|
|
if ((decl_maybe_constant_var_p (decl)
|
|
|
|
|
|| (TREE_CODE (decl) == FUNCTION_DECL
|
|
|
|
|
&& DECL_DECLARED_CONSTEXPR_P (decl)))
|
|
|
|
|
&& !DECL_INITIAL (decl)
|
|
|
|
|
&& DECL_LANG_SPECIFIC (decl)
|
|
|
|
|
&& DECL_TEMPLATE_INSTANTIATION (decl))
|
2005-10-17 01:17:53 +02:00
|
|
|
|
{
|
2010-11-02 02:30:39 +01:00
|
|
|
|
/* Instantiating a function will result in garbage collection. We
|
|
|
|
|
must treat this situation as if we were within the body of a
|
|
|
|
|
function so as to avoid collecting live data only referenced from
|
|
|
|
|
the stack (such as overload resolution candidates). */
|
|
|
|
|
++function_depth;
|
|
|
|
|
instantiate_decl (decl, /*defer_ok=*/false,
|
|
|
|
|
/*expl_inst_class_mem_p=*/false);
|
|
|
|
|
--function_depth;
|
2005-09-08 20:56:42 +02:00
|
|
|
|
}
|
2006-06-06 13:44:09 +02:00
|
|
|
|
|
2010-11-02 02:30:39 +01:00
|
|
|
|
/* If we don't need a value, then we don't need to synthesize DECL. */
|
|
|
|
|
if (cp_unevaluated_operand != 0)
|
|
|
|
|
return;
|
|
|
|
|
|
2005-10-17 01:17:53 +02:00
|
|
|
|
if (processing_template_decl)
|
2006-06-06 13:44:09 +02:00
|
|
|
|
return;
|
2002-12-26 19:20:14 +01:00
|
|
|
|
|
2010-11-02 02:30:39 +01:00
|
|
|
|
/* Check this too in case we're within fold_non_dependent_expr. */
|
|
|
|
|
if (DECL_TEMPLATE_INFO (decl)
|
|
|
|
|
&& uses_template_parms (DECL_TI_ARGS (decl)))
|
|
|
|
|
return;
|
|
|
|
|
|
2009-08-24 23:31:54 +02:00
|
|
|
|
DECL_ODR_USED (decl) = 1;
|
2009-08-16 19:42:56 +02:00
|
|
|
|
if (DECL_CLONED_FUNCTION_P (decl))
|
2009-08-24 23:31:54 +02:00
|
|
|
|
DECL_ODR_USED (DECL_CLONED_FUNCTION (decl)) = 1;
|
2009-08-16 19:42:56 +02:00
|
|
|
|
|
2009-08-10 22:47:55 +02:00
|
|
|
|
/* DR 757: A type without linkage shall not be used as the type of a
|
|
|
|
|
variable or function with linkage, unless
|
|
|
|
|
o the variable or function has extern "C" linkage (7.5 [dcl.link]), or
|
|
|
|
|
o the variable or function is not used (3.2 [basic.def.odr]) or is
|
|
|
|
|
defined in the same translation unit. */
|
2009-11-02 17:14:26 +01:00
|
|
|
|
if (cxx_dialect > cxx98
|
|
|
|
|
&& decl_linkage (decl) != lk_none
|
2009-08-24 23:32:12 +02:00
|
|
|
|
&& !DECL_EXTERN_C_P (decl)
|
|
|
|
|
&& !DECL_ARTIFICIAL (decl)
|
|
|
|
|
&& !decl_defined_p (decl)
|
|
|
|
|
&& no_linkage_check (TREE_TYPE (decl), /*relaxed_p=*/false))
|
|
|
|
|
{
|
|
|
|
|
if (is_local_extern (decl))
|
|
|
|
|
/* There's no way to define a local extern, and adding it to
|
|
|
|
|
the vector interferes with GC, so give an error now. */
|
|
|
|
|
no_linkage_error (decl);
|
|
|
|
|
else
|
|
|
|
|
VEC_safe_push (tree, gc, no_linkage_decls, decl);
|
2009-08-10 22:47:55 +02:00
|
|
|
|
}
|
|
|
|
|
|
2002-12-26 19:20:14 +01:00
|
|
|
|
if (TREE_CODE (decl) == FUNCTION_DECL && DECL_DECLARED_INLINE_P (decl)
|
2009-08-24 23:32:24 +02:00
|
|
|
|
&& !DECL_INITIAL (decl) && !DECL_ARTIFICIAL (decl))
|
2002-12-26 19:20:14 +01:00
|
|
|
|
/* Remember it, so we can check it was defined. */
|
2009-08-24 23:32:24 +02:00
|
|
|
|
note_vague_linkage_fn (decl);
|
2005-06-14 22:01:59 +02:00
|
|
|
|
|
1996-08-13 17:39:22 +02:00
|
|
|
|
/* Is it a synthesized method that needs to be synthesized? */
|
Make DECL_CONTEXT mean the class in which a member function was declared, even for a virtual function.
Make DECL_CONTEXT mean the class in which a member function was
declared, even for a virtual function.
* cp-tree.h (DECL_CLASS_CONTEXT): Adjust.
(DECL_FRIEND_CONTEXT): New macro.
(DECL_REAL_CONTEXT): Remove.
(SET_DECL_FRIEND_CONTEXT): Likewise.
(DECL_VIRTUAL_CONTEXT): Adjust.
(DECL_CLASS_SCOPE_P): Use TYPE_P.
(add_friends): Remove.
(hack_decl_function_context): Likewise.
* call.c (build_new_function_call): Replace DECL_REAL_CONTEXT with
CP_DECL_CONTEXT.
(build_over_call): Fix indentation. Use DECL_CONTEXT
instead of DECL_CLASS_CONTEXT.
* class.c (dfs_build_vcall_offset_vtbl_entries): Likewise.
(add_method): Set DECL_VIRTUAL_CONTEXT, not DECL_CLASS_CONTEXT.
(strictly_overrides): Use DECL_CONTEXT, not DECL_CLASS_CONTEXT.
(build_vtbl_or_vbase_field): Don't set DECL_CLASS_CONTEXT.
(build_base_field): Likewise.
(finish_struct_1): Likewise.
(build_self_reference): Likewise.
* decl.c (push_class_binding): Use CP_DECL_CONTEXT, not
DECL_REAL_CONTEXT.
(pushtag): Use decl_function_context, not
hack_decl_function_context.
(decls_match): Use CP_DECL_CONTEXT, not DECL_REAL_CONTEXT.
(duplicate_decls): Use DECL_VIRTUAL_CONTEXT.
(pushdecl): Remove bogus code.
(start_decl): Use DECL_CONTEXT rather than DECL_CLASS_CONTEXT.
(cp_finish_decl): Use CP_DECL_CONTEXT, not DECL_REAL_CONTEXT.
(grokfndecl): Use DECL_CONTEXT, not DECL_CLASS_CONTEXT.
Use decl_function_context, nothack_decl_function_context.
(grokvardecl): Don't set DECL_CLASS_CONTEXT.
(grokdeclarator): Likewise. Use decl_function_context, not
hack_decl_function_context.
(copy_args_p): Document. Don't use DECL_CLASS_CONTEXT.
(start_function): Use DECL_FRIEND_CONTEXT, not
DECL_CLASS_CONTEXT. Use decl_function_context, not
hack_decl_function_context.
(finish_function): Use decl_function_context, not
hack_decl_function_context.
(maybe_retrofit_in_chrg): Use DECL_CONTEXT, not
DECL_CLASS_CONTEXT.
(grokclassfn): Set DECL_VIRTUAL_CONTEXT, not DECL_CONTEXT.
(finish_static_data_member_decl): Don't set DECL_CLASS_CONTEXT.
(grokfield): Likewise.
(finish_builtin_type): Likewise.
(finish_vtable_vardec): Use decl_function_context, not
hack_decl_function_context.
(import_export_decl): Use DECL_CONTEXT, not DECL_CLASS_CONTEXT.
(start_static_initialization_or_destruction): Likewise.
(finish_static_initialization_or_destruction): Likewise.
(mark_used): Adjust logic for deciding when to synthesize methods.
* dump.c (dequeue_and_dump): Use CP_DECL_CONTEXT, not
DECL_REAL_CONTEXT.
* error.c (dump_function_decl): Use DECL_CONTEXT, not
DECL_CLASS_CONTEXT.
* friend.c (is_friend): Likewise.
(add_friends): Remove.
(do_friend): Use SET_DECL_FRIEND_CONTEXT.
* lex.c (begin_definition_of_inclass_inline): Use
decl_function_context, not hack_decl_function_context.
(process_next_inline): Likewise.
(do_identifier): Use CP_DECL_CONTEXT, not DECL_REAL_CONTEXT.
* method.c (set_mangled_name_for_decl): Use DECL_CONTEXT, not
DECL_CLASSS_CONTEXT.
(hack_identifier): Likewise.
(synthesize_method): Use decl_function_context, not
hack_decl_function_context.
* pt.c (template_class_depth_real): Use CP_DECL_CONTEXT, not
DECL_REAL_CONTEXT.
(is_member_template): Use decl_function_context, not
hack_decl_function_context. Use DECL_CONTEXT, not
DECL_CLASS_CONTEXT.
(build_template_decl): Set DECL_VIRTUAL_CONTEXT, not
DECL_CLASS_CONTEXT.
(check_default_tmpl_args): Use CP_DECL_CONTEXT, not
DECL_REAL_CONTEXT.
(push_template_decl_real): Likewise.
(instantiate_class_template): Don't call add_friends.
(tsubst_default_argument): Use DECL_CONTEXT, not
DECL_REAL_CONTEXT.
(tsubst_decl): Set DECL_VIRTUAL_CONTEXT, not DECL_CLASS_CONTEXT.
Use DECL_CONTEXT, not DECL_CLASS_CONTEXT.
(set_meangled_name_for_template_decl): Use DECL_CONTEXT, not
DECL_CLASS_CONTEXT.
* repo.c (repo_inline_used): Likewise.
* search.c (current_scope): Adjust for new _CONTEXT macros.
(context_for_name_lookup): Use CP_DECL_CONTEXT, not
DECL_REAL_CONTEXT.
(friend_accessible_p): Use DECL_CONTEXT, not DECL_CLASS_CONTEXT.
(lookup_fnfields_here):Likewise.
(check_final_overrider): Likewise.
(init_vbase_pointers): Likewise.
(virtual_context): Likewise.
* semantics.c (finish_member_declaration): Just set DECL_CONTEXT.
(expand_body): Use decl_function_context, not
hack_decl_function_context.
* tree.c (hack_decl_function_context): Remove.
* typeck.c (build_x_function_call): Use DECL_CONTEXT, not
DECL_CLASS_CONTEXT.
* typeck2.c (error_not_base_type): Likewise.
From-SVN: r32018
2000-02-17 00:54:23 +01:00
|
|
|
|
if (TREE_CODE (decl) == FUNCTION_DECL
|
|
|
|
|
&& DECL_NONSTATIC_MEMBER_FUNCTION_P (decl)
|
2008-07-24 21:15:00 +02:00
|
|
|
|
&& DECL_DEFAULTED_FN (decl)
|
2009-08-16 19:42:41 +02:00
|
|
|
|
&& ! DECL_INITIAL (decl))
|
2000-04-11 22:16:36 +02:00
|
|
|
|
{
|
2009-08-24 23:32:24 +02:00
|
|
|
|
/* Remember the current location for a function we will end up
|
|
|
|
|
synthesizing. Then we can inform the user where it was
|
|
|
|
|
required in the case of error. */
|
|
|
|
|
DECL_SOURCE_LOCATION (decl) = input_location;
|
|
|
|
|
|
2009-08-19 19:14:33 +02:00
|
|
|
|
/* Synthesizing an implicitly defined member function will result in
|
|
|
|
|
garbage collection. We must treat this situation as if we were
|
|
|
|
|
within the body of a function so as to avoid collecting live data
|
|
|
|
|
on the stack (such as overload resolution candidates).
|
|
|
|
|
|
2009-08-19 20:24:13 +02:00
|
|
|
|
We could just let cp_write_global_declarations handle synthesizing
|
|
|
|
|
this function, since we just added it to deferred_fns, but doing
|
|
|
|
|
it at the use site produces better error messages. */
|
2009-08-19 19:14:33 +02:00
|
|
|
|
++function_depth;
|
2000-04-11 22:16:36 +02:00
|
|
|
|
synthesize_method (decl);
|
2009-08-19 19:14:33 +02:00
|
|
|
|
--function_depth;
|
2009-08-19 20:24:13 +02:00
|
|
|
|
/* If this is a synthesized method we don't need to
|
2006-05-01 01:21:38 +02:00
|
|
|
|
do the instantiation test below. */
|
|
|
|
|
}
|
2009-08-24 23:32:12 +02:00
|
|
|
|
else if ((TREE_CODE (decl) == FUNCTION_DECL || TREE_CODE (decl) == VAR_DECL)
|
|
|
|
|
&& DECL_TEMPLATE_INFO (decl)
|
2006-05-01 01:21:38 +02:00
|
|
|
|
&& (!DECL_EXPLICIT_INSTANTIATION (decl)
|
2009-08-16 19:42:56 +02:00
|
|
|
|
|| always_instantiate_p (decl)))
|
2006-05-01 01:21:38 +02:00
|
|
|
|
/* If this is a function or variable that is an instance of some
|
|
|
|
|
template, we now know that we will need to actually do the
|
|
|
|
|
instantiation. We check that DECL is not an explicit
|
|
|
|
|
instantiation because that is not checked in instantiate_decl.
|
2006-06-06 13:44:09 +02:00
|
|
|
|
|
2006-05-01 01:21:38 +02:00
|
|
|
|
We put off instantiating functions in order to improve compile
|
2004-07-29 19:59:31 +02:00
|
|
|
|
times. Maintaining a stack of active functions is expensive,
|
|
|
|
|
and the inliner knows to instantiate any functions it might
|
2006-05-01 01:21:38 +02:00
|
|
|
|
need. Therefore, we always try to defer instantiation. */
|
2006-06-06 13:44:09 +02:00
|
|
|
|
instantiate_decl (decl, /*defer_ok=*/true,
|
2005-07-18 17:44:36 +02:00
|
|
|
|
/*expl_inst_class_mem_p=*/false);
|
1995-12-19 07:51:14 +01:00
|
|
|
|
}
|
1997-08-20 00:49:24 +02:00
|
|
|
|
|
2002-06-04 09:11:05 +02:00
|
|
|
|
#include "gt-cp-decl2.h"
|