1996-02-01 20:33:01 +01:00
|
|
|
|
/* RunTime Type Identification
|
2003-01-14 22:36:20 +01:00
|
|
|
|
Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003
|
builtins.c (c_strlen): Use size_diffop and return ssizetype value.
* builtins.c (c_strlen): Use size_diffop and return ssizetype value.
(expand_builtin_strcpy): Pass correct type to size_binop.
(expand_builtin_strcmp): Likewise.
Clean up conditional structure.
* c-decl.c (init_decl_processing): Don't call set_sizetype twice.
(complete_array_type): Don't use size_binop for MAXINDEX.
* c-typeck.c (c_sizeof): Use size_one_node and TYPE_SIZE_UNIT.
(c_sizeof_nowarn, c_size_in_bytes): Likewise.
(c_alignof): Use size_one_node.
(build_unary_op): Pass arg of proper type to size_binop.
(really_start_incremental_init, push_init_level): Use sizetype for
constructor{,_bit,_unfilled}_index.
(pop_init_label, output_init_element): Likewise.
(output_pending_init_elements, process_init_element): Likewise.
* calls.c (compute_argument_block_size): Field VAR is ssizetype.
* expr.c (store_expr): Use size_int.
(store_constructor): Use proper types for size_binop args.
(get_inner_reference, expand_expr, case ARRAY_REF): Likewise.
(expand_expr_unaligned): Likewise.
(string_contant): Return object of sizetype.
* expr.h (SUB_PARM_SIZE): Call size_diffop and pass proper types.
(ARGS_SIZE_RTX): Call ARGS_SIZE_TREE.
(ARGS_SIZE_TREE): Pass proper types to size_binop.
* fold-const.c (int_const_binop): Refine when size_int is called.
(fold_convert): Likewise.
(size_int_wide): Rework to take KIND as arg, only take low order
bits, handle new sizetype_tab datatype, and chain entries in
size_table.
(size_int_type_wide): New function.
(size_binop): Validate types of arguments.
(ssize_binop): Deleted.
(size_diffop): New function.
(extract_muldiv): Only fold division into multiplication for sizetypes.
* function.c (assign_parms): Use size_diffop and make sure
VAR field is of ssizetype; also pass proper type to size_binop.
(locate_and_pad_parm, pad_to_arg_alignment): Likewise.
(round_down): Deleted from here.
* store-layout.c (sizetype_tab): Now an array.
(sizetype_set, early_root_list): New variables.
(variable_size): Use size_one_node.
(round_up): Pass proper type to size_binop.
(round_down): Moved to here and corrected as above.
(layout_record): Pass proper arg types to size_binop.
(layout_type): Likewise.
If sizetype_set is zero, record the type just laid out.
(make_unsigned_type): Don't call set_sizetype;
(make_signed_type): Likewise; also, call fixup_signed_type.
(initialize_sizetypes): New function.
(set_sizetype): Make copy of types, set TYPE_IS_SIZETYPE, and
set name of bitsizetype to "bit_size_type".
Fix up type of sizes of all types made before call.
* tm.texi (ROUND_TYPE_SIZE_UNIT): New macro.
* tree.c (fix_sizetype): Deleted.
(build_common_tree_nodes): Call initialize_sizetypes.
(build_common_tree_nodes_2): Don't call fix_sizetype.
* tree.h (TYPE_IS_SIZETYPE): New macro.
(initialize_sizetype): New declaration.
(enum size_type_kind): New type.
(struct sizetype_tab): Deleted.
(sizetype_tab): Now array; adjust sizetype macros.
(size_diffop, size_int_type_wide): New functions.
(size_int_wide): Change number of args and type; access macros changed.
(ssize_int, sbitsize_int): New macros.
* config/i960/i960.h (ROUND_TYPE_SIZE): Use size_int.
(ROUND_TYPE_SIZE_UNIT): New macro.
* ch/actions.c (chill_convert_for_assignment): Don't use size_binop
for things that aren't sizes.
(expand_varying_length_assignment): Likewise.
* ch/convert.c (digest_array_tuple, convert): Likewise.
* ch/typeck.c (build_chill_slice, smash_dummy_type): Likewise.
(build_chill_slice_with_range): Likewise.
(build_chill_slice_with_length): Likewise.
(build_array_from_set): Adjust types for size_binop.
* ch/expr.c (build_concat_expr, build_chill_repetition_op): Likewise.
(build_chill_sizeof): Use TYPE_SIZE_UNIT.
* ch/tree.c (build_string_type): Pass proper type to size_binop.
* cp/class.c (dfs_build_vtable_offset_vtbl_entries): Don't use
size_binop on things that are not sizes; ssize_binop deleted.
Call size_diffop when appropriate.
(dfs_build_vcall_offset_vtbl_entries): Likewise.
(build_primary_vtable, build_secondary_vtable): Likewise.
(dfs_set_offset_for_unshared_vbases, dfs_modify_vtables): Likewise.
Variable I is HOST_WIDE_INT.
(get_vfield_offset): Pass proper types to size_binop.
(size_extra_vtbl_entries, layout_virtual_bases): Likewise.
(finish_struct_1): Likewise.
(skip_rtti_stuff): Arg N is now pointer to signed.
(layout_class_type): Use size_zero_node.
* cp/cp-tree.h (skip_rtti_stuff): Arg N is pointer to signed.
* cp/cvt.c (cp_convert_to_pointer): Pass proper types to size_binop.
* cp/decl.c (complete_arry_type): Pass proper types to size_binop.
(xref_basetypes): BINFO_OFFSET is sizetype.
* cp/error.c (dump_expr): Don't use size_binop non-sizes.
* cp/expr.c (cplus_expand_constant): Pass proper types to size_binop.
* cp/init.c (construct_virtual_bases): Fix type error.
(build_vec_delete_1): Pass proper type to size_binop and don't
fold result.
* cp/lex.c (cp_make_lang_type): BINFO_OFFSET is sizetype.
* cp/rtti.c (get_base_offset): Pass proper type to size_binop.
* cp/search.c (dfs_find_vbases): Fix type error.
(expand_upcast_fixups): Arg to skip_rtti_stuff is pointer to signed.
(dfs_get_vbase_types): BINFO_OFFSET is sizetype.
* cp/tree.c (debug_binfo): Variable N is signed.
Use HOST_WIDE_INT_PRINT_DEC.
* cp/typeck.c (comptypes): sizetype is same as equivalent integer type.
(c_sizeof, c_sizeof_nowarn, expr_sizeof): Use TYPE_SIZE_UNIT,
size_one_node and size_zero_node.
(c_alignof): Use size_one_node.
(build_component_addr): Pass proper types to size_binop.
(expand_ptrmemfunc_cst): Don't use size_binop on non-sizes.
* f/com.c (ffecom_arrayref_): Convert args to size_binop to proper
type.
(ffecom_tree_canonize_ptr_): Don't use size_binop for non-sizes.
(ffecom_tree_canonize_ref_): Likewise.
(type_for_mode): Handle TImode.
* f/ste.c (ffeste_io_dofio_, ffeste_io_douio_): Use TYPE_SIZE_UNIT.
(ffeste_io_ciclist_): Likewise.
* java/expr.c (build_java_ret): Pass proper type to size_binop.
From-SVN: r32225
2000-02-27 22:39:40 +01:00
|
|
|
|
Free Software Foundation, Inc.
|
1996-04-13 01:55:07 +02:00
|
|
|
|
Mostly written by Jason Merrill (jason@cygnus.com).
|
1996-02-01 20:33:01 +01:00
|
|
|
|
|
call.c, [...]: Replace "GNU CC" with "GCC" in the copyright header.
* call.c, class.c, cp-lang.c, cp-tree.h, cvt.c, dump.c, error.c,
except.c, expr.c friend.c, g++spec.c, init.c, lang-options.h,
lang-specs.h, lex.c, mangle.c, method.c, optimize.c, parser.c,
pt.c, ptree.c, repo.c, rtti.c, search.c, semantics.c, tree.c,
typeck.c, typeck2.c: Replace "GNU CC" with "GCC" in the
copyright header.
* lex.h: parse.y is dead, so don't mention it. Also replace the
copyright header with the default GNU copyright header.
From-SVN: r60738
2003-01-01 12:58:58 +01:00
|
|
|
|
This file is part of GCC.
|
1996-02-01 20:33:01 +01:00
|
|
|
|
|
call.c, [...]: Replace "GNU CC" with "GCC" in the copyright header.
* call.c, class.c, cp-lang.c, cp-tree.h, cvt.c, dump.c, error.c,
except.c, expr.c friend.c, g++spec.c, init.c, lang-options.h,
lang-specs.h, lex.c, mangle.c, method.c, optimize.c, parser.c,
pt.c, ptree.c, repo.c, rtti.c, search.c, semantics.c, tree.c,
typeck.c, typeck2.c: Replace "GNU CC" with "GCC" in the
copyright header.
* lex.h: parse.y is dead, so don't mention it. Also replace the
copyright header with the default GNU copyright header.
From-SVN: r60738
2003-01-01 12:58:58 +01:00
|
|
|
|
GCC is free software; you can redistribute it and/or modify
|
1996-02-01 20:33:01 +01:00
|
|
|
|
it under the terms of the GNU General Public License as published by
|
|
|
|
|
the Free Software Foundation; either version 2, or (at your option)
|
|
|
|
|
any later version.
|
|
|
|
|
|
call.c, [...]: Replace "GNU CC" with "GCC" in the copyright header.
* call.c, class.c, cp-lang.c, cp-tree.h, cvt.c, dump.c, error.c,
except.c, expr.c friend.c, g++spec.c, init.c, lang-options.h,
lang-specs.h, lex.c, mangle.c, method.c, optimize.c, parser.c,
pt.c, ptree.c, repo.c, rtti.c, search.c, semantics.c, tree.c,
typeck.c, typeck2.c: Replace "GNU CC" with "GCC" in the
copyright header.
* lex.h: parse.y is dead, so don't mention it. Also replace the
copyright header with the default GNU copyright header.
From-SVN: r60738
2003-01-01 12:58:58 +01:00
|
|
|
|
GCC is distributed in the hope that it will be useful,
|
1996-02-01 20:33:01 +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
|
call.c, [...]: Replace "GNU CC" with "GCC" in the copyright header.
* call.c, class.c, cp-lang.c, cp-tree.h, cvt.c, dump.c, error.c,
except.c, expr.c friend.c, g++spec.c, init.c, lang-options.h,
lang-specs.h, lex.c, mangle.c, method.c, optimize.c, parser.c,
pt.c, ptree.c, repo.c, rtti.c, search.c, semantics.c, tree.c,
typeck.c, typeck2.c: Replace "GNU CC" with "GCC" in the
copyright header.
* lex.h: parse.y is dead, so don't mention it. Also replace the
copyright header with the default GNU copyright header.
From-SVN: r60738
2003-01-01 12:58:58 +01:00
|
|
|
|
along with GCC; see the file COPYING. If not, write to
|
1996-02-01 20:33:01 +01:00
|
|
|
|
the Free Software Foundation, 59 Temple Place - Suite 330,
|
|
|
|
|
Boston, MA 02111-1307, USA. */
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#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"
|
1996-02-01 20:33:01 +01:00
|
|
|
|
#include "tree.h"
|
|
|
|
|
#include "cp-tree.h"
|
|
|
|
|
#include "flags.h"
|
|
|
|
|
#include "output.h"
|
1996-09-12 21:19:15 +02:00
|
|
|
|
#include "assert.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"
|
1996-09-30 23:34:04 +02:00
|
|
|
|
|
2002-06-30 22:41:38 +02:00
|
|
|
|
/* C++ returns type information to the user in struct type_info
|
|
|
|
|
objects. We also use type information to implement dynamic_cast and
|
|
|
|
|
exception handlers. Type information for a particular type is
|
|
|
|
|
indicated with an ABI defined structure derived from type_info.
|
|
|
|
|
This would all be very straight forward, but for the fact that the
|
|
|
|
|
runtime library provides the definitions of the type_info structure
|
|
|
|
|
and the ABI defined derived classes. We cannot build declarations
|
|
|
|
|
of them directly in the compiler, but we need to layout objects of
|
|
|
|
|
their type. Somewhere we have to lie.
|
|
|
|
|
|
|
|
|
|
We define layout compatible POD-structs with compiler-defined names
|
|
|
|
|
and generate the appropriate initializations for them (complete
|
|
|
|
|
with explicit mention of their vtable). When we have to provide a
|
|
|
|
|
type_info to the user we reinterpret_cast the internal compiler
|
|
|
|
|
type to type_info. A well formed program can only explicitly refer
|
|
|
|
|
to the type_infos of complete types (& cv void). However, we chain
|
|
|
|
|
pointer type_infos to the pointed-to-type, and that can be
|
|
|
|
|
incomplete. We only need the addresses of such incomplete
|
|
|
|
|
type_info objects for static initialization.
|
|
|
|
|
|
|
|
|
|
The type information VAR_DECL of a type is held on the
|
|
|
|
|
IDENTIFIER_GLOBAL_VALUE of the type's mangled name. That VAR_DECL
|
|
|
|
|
will be the internal type. It will usually have the correct
|
|
|
|
|
internal type reflecting the kind of type it represents (pointer,
|
|
|
|
|
array, function, class, inherited class, etc). When the type it
|
|
|
|
|
represents is incomplete, it will have the internal type
|
|
|
|
|
corresponding to type_info. That will only happen at the end of
|
|
|
|
|
translation, when we are emitting the type info objects. */
|
|
|
|
|
|
2000-01-28 14:30:13 +01:00
|
|
|
|
/* Accessors for the type_info objects. We need to remember several things
|
|
|
|
|
about each of the type_info types. The global tree nodes such as
|
|
|
|
|
bltn_desc_type_node are TREE_LISTs, and these macros are used to access
|
2002-09-14 14:07:44 +02:00
|
|
|
|
the required information. */
|
|
|
|
|
/* The RECORD_TYPE of a type_info derived class. */
|
2000-01-28 14:30:13 +01:00
|
|
|
|
#define TINFO_PSEUDO_TYPE(NODE) TREE_TYPE (NODE)
|
2002-06-30 22:41:38 +02:00
|
|
|
|
/* The VAR_DECL of the vtable for the type_info derived class.
|
2002-09-14 14:07:44 +02:00
|
|
|
|
This is only filled in at the end of the translation. */
|
2000-01-28 14:30:13 +01:00
|
|
|
|
#define TINFO_VTABLE_DECL(NODE) TREE_VALUE (NODE)
|
2002-09-14 14:07:44 +02:00
|
|
|
|
/* The IDENTIFIER_NODE naming the real class. */
|
2002-06-30 22:41:38 +02:00
|
|
|
|
#define TINFO_REAL_NAME(NODE) TREE_PURPOSE (NODE)
|
1996-02-01 20:33:01 +01:00
|
|
|
|
|
2003-03-20 22:14:30 +01:00
|
|
|
|
/* A varray of all tinfo decls that haven't yet been emitted. */
|
|
|
|
|
varray_type unemitted_tinfo_decls;
|
|
|
|
|
|
2003-06-13 16:30:19 +02:00
|
|
|
|
static tree build_headof (tree);
|
|
|
|
|
static tree ifnonnull (tree, tree);
|
|
|
|
|
static tree tinfo_name (tree);
|
|
|
|
|
static tree build_dynamic_cast_1 (tree, tree);
|
|
|
|
|
static tree throw_bad_cast (void);
|
|
|
|
|
static tree throw_bad_typeid (void);
|
|
|
|
|
static tree get_tinfo_decl_dynamic (tree);
|
|
|
|
|
static tree get_tinfo_ptr (tree);
|
|
|
|
|
static bool typeid_ok_p (void);
|
|
|
|
|
static int qualifier_flags (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 bool target_incomplete_p (tree);
|
2003-06-13 16:30:19 +02:00
|
|
|
|
static tree tinfo_base_init (tree, tree);
|
|
|
|
|
static tree generic_initializer (tree, 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 tree ptr_initializer (tree, tree, bool *);
|
|
|
|
|
static tree ptm_initializer (tree, tree, bool *);
|
2003-06-13 16:30:19 +02:00
|
|
|
|
static tree dfs_class_hint_mark (tree, void *);
|
|
|
|
|
static tree dfs_class_hint_unmark (tree, void *);
|
|
|
|
|
static int class_hint_flags (tree);
|
|
|
|
|
static tree class_initializer (tree, tree, tree);
|
|
|
|
|
static tree create_pseudo_type_info (const char *, int, ...);
|
|
|
|
|
static tree get_pseudo_ti_init (tree, tree, bool *);
|
|
|
|
|
static tree get_pseudo_ti_desc (tree);
|
|
|
|
|
static void create_tinfo_types (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
|
|
|
|
static bool typeinfo_in_lib_p (tree);
|
2003-06-13 16:30:19 +02:00
|
|
|
|
static bool unemitted_tinfo_decl_p (tree);
|
2000-01-28 14:30:13 +01:00
|
|
|
|
|
|
|
|
|
static int doing_runtime = 0;
|
1996-02-01 20:33:01 +01:00
|
|
|
|
|
2002-06-30 22:41:38 +02:00
|
|
|
|
|
|
|
|
|
/* Declare language defined type_info type and a pointer to const
|
|
|
|
|
type_info. This is incomplete here, and will be completed when
|
|
|
|
|
the user #includes <typeinfo>. There are language defined
|
|
|
|
|
restrictions on what can be done until that is included. Create
|
|
|
|
|
the internal versions of the ABI types. */
|
|
|
|
|
|
1996-04-13 01:55:07 +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
|
|
|
|
init_rtti_processing (void)
|
1996-04-13 01:55:07 +02:00
|
|
|
|
{
|
2002-12-28 09:03:42 +01:00
|
|
|
|
tree const_type_info_type;
|
|
|
|
|
|
2001-08-02 12:51:17 +02:00
|
|
|
|
push_namespace (std_identifier);
|
2002-06-26 19:03:44 +02:00
|
|
|
|
type_info_type_node
|
|
|
|
|
= xref_tag (class_type, get_identifier ("type_info"),
|
|
|
|
|
/*attributes=*/NULL_TREE, 1);
|
2001-08-02 12:51:17 +02:00
|
|
|
|
pop_namespace ();
|
2002-12-28 09:03:42 +01:00
|
|
|
|
const_type_info_type = build_qualified_type (type_info_type_node,
|
|
|
|
|
TYPE_QUAL_CONST);
|
|
|
|
|
type_info_ptr_type = build_pointer_type (const_type_info_type);
|
|
|
|
|
type_info_ref_type = build_reference_type (const_type_info_type);
|
2002-06-30 22:41:38 +02:00
|
|
|
|
|
2003-03-20 22:14:30 +01:00
|
|
|
|
VARRAY_TREE_INIT (unemitted_tinfo_decls, 10, "RTTI decls");
|
|
|
|
|
|
2002-06-30 22:41:38 +02:00
|
|
|
|
create_tinfo_types ();
|
1996-04-13 01:55:07 +02:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Given the expression EXP of type `class *', return the head of the
|
|
|
|
|
object pointed to by EXP with type cv void*, if the class has any
|
1999-12-21 01:19:01 +01:00
|
|
|
|
virtual functions (TYPE_POLYMORPHIC_P), else just return the
|
1996-04-13 01:55:07 +02:00
|
|
|
|
expression. */
|
1996-07-11 03:13:25 +02:00
|
|
|
|
|
1996-02-28 23:01:56 +01: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
|
|
|
|
build_headof (tree exp)
|
1996-02-01 20:33:01 +01:00
|
|
|
|
{
|
|
|
|
|
tree type = TREE_TYPE (exp);
|
1997-01-21 22:32:30 +01:00
|
|
|
|
tree offset;
|
2000-03-28 21:27:15 +02:00
|
|
|
|
tree index;
|
1996-02-01 20:33:01 +01:00
|
|
|
|
|
2000-01-18 11:23:31 +01:00
|
|
|
|
my_friendly_assert (TREE_CODE (type) == POINTER_TYPE, 20000112);
|
1996-02-01 20:33:01 +01:00
|
|
|
|
type = TREE_TYPE (type);
|
|
|
|
|
|
1999-12-21 01:19:01 +01:00
|
|
|
|
if (!TYPE_POLYMORPHIC_P (type))
|
1996-02-01 20:33:01 +01:00
|
|
|
|
return exp;
|
|
|
|
|
|
1996-04-13 01:55:07 +02:00
|
|
|
|
/* We use this a couple of times below, protect it. */
|
|
|
|
|
exp = save_expr (exp);
|
|
|
|
|
|
2001-07-21 02:03:21 +02:00
|
|
|
|
/* The offset-to-top field is at index -2 from the vptr. */
|
2002-06-14 02:50:34 +02:00
|
|
|
|
index = build_int_2 (-2 * TARGET_VTABLE_DATA_ENTRY_DISTANCE, -1);
|
2000-03-28 21:27:15 +02:00
|
|
|
|
|
2001-07-21 11:42:21 +02:00
|
|
|
|
offset = build_vtbl_ref (build_indirect_ref (exp, NULL), index);
|
1996-02-01 20:33:01 +01:00
|
|
|
|
|
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
|
|
|
|
type = build_qualified_type (ptr_type_node,
|
tree-dump.c: Rename from c-dump.c.
* tree-dump.c: Rename from c-dump.c. Include c-tree.h, not c-common.h.
(lang_type_quals): Declare.
(dequeue_and_dump): Use lang_hooks.tree_dump.type_quals function to
retrieve language-specific qualifiers for a type node, instead of
C_TYPE_QUALS. Likewise for lang_hooks.tree_dump.dump_tree instead of
lang_dump_tree.
* tree-dump.h: Rename from c-dump.h.
* c-common.h (C_TYPE_QUALS): Removed.
Move declarations for tree-dump.c interface to...
* tree.h: ... here. Remove lang_dump_tree.
* langhooks.h (struct lang_hooks_for_tree_dump): New.
(struct lang_hooks): Add tree_dump hooks.
* langhooks.c (lhd_tree_dump_dump_tree): New function.
(lhd_tree_dump_type_quals): New function.
* langhooks-def.h (lhd_tree_dump_dump_tree, lhd_tree_dump_type_quals):
Declare.
(LANG_HOOKS_INITIALIZER): Add tree_dump hooks.
* Makefile.in: Move tree-dump.o to language-independent back-end.
cp:
* cp-tree.h (CP_TYPE_QUALS): Removed.
* decl.c (cxx_init_decl_processing): Don't set lang_dump_tree.
* cp-lang.c: Set LANG_HOOKS_TREE_DUMP_DUMP_TREE_FN and
LANG_HOOKS_TREE_DUMP_TYPE_QUALS_FN.
* dump.c (cp_dump_tree): Use void* dump_info argument to match
lang-hooks prototype.
* call.c, cp-tree.h, cvt.c, decl.c, init.c, mangle.c, method.c, pt.c,
rtti.c, semantics.c, tree.c, typeck.c, typeck2.c: All references to
CP_TYPE_QUALS changed to cp_type_quals.
* Make-lang.in: References to c-dump.h changed to tree-dump.h.
(CXX_C_OBJS): Remove c-dump.o.
From-SVN: r47257
2001-11-22 03:33:02 +01:00
|
|
|
|
cp_type_quals (TREE_TYPE (exp)));
|
1996-02-01 20:33:01 +01:00
|
|
|
|
return build (PLUS_EXPR, type, exp,
|
1997-05-29 01:20:02 +02:00
|
|
|
|
cp_convert (ptrdiff_type_node, offset));
|
1996-02-01 20:33:01 +01:00
|
|
|
|
}
|
1996-09-30 23:34:04 +02:00
|
|
|
|
|
|
|
|
|
/* Get a bad_cast node for the program to throw...
|
|
|
|
|
|
|
|
|
|
See libstdc++/exception.cc for __throw_bad_cast */
|
|
|
|
|
|
|
|
|
|
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
|
|
|
|
throw_bad_cast (void)
|
1996-09-30 23:34:04 +02:00
|
|
|
|
{
|
2001-02-12 10:58:18 +01:00
|
|
|
|
tree fn = get_identifier ("__cxa_bad_cast");
|
decl.c (push_overloaded_decl_1, [...]): Lose.
* decl.c (push_overloaded_decl_1, auto_function,
define_function): Lose.
(build_library_fn_1): New static fn.
(builtin_function): Use it.
(get_atexit_node): Use build_library_fn_ptr.
(build_library_fn, build_cp_library_fn, build_library_fn_ptr,
build_cp_library_fn_ptr, push_library_fn, push_cp_library_fn,
push_void_library_fn, push_throw_library_fn): New fns.
* cp-tree.h: Declare them.
(cp_tree_index): Remove CPTI_BAD_CAST, CPTI_BAD_TYPEID.
(throw_bad_cast_node, throw_bad_typeid_node): Lose.
* except.c (init_exception_processing, call_eh_info, do_pop_exception,
(expand_end_eh_spec, alloc_eh_object, expand_throw): Use above fns.
* rtti.c (build_runtime_decl): Lose.
(throw_bad_cast, throw_bad_typeid, get_tinfo_decl,
build_dynamic_cast_1, expand_si_desc, expand_class_desc,
expand_ptr_desc, expand_attr_desc, expand_generic_desc): Use above fns.
* call.c (build_call): Remove result_type parm.
Call mark_used on unused artificial fns.
* init.c, method.c, typeck.c, except.c, rtti.c: Adjust.
From-SVN: r32468
2000-03-10 10:25:45 +01:00
|
|
|
|
if (IDENTIFIER_GLOBAL_VALUE (fn))
|
|
|
|
|
fn = IDENTIFIER_GLOBAL_VALUE (fn);
|
|
|
|
|
else
|
2000-03-11 01:23:18 +01:00
|
|
|
|
fn = push_throw_library_fn (fn, build_function_type (ptr_type_node,
|
|
|
|
|
void_list_node));
|
2000-01-24 13:16:59 +01:00
|
|
|
|
|
2003-04-22 07:44:12 +02:00
|
|
|
|
return build_cxx_call (fn, NULL_TREE, NULL_TREE);
|
1996-09-30 23:34:04 +02:00
|
|
|
|
}
|
|
|
|
|
|
2003-01-10 21:30:56 +01:00
|
|
|
|
/* Return an expression for "__cxa_bad_typeid()". The expression
|
|
|
|
|
returned is an lvalue of type "const std::type_info". */
|
|
|
|
|
|
1996-09-30 23:34:04 +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
|
|
|
|
throw_bad_typeid (void)
|
1996-09-30 23:34:04 +02:00
|
|
|
|
{
|
2001-02-12 10:58:18 +01:00
|
|
|
|
tree fn = get_identifier ("__cxa_bad_typeid");
|
decl.c (push_overloaded_decl_1, [...]): Lose.
* decl.c (push_overloaded_decl_1, auto_function,
define_function): Lose.
(build_library_fn_1): New static fn.
(builtin_function): Use it.
(get_atexit_node): Use build_library_fn_ptr.
(build_library_fn, build_cp_library_fn, build_library_fn_ptr,
build_cp_library_fn_ptr, push_library_fn, push_cp_library_fn,
push_void_library_fn, push_throw_library_fn): New fns.
* cp-tree.h: Declare them.
(cp_tree_index): Remove CPTI_BAD_CAST, CPTI_BAD_TYPEID.
(throw_bad_cast_node, throw_bad_typeid_node): Lose.
* except.c (init_exception_processing, call_eh_info, do_pop_exception,
(expand_end_eh_spec, alloc_eh_object, expand_throw): Use above fns.
* rtti.c (build_runtime_decl): Lose.
(throw_bad_cast, throw_bad_typeid, get_tinfo_decl,
build_dynamic_cast_1, expand_si_desc, expand_class_desc,
expand_ptr_desc, expand_attr_desc, expand_generic_desc): Use above fns.
* call.c (build_call): Remove result_type parm.
Call mark_used on unused artificial fns.
* init.c, method.c, typeck.c, except.c, rtti.c: Adjust.
From-SVN: r32468
2000-03-10 10:25:45 +01:00
|
|
|
|
if (IDENTIFIER_GLOBAL_VALUE (fn))
|
|
|
|
|
fn = IDENTIFIER_GLOBAL_VALUE (fn);
|
|
|
|
|
else
|
2000-03-11 01:23:18 +01:00
|
|
|
|
{
|
|
|
|
|
tree t = build_qualified_type (type_info_type_node, TYPE_QUAL_CONST);
|
|
|
|
|
t = build_function_type (build_reference_type (t), void_list_node);
|
|
|
|
|
fn = push_throw_library_fn (fn, t);
|
|
|
|
|
}
|
2000-01-24 13:16:59 +01:00
|
|
|
|
|
2003-04-22 09:48:02 +02:00
|
|
|
|
return convert_from_reference (build_cxx_call (fn, NULL_TREE, NULL_TREE));
|
1996-09-30 23:34:04 +02:00
|
|
|
|
}
|
1996-02-01 20:33:01 +01:00
|
|
|
|
|
2003-01-10 21:30:56 +01:00
|
|
|
|
/* Return an lvalue expression whose type is "const std::type_info"
|
|
|
|
|
and whose value indicates the type of the expression EXP. If EXP
|
|
|
|
|
is a reference to a polymorphic class, return the dynamic type;
|
1996-09-30 23:34:04 +02:00
|
|
|
|
otherwise return the static type of the expression. */
|
1996-07-11 03:13:25 +02:00
|
|
|
|
|
2000-01-18 11:23:31 +01: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
|
|
|
|
get_tinfo_decl_dynamic (tree exp)
|
1996-02-01 20:33:01 +01:00
|
|
|
|
{
|
|
|
|
|
tree type;
|
2003-01-10 21:30:56 +01:00
|
|
|
|
tree t;
|
2000-01-18 11:23:31 +01:00
|
|
|
|
|
1996-02-01 20:33:01 +01:00
|
|
|
|
if (exp == error_mark_node)
|
|
|
|
|
return error_mark_node;
|
|
|
|
|
|
|
|
|
|
type = TREE_TYPE (exp);
|
|
|
|
|
|
1996-07-11 03:13:25 +02:00
|
|
|
|
/* peel back references, so they match. */
|
1996-02-01 20:33:01 +01:00
|
|
|
|
if (TREE_CODE (type) == REFERENCE_TYPE)
|
|
|
|
|
type = TREE_TYPE (type);
|
|
|
|
|
|
1996-07-11 03:13:25 +02:00
|
|
|
|
/* Peel off cv qualifiers. */
|
1996-02-01 20:33:01 +01:00
|
|
|
|
type = TYPE_MAIN_VARIANT (type);
|
2000-01-18 11:23:31 +01:00
|
|
|
|
|
2000-06-20 17:42:55 +02:00
|
|
|
|
if (!VOID_TYPE_P (type))
|
2000-01-18 11:23:31 +01:00
|
|
|
|
type = complete_type_or_else (type, exp);
|
|
|
|
|
|
|
|
|
|
if (!type)
|
|
|
|
|
return error_mark_node;
|
1998-11-16 21:45:16 +01:00
|
|
|
|
|
1996-02-01 20:33:01 +01:00
|
|
|
|
/* If exp is a reference to polymorphic type, get the real type_info. */
|
1999-12-21 01:19:01 +01:00
|
|
|
|
if (TYPE_POLYMORPHIC_P (type) && ! resolves_to_fixed_type_p (exp, 0))
|
1996-02-01 20:33:01 +01:00
|
|
|
|
{
|
|
|
|
|
/* build reference to type_info from vtable. */
|
2000-03-28 21:27:15 +02:00
|
|
|
|
tree index;
|
1996-02-01 20:33:01 +01:00
|
|
|
|
|
2001-02-18 21:31:44 +01:00
|
|
|
|
/* The RTTI information is at index -1. */
|
2002-06-14 02:50:34 +02:00
|
|
|
|
index = build_int_2 (-1 * TARGET_VTABLE_DATA_ENTRY_DISTANCE, -1);
|
2001-08-15 01:51:27 +02:00
|
|
|
|
t = build_vtbl_ref (exp, index);
|
2002-06-30 22:41:38 +02:00
|
|
|
|
TREE_TYPE (t) = type_info_ptr_type;
|
1996-02-01 20:33:01 +01:00
|
|
|
|
}
|
2003-01-10 21:30:56 +01:00
|
|
|
|
else
|
|
|
|
|
/* Otherwise return the type_info for the static type of the expr. */
|
|
|
|
|
t = get_tinfo_ptr (TYPE_MAIN_VARIANT (type));
|
1996-02-01 20:33:01 +01:00
|
|
|
|
|
2003-01-10 21:30:56 +01:00
|
|
|
|
return build_indirect_ref (t, NULL);
|
1996-09-30 23:34:04 +02:00
|
|
|
|
}
|
|
|
|
|
|
2001-07-24 10:56:12 +02:00
|
|
|
|
static bool
|
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
|
|
|
|
typeid_ok_p (void)
|
1996-09-30 23:34:04 +02:00
|
|
|
|
{
|
1999-04-27 11:41:33 +02:00
|
|
|
|
if (! flag_rtti)
|
|
|
|
|
{
|
|
|
|
|
error ("cannot use typeid with -fno-rtti");
|
2001-07-24 10:56:12 +02:00
|
|
|
|
return false;
|
1999-04-27 11:41:33 +02:00
|
|
|
|
}
|
|
|
|
|
|
tree.h (COMPLETE_TYPE_P): New macro.
gcc
* tree.h (COMPLETE_TYPE_P): New macro.
(COMPLETE_OR_VOID_TYPE_P): New macro.
(COMPLETE_OR_UNBOUND_ARRAY_TYPE_P): New macro.
* stor-layout.c (layout_type, case VOID_TYPE): Don't set TYPE_SIZE.
* c-aux-info.c (gen_type): Use them.
* c-common.c (c_expand_expr_stmt): Likewise.
* c-decl.c (poplevel, pushdecl, start_decl, finish_decl,
grokdeclarator, grokparms, finish_struct, start_function,
store_parm_decls, combine_parm_decls): Likewise.
* c-parse.y (cast_expr): Likewise.
* c-typeck.c (require_complete_type, c_sizeof, c_sizeof_nowarn,
c_size_in_bytes, c_alignof, build_component_ref,
build_indirect_ref, build_array_ref, convert_arguments,
build_binary_op, pointer_diff, build_unary_op, digest_init: Likewise.
* calls.c (initialize_argument_information): Likewise.
* convert.c (convert_to_integer): Likewise.
* dbxout.c (dbxout_typedefs, dbxout_type, dbxout_symbol): Likewise.
* dwarfout.c (location_or_const_value_attribute,
output_enumeration_type_die, output_structure_type_die,
output_union_type_die, output_type): Likewise.
* expr.c (safe_from_p, expand_expr): Likewise.
* function.c (assign_parms): Likewise.
* sdbout.c (sdbout_symbol, sdbout_one_type): Likewise.
* tree.c (build_array_type, build_function_type,
build_method_type, build_offset_type, build_complex_type): Likewise.
* c-parse.c, c-parse.h: Regenerated.
gcc/cp
* typeck.c (require_complete_type, complete_type,
complete_type_or_else, c_sizeof, c_sizeof_nowarn,
build_array_ref, convert_arguments, pointer_diff,
build_x_unary_op, build_unary_op, build_c_cast,
build_modify_expr): Use COMPLETE_TYPE_P etc.
* call.c (is_complete, convert_like_real,
build_new_method_call): Likewise.
* class.c (build_vbase_pointer_fields, check_bases,
build_base_field, finish_struct_1, pushclass): Likewise.
* cvt.c (cp_convert_to_pointer, convert_to_void): Likewise.
* decl.c (maybe_process_template_type_declaration, pushtag,
pushdecl, redeclaration_error_message, start_decl, start_decl_1,
layout_var_decl, check_initializer, cp_finish_decl,
grokdeclarator, require_complete_types_for_parms,
grok_op_properties, xref_tag, xref_basetypes,
check_function_type): Likewise.
* decl2.c (check_classfn, reparse_absdcl_as_casts): Likewise.
* friend.c (do_friend): Likewise.
* init.c (build_offset_ref): Likewise.
* parse.y (structsp): Likewise.
* pt.c (maybe_process_partial_specialization,
tsubst_friend_function, instantiate_class_template, tsubst,
do_type_instantiation, instantiate_pending_templates): Likewise.
* repo.c (repo_get_id): Likewise.
* rtti.c (build_typeid, get_typeid, build_dynamic_cast_1,
synthesize_tinfo_var, emit_support_tinfos): Likewise.
* search.c (lookup_fnfields_1, lookup_conversions): Likewise.
* semantics.c (begin_class_definition): Likewise.
* tree.c (build_cplus_method_type): Likewise.
* typeck2.c (digest_init, build_functional_cast,
add_exception_specifier): Likewise.
* parse.h, parse.c: Regenerated.
From-SVN: r32671
2000-03-21 19:10:48 +01:00
|
|
|
|
if (!COMPLETE_TYPE_P (type_info_type_node))
|
1998-11-16 21:45:16 +01:00
|
|
|
|
{
|
|
|
|
|
error ("must #include <typeinfo> before using typeid");
|
2001-07-24 10:56:12 +02:00
|
|
|
|
return false;
|
1998-11-16 21:45:16 +01:00
|
|
|
|
}
|
|
|
|
|
|
2001-07-24 10:56:12 +02:00
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
2003-01-10 21:30:56 +01:00
|
|
|
|
/* Return an expression for "typeid(EXP)". The expression returned is
|
|
|
|
|
an lvalue of type "const std::type_info". */
|
|
|
|
|
|
2001-07-24 10:56:12 +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_typeid (tree exp)
|
2001-07-24 10:56:12 +02:00
|
|
|
|
{
|
|
|
|
|
tree cond = NULL_TREE;
|
|
|
|
|
int nonnull = 0;
|
|
|
|
|
|
|
|
|
|
if (exp == error_mark_node || !typeid_ok_p ())
|
|
|
|
|
return error_mark_node;
|
|
|
|
|
|
1996-09-30 23:34:04 +02:00
|
|
|
|
if (processing_template_decl)
|
2002-12-28 09:03:42 +01:00
|
|
|
|
return build_min (TYPEID_EXPR, type_info_ref_type, exp);
|
1996-09-30 23:34:04 +02:00
|
|
|
|
|
|
|
|
|
if (TREE_CODE (exp) == INDIRECT_REF
|
|
|
|
|
&& TREE_CODE (TREE_TYPE (TREE_OPERAND (exp, 0))) == POINTER_TYPE
|
1999-12-21 01:19:01 +01:00
|
|
|
|
&& TYPE_POLYMORPHIC_P (TREE_TYPE (exp))
|
1996-09-30 23:34:04 +02:00
|
|
|
|
&& ! resolves_to_fixed_type_p (exp, &nonnull)
|
|
|
|
|
&& ! nonnull)
|
|
|
|
|
{
|
|
|
|
|
exp = stabilize_reference (exp);
|
1997-05-29 01:20:02 +02:00
|
|
|
|
cond = cp_convert (boolean_type_node, TREE_OPERAND (exp, 0));
|
1996-09-30 23:34:04 +02:00
|
|
|
|
}
|
|
|
|
|
|
2000-01-18 11:23:31 +01:00
|
|
|
|
exp = get_tinfo_decl_dynamic (exp);
|
1996-11-12 20:49:48 +01:00
|
|
|
|
|
|
|
|
|
if (exp == error_mark_node)
|
|
|
|
|
return error_mark_node;
|
|
|
|
|
|
1996-09-30 23:34:04 +02:00
|
|
|
|
if (cond)
|
|
|
|
|
{
|
|
|
|
|
tree bad = throw_bad_typeid ();
|
|
|
|
|
|
2000-01-18 11:23:31 +01:00
|
|
|
|
exp = build (COND_EXPR, TREE_TYPE (exp), cond, exp, bad);
|
1996-09-30 23:34:04 +02:00
|
|
|
|
}
|
|
|
|
|
|
2003-01-10 21:30:56 +01:00
|
|
|
|
return exp;
|
1996-02-01 20:33:01 +01:00
|
|
|
|
}
|
|
|
|
|
|
cp-tree.h (CPTI_TP_DESC_TYPE, [...]): Remove cp_tree_index enumerations.
* cp-tree.h (CPTI_TP_DESC_TYPE, CPTI_ACCESS_MODE_TYPE,
CPTI_USER_DESC_TYPE, CPTI_CLASS_DESC_TYPE, CPTI_ATTR_DESC_TYPE,
CPTI_PTMF_DESC_TYPE): Remove cp_tree_index enumerations.
(CPTI_TI_DESC_TYPE, CPTI_REF_DESC_TYPE, CPTI_ARY_DESC_TYPE,
CPTI_ENUM_DESC_TYPE, CPTI_CLASS_DESC_TYPE, CPTI_SI_CLASS_DESC_TYPE,
CPTI_VMI_CLASS_DESC_TYPE, CPTI_BASE_DESC_TYPE): New enumerations.
(CPTI_TINFO_FN_ID, CPTI_TINFO_FN_TYPE): Rename to ...
(CPTI_TINFO_DECL_ID, CPTI_TINFO_DECL_TYPE): ... here.
(CPTI_TINFO_VAR_ID): New enumeration.
(__tp_desc_type_node, __access_mode_type_node,
__bltn_desc_type_node, __user_desc_type_node,
__class_desc_type_node, __ptr_desc_type_node,
__attr_desc_type_node, __func_desc_type_node,
__ptmf_desc_type_node, __ptmd_desc_type_node): Remove #defines.
(ti_desc_type_node, bltn_desc_type_node, ptr_desc_type_node,
ref_desc_type_node, ary_desc_type_node, func_desc_type_node,
enum_desc_type_node, class_desc_type_node,
si_class_desc_type_node, vmi_class_desc_type_node,
ptmd_desc_type_node, base_desc_type_node): New #defines.
(tinfo_fn_id, tinfo_fn_type): Rename to ...
(tinfo_decl_id, tinfo_decl_type): ... here. Adjust.
(tinfo_var_id): New enumeration.
(DECL_TINFO_FN_P): Augment comment.
* decl.c (cp_global_trees): Adjust documentation.
* rtti.c (init_rtti_processing): Adjust for tinfo_decl_id,
tinfo_decl_type and tinfo_var_id.
(get_tinfo_decl_dynamic): Adjust for tinfo_decl_type.
(build_typeid): Remove unused variable.
(get_tinfo_var): Use tinfo_var_id.
(tinfo_name): New static function.
(get_tinfo_decl): Adjust for tinfo_decl_id and tinfo_decl_type.
(tinfo_from_decl): Likewise.
(get_base_offset): New static function, broken out of
expand_class_desc.
(expand_si_desc): Use tinfo_name.
(expand_class_desc): Likewise. Lose local static variable.
Use base_desc_type_node. Use get_base_offset.
(expand_ptr_desc): Use tinfo_name.
(expand_attr_desc): Likewise.
(expand_generic_desc): Likewise.
* tinfo.cc (__GXX_ABI_VERSION): Test value and existance.
* tinfo.h (__GXX_ABI_VERSION): Test value and existance.
From-SVN: r31582
2000-01-24 11:23:26 +01:00
|
|
|
|
/* Generate the NTBS name of a type. */
|
|
|
|
|
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
|
|
|
|
tinfo_name (tree type)
|
cp-tree.h (CPTI_TP_DESC_TYPE, [...]): Remove cp_tree_index enumerations.
* cp-tree.h (CPTI_TP_DESC_TYPE, CPTI_ACCESS_MODE_TYPE,
CPTI_USER_DESC_TYPE, CPTI_CLASS_DESC_TYPE, CPTI_ATTR_DESC_TYPE,
CPTI_PTMF_DESC_TYPE): Remove cp_tree_index enumerations.
(CPTI_TI_DESC_TYPE, CPTI_REF_DESC_TYPE, CPTI_ARY_DESC_TYPE,
CPTI_ENUM_DESC_TYPE, CPTI_CLASS_DESC_TYPE, CPTI_SI_CLASS_DESC_TYPE,
CPTI_VMI_CLASS_DESC_TYPE, CPTI_BASE_DESC_TYPE): New enumerations.
(CPTI_TINFO_FN_ID, CPTI_TINFO_FN_TYPE): Rename to ...
(CPTI_TINFO_DECL_ID, CPTI_TINFO_DECL_TYPE): ... here.
(CPTI_TINFO_VAR_ID): New enumeration.
(__tp_desc_type_node, __access_mode_type_node,
__bltn_desc_type_node, __user_desc_type_node,
__class_desc_type_node, __ptr_desc_type_node,
__attr_desc_type_node, __func_desc_type_node,
__ptmf_desc_type_node, __ptmd_desc_type_node): Remove #defines.
(ti_desc_type_node, bltn_desc_type_node, ptr_desc_type_node,
ref_desc_type_node, ary_desc_type_node, func_desc_type_node,
enum_desc_type_node, class_desc_type_node,
si_class_desc_type_node, vmi_class_desc_type_node,
ptmd_desc_type_node, base_desc_type_node): New #defines.
(tinfo_fn_id, tinfo_fn_type): Rename to ...
(tinfo_decl_id, tinfo_decl_type): ... here. Adjust.
(tinfo_var_id): New enumeration.
(DECL_TINFO_FN_P): Augment comment.
* decl.c (cp_global_trees): Adjust documentation.
* rtti.c (init_rtti_processing): Adjust for tinfo_decl_id,
tinfo_decl_type and tinfo_var_id.
(get_tinfo_decl_dynamic): Adjust for tinfo_decl_type.
(build_typeid): Remove unused variable.
(get_tinfo_var): Use tinfo_var_id.
(tinfo_name): New static function.
(get_tinfo_decl): Adjust for tinfo_decl_id and tinfo_decl_type.
(tinfo_from_decl): Likewise.
(get_base_offset): New static function, broken out of
expand_class_desc.
(expand_si_desc): Use tinfo_name.
(expand_class_desc): Likewise. Lose local static variable.
Use base_desc_type_node. Use get_base_offset.
(expand_ptr_desc): Use tinfo_name.
(expand_attr_desc): Likewise.
(expand_generic_desc): Likewise.
* tinfo.cc (__GXX_ABI_VERSION): Test value and existance.
* tinfo.h (__GXX_ABI_VERSION): Test value and existance.
From-SVN: r31582
2000-01-24 11:23:26 +01:00
|
|
|
|
{
|
2000-06-04 23:12:27 +02:00
|
|
|
|
const char *name;
|
|
|
|
|
tree name_string;
|
|
|
|
|
|
2001-02-12 10:58:18 +01:00
|
|
|
|
name = mangle_type_string (type);
|
2002-04-26 09:40:12 +02:00
|
|
|
|
name_string = fix_string_type (build_string (strlen (name) + 1, name));
|
cp-tree.h (CPTI_TP_DESC_TYPE, [...]): Remove cp_tree_index enumerations.
* cp-tree.h (CPTI_TP_DESC_TYPE, CPTI_ACCESS_MODE_TYPE,
CPTI_USER_DESC_TYPE, CPTI_CLASS_DESC_TYPE, CPTI_ATTR_DESC_TYPE,
CPTI_PTMF_DESC_TYPE): Remove cp_tree_index enumerations.
(CPTI_TI_DESC_TYPE, CPTI_REF_DESC_TYPE, CPTI_ARY_DESC_TYPE,
CPTI_ENUM_DESC_TYPE, CPTI_CLASS_DESC_TYPE, CPTI_SI_CLASS_DESC_TYPE,
CPTI_VMI_CLASS_DESC_TYPE, CPTI_BASE_DESC_TYPE): New enumerations.
(CPTI_TINFO_FN_ID, CPTI_TINFO_FN_TYPE): Rename to ...
(CPTI_TINFO_DECL_ID, CPTI_TINFO_DECL_TYPE): ... here.
(CPTI_TINFO_VAR_ID): New enumeration.
(__tp_desc_type_node, __access_mode_type_node,
__bltn_desc_type_node, __user_desc_type_node,
__class_desc_type_node, __ptr_desc_type_node,
__attr_desc_type_node, __func_desc_type_node,
__ptmf_desc_type_node, __ptmd_desc_type_node): Remove #defines.
(ti_desc_type_node, bltn_desc_type_node, ptr_desc_type_node,
ref_desc_type_node, ary_desc_type_node, func_desc_type_node,
enum_desc_type_node, class_desc_type_node,
si_class_desc_type_node, vmi_class_desc_type_node,
ptmd_desc_type_node, base_desc_type_node): New #defines.
(tinfo_fn_id, tinfo_fn_type): Rename to ...
(tinfo_decl_id, tinfo_decl_type): ... here. Adjust.
(tinfo_var_id): New enumeration.
(DECL_TINFO_FN_P): Augment comment.
* decl.c (cp_global_trees): Adjust documentation.
* rtti.c (init_rtti_processing): Adjust for tinfo_decl_id,
tinfo_decl_type and tinfo_var_id.
(get_tinfo_decl_dynamic): Adjust for tinfo_decl_type.
(build_typeid): Remove unused variable.
(get_tinfo_var): Use tinfo_var_id.
(tinfo_name): New static function.
(get_tinfo_decl): Adjust for tinfo_decl_id and tinfo_decl_type.
(tinfo_from_decl): Likewise.
(get_base_offset): New static function, broken out of
expand_class_desc.
(expand_si_desc): Use tinfo_name.
(expand_class_desc): Likewise. Lose local static variable.
Use base_desc_type_node. Use get_base_offset.
(expand_ptr_desc): Use tinfo_name.
(expand_attr_desc): Likewise.
(expand_generic_desc): Likewise.
* tinfo.cc (__GXX_ABI_VERSION): Test value and existance.
* tinfo.h (__GXX_ABI_VERSION): Test value and existance.
From-SVN: r31582
2000-01-24 11:23:26 +01:00
|
|
|
|
return name_string;
|
|
|
|
|
}
|
|
|
|
|
|
2002-06-30 22:41:38 +02:00
|
|
|
|
/* Return a VAR_DECL for the internal ABI defined type_info object for
|
|
|
|
|
TYPE. You must arrange that the decl is mark_used, if actually use
|
|
|
|
|
it --- decls in vtables are only used if the vtable is output. */
|
1999-11-13 10:39:11 +01:00
|
|
|
|
|
1996-04-13 01:55:07 +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_tinfo_decl (tree type)
|
1996-04-13 01:55:07 +02:00
|
|
|
|
{
|
1996-11-12 20:49:48 +01:00
|
|
|
|
tree name;
|
1996-04-13 01:55:07 +02:00
|
|
|
|
tree d;
|
|
|
|
|
|
2001-04-04 06:45:23 +02:00
|
|
|
|
if (COMPLETE_TYPE_P (type)
|
|
|
|
|
&& TREE_CODE (TYPE_SIZE (type)) != INTEGER_CST)
|
|
|
|
|
{
|
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
|
|
|
|
error ("cannot create type information for type `%T' because its size is variable",
|
2002-06-30 22:41:38 +02:00
|
|
|
|
type);
|
2001-04-04 06:45:23 +02:00
|
|
|
|
return error_mark_node;
|
|
|
|
|
}
|
|
|
|
|
|
1996-11-12 20:49:48 +01:00
|
|
|
|
if (TREE_CODE (type) == OFFSET_TYPE)
|
|
|
|
|
type = TREE_TYPE (type);
|
|
|
|
|
if (TREE_CODE (type) == METHOD_TYPE)
|
|
|
|
|
type = build_function_type (TREE_TYPE (type),
|
|
|
|
|
TREE_CHAIN (TYPE_ARG_TYPES (type)));
|
|
|
|
|
|
2002-12-01 21:27:37 +01:00
|
|
|
|
/* For a class type, the variable is cached in the type node
|
|
|
|
|
itself. */
|
|
|
|
|
if (CLASS_TYPE_P (type))
|
|
|
|
|
{
|
|
|
|
|
d = CLASSTYPE_TYPEINFO_VAR (TYPE_MAIN_VARIANT (type));
|
|
|
|
|
if (d)
|
|
|
|
|
return d;
|
|
|
|
|
}
|
|
|
|
|
|
2001-02-12 10:58:18 +01:00
|
|
|
|
name = mangle_typeinfo_for_type (type);
|
2000-06-09 18:26:24 +02:00
|
|
|
|
|
2000-01-28 14:30:13 +01:00
|
|
|
|
d = IDENTIFIER_GLOBAL_VALUE (name);
|
2002-06-30 22:41:38 +02:00
|
|
|
|
if (!d)
|
2000-01-28 14:30:13 +01:00
|
|
|
|
{
|
2002-06-30 22:41:38 +02:00
|
|
|
|
tree var_desc = get_pseudo_ti_desc (type);
|
|
|
|
|
|
|
|
|
|
d = build_lang_decl (VAR_DECL, name, TINFO_PSEUDO_TYPE (var_desc));
|
2000-01-28 14:30:13 +01:00
|
|
|
|
|
|
|
|
|
DECL_ARTIFICIAL (d) = 1;
|
|
|
|
|
TREE_READONLY (d) = 1;
|
|
|
|
|
TREE_STATIC (d) = 1;
|
|
|
|
|
DECL_EXTERNAL (d) = 1;
|
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
|
|
|
|
SET_DECL_ASSEMBLER_NAME (d, name);
|
2002-07-17 13:46:38 +02:00
|
|
|
|
DECL_COMDAT (d) = 1;
|
2000-01-28 14:30:13 +01:00
|
|
|
|
cp_finish_decl (d, NULL_TREE, NULL_TREE, 0);
|
1998-07-23 04:29:34 +02:00
|
|
|
|
|
2000-01-28 14:30:13 +01:00
|
|
|
|
pushdecl_top_level (d);
|
2002-06-30 22:41:38 +02:00
|
|
|
|
|
2002-12-01 21:27:37 +01:00
|
|
|
|
if (CLASS_TYPE_P (type))
|
|
|
|
|
CLASSTYPE_TYPEINFO_VAR (TYPE_MAIN_VARIANT (type)) = d;
|
|
|
|
|
|
2000-01-28 14:30:13 +01:00
|
|
|
|
/* Remember the type it is for. */
|
|
|
|
|
TREE_TYPE (name) = type;
|
2003-03-20 22:14:30 +01:00
|
|
|
|
|
|
|
|
|
/* Add decl to the global array of tinfo decls. */
|
|
|
|
|
my_friendly_assert (unemitted_tinfo_decls != 0, 20030312);
|
|
|
|
|
VARRAY_PUSH_TREE (unemitted_tinfo_decls, d);
|
2000-01-28 14:30:13 +01:00
|
|
|
|
}
|
2002-06-30 22:41:38 +02:00
|
|
|
|
|
1996-04-13 01:55:07 +02:00
|
|
|
|
return d;
|
|
|
|
|
}
|
|
|
|
|
|
2002-06-30 22:41:38 +02:00
|
|
|
|
/* Return a pointer to a type_info object describing TYPE, suitably
|
|
|
|
|
cast to the language defined type. */
|
|
|
|
|
|
|
|
|
|
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_tinfo_ptr (tree type)
|
2002-06-30 22:41:38 +02:00
|
|
|
|
{
|
2003-03-07 08:02:02 +01:00
|
|
|
|
return build_nop (type_info_ptr_type,
|
|
|
|
|
build_address (get_tinfo_decl (type)));
|
2002-06-30 22:41:38 +02:00
|
|
|
|
}
|
|
|
|
|
|
2000-01-18 11:23:31 +01:00
|
|
|
|
/* Return the type_info object for TYPE. */
|
1996-07-11 03:13:25 +02:00
|
|
|
|
|
1996-02-01 20:33:01 +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
|
|
|
|
get_typeid (tree type)
|
1996-02-01 20:33:01 +01:00
|
|
|
|
{
|
2001-07-24 10:56:12 +02:00
|
|
|
|
if (type == error_mark_node || !typeid_ok_p ())
|
1996-02-01 20:33:01 +01:00
|
|
|
|
return error_mark_node;
|
1998-11-16 21:45:16 +01:00
|
|
|
|
|
1997-02-12 21:23:55 +01:00
|
|
|
|
if (processing_template_decl)
|
2002-12-28 09:03:42 +01:00
|
|
|
|
return build_min (TYPEID_EXPR, type_info_ref_type, type);
|
1997-02-12 21:23:55 +01:00
|
|
|
|
|
1996-04-13 01:55:07 +02:00
|
|
|
|
/* If the type of the type-id is a reference type, the result of the
|
|
|
|
|
typeid expression refers to a type_info object representing the
|
|
|
|
|
referenced type. */
|
1996-02-01 20:33:01 +01:00
|
|
|
|
if (TREE_CODE (type) == REFERENCE_TYPE)
|
|
|
|
|
type = TREE_TYPE (type);
|
|
|
|
|
|
1996-04-13 01:55:07 +02:00
|
|
|
|
/* The top-level cv-qualifiers of the lvalue expression or the type-id
|
1996-07-11 03:13:25 +02:00
|
|
|
|
that is the operand of typeid are always ignored. */
|
1996-04-13 01:55:07 +02:00
|
|
|
|
type = TYPE_MAIN_VARIANT (type);
|
1996-02-01 20:33:01 +01:00
|
|
|
|
|
2000-06-20 17:42:55 +02:00
|
|
|
|
if (!VOID_TYPE_P (type))
|
2000-01-18 11:23:31 +01:00
|
|
|
|
type = complete_type_or_else (type, NULL_TREE);
|
|
|
|
|
|
|
|
|
|
if (!type)
|
|
|
|
|
return error_mark_node;
|
1998-11-16 21:45:16 +01:00
|
|
|
|
|
2002-06-30 22:41:38 +02:00
|
|
|
|
return build_indirect_ref (get_tinfo_ptr (type), NULL);
|
1996-02-01 20:33:01 +01:00
|
|
|
|
}
|
|
|
|
|
|
1996-04-19 02:48:03 +02:00
|
|
|
|
/* Check whether TEST is null before returning RESULT. If TEST is used in
|
|
|
|
|
RESULT, it must have previously had a save_expr applied to it. */
|
|
|
|
|
|
1997-02-04 03:31:49 +01: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
|
|
|
|
ifnonnull (tree test, tree result)
|
1996-04-19 02:48:03 +02:00
|
|
|
|
{
|
|
|
|
|
return build (COND_EXPR, TREE_TYPE (result),
|
|
|
|
|
build (EQ_EXPR, boolean_type_node, test, integer_zero_node),
|
1997-05-29 01:20:02 +02:00
|
|
|
|
cp_convert (TREE_TYPE (result), integer_zero_node),
|
1996-04-19 02:48:03 +02:00
|
|
|
|
result);
|
|
|
|
|
}
|
|
|
|
|
|
1996-02-01 20:33:01 +01:00
|
|
|
|
/* Execute a dynamic cast, as described in section 5.2.6 of the 9/93 working
|
|
|
|
|
paper. */
|
1996-04-13 01:55:07 +02:00
|
|
|
|
|
1997-07-24 23:09:25 +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
|
|
|
|
build_dynamic_cast_1 (tree type, tree expr)
|
1996-02-01 20:33:01 +01:00
|
|
|
|
{
|
|
|
|
|
enum tree_code tc = TREE_CODE (type);
|
2000-04-11 02:38:39 +02:00
|
|
|
|
tree exprtype = TREE_TYPE (expr);
|
1996-04-13 01:55:07 +02:00
|
|
|
|
tree dcast_fn;
|
1998-11-16 21:45:16 +01:00
|
|
|
|
tree old_expr = expr;
|
2000-04-04 22:46:23 +02:00
|
|
|
|
const char *errstr = NULL;
|
1996-02-01 20:33:01 +01:00
|
|
|
|
|
2000-03-17 01:56:12 +01:00
|
|
|
|
/* T shall be a pointer or reference to a complete class type, or
|
|
|
|
|
`pointer to cv void''. */
|
1996-02-01 20:33:01 +01:00
|
|
|
|
switch (tc)
|
|
|
|
|
{
|
|
|
|
|
case POINTER_TYPE:
|
2000-03-17 01:56:12 +01:00
|
|
|
|
if (TREE_CODE (TREE_TYPE (type)) == VOID_TYPE)
|
1996-02-01 20:33:01 +01:00
|
|
|
|
break;
|
|
|
|
|
case REFERENCE_TYPE:
|
2000-03-17 01:56:12 +01:00
|
|
|
|
if (! IS_AGGR_TYPE (TREE_TYPE (type)))
|
|
|
|
|
{
|
|
|
|
|
errstr = "target is not pointer or reference to class";
|
|
|
|
|
goto fail;
|
|
|
|
|
}
|
tree.h (COMPLETE_TYPE_P): New macro.
gcc
* tree.h (COMPLETE_TYPE_P): New macro.
(COMPLETE_OR_VOID_TYPE_P): New macro.
(COMPLETE_OR_UNBOUND_ARRAY_TYPE_P): New macro.
* stor-layout.c (layout_type, case VOID_TYPE): Don't set TYPE_SIZE.
* c-aux-info.c (gen_type): Use them.
* c-common.c (c_expand_expr_stmt): Likewise.
* c-decl.c (poplevel, pushdecl, start_decl, finish_decl,
grokdeclarator, grokparms, finish_struct, start_function,
store_parm_decls, combine_parm_decls): Likewise.
* c-parse.y (cast_expr): Likewise.
* c-typeck.c (require_complete_type, c_sizeof, c_sizeof_nowarn,
c_size_in_bytes, c_alignof, build_component_ref,
build_indirect_ref, build_array_ref, convert_arguments,
build_binary_op, pointer_diff, build_unary_op, digest_init: Likewise.
* calls.c (initialize_argument_information): Likewise.
* convert.c (convert_to_integer): Likewise.
* dbxout.c (dbxout_typedefs, dbxout_type, dbxout_symbol): Likewise.
* dwarfout.c (location_or_const_value_attribute,
output_enumeration_type_die, output_structure_type_die,
output_union_type_die, output_type): Likewise.
* expr.c (safe_from_p, expand_expr): Likewise.
* function.c (assign_parms): Likewise.
* sdbout.c (sdbout_symbol, sdbout_one_type): Likewise.
* tree.c (build_array_type, build_function_type,
build_method_type, build_offset_type, build_complex_type): Likewise.
* c-parse.c, c-parse.h: Regenerated.
gcc/cp
* typeck.c (require_complete_type, complete_type,
complete_type_or_else, c_sizeof, c_sizeof_nowarn,
build_array_ref, convert_arguments, pointer_diff,
build_x_unary_op, build_unary_op, build_c_cast,
build_modify_expr): Use COMPLETE_TYPE_P etc.
* call.c (is_complete, convert_like_real,
build_new_method_call): Likewise.
* class.c (build_vbase_pointer_fields, check_bases,
build_base_field, finish_struct_1, pushclass): Likewise.
* cvt.c (cp_convert_to_pointer, convert_to_void): Likewise.
* decl.c (maybe_process_template_type_declaration, pushtag,
pushdecl, redeclaration_error_message, start_decl, start_decl_1,
layout_var_decl, check_initializer, cp_finish_decl,
grokdeclarator, require_complete_types_for_parms,
grok_op_properties, xref_tag, xref_basetypes,
check_function_type): Likewise.
* decl2.c (check_classfn, reparse_absdcl_as_casts): Likewise.
* friend.c (do_friend): Likewise.
* init.c (build_offset_ref): Likewise.
* parse.y (structsp): Likewise.
* pt.c (maybe_process_partial_specialization,
tsubst_friend_function, instantiate_class_template, tsubst,
do_type_instantiation, instantiate_pending_templates): Likewise.
* repo.c (repo_get_id): Likewise.
* rtti.c (build_typeid, get_typeid, build_dynamic_cast_1,
synthesize_tinfo_var, emit_support_tinfos): Likewise.
* search.c (lookup_fnfields_1, lookup_conversions): Likewise.
* semantics.c (begin_class_definition): Likewise.
* tree.c (build_cplus_method_type): Likewise.
* typeck2.c (digest_init, build_functional_cast,
add_exception_specifier): Likewise.
* parse.h, parse.c: Regenerated.
From-SVN: r32671
2000-03-21 19:10:48 +01:00
|
|
|
|
if (!COMPLETE_TYPE_P (complete_type (TREE_TYPE (type))))
|
2000-03-17 01:56:12 +01:00
|
|
|
|
{
|
|
|
|
|
errstr = "target is not pointer or reference to complete type";
|
|
|
|
|
goto fail;
|
|
|
|
|
}
|
1996-04-05 20:07:00 +02:00
|
|
|
|
break;
|
2000-03-17 01:56:12 +01:00
|
|
|
|
|
1996-02-01 20:33:01 +01:00
|
|
|
|
default:
|
2000-03-17 01:56:12 +01:00
|
|
|
|
errstr = "target is not pointer or reference";
|
1996-02-01 20:33:01 +01:00
|
|
|
|
goto fail;
|
|
|
|
|
}
|
|
|
|
|
|
2000-03-17 01:56:12 +01:00
|
|
|
|
if (TREE_CODE (expr) == OFFSET_REF)
|
2000-04-11 02:38:39 +02:00
|
|
|
|
{
|
|
|
|
|
expr = resolve_offset_ref (expr);
|
|
|
|
|
exprtype = TREE_TYPE (expr);
|
|
|
|
|
}
|
2000-03-17 01:56:12 +01:00
|
|
|
|
|
|
|
|
|
if (tc == POINTER_TYPE)
|
|
|
|
|
expr = convert_from_reference (expr);
|
|
|
|
|
else if (TREE_CODE (exprtype) != REFERENCE_TYPE)
|
1996-02-01 20:33:01 +01:00
|
|
|
|
{
|
2000-03-17 01:56:12 +01:00
|
|
|
|
/* Apply trivial conversion T -> T& for dereferenced ptrs. */
|
1996-02-01 20:33:01 +01:00
|
|
|
|
exprtype = build_reference_type (exprtype);
|
|
|
|
|
expr = convert_to_reference (exprtype, expr, CONV_IMPLICIT,
|
|
|
|
|
LOOKUP_NORMAL, NULL_TREE);
|
|
|
|
|
}
|
|
|
|
|
|
2000-03-17 01:56:12 +01:00
|
|
|
|
exprtype = TREE_TYPE (expr);
|
|
|
|
|
|
|
|
|
|
if (tc == POINTER_TYPE)
|
1996-02-01 20:33:01 +01:00
|
|
|
|
{
|
2000-03-17 01:56:12 +01:00
|
|
|
|
/* If T is a pointer type, v shall be an rvalue of a pointer to
|
|
|
|
|
complete class type, and the result is an rvalue of type T. */
|
|
|
|
|
|
|
|
|
|
if (TREE_CODE (exprtype) != POINTER_TYPE)
|
|
|
|
|
{
|
|
|
|
|
errstr = "source is not a pointer";
|
|
|
|
|
goto fail;
|
|
|
|
|
}
|
|
|
|
|
if (! IS_AGGR_TYPE (TREE_TYPE (exprtype)))
|
|
|
|
|
{
|
|
|
|
|
errstr = "source is not a pointer to class";
|
|
|
|
|
goto fail;
|
|
|
|
|
}
|
tree.h (COMPLETE_TYPE_P): New macro.
gcc
* tree.h (COMPLETE_TYPE_P): New macro.
(COMPLETE_OR_VOID_TYPE_P): New macro.
(COMPLETE_OR_UNBOUND_ARRAY_TYPE_P): New macro.
* stor-layout.c (layout_type, case VOID_TYPE): Don't set TYPE_SIZE.
* c-aux-info.c (gen_type): Use them.
* c-common.c (c_expand_expr_stmt): Likewise.
* c-decl.c (poplevel, pushdecl, start_decl, finish_decl,
grokdeclarator, grokparms, finish_struct, start_function,
store_parm_decls, combine_parm_decls): Likewise.
* c-parse.y (cast_expr): Likewise.
* c-typeck.c (require_complete_type, c_sizeof, c_sizeof_nowarn,
c_size_in_bytes, c_alignof, build_component_ref,
build_indirect_ref, build_array_ref, convert_arguments,
build_binary_op, pointer_diff, build_unary_op, digest_init: Likewise.
* calls.c (initialize_argument_information): Likewise.
* convert.c (convert_to_integer): Likewise.
* dbxout.c (dbxout_typedefs, dbxout_type, dbxout_symbol): Likewise.
* dwarfout.c (location_or_const_value_attribute,
output_enumeration_type_die, output_structure_type_die,
output_union_type_die, output_type): Likewise.
* expr.c (safe_from_p, expand_expr): Likewise.
* function.c (assign_parms): Likewise.
* sdbout.c (sdbout_symbol, sdbout_one_type): Likewise.
* tree.c (build_array_type, build_function_type,
build_method_type, build_offset_type, build_complex_type): Likewise.
* c-parse.c, c-parse.h: Regenerated.
gcc/cp
* typeck.c (require_complete_type, complete_type,
complete_type_or_else, c_sizeof, c_sizeof_nowarn,
build_array_ref, convert_arguments, pointer_diff,
build_x_unary_op, build_unary_op, build_c_cast,
build_modify_expr): Use COMPLETE_TYPE_P etc.
* call.c (is_complete, convert_like_real,
build_new_method_call): Likewise.
* class.c (build_vbase_pointer_fields, check_bases,
build_base_field, finish_struct_1, pushclass): Likewise.
* cvt.c (cp_convert_to_pointer, convert_to_void): Likewise.
* decl.c (maybe_process_template_type_declaration, pushtag,
pushdecl, redeclaration_error_message, start_decl, start_decl_1,
layout_var_decl, check_initializer, cp_finish_decl,
grokdeclarator, require_complete_types_for_parms,
grok_op_properties, xref_tag, xref_basetypes,
check_function_type): Likewise.
* decl2.c (check_classfn, reparse_absdcl_as_casts): Likewise.
* friend.c (do_friend): Likewise.
* init.c (build_offset_ref): Likewise.
* parse.y (structsp): Likewise.
* pt.c (maybe_process_partial_specialization,
tsubst_friend_function, instantiate_class_template, tsubst,
do_type_instantiation, instantiate_pending_templates): Likewise.
* repo.c (repo_get_id): Likewise.
* rtti.c (build_typeid, get_typeid, build_dynamic_cast_1,
synthesize_tinfo_var, emit_support_tinfos): Likewise.
* search.c (lookup_fnfields_1, lookup_conversions): Likewise.
* semantics.c (begin_class_definition): Likewise.
* tree.c (build_cplus_method_type): Likewise.
* typeck2.c (digest_init, build_functional_cast,
add_exception_specifier): Likewise.
* parse.h, parse.c: Regenerated.
From-SVN: r32671
2000-03-21 19:10:48 +01:00
|
|
|
|
if (!COMPLETE_TYPE_P (complete_type (TREE_TYPE (exprtype))))
|
2000-03-17 01:56:12 +01:00
|
|
|
|
{
|
|
|
|
|
errstr = "source is a pointer to incomplete type";
|
|
|
|
|
goto fail;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
/* T is a reference type, v shall be an lvalue of a complete class
|
|
|
|
|
type, and the result is an lvalue of the type referred to by T. */
|
|
|
|
|
|
|
|
|
|
if (! IS_AGGR_TYPE (TREE_TYPE (exprtype)))
|
|
|
|
|
{
|
|
|
|
|
errstr = "source is not of class type";
|
|
|
|
|
goto fail;
|
|
|
|
|
}
|
tree.h (COMPLETE_TYPE_P): New macro.
gcc
* tree.h (COMPLETE_TYPE_P): New macro.
(COMPLETE_OR_VOID_TYPE_P): New macro.
(COMPLETE_OR_UNBOUND_ARRAY_TYPE_P): New macro.
* stor-layout.c (layout_type, case VOID_TYPE): Don't set TYPE_SIZE.
* c-aux-info.c (gen_type): Use them.
* c-common.c (c_expand_expr_stmt): Likewise.
* c-decl.c (poplevel, pushdecl, start_decl, finish_decl,
grokdeclarator, grokparms, finish_struct, start_function,
store_parm_decls, combine_parm_decls): Likewise.
* c-parse.y (cast_expr): Likewise.
* c-typeck.c (require_complete_type, c_sizeof, c_sizeof_nowarn,
c_size_in_bytes, c_alignof, build_component_ref,
build_indirect_ref, build_array_ref, convert_arguments,
build_binary_op, pointer_diff, build_unary_op, digest_init: Likewise.
* calls.c (initialize_argument_information): Likewise.
* convert.c (convert_to_integer): Likewise.
* dbxout.c (dbxout_typedefs, dbxout_type, dbxout_symbol): Likewise.
* dwarfout.c (location_or_const_value_attribute,
output_enumeration_type_die, output_structure_type_die,
output_union_type_die, output_type): Likewise.
* expr.c (safe_from_p, expand_expr): Likewise.
* function.c (assign_parms): Likewise.
* sdbout.c (sdbout_symbol, sdbout_one_type): Likewise.
* tree.c (build_array_type, build_function_type,
build_method_type, build_offset_type, build_complex_type): Likewise.
* c-parse.c, c-parse.h: Regenerated.
gcc/cp
* typeck.c (require_complete_type, complete_type,
complete_type_or_else, c_sizeof, c_sizeof_nowarn,
build_array_ref, convert_arguments, pointer_diff,
build_x_unary_op, build_unary_op, build_c_cast,
build_modify_expr): Use COMPLETE_TYPE_P etc.
* call.c (is_complete, convert_like_real,
build_new_method_call): Likewise.
* class.c (build_vbase_pointer_fields, check_bases,
build_base_field, finish_struct_1, pushclass): Likewise.
* cvt.c (cp_convert_to_pointer, convert_to_void): Likewise.
* decl.c (maybe_process_template_type_declaration, pushtag,
pushdecl, redeclaration_error_message, start_decl, start_decl_1,
layout_var_decl, check_initializer, cp_finish_decl,
grokdeclarator, require_complete_types_for_parms,
grok_op_properties, xref_tag, xref_basetypes,
check_function_type): Likewise.
* decl2.c (check_classfn, reparse_absdcl_as_casts): Likewise.
* friend.c (do_friend): Likewise.
* init.c (build_offset_ref): Likewise.
* parse.y (structsp): Likewise.
* pt.c (maybe_process_partial_specialization,
tsubst_friend_function, instantiate_class_template, tsubst,
do_type_instantiation, instantiate_pending_templates): Likewise.
* repo.c (repo_get_id): Likewise.
* rtti.c (build_typeid, get_typeid, build_dynamic_cast_1,
synthesize_tinfo_var, emit_support_tinfos): Likewise.
* search.c (lookup_fnfields_1, lookup_conversions): Likewise.
* semantics.c (begin_class_definition): Likewise.
* tree.c (build_cplus_method_type): Likewise.
* typeck2.c (digest_init, build_functional_cast,
add_exception_specifier): Likewise.
* parse.h, parse.c: Regenerated.
From-SVN: r32671
2000-03-21 19:10:48 +01:00
|
|
|
|
if (!COMPLETE_TYPE_P (complete_type (TREE_TYPE (exprtype))))
|
2000-03-17 01:56:12 +01:00
|
|
|
|
{
|
|
|
|
|
errstr = "source is of incomplete class type";
|
|
|
|
|
goto fail;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* The dynamic_cast operator shall not cast away constness. */
|
|
|
|
|
if (!at_least_as_qualified_p (TREE_TYPE (type),
|
|
|
|
|
TREE_TYPE (exprtype)))
|
|
|
|
|
{
|
|
|
|
|
errstr = "conversion casts away constness";
|
|
|
|
|
goto fail;
|
1996-02-01 20:33:01 +01:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* If *type is an unambiguous accessible base class of *exprtype,
|
|
|
|
|
convert statically. */
|
|
|
|
|
{
|
2001-11-25 14:21:45 +01:00
|
|
|
|
tree binfo;
|
1996-02-01 20:33:01 +01:00
|
|
|
|
|
2001-11-25 14:21:45 +01:00
|
|
|
|
binfo = lookup_base (TREE_TYPE (exprtype), TREE_TYPE (type),
|
|
|
|
|
ba_not_special, NULL);
|
1998-11-16 21:45:16 +01:00
|
|
|
|
|
2001-11-25 14:21:45 +01:00
|
|
|
|
if (binfo)
|
1998-11-16 21:45:16 +01:00
|
|
|
|
{
|
2001-11-25 14:21:45 +01:00
|
|
|
|
expr = build_base_path (PLUS_EXPR, convert_from_reference (expr),
|
|
|
|
|
binfo, 0);
|
2000-04-11 02:38:39 +02:00
|
|
|
|
if (TREE_CODE (exprtype) == POINTER_TYPE)
|
|
|
|
|
expr = non_lvalue (expr);
|
|
|
|
|
return expr;
|
|
|
|
|
}
|
1996-02-01 20:33:01 +01:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Otherwise *exprtype must be a polymorphic class (have a vtbl). */
|
1999-12-21 01:19:01 +01:00
|
|
|
|
if (TYPE_POLYMORPHIC_P (TREE_TYPE (exprtype)))
|
1996-02-01 20:33:01 +01:00
|
|
|
|
{
|
1996-04-19 02:48:03 +02:00
|
|
|
|
tree expr1;
|
1996-02-01 20:33:01 +01:00
|
|
|
|
/* if TYPE is `void *', return pointer to complete object. */
|
2000-06-20 17:42:55 +02:00
|
|
|
|
if (tc == POINTER_TYPE && VOID_TYPE_P (TREE_TYPE (type)))
|
1996-02-01 20:33:01 +01:00
|
|
|
|
{
|
|
|
|
|
/* if b is an object, dynamic_cast<void *>(&b) == (void *)&b. */
|
|
|
|
|
if (TREE_CODE (expr) == ADDR_EXPR
|
|
|
|
|
&& TREE_CODE (TREE_OPERAND (expr, 0)) == VAR_DECL
|
|
|
|
|
&& TREE_CODE (TREE_TYPE (TREE_OPERAND (expr, 0))) == RECORD_TYPE)
|
|
|
|
|
return build1 (NOP_EXPR, type, expr);
|
|
|
|
|
|
1996-04-19 02:48:03 +02:00
|
|
|
|
/* Since expr is used twice below, save it. */
|
|
|
|
|
expr = save_expr (expr);
|
|
|
|
|
|
|
|
|
|
expr1 = build_headof (expr);
|
|
|
|
|
if (TREE_TYPE (expr1) != type)
|
|
|
|
|
expr1 = build1 (NOP_EXPR, type, expr1);
|
|
|
|
|
return ifnonnull (expr, expr1);
|
1996-02-01 20:33:01 +01:00
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
tree retval;
|
2000-01-28 14:30:13 +01:00
|
|
|
|
tree result, td2, td3, elems;
|
1999-09-21 16:40:13 +02:00
|
|
|
|
tree static_type, target_type, boff;
|
1996-02-01 20:33:01 +01:00
|
|
|
|
|
|
|
|
|
/* If we got here, we can't convert statically. Therefore,
|
|
|
|
|
dynamic_cast<D&>(b) (b an object) cannot succeed. */
|
2000-03-17 01:56:12 +01:00
|
|
|
|
if (tc == REFERENCE_TYPE)
|
1996-02-01 20:33:01 +01:00
|
|
|
|
{
|
1998-11-16 21:45:16 +01:00
|
|
|
|
if (TREE_CODE (old_expr) == VAR_DECL
|
|
|
|
|
&& TREE_CODE (TREE_TYPE (old_expr)) == RECORD_TYPE)
|
1996-02-01 20:33:01 +01:00
|
|
|
|
{
|
2000-01-24 13:16:59 +01:00
|
|
|
|
tree expr = throw_bad_cast ();
|
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
|
|
|
|
warning ("dynamic_cast of `%#D' to `%#T' can never succeed",
|
1998-11-16 21:45:16 +01:00
|
|
|
|
old_expr, type);
|
2000-01-24 13:16:59 +01:00
|
|
|
|
/* Bash it to the expected type. */
|
|
|
|
|
TREE_TYPE (expr) = type;
|
|
|
|
|
return expr;
|
1996-02-01 20:33:01 +01:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
/* Ditto for dynamic_cast<D*>(&b). */
|
|
|
|
|
else if (TREE_CODE (expr) == ADDR_EXPR)
|
|
|
|
|
{
|
|
|
|
|
tree op = TREE_OPERAND (expr, 0);
|
|
|
|
|
if (TREE_CODE (op) == VAR_DECL
|
|
|
|
|
&& TREE_CODE (TREE_TYPE (op)) == RECORD_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
|
|
|
|
warning ("dynamic_cast of `%#D' to `%#T' can never succeed",
|
1998-10-31 03:50:29 +01:00
|
|
|
|
op, type);
|
1996-02-01 20:33:01 +01:00
|
|
|
|
retval = build_int_2 (0, 0);
|
|
|
|
|
TREE_TYPE (retval) = type;
|
|
|
|
|
return retval;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2000-01-28 14:30:13 +01:00
|
|
|
|
target_type = TYPE_MAIN_VARIANT (TREE_TYPE (type));
|
|
|
|
|
static_type = TYPE_MAIN_VARIANT (TREE_TYPE (exprtype));
|
|
|
|
|
td2 = build_unary_op (ADDR_EXPR, get_tinfo_decl (target_type), 0);
|
|
|
|
|
td3 = build_unary_op (ADDR_EXPR, get_tinfo_decl (static_type), 0);
|
|
|
|
|
|
|
|
|
|
/* Determine how T and V are related. */
|
|
|
|
|
boff = get_dynamic_cast_base_type (static_type, target_type);
|
|
|
|
|
|
1996-04-13 01:55:07 +02:00
|
|
|
|
/* Since expr is used twice below, save it. */
|
|
|
|
|
expr = save_expr (expr);
|
|
|
|
|
|
1996-02-01 20:33:01 +01:00
|
|
|
|
expr1 = expr;
|
|
|
|
|
if (tc == REFERENCE_TYPE)
|
|
|
|
|
expr1 = build_unary_op (ADDR_EXPR, expr1, 0);
|
|
|
|
|
|
2001-02-18 21:31:44 +01:00
|
|
|
|
elems = tree_cons
|
|
|
|
|
(NULL_TREE, expr1, tree_cons
|
|
|
|
|
(NULL_TREE, td3, tree_cons
|
|
|
|
|
(NULL_TREE, td2, tree_cons
|
|
|
|
|
(NULL_TREE, boff, NULL_TREE))));
|
1996-04-13 01:55:07 +02:00
|
|
|
|
|
2000-01-24 13:16:59 +01:00
|
|
|
|
dcast_fn = dynamic_cast_node;
|
|
|
|
|
if (!dcast_fn)
|
1996-04-13 01:55:07 +02:00
|
|
|
|
{
|
|
|
|
|
tree tmp;
|
2000-01-28 14:30:13 +01:00
|
|
|
|
tree tinfo_ptr;
|
2001-02-18 21:31:44 +01:00
|
|
|
|
tree ns = abi_node;
|
2000-01-28 14:30:13 +01:00
|
|
|
|
const char *name;
|
|
|
|
|
|
2000-03-21 17:12:25 +01:00
|
|
|
|
push_nested_namespace (ns);
|
2002-06-26 19:03:44 +02:00
|
|
|
|
tinfo_ptr = xref_tag (class_type,
|
2001-02-18 21:31:44 +01:00
|
|
|
|
get_identifier ("__class_type_info"),
|
2002-06-26 19:03:44 +02:00
|
|
|
|
/*attributes=*/NULL_TREE,
|
2001-02-18 21:31:44 +01:00
|
|
|
|
1);
|
|
|
|
|
|
|
|
|
|
tinfo_ptr = build_pointer_type
|
|
|
|
|
(build_qualified_type
|
|
|
|
|
(tinfo_ptr, TYPE_QUAL_CONST));
|
|
|
|
|
name = "__dynamic_cast";
|
|
|
|
|
tmp = tree_cons
|
|
|
|
|
(NULL_TREE, const_ptr_type_node, tree_cons
|
|
|
|
|
(NULL_TREE, tinfo_ptr, tree_cons
|
|
|
|
|
(NULL_TREE, tinfo_ptr, tree_cons
|
|
|
|
|
(NULL_TREE, ptrdiff_type_node, void_list_node))));
|
1996-04-13 01:55:07 +02:00
|
|
|
|
tmp = build_function_type (ptr_type_node, tmp);
|
2000-08-09 11:57:55 +02:00
|
|
|
|
dcast_fn = build_library_fn_ptr (name, tmp);
|
2000-01-28 14:30:13 +01:00
|
|
|
|
pop_nested_namespace (ns);
|
|
|
|
|
dynamic_cast_node = dcast_fn;
|
1996-04-13 01:55:07 +02:00
|
|
|
|
}
|
2003-04-22 07:44:12 +02:00
|
|
|
|
result = build_cxx_call (dcast_fn, elems, elems);
|
1996-02-01 20:33:01 +01:00
|
|
|
|
|
|
|
|
|
if (tc == REFERENCE_TYPE)
|
|
|
|
|
{
|
2000-01-28 14:30:13 +01:00
|
|
|
|
tree bad = throw_bad_cast ();
|
|
|
|
|
|
1996-02-01 20:33:01 +01:00
|
|
|
|
result = save_expr (result);
|
2000-01-28 14:30:13 +01:00
|
|
|
|
return build (COND_EXPR, type, result, result, bad);
|
1996-02-01 20:33:01 +01:00
|
|
|
|
}
|
|
|
|
|
|
1996-07-11 03:13:25 +02:00
|
|
|
|
/* Now back to the type we want from a void*. */
|
1997-05-29 01:20:02 +02:00
|
|
|
|
result = cp_convert (type, result);
|
1996-04-19 02:48:03 +02:00
|
|
|
|
return ifnonnull (expr, result);
|
1996-02-01 20:33:01 +01:00
|
|
|
|
}
|
|
|
|
|
}
|
2000-03-17 01:56:12 +01:00
|
|
|
|
else
|
|
|
|
|
errstr = "source type is not polymorphic";
|
1999-10-29 01:55:28 +02:00
|
|
|
|
|
1996-02-01 20:33:01 +01:00
|
|
|
|
fail:
|
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
|
|
|
|
error ("cannot dynamic_cast `%E' (of type `%#T') to type `%#T' (%s)",
|
2000-03-17 01:56:12 +01:00
|
|
|
|
expr, exprtype, type, errstr);
|
1996-02-01 20:33:01 +01:00
|
|
|
|
return error_mark_node;
|
|
|
|
|
}
|
1997-07-24 23:09:25 +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_dynamic_cast (tree type, tree expr)
|
1997-07-24 23:09:25 +02:00
|
|
|
|
{
|
1997-11-26 11:14:51 +01:00
|
|
|
|
if (type == error_mark_node || expr == error_mark_node)
|
|
|
|
|
return error_mark_node;
|
|
|
|
|
|
|
|
|
|
if (processing_template_decl)
|
1999-09-08 22:12:35 +02:00
|
|
|
|
return build_min (DYNAMIC_CAST_EXPR, type, expr);
|
1997-11-26 11:14:51 +01:00
|
|
|
|
|
1997-07-24 23:09:25 +02:00
|
|
|
|
return convert_from_reference (build_dynamic_cast_1 (type, expr));
|
|
|
|
|
}
|
1996-02-01 20:33:01 +01:00
|
|
|
|
|
2000-01-28 14:30:13 +01:00
|
|
|
|
/* Return the runtime bit mask encoding the qualifiers of TYPE. */
|
|
|
|
|
|
|
|
|
|
static int
|
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
|
|
|
|
qualifier_flags (tree type)
|
2000-01-28 14:30:13 +01:00
|
|
|
|
{
|
|
|
|
|
int flags = 0;
|
2002-11-23 00:19:17 +01:00
|
|
|
|
int quals = cp_type_quals (type);
|
2000-01-28 14:30:13 +01:00
|
|
|
|
|
|
|
|
|
if (quals & TYPE_QUAL_CONST)
|
|
|
|
|
flags |= 1;
|
|
|
|
|
if (quals & TYPE_QUAL_VOLATILE)
|
|
|
|
|
flags |= 2;
|
2000-04-10 18:21:28 +02:00
|
|
|
|
if (quals & TYPE_QUAL_RESTRICT)
|
|
|
|
|
flags |= 4;
|
2000-01-28 14:30:13 +01:00
|
|
|
|
return flags;
|
|
|
|
|
}
|
|
|
|
|
|
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, if the pointer chain TYPE ends at an incomplete type, or
|
2000-04-20 16:25:33 +02:00
|
|
|
|
contains a pointer to member of an incomplete class. */
|
|
|
|
|
|
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
|
|
|
|
|
target_incomplete_p (tree type)
|
2000-04-20 16:25:33 +02:00
|
|
|
|
{
|
|
|
|
|
while (TREE_CODE (type) == POINTER_TYPE)
|
|
|
|
|
if (TYPE_PTRMEM_P (type))
|
|
|
|
|
{
|
|
|
|
|
if (!COMPLETE_TYPE_P (TYPE_PTRMEM_CLASS_TYPE (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;
|
2000-04-20 16:25:33 +02:00
|
|
|
|
type = TYPE_PTRMEM_POINTED_TO_TYPE (type);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
type = TREE_TYPE (type);
|
|
|
|
|
if (!COMPLETE_OR_VOID_TYPE_P (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;
|
2000-04-20 16:25:33 +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;
|
2000-04-20 16:25:33 +02:00
|
|
|
|
}
|
|
|
|
|
|
2000-01-28 14:30:13 +01:00
|
|
|
|
/* Return a CONSTRUCTOR for the common part of the type_info objects. This
|
2000-04-20 16:25:33 +02:00
|
|
|
|
is the vtable pointer and NTBS name. The NTBS name is emitted as a
|
|
|
|
|
comdat const char array, so it becomes a unique key for the type. Generate
|
|
|
|
|
and emit that VAR_DECL here. (We can't always emit the type_info itself
|
|
|
|
|
as comdat, because of pointers to incomplete.) */
|
2000-01-28 14:30:13 +01: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
|
|
|
|
tinfo_base_init (tree desc, tree target)
|
2000-01-28 14:30:13 +01:00
|
|
|
|
{
|
|
|
|
|
tree init = NULL_TREE;
|
2000-04-20 16:25:33 +02:00
|
|
|
|
tree name_decl;
|
2002-06-30 22:41:38 +02:00
|
|
|
|
tree vtable_ptr;
|
2000-04-20 16:25:33 +02:00
|
|
|
|
|
|
|
|
|
{
|
2000-06-04 23:12:27 +02:00
|
|
|
|
tree name_name;
|
|
|
|
|
|
2000-04-20 16:25:33 +02:00
|
|
|
|
/* Generate the NTBS array variable. */
|
|
|
|
|
tree name_type = build_cplus_array_type
|
|
|
|
|
(build_qualified_type (char_type_node, TYPE_QUAL_CONST),
|
|
|
|
|
NULL_TREE);
|
|
|
|
|
tree name_string = tinfo_name (target);
|
2000-06-04 23:12:27 +02:00
|
|
|
|
|
2001-02-12 10:58:18 +01:00
|
|
|
|
name_name = mangle_typeinfo_string_for_type (target);
|
2000-04-20 16:25:33 +02:00
|
|
|
|
name_decl = build_lang_decl (VAR_DECL, name_name, name_type);
|
|
|
|
|
|
|
|
|
|
DECL_ARTIFICIAL (name_decl) = 1;
|
|
|
|
|
TREE_READONLY (name_decl) = 1;
|
|
|
|
|
TREE_STATIC (name_decl) = 1;
|
|
|
|
|
DECL_EXTERNAL (name_decl) = 0;
|
|
|
|
|
TREE_PUBLIC (name_decl) = 1;
|
|
|
|
|
comdat_linkage (name_decl);
|
2001-07-21 02:03:21 +02:00
|
|
|
|
/* External name of the string containing the type's name has a
|
|
|
|
|
special name. */
|
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
|
|
|
|
SET_DECL_ASSEMBLER_NAME (name_decl,
|
|
|
|
|
mangle_typeinfo_string_for_type (target));
|
2000-04-20 16:25:33 +02:00
|
|
|
|
DECL_INITIAL (name_decl) = name_string;
|
|
|
|
|
cp_finish_decl (name_decl, name_string, NULL_TREE, 0);
|
2001-02-04 09:35:11 +01:00
|
|
|
|
pushdecl_top_level (name_decl);
|
2000-04-20 16:25:33 +02:00
|
|
|
|
}
|
2002-06-30 22:41:38 +02:00
|
|
|
|
|
|
|
|
|
vtable_ptr = TINFO_VTABLE_DECL (desc);
|
|
|
|
|
if (!vtable_ptr)
|
2000-01-28 14:30:13 +01:00
|
|
|
|
{
|
2002-06-30 22:41:38 +02:00
|
|
|
|
tree real_type;
|
|
|
|
|
|
|
|
|
|
push_nested_namespace (abi_node);
|
|
|
|
|
real_type = xref_tag (class_type, TINFO_REAL_NAME (desc),
|
|
|
|
|
/*attributes=*/NULL_TREE, 1);
|
|
|
|
|
pop_nested_namespace (abi_node);
|
|
|
|
|
|
|
|
|
|
if (!COMPLETE_TYPE_P (real_type))
|
|
|
|
|
{
|
|
|
|
|
/* We never saw a definition of this type, so we need to
|
|
|
|
|
tell the compiler that this is an exported class, as
|
|
|
|
|
indeed all of the __*_type_info classes are. */
|
|
|
|
|
SET_CLASSTYPE_INTERFACE_KNOWN (real_type);
|
|
|
|
|
CLASSTYPE_INTERFACE_ONLY (real_type) = 1;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
vtable_ptr = get_vtable_decl (real_type, /*complete=*/1);
|
|
|
|
|
vtable_ptr = build_unary_op (ADDR_EXPR, vtable_ptr, 0);
|
|
|
|
|
|
|
|
|
|
/* We need to point into the middle of the vtable. */
|
|
|
|
|
vtable_ptr = build
|
|
|
|
|
(PLUS_EXPR, TREE_TYPE (vtable_ptr), vtable_ptr,
|
|
|
|
|
size_binop (MULT_EXPR,
|
|
|
|
|
size_int (2 * TARGET_VTABLE_DATA_ENTRY_DISTANCE),
|
|
|
|
|
TYPE_SIZE_UNIT (vtable_entry_type)));
|
|
|
|
|
TREE_CONSTANT (vtable_ptr) = 1;
|
|
|
|
|
|
|
|
|
|
TINFO_VTABLE_DECL (desc) = vtable_ptr;
|
2000-01-28 14:30:13 +01:00
|
|
|
|
}
|
2002-06-30 22:41:38 +02:00
|
|
|
|
|
|
|
|
|
init = tree_cons (NULL_TREE, vtable_ptr, init);
|
2000-01-28 14:30:13 +01:00
|
|
|
|
|
2000-04-20 16:25:33 +02:00
|
|
|
|
init = tree_cons (NULL_TREE, decay_conversion (name_decl), init);
|
2000-01-28 14:30:13 +01:00
|
|
|
|
|
tree.c (build_constructor): New function.
* tree.c (build_constructor): New function.
* tree.h: Prototype it.
* c-typeck.c (build_c_cast, pop_init_level)
* profile.c (build_function_info_value, build_gcov_info_value)
(create_profiler):
Use build_constructor.
* builtins.c (expand_builtin_args_info): Remove #if 0 blocks.
* objc/objc-act.c (build_constructor):
Rename objc_build_constructor. Use build_constructor.
(build_objc_string_object, objc_add_static_instance)
(init_def_list, init_objc_symtab, init_module_descriptor)
(generate_static_references, build_selector_translation_table)
(build_descriptor_table_initializer, generate_descriptor_table)
(build_protocol_initializer, build_ivar_list_initializer)
(generate_ivars_list, build_dispatch_table_initializer)
(generate_dispatch_table, generate_protocol_list)
(build_category_initializer, build_shared_structure_initializer):
Update to match.
ada:
* gigi.h, utils2.c (build_constructor):
Rename gnat_build_constructor. Use build_constructor.
* decl.c (gnat_to_gnu_entity)
* trans.c (tree_transform, pos_to_constructor, extract_values)
* ada/utils.c (build_template, convert_to_fat_pointer, convert)
(unchecked_convert)
* ada/utils2.c (build_binary_op, build_call_raise, build_allocator)
(fill_vms_descriptor):
Update to match.
cp:
* class.c (initialize_array)
* decl.c (reshape_init)
* decl2.c (build_expr_from_tree)
* init.c (build_zero_init)
* pt.c (tsubst_copy, tsubst_copy_and_build)
* rtti.c (tinfo_base_init, generic_initializer, ptr_initializer)
(ptm_initializer, class_initializer, get_pseudo_ti_init)
* semantics.c (finish_compound_literal)
* typeck.c (build_ptrmemfunc1)
* typeck2.c (store_init_value, process_init_constructor)
(build_functional_cast): Use build_constructor.
f:
* com.c (ffecom_build_complex_constant_, ffecom_expr_)
(ffecom_init_zero_, ffecom_transform_namelist_, ffecom_vardesc_)
(ffecom_vardesc_array_, ffecom_vardesc_dims_, ffecom_2)
* ste.c (ffeste_io_ialist_, ffeste_io_cilist_, ffeste_io_cllist_)
(ffeste_io_icilist_, ffeste_io_inlist_, ffeste_io_olist_):
Use build_constructor.
java:
* class.c (make_field_value, make_method_value, get_dispatch_table)
(make_class_data, emit_offset_symbol_table)
* constants.c (build_constants_constructor)
* java-tree.h (START_RECORD_CONSTRUCTOR)
* parse.y (maybe_build_array_element_wfl):
Use build_constructor.
From-SVN: r65539
2003-04-13 03:45:35 +02:00
|
|
|
|
init = build_constructor (NULL_TREE, nreverse (init));
|
2000-01-28 14:30:13 +01:00
|
|
|
|
TREE_HAS_CONSTRUCTOR (init) = TREE_CONSTANT (init) = TREE_STATIC (init) = 1;
|
|
|
|
|
init = tree_cons (NULL_TREE, init, NULL_TREE);
|
|
|
|
|
|
|
|
|
|
return init;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Return the CONSTRUCTOR expr for a type_info of TYPE. DESC provides the
|
|
|
|
|
information about the particular type_info derivation, which adds no
|
|
|
|
|
additional fields to the type_info base. */
|
|
|
|
|
|
|
|
|
|
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
|
|
|
|
generic_initializer (tree desc, tree target)
|
2000-01-28 14:30:13 +01:00
|
|
|
|
{
|
|
|
|
|
tree init = tinfo_base_init (desc, target);
|
|
|
|
|
|
tree.c (build_constructor): New function.
* tree.c (build_constructor): New function.
* tree.h: Prototype it.
* c-typeck.c (build_c_cast, pop_init_level)
* profile.c (build_function_info_value, build_gcov_info_value)
(create_profiler):
Use build_constructor.
* builtins.c (expand_builtin_args_info): Remove #if 0 blocks.
* objc/objc-act.c (build_constructor):
Rename objc_build_constructor. Use build_constructor.
(build_objc_string_object, objc_add_static_instance)
(init_def_list, init_objc_symtab, init_module_descriptor)
(generate_static_references, build_selector_translation_table)
(build_descriptor_table_initializer, generate_descriptor_table)
(build_protocol_initializer, build_ivar_list_initializer)
(generate_ivars_list, build_dispatch_table_initializer)
(generate_dispatch_table, generate_protocol_list)
(build_category_initializer, build_shared_structure_initializer):
Update to match.
ada:
* gigi.h, utils2.c (build_constructor):
Rename gnat_build_constructor. Use build_constructor.
* decl.c (gnat_to_gnu_entity)
* trans.c (tree_transform, pos_to_constructor, extract_values)
* ada/utils.c (build_template, convert_to_fat_pointer, convert)
(unchecked_convert)
* ada/utils2.c (build_binary_op, build_call_raise, build_allocator)
(fill_vms_descriptor):
Update to match.
cp:
* class.c (initialize_array)
* decl.c (reshape_init)
* decl2.c (build_expr_from_tree)
* init.c (build_zero_init)
* pt.c (tsubst_copy, tsubst_copy_and_build)
* rtti.c (tinfo_base_init, generic_initializer, ptr_initializer)
(ptm_initializer, class_initializer, get_pseudo_ti_init)
* semantics.c (finish_compound_literal)
* typeck.c (build_ptrmemfunc1)
* typeck2.c (store_init_value, process_init_constructor)
(build_functional_cast): Use build_constructor.
f:
* com.c (ffecom_build_complex_constant_, ffecom_expr_)
(ffecom_init_zero_, ffecom_transform_namelist_, ffecom_vardesc_)
(ffecom_vardesc_array_, ffecom_vardesc_dims_, ffecom_2)
* ste.c (ffeste_io_ialist_, ffeste_io_cilist_, ffeste_io_cllist_)
(ffeste_io_icilist_, ffeste_io_inlist_, ffeste_io_olist_):
Use build_constructor.
java:
* class.c (make_field_value, make_method_value, get_dispatch_table)
(make_class_data, emit_offset_symbol_table)
* constants.c (build_constants_constructor)
* java-tree.h (START_RECORD_CONSTRUCTOR)
* parse.y (maybe_build_array_element_wfl):
Use build_constructor.
From-SVN: r65539
2003-04-13 03:45:35 +02:00
|
|
|
|
init = build_constructor (NULL_TREE, init);
|
2000-01-28 14:30:13 +01:00
|
|
|
|
TREE_HAS_CONSTRUCTOR (init) = TREE_CONSTANT (init) = TREE_STATIC (init) = 1;
|
|
|
|
|
return init;
|
|
|
|
|
}
|
|
|
|
|
|
2000-03-15 11:40:27 +01:00
|
|
|
|
/* Return the CONSTRUCTOR expr for a type_info of pointer TYPE.
|
2000-01-28 14:30:13 +01:00
|
|
|
|
DESC provides information about the particular type_info derivation,
|
|
|
|
|
which adds target type and qualifier flags members to the type_info base. */
|
|
|
|
|
|
|
|
|
|
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
|
|
|
|
ptr_initializer (tree desc, tree target, bool *non_public_ptr)
|
2000-01-28 14:30:13 +01:00
|
|
|
|
{
|
|
|
|
|
tree init = tinfo_base_init (desc, target);
|
|
|
|
|
tree to = TREE_TYPE (target);
|
|
|
|
|
int flags = qualifier_flags (to);
|
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 incomplete = target_incomplete_p (to);
|
2000-01-28 14:30:13 +01:00
|
|
|
|
|
2000-04-20 16:25:33 +02:00
|
|
|
|
if (incomplete)
|
|
|
|
|
{
|
|
|
|
|
flags |= 8;
|
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
|
|
|
|
*non_public_ptr = true;
|
2000-04-20 16:25:33 +02:00
|
|
|
|
}
|
2000-01-28 14:30:13 +01:00
|
|
|
|
init = tree_cons (NULL_TREE, build_int_2 (flags, 0), init);
|
|
|
|
|
init = tree_cons (NULL_TREE,
|
2002-06-30 22:41:38 +02:00
|
|
|
|
get_tinfo_ptr (TYPE_MAIN_VARIANT (to)),
|
2000-01-28 14:30:13 +01:00
|
|
|
|
init);
|
|
|
|
|
|
tree.c (build_constructor): New function.
* tree.c (build_constructor): New function.
* tree.h: Prototype it.
* c-typeck.c (build_c_cast, pop_init_level)
* profile.c (build_function_info_value, build_gcov_info_value)
(create_profiler):
Use build_constructor.
* builtins.c (expand_builtin_args_info): Remove #if 0 blocks.
* objc/objc-act.c (build_constructor):
Rename objc_build_constructor. Use build_constructor.
(build_objc_string_object, objc_add_static_instance)
(init_def_list, init_objc_symtab, init_module_descriptor)
(generate_static_references, build_selector_translation_table)
(build_descriptor_table_initializer, generate_descriptor_table)
(build_protocol_initializer, build_ivar_list_initializer)
(generate_ivars_list, build_dispatch_table_initializer)
(generate_dispatch_table, generate_protocol_list)
(build_category_initializer, build_shared_structure_initializer):
Update to match.
ada:
* gigi.h, utils2.c (build_constructor):
Rename gnat_build_constructor. Use build_constructor.
* decl.c (gnat_to_gnu_entity)
* trans.c (tree_transform, pos_to_constructor, extract_values)
* ada/utils.c (build_template, convert_to_fat_pointer, convert)
(unchecked_convert)
* ada/utils2.c (build_binary_op, build_call_raise, build_allocator)
(fill_vms_descriptor):
Update to match.
cp:
* class.c (initialize_array)
* decl.c (reshape_init)
* decl2.c (build_expr_from_tree)
* init.c (build_zero_init)
* pt.c (tsubst_copy, tsubst_copy_and_build)
* rtti.c (tinfo_base_init, generic_initializer, ptr_initializer)
(ptm_initializer, class_initializer, get_pseudo_ti_init)
* semantics.c (finish_compound_literal)
* typeck.c (build_ptrmemfunc1)
* typeck2.c (store_init_value, process_init_constructor)
(build_functional_cast): Use build_constructor.
f:
* com.c (ffecom_build_complex_constant_, ffecom_expr_)
(ffecom_init_zero_, ffecom_transform_namelist_, ffecom_vardesc_)
(ffecom_vardesc_array_, ffecom_vardesc_dims_, ffecom_2)
* ste.c (ffeste_io_ialist_, ffeste_io_cilist_, ffeste_io_cllist_)
(ffeste_io_icilist_, ffeste_io_inlist_, ffeste_io_olist_):
Use build_constructor.
java:
* class.c (make_field_value, make_method_value, get_dispatch_table)
(make_class_data, emit_offset_symbol_table)
* constants.c (build_constants_constructor)
* java-tree.h (START_RECORD_CONSTRUCTOR)
* parse.y (maybe_build_array_element_wfl):
Use build_constructor.
From-SVN: r65539
2003-04-13 03:45:35 +02:00
|
|
|
|
init = build_constructor (NULL_TREE, nreverse (init));
|
2000-01-28 14:30:13 +01:00
|
|
|
|
TREE_HAS_CONSTRUCTOR (init) = TREE_CONSTANT (init) = TREE_STATIC (init) = 1;
|
|
|
|
|
return init;
|
|
|
|
|
}
|
|
|
|
|
|
2000-03-15 11:40:27 +01:00
|
|
|
|
/* Return the CONSTRUCTOR expr for a type_info of pointer to member data TYPE.
|
2000-01-28 14:30:13 +01:00
|
|
|
|
DESC provides information about the particular type_info derivation,
|
2000-04-20 16:25:33 +02:00
|
|
|
|
which adds class, target type and qualifier flags members to the type_info
|
|
|
|
|
base. */
|
2000-01-28 14:30:13 +01: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
|
|
|
|
ptm_initializer (tree desc, tree target, bool *non_public_ptr)
|
2000-01-28 14:30:13 +01:00
|
|
|
|
{
|
|
|
|
|
tree init = tinfo_base_init (desc, target);
|
|
|
|
|
tree to = TYPE_PTRMEM_POINTED_TO_TYPE (target);
|
|
|
|
|
tree klass = TYPE_PTRMEM_CLASS_TYPE (target);
|
|
|
|
|
int flags = qualifier_flags (to);
|
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 incomplete = target_incomplete_p (to);
|
2000-01-28 14:30:13 +01:00
|
|
|
|
|
2000-04-20 16:25:33 +02:00
|
|
|
|
if (incomplete)
|
|
|
|
|
{
|
|
|
|
|
flags |= 0x8;
|
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
|
|
|
|
*non_public_ptr = true;
|
2000-04-20 16:25:33 +02:00
|
|
|
|
}
|
|
|
|
|
if (!COMPLETE_TYPE_P (klass))
|
2000-05-06 17:52:11 +02:00
|
|
|
|
{
|
|
|
|
|
flags |= 0x10;
|
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
|
|
|
|
*non_public_ptr = true;
|
2000-05-06 17:52:11 +02:00
|
|
|
|
}
|
2000-04-10 18:21:28 +02:00
|
|
|
|
init = tree_cons (NULL_TREE, build_int_2 (flags, 0), init);
|
2000-01-28 14:30:13 +01:00
|
|
|
|
init = tree_cons (NULL_TREE,
|
2002-06-30 22:41:38 +02:00
|
|
|
|
get_tinfo_ptr (TYPE_MAIN_VARIANT (to)),
|
2000-01-28 14:30:13 +01:00
|
|
|
|
init);
|
2000-04-10 18:21:28 +02:00
|
|
|
|
init = tree_cons (NULL_TREE,
|
2002-06-30 22:41:38 +02:00
|
|
|
|
get_tinfo_ptr (klass),
|
|
|
|
|
init);
|
2000-01-28 14:30:13 +01:00
|
|
|
|
|
tree.c (build_constructor): New function.
* tree.c (build_constructor): New function.
* tree.h: Prototype it.
* c-typeck.c (build_c_cast, pop_init_level)
* profile.c (build_function_info_value, build_gcov_info_value)
(create_profiler):
Use build_constructor.
* builtins.c (expand_builtin_args_info): Remove #if 0 blocks.
* objc/objc-act.c (build_constructor):
Rename objc_build_constructor. Use build_constructor.
(build_objc_string_object, objc_add_static_instance)
(init_def_list, init_objc_symtab, init_module_descriptor)
(generate_static_references, build_selector_translation_table)
(build_descriptor_table_initializer, generate_descriptor_table)
(build_protocol_initializer, build_ivar_list_initializer)
(generate_ivars_list, build_dispatch_table_initializer)
(generate_dispatch_table, generate_protocol_list)
(build_category_initializer, build_shared_structure_initializer):
Update to match.
ada:
* gigi.h, utils2.c (build_constructor):
Rename gnat_build_constructor. Use build_constructor.
* decl.c (gnat_to_gnu_entity)
* trans.c (tree_transform, pos_to_constructor, extract_values)
* ada/utils.c (build_template, convert_to_fat_pointer, convert)
(unchecked_convert)
* ada/utils2.c (build_binary_op, build_call_raise, build_allocator)
(fill_vms_descriptor):
Update to match.
cp:
* class.c (initialize_array)
* decl.c (reshape_init)
* decl2.c (build_expr_from_tree)
* init.c (build_zero_init)
* pt.c (tsubst_copy, tsubst_copy_and_build)
* rtti.c (tinfo_base_init, generic_initializer, ptr_initializer)
(ptm_initializer, class_initializer, get_pseudo_ti_init)
* semantics.c (finish_compound_literal)
* typeck.c (build_ptrmemfunc1)
* typeck2.c (store_init_value, process_init_constructor)
(build_functional_cast): Use build_constructor.
f:
* com.c (ffecom_build_complex_constant_, ffecom_expr_)
(ffecom_init_zero_, ffecom_transform_namelist_, ffecom_vardesc_)
(ffecom_vardesc_array_, ffecom_vardesc_dims_, ffecom_2)
* ste.c (ffeste_io_ialist_, ffeste_io_cilist_, ffeste_io_cllist_)
(ffeste_io_icilist_, ffeste_io_inlist_, ffeste_io_olist_):
Use build_constructor.
java:
* class.c (make_field_value, make_method_value, get_dispatch_table)
(make_class_data, emit_offset_symbol_table)
* constants.c (build_constants_constructor)
* java-tree.h (START_RECORD_CONSTRUCTOR)
* parse.y (maybe_build_array_element_wfl):
Use build_constructor.
From-SVN: r65539
2003-04-13 03:45:35 +02:00
|
|
|
|
init = build_constructor (NULL_TREE, nreverse (init));
|
2000-01-28 14:30:13 +01:00
|
|
|
|
TREE_HAS_CONSTRUCTOR (init) = TREE_CONSTANT (init) = TREE_STATIC (init) = 1;
|
|
|
|
|
return init;
|
|
|
|
|
}
|
|
|
|
|
|
2000-04-06 11:42:03 +02:00
|
|
|
|
/* Check base BINFO to set hint flags in *DATA, which is really an int.
|
|
|
|
|
We use CLASSTYPE_MARKED to tag types we've found as non-virtual bases and
|
|
|
|
|
CLASSTYPE_MARKED2 to tag those which are virtual bases. Remember it is
|
|
|
|
|
possible for a type to be both a virtual and non-virtual base. */
|
|
|
|
|
|
|
|
|
|
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
|
|
|
|
dfs_class_hint_mark (tree binfo, void *data)
|
2000-04-06 11:42:03 +02:00
|
|
|
|
{
|
|
|
|
|
tree basetype = BINFO_TYPE (binfo);
|
|
|
|
|
int *hint = (int *) data;
|
|
|
|
|
|
|
|
|
|
if (TREE_VIA_VIRTUAL (binfo))
|
|
|
|
|
{
|
|
|
|
|
if (CLASSTYPE_MARKED (basetype))
|
|
|
|
|
*hint |= 1;
|
|
|
|
|
if (CLASSTYPE_MARKED2 (basetype))
|
|
|
|
|
*hint |= 2;
|
|
|
|
|
SET_CLASSTYPE_MARKED2 (basetype);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
if (CLASSTYPE_MARKED (basetype) || CLASSTYPE_MARKED2 (basetype))
|
|
|
|
|
*hint |= 1;
|
|
|
|
|
SET_CLASSTYPE_MARKED (basetype);
|
|
|
|
|
}
|
|
|
|
|
return NULL_TREE;
|
gengtype-lex.l (IWORD): Add CHAR_BITFIELD.
gcc:
* gengtype-lex.l (IWORD): Add CHAR_BITFIELD.
* system.h (CHAR_BITFIELD): New.
cp:
* operators.def (DEF_SIMPLE_OPERATOR, DEF_ASSN_OPERATOR,
DEF_ASSN_OPERATOR): Delete spurious semi-colon.
* rtti.c (dfs_class_hint_mark): Likewise.
* decl.c (push_local_name, push_class_level_binding,
maybe_inject_for_scope_var): Don't use POP_TIMEVAR_AND_RETURN in
functions returning void.
* decl2.c (add_using_namespace): Likewise.
* decl.c (print_binding_level, print_other_binding_stack,
print_binding_stack): Cast argument of %p specifier to void*.
* ptree.c (cxx_print_decl): Likewise.
* cp-tree.h (VAR_OR_FUNCTION_DECL_CHECK,
VAR_FUNCTION_OR_PARM_DECL_CHECK,
VAR_TEMPL_TYPE_OR_FUNCTION_DECL_CHECK, RECORD_OR_UNION_TYPE_CHECK,
BOUND_TEMPLATE_TEMPLATE_PARM_TYPE_CHECK, LANG_TYPE_CLASS_CHECK,
LANG_TYPE_PTRMEM_CHECK, LANG_DECL_U2_CHECK): Add __extension__.
* decl.c (set_current_binding_level): New macro. Use throughout
when setting the current binding level.
* cp-tree.h (cp_lvalue_kind, base_access): Delete trailing comma
in enum.
* method.c (mangling_flags): Likewise.
* cp-tree.h (lang_type_header): Add __extension__ and use
CHAR_BITFIELD for members.
From-SVN: r65201
2003-04-03 17:42:16 +02:00
|
|
|
|
}
|
2000-04-06 11:42:03 +02:00
|
|
|
|
|
2002-09-14 14:07:44 +02:00
|
|
|
|
/* Clear the base's dfs marks, after searching for duplicate bases. */
|
2000-04-06 11:42:03 +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
|
|
|
|
dfs_class_hint_unmark (tree binfo, void *data ATTRIBUTE_UNUSED)
|
2000-04-06 11:42:03 +02:00
|
|
|
|
{
|
|
|
|
|
tree basetype = BINFO_TYPE (binfo);
|
|
|
|
|
|
|
|
|
|
CLEAR_CLASSTYPE_MARKED (basetype);
|
|
|
|
|
CLEAR_CLASSTYPE_MARKED2 (basetype);
|
|
|
|
|
return NULL_TREE;
|
|
|
|
|
}
|
|
|
|
|
|
ChangeLog.1, [...]: Fix spelling errors.
* ChangeLog.1, ChangeLog.2, ChangeLog, NEWS, call.c, class.c,
cp-tree.h, decl.c, decl2.c, except.c, operators.def, optimize.c,
pt.c, rtti.c, semantics.c, typeck.c: Fix spelling errors.
From-SVN: r48072
2001-12-16 17:07:01 +01:00
|
|
|
|
/* Determine the hint flags describing the features of a class's hierarchy. */
|
2000-01-28 14:30:13 +01:00
|
|
|
|
|
|
|
|
|
static int
|
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
|
|
|
|
class_hint_flags (tree type)
|
2000-01-28 14:30:13 +01:00
|
|
|
|
{
|
|
|
|
|
int hint_flags = 0;
|
2000-04-06 11:42:03 +02:00
|
|
|
|
|
|
|
|
|
dfs_walk (TYPE_BINFO (type), dfs_class_hint_mark, NULL, &hint_flags);
|
|
|
|
|
dfs_walk (TYPE_BINFO (type), dfs_class_hint_unmark, NULL, NULL);
|
2000-01-28 14:30:13 +01:00
|
|
|
|
|
|
|
|
|
return hint_flags;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Return the CONSTRUCTOR expr for a type_info of class TYPE.
|
|
|
|
|
DESC provides information about the particular __class_type_info derivation,
|
|
|
|
|
which adds hint flags and TRAIL initializers to the type_info base. */
|
|
|
|
|
|
|
|
|
|
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
|
|
|
|
class_initializer (tree desc, tree target, tree trail)
|
2000-01-28 14:30:13 +01:00
|
|
|
|
{
|
|
|
|
|
tree init = tinfo_base_init (desc, target);
|
|
|
|
|
|
|
|
|
|
TREE_CHAIN (init) = trail;
|
tree.c (build_constructor): New function.
* tree.c (build_constructor): New function.
* tree.h: Prototype it.
* c-typeck.c (build_c_cast, pop_init_level)
* profile.c (build_function_info_value, build_gcov_info_value)
(create_profiler):
Use build_constructor.
* builtins.c (expand_builtin_args_info): Remove #if 0 blocks.
* objc/objc-act.c (build_constructor):
Rename objc_build_constructor. Use build_constructor.
(build_objc_string_object, objc_add_static_instance)
(init_def_list, init_objc_symtab, init_module_descriptor)
(generate_static_references, build_selector_translation_table)
(build_descriptor_table_initializer, generate_descriptor_table)
(build_protocol_initializer, build_ivar_list_initializer)
(generate_ivars_list, build_dispatch_table_initializer)
(generate_dispatch_table, generate_protocol_list)
(build_category_initializer, build_shared_structure_initializer):
Update to match.
ada:
* gigi.h, utils2.c (build_constructor):
Rename gnat_build_constructor. Use build_constructor.
* decl.c (gnat_to_gnu_entity)
* trans.c (tree_transform, pos_to_constructor, extract_values)
* ada/utils.c (build_template, convert_to_fat_pointer, convert)
(unchecked_convert)
* ada/utils2.c (build_binary_op, build_call_raise, build_allocator)
(fill_vms_descriptor):
Update to match.
cp:
* class.c (initialize_array)
* decl.c (reshape_init)
* decl2.c (build_expr_from_tree)
* init.c (build_zero_init)
* pt.c (tsubst_copy, tsubst_copy_and_build)
* rtti.c (tinfo_base_init, generic_initializer, ptr_initializer)
(ptm_initializer, class_initializer, get_pseudo_ti_init)
* semantics.c (finish_compound_literal)
* typeck.c (build_ptrmemfunc1)
* typeck2.c (store_init_value, process_init_constructor)
(build_functional_cast): Use build_constructor.
f:
* com.c (ffecom_build_complex_constant_, ffecom_expr_)
(ffecom_init_zero_, ffecom_transform_namelist_, ffecom_vardesc_)
(ffecom_vardesc_array_, ffecom_vardesc_dims_, ffecom_2)
* ste.c (ffeste_io_ialist_, ffeste_io_cilist_, ffeste_io_cllist_)
(ffeste_io_icilist_, ffeste_io_inlist_, ffeste_io_olist_):
Use build_constructor.
java:
* class.c (make_field_value, make_method_value, get_dispatch_table)
(make_class_data, emit_offset_symbol_table)
* constants.c (build_constants_constructor)
* java-tree.h (START_RECORD_CONSTRUCTOR)
* parse.y (maybe_build_array_element_wfl):
Use build_constructor.
From-SVN: r65539
2003-04-13 03:45:35 +02:00
|
|
|
|
init = build_constructor (NULL_TREE, init);
|
2000-01-28 14:30:13 +01:00
|
|
|
|
TREE_HAS_CONSTRUCTOR (init) = TREE_CONSTANT (init) = TREE_STATIC (init) = 1;
|
|
|
|
|
return init;
|
|
|
|
|
}
|
|
|
|
|
|
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 the typeinfo for type should be placed in
|
2001-02-04 09:35:11 +01:00
|
|
|
|
the runtime library. */
|
|
|
|
|
|
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
|
|
|
|
|
typeinfo_in_lib_p (tree type)
|
2001-02-04 09:35:11 +01:00
|
|
|
|
{
|
|
|
|
|
/* The typeinfo objects for `T*' and `const T*' are in the runtime
|
|
|
|
|
library for simple types T. */
|
|
|
|
|
if (TREE_CODE (type) == POINTER_TYPE
|
tree-dump.c: Rename from c-dump.c.
* tree-dump.c: Rename from c-dump.c. Include c-tree.h, not c-common.h.
(lang_type_quals): Declare.
(dequeue_and_dump): Use lang_hooks.tree_dump.type_quals function to
retrieve language-specific qualifiers for a type node, instead of
C_TYPE_QUALS. Likewise for lang_hooks.tree_dump.dump_tree instead of
lang_dump_tree.
* tree-dump.h: Rename from c-dump.h.
* c-common.h (C_TYPE_QUALS): Removed.
Move declarations for tree-dump.c interface to...
* tree.h: ... here. Remove lang_dump_tree.
* langhooks.h (struct lang_hooks_for_tree_dump): New.
(struct lang_hooks): Add tree_dump hooks.
* langhooks.c (lhd_tree_dump_dump_tree): New function.
(lhd_tree_dump_type_quals): New function.
* langhooks-def.h (lhd_tree_dump_dump_tree, lhd_tree_dump_type_quals):
Declare.
(LANG_HOOKS_INITIALIZER): Add tree_dump hooks.
* Makefile.in: Move tree-dump.o to language-independent back-end.
cp:
* cp-tree.h (CP_TYPE_QUALS): Removed.
* decl.c (cxx_init_decl_processing): Don't set lang_dump_tree.
* cp-lang.c: Set LANG_HOOKS_TREE_DUMP_DUMP_TREE_FN and
LANG_HOOKS_TREE_DUMP_TYPE_QUALS_FN.
* dump.c (cp_dump_tree): Use void* dump_info argument to match
lang-hooks prototype.
* call.c, cp-tree.h, cvt.c, decl.c, init.c, mangle.c, method.c, pt.c,
rtti.c, semantics.c, tree.c, typeck.c, typeck2.c: All references to
CP_TYPE_QUALS changed to cp_type_quals.
* Make-lang.in: References to c-dump.h changed to tree-dump.h.
(CXX_C_OBJS): Remove c-dump.o.
From-SVN: r47257
2001-11-22 03:33:02 +01:00
|
|
|
|
&& (cp_type_quals (TREE_TYPE (type)) == TYPE_QUAL_CONST
|
|
|
|
|
|| cp_type_quals (TREE_TYPE (type)) == TYPE_UNQUALIFIED))
|
2001-02-04 09:35:11 +01:00
|
|
|
|
type = TREE_TYPE (type);
|
|
|
|
|
|
|
|
|
|
switch (TREE_CODE (type))
|
|
|
|
|
{
|
|
|
|
|
case INTEGER_TYPE:
|
|
|
|
|
case BOOLEAN_TYPE:
|
|
|
|
|
case CHAR_TYPE:
|
|
|
|
|
case REAL_TYPE:
|
|
|
|
|
case VOID_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;
|
2001-02-04 09:35:11 +01:00
|
|
|
|
|
|
|
|
|
default:
|
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;
|
2001-02-04 09:35:11 +01:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2002-06-30 22:41:38 +02:00
|
|
|
|
/* Generate the initializer for the type info describing
|
2002-09-21 14:51:56 +02:00
|
|
|
|
TYPE. VAR_DESC is a . NON_PUBLIC_P is set nonzero, if the VAR_DECL
|
2002-06-30 22:41:38 +02:00
|
|
|
|
should not be exported from this object file. This should only be
|
|
|
|
|
called at the end of translation, when we know that no further
|
|
|
|
|
types will be completed. */
|
2000-01-28 14:30:13 +01: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
|
|
|
|
get_pseudo_ti_init (tree type, tree var_desc, bool *non_public_p)
|
2000-01-28 14:30:13 +01:00
|
|
|
|
{
|
2002-06-30 22:41:38 +02:00
|
|
|
|
my_friendly_assert (at_eof, 20021120);
|
|
|
|
|
switch (TREE_CODE (type))
|
2000-01-28 14:30:13 +01:00
|
|
|
|
{
|
|
|
|
|
case POINTER_TYPE:
|
2002-06-30 22:41:38 +02:00
|
|
|
|
if (TYPE_PTRMEM_P (type))
|
|
|
|
|
return ptm_initializer (var_desc, type, non_public_p);
|
2000-01-28 14:30:13 +01:00
|
|
|
|
else
|
2002-06-30 22:41:38 +02:00
|
|
|
|
return ptr_initializer (var_desc, type, non_public_p);
|
2000-01-28 14:30:13 +01:00
|
|
|
|
break;
|
|
|
|
|
case ENUMERAL_TYPE:
|
2002-06-30 22:41:38 +02:00
|
|
|
|
return generic_initializer (var_desc, type);
|
2000-01-28 14:30:13 +01:00
|
|
|
|
break;
|
|
|
|
|
case FUNCTION_TYPE:
|
2002-06-30 22:41:38 +02:00
|
|
|
|
return generic_initializer (var_desc, type);
|
2000-01-28 14:30:13 +01:00
|
|
|
|
break;
|
|
|
|
|
case ARRAY_TYPE:
|
2002-06-30 22:41:38 +02:00
|
|
|
|
return generic_initializer (var_desc, type);
|
2000-01-28 14:30:13 +01:00
|
|
|
|
break;
|
|
|
|
|
case UNION_TYPE:
|
|
|
|
|
case RECORD_TYPE:
|
2002-06-30 22:41:38 +02:00
|
|
|
|
if (TYPE_PTRMEMFUNC_P (type))
|
|
|
|
|
return ptm_initializer (var_desc, type, non_public_p);
|
|
|
|
|
else if (var_desc == class_desc_type_node)
|
2000-05-26 10:50:47 +02:00
|
|
|
|
{
|
2002-06-30 22:41:38 +02:00
|
|
|
|
if (!COMPLETE_TYPE_P (type))
|
|
|
|
|
/* Emit a non-public class_type_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
|
|
|
|
*non_public_p = true;
|
2002-06-30 22:41:38 +02:00
|
|
|
|
return class_initializer (var_desc, type, NULL_TREE);
|
2000-01-28 14:30:13 +01:00
|
|
|
|
}
|
2002-06-30 22:41:38 +02:00
|
|
|
|
else if (var_desc == si_class_desc_type_node)
|
|
|
|
|
{
|
|
|
|
|
tree base_binfos = BINFO_BASETYPES (TYPE_BINFO (type));
|
|
|
|
|
tree base_binfo = TREE_VEC_ELT (base_binfos, 0);
|
|
|
|
|
tree tinfo = get_tinfo_ptr (BINFO_TYPE (base_binfo));
|
|
|
|
|
tree base_inits = tree_cons (NULL_TREE, tinfo, NULL_TREE);
|
|
|
|
|
|
|
|
|
|
return class_initializer (var_desc, type, base_inits);
|
|
|
|
|
}
|
2000-01-28 14:30:13 +01:00
|
|
|
|
else
|
|
|
|
|
{
|
2002-06-30 22:41:38 +02:00
|
|
|
|
int hint = class_hint_flags (type);
|
|
|
|
|
tree binfo = TYPE_BINFO (type);
|
2000-01-28 14:30:13 +01:00
|
|
|
|
int nbases = BINFO_N_BASETYPES (binfo);
|
|
|
|
|
tree base_binfos = BINFO_BASETYPES (binfo);
|
Change base class access representation.
* tree.h (TREE_VIA_PUBLIC, TREE_VIA_PROTECTED,
TREE_VIA_PRIVATE): Remove.
(BINFO_BASEACCESSES): New binfo elt.
(BINFO_BASEACCESS): New accessor.
(BINFO_ELTS): Increase.
(TI_ACCESS_PUBLIC, TI_ACCESS_PROTECTED, TI_ACCESS_PRIVATE): New.
(access_public_node, access_protected_node,
access_private_node): New global nodes.
* tree.c (build_common_tree_nodes_2): Initialize access nodes.
* dbxout.c (dbxout_type): Adjust.
* dwarf2out.c (gen_inheritance_die): Add access parameter.
(gen_member_die): Adjust.
* dwarfout.c (output_inheritance_die): ARG is array of two trees.
(output_type): Adjust.
* tree-dump.c (dequeue_and_dump): Adjust binfo dumping.
Change base class access representation. Share virtual base
binfos.
* cp/call.c (build_special_member_call): Remove binfo_for_vbase
call.
* cp/class.c (build_base_path): Likewise.
(build_primary_vtable): Adjust BINFO_NEW_VTABLE_MARKED use.
(build_secondary_vtable): Remove FOR_TYPE arg. Adjust.
(make_new_vtable): Adjust.
(force_canonical_binfo_r): Delete.
(force_canonical_binfo): Delete.
(mark_primary_virtual_base): Delete.
(dfs_unshared_virtual_bases): Delete.
(mark_primary_bases): Adjust.
(maybe_warn_about_overly_private_class): Adjust.
(dfs_base_derived_from): Delete.
(base_derived_from): Follow the inheritance chain.
(struct find_final_overrider_data): Add vpath member.
(dfs_find_final_overrider): Adjust.
(dfs_find_final_overrider_q, dfs_find_final_overrider_post): New.
(find_final_overrider): Adjust.
(update_vtable_entry_for_fn): Adjust.
(modify_all_vtables): Adjust.
(walk_subobject_offsets): Adjust.
(layout_nonempty_base_or_field): Adjust.
(layout_empty_base): Remove last parameter. Adjust.
(build_base_field): Adjust.
(build_base_fields): Adjust.
(propagate_binfo_offsets): Remove last parameter. Adjust.
(dfs_set_offset_for_unshared_vbases): Delete.
(layout_virtual_bases): Adjust.
(finish_struct_1): Adjust.
(init_class_processing): Don't init access nodes.
(dfs_get_primary_binfo): Delete.
(get_primary_binfo): Adjust.
(dump_class_hierarchy_r): Remove most derived arg, add IGO
parameter. Adjust.
(dump_class_hierarchy): Adjust.
(finish_vtbls): Adjust.
(get_original_base): Delete.
(build_vtt_inits): Adjust.
(dfs_build_secondary_vptr_vtt_inits): Adjust.
(dfs_ctor_vtable_bases_queue_p): Adjust.
(build_ctor_vtbl_group): Adjust.
(dfs_accumulate_vtbl_inits): Adjust.
(build_vtbl_initializer): Adjust.
(build_vbase_offset_vtbl_entries): Adjust.
(add_vcall_offset_vtbl_entries_1): Adjust.
* cp/cp-tree.h (CPTI_ACCESS_*): Remove.
(access_*_node): Remove.
(CANONICAL_BINFO): Delete.
(BINFO_UNSHARED_MARKED): Remove.
(BINFO_MARKED): Set LANG_FLAG_0 directly.
(SET_BINFO_MARKED, CLEAR_BINFO_MARKED): Delete.
(BINFO_VTABLE_PATH_MARKED): Set LANG_FLAG_3 directly.
(SET_BINFO_VTABLE_PATH_MARKED, CLEAR_BINFO_VTABLE_PATH_MARKED):
Delete.
(BINFO_NEW_VTABLE_MARKED): Set LANG_FLAG_4 directly.
(SET_BINFO_NEW_VTABLE_MARKED): Adjust.
(SET_BINFO_PUSHDECLS_MARKED, CLEAR_BINFO_PUSHDECLS_MARKED):
Delete.
(BINFO_DEPENDENT_BASE_P): New.
(dfs_walk, dfs_walk_real): Queue function takes derived binfo and
index.
(markedp, unmarkedp): Adjust.
(dfs_unmarked_real_bases_queue_p, dfs_marked_real_bases_queue_p,
dfs_skip_vbases, marked_vtable_pathp, unmarked_vtable_pathp,
find_vbase_instance, binfo_for_vbase): Delete.
(copied_binfo, original_binfo): Declare.
(finish_base_specifier): Add virtual_p arg.
(unshare_base_binfos): Delete.
(copy_base_binfos): Declare.
(reverse_path): Delete.
* cp/decl.c (xref_basetypes): Access and virtuality passed
differently. Don't copy direct base binfos here. Call
copy_base_binfos.
* cp/init.c (dfs_initialize_vtbl_ptrs): Adjust.
(initialize_vtbl_ptrs): Adjust.
(expand_member_init): Adjust.
* cp/parser.c (cp_parser_base_specifier): Adjust.
* cp/pt.c (instantiate_class_template): Adjust.
(get_template_base_recursive): Adjust.
* cp/rtti.c (get_pseudo_ti_init): Adjust.
(get_pseudo_ti_desc): Adjust.
* cp/tree.c (unshare_base_binfos): Rename to ...
(copy_base_binfos): ... here, reimplement.
(make_binfo): Set BINFO_DEPENDENT_BASE_P.
(reverse_path): Remove.
* cp/typeck.c (get_delta_difference): Adjust error messages.
* cp/semantics.c (finish_base_specifier): Add virtual arg, adjust.
* cp/search.c (lookup_base_r): Adjust.
(dynamic_cast_base_recurse): Adjust.
(canonical_binfo): Remove.
(dfs_canonical_queue): Remove.
(dfs_assert_unmarked_p): Remove.
(assert_canonical_unmarked): Remove.
(shared_marked_p, shared_unmarked_p): Remove.
(BINFO_ACCESS, SET_BINFO_ACCESS): Use TREE_PUBLIC & TREE_PRIVATE.
(dfs_access_in_type): Adjust.
(access_in_type): Adjust.
(dfs_accessible_queue_p): Adjust.
(dfs_accessible_p): Adjust.
(is_subobject_of_p_1, is_subobject_of_p): Remove.
(struct lookup_field_info): Remove from_dep_base_p field.
(lookup_field_queue_p): Adjust, test BINFO_DEPENDENT_BASE_P.
(lookup_field_r): Remove dependent base code.
(lookup_member): Likewise.
(dfs_walk, dfs_walk_real): Add access arg to queue fn.
(dfs_unmarked_real_bases_queue_p): Remove.
(dfs_marked_real_bases_queue_p): Remove.
(dfs_skip_vbases): Remove.
(dfs_get_pure_virtuals): Adjust.
(markedp, unmarkedp): Adjust.
(marked_vtable_pathp, unmarked_vtable_pathp): Remove.
(marked_pushdecls_p, unmarked_pushdecls_p): Adjust.
(dfs_unmark): Adjust.
(dfs_get_vbase_types):Remove.
(dfs_build_inheritance_graph_order): Remove.
(get_vbase_types): Remove
(dfs_find_vbase_instance): Remove.
(find_vbase_instance): Remove.
(dfs_debug_unmarkedp): Adjust.
(dependent_base_p): Remove.
(dfs_push_type_decls): Adjust.
(dfs_push_decls): Adjust.
(dfs_no_overlap_yet): Adjust.
(copied_binfo): New function.
(original_binfo): New function.
(binfo_for_vbase): Remove.
Change base class access representation.
* java/class.c (set_super_info): Don't set TREE_VIA_PUBLIC.
(add_interface_do): Likewise.
From-SVN: r63172
2003-02-20 18:51:46 +01:00
|
|
|
|
tree base_accesses = BINFO_BASEACCESSES (binfo);
|
2000-01-28 14:30:13 +01:00
|
|
|
|
tree base_inits = NULL_TREE;
|
|
|
|
|
int ix;
|
|
|
|
|
|
|
|
|
|
/* Generate the base information initializer. */
|
|
|
|
|
for (ix = nbases; ix--;)
|
|
|
|
|
{
|
|
|
|
|
tree base_binfo = TREE_VEC_ELT (base_binfos, ix);
|
|
|
|
|
tree base_init = NULL_TREE;
|
|
|
|
|
int flags = 0;
|
|
|
|
|
tree tinfo;
|
|
|
|
|
tree offset;
|
|
|
|
|
|
Change base class access representation.
* tree.h (TREE_VIA_PUBLIC, TREE_VIA_PROTECTED,
TREE_VIA_PRIVATE): Remove.
(BINFO_BASEACCESSES): New binfo elt.
(BINFO_BASEACCESS): New accessor.
(BINFO_ELTS): Increase.
(TI_ACCESS_PUBLIC, TI_ACCESS_PROTECTED, TI_ACCESS_PRIVATE): New.
(access_public_node, access_protected_node,
access_private_node): New global nodes.
* tree.c (build_common_tree_nodes_2): Initialize access nodes.
* dbxout.c (dbxout_type): Adjust.
* dwarf2out.c (gen_inheritance_die): Add access parameter.
(gen_member_die): Adjust.
* dwarfout.c (output_inheritance_die): ARG is array of two trees.
(output_type): Adjust.
* tree-dump.c (dequeue_and_dump): Adjust binfo dumping.
Change base class access representation. Share virtual base
binfos.
* cp/call.c (build_special_member_call): Remove binfo_for_vbase
call.
* cp/class.c (build_base_path): Likewise.
(build_primary_vtable): Adjust BINFO_NEW_VTABLE_MARKED use.
(build_secondary_vtable): Remove FOR_TYPE arg. Adjust.
(make_new_vtable): Adjust.
(force_canonical_binfo_r): Delete.
(force_canonical_binfo): Delete.
(mark_primary_virtual_base): Delete.
(dfs_unshared_virtual_bases): Delete.
(mark_primary_bases): Adjust.
(maybe_warn_about_overly_private_class): Adjust.
(dfs_base_derived_from): Delete.
(base_derived_from): Follow the inheritance chain.
(struct find_final_overrider_data): Add vpath member.
(dfs_find_final_overrider): Adjust.
(dfs_find_final_overrider_q, dfs_find_final_overrider_post): New.
(find_final_overrider): Adjust.
(update_vtable_entry_for_fn): Adjust.
(modify_all_vtables): Adjust.
(walk_subobject_offsets): Adjust.
(layout_nonempty_base_or_field): Adjust.
(layout_empty_base): Remove last parameter. Adjust.
(build_base_field): Adjust.
(build_base_fields): Adjust.
(propagate_binfo_offsets): Remove last parameter. Adjust.
(dfs_set_offset_for_unshared_vbases): Delete.
(layout_virtual_bases): Adjust.
(finish_struct_1): Adjust.
(init_class_processing): Don't init access nodes.
(dfs_get_primary_binfo): Delete.
(get_primary_binfo): Adjust.
(dump_class_hierarchy_r): Remove most derived arg, add IGO
parameter. Adjust.
(dump_class_hierarchy): Adjust.
(finish_vtbls): Adjust.
(get_original_base): Delete.
(build_vtt_inits): Adjust.
(dfs_build_secondary_vptr_vtt_inits): Adjust.
(dfs_ctor_vtable_bases_queue_p): Adjust.
(build_ctor_vtbl_group): Adjust.
(dfs_accumulate_vtbl_inits): Adjust.
(build_vtbl_initializer): Adjust.
(build_vbase_offset_vtbl_entries): Adjust.
(add_vcall_offset_vtbl_entries_1): Adjust.
* cp/cp-tree.h (CPTI_ACCESS_*): Remove.
(access_*_node): Remove.
(CANONICAL_BINFO): Delete.
(BINFO_UNSHARED_MARKED): Remove.
(BINFO_MARKED): Set LANG_FLAG_0 directly.
(SET_BINFO_MARKED, CLEAR_BINFO_MARKED): Delete.
(BINFO_VTABLE_PATH_MARKED): Set LANG_FLAG_3 directly.
(SET_BINFO_VTABLE_PATH_MARKED, CLEAR_BINFO_VTABLE_PATH_MARKED):
Delete.
(BINFO_NEW_VTABLE_MARKED): Set LANG_FLAG_4 directly.
(SET_BINFO_NEW_VTABLE_MARKED): Adjust.
(SET_BINFO_PUSHDECLS_MARKED, CLEAR_BINFO_PUSHDECLS_MARKED):
Delete.
(BINFO_DEPENDENT_BASE_P): New.
(dfs_walk, dfs_walk_real): Queue function takes derived binfo and
index.
(markedp, unmarkedp): Adjust.
(dfs_unmarked_real_bases_queue_p, dfs_marked_real_bases_queue_p,
dfs_skip_vbases, marked_vtable_pathp, unmarked_vtable_pathp,
find_vbase_instance, binfo_for_vbase): Delete.
(copied_binfo, original_binfo): Declare.
(finish_base_specifier): Add virtual_p arg.
(unshare_base_binfos): Delete.
(copy_base_binfos): Declare.
(reverse_path): Delete.
* cp/decl.c (xref_basetypes): Access and virtuality passed
differently. Don't copy direct base binfos here. Call
copy_base_binfos.
* cp/init.c (dfs_initialize_vtbl_ptrs): Adjust.
(initialize_vtbl_ptrs): Adjust.
(expand_member_init): Adjust.
* cp/parser.c (cp_parser_base_specifier): Adjust.
* cp/pt.c (instantiate_class_template): Adjust.
(get_template_base_recursive): Adjust.
* cp/rtti.c (get_pseudo_ti_init): Adjust.
(get_pseudo_ti_desc): Adjust.
* cp/tree.c (unshare_base_binfos): Rename to ...
(copy_base_binfos): ... here, reimplement.
(make_binfo): Set BINFO_DEPENDENT_BASE_P.
(reverse_path): Remove.
* cp/typeck.c (get_delta_difference): Adjust error messages.
* cp/semantics.c (finish_base_specifier): Add virtual arg, adjust.
* cp/search.c (lookup_base_r): Adjust.
(dynamic_cast_base_recurse): Adjust.
(canonical_binfo): Remove.
(dfs_canonical_queue): Remove.
(dfs_assert_unmarked_p): Remove.
(assert_canonical_unmarked): Remove.
(shared_marked_p, shared_unmarked_p): Remove.
(BINFO_ACCESS, SET_BINFO_ACCESS): Use TREE_PUBLIC & TREE_PRIVATE.
(dfs_access_in_type): Adjust.
(access_in_type): Adjust.
(dfs_accessible_queue_p): Adjust.
(dfs_accessible_p): Adjust.
(is_subobject_of_p_1, is_subobject_of_p): Remove.
(struct lookup_field_info): Remove from_dep_base_p field.
(lookup_field_queue_p): Adjust, test BINFO_DEPENDENT_BASE_P.
(lookup_field_r): Remove dependent base code.
(lookup_member): Likewise.
(dfs_walk, dfs_walk_real): Add access arg to queue fn.
(dfs_unmarked_real_bases_queue_p): Remove.
(dfs_marked_real_bases_queue_p): Remove.
(dfs_skip_vbases): Remove.
(dfs_get_pure_virtuals): Adjust.
(markedp, unmarkedp): Adjust.
(marked_vtable_pathp, unmarked_vtable_pathp): Remove.
(marked_pushdecls_p, unmarked_pushdecls_p): Adjust.
(dfs_unmark): Adjust.
(dfs_get_vbase_types):Remove.
(dfs_build_inheritance_graph_order): Remove.
(get_vbase_types): Remove
(dfs_find_vbase_instance): Remove.
(find_vbase_instance): Remove.
(dfs_debug_unmarkedp): Adjust.
(dependent_base_p): Remove.
(dfs_push_type_decls): Adjust.
(dfs_push_decls): Adjust.
(dfs_no_overlap_yet): Adjust.
(copied_binfo): New function.
(original_binfo): New function.
(binfo_for_vbase): Remove.
Change base class access representation.
* java/class.c (set_super_info): Don't set TREE_VIA_PUBLIC.
(add_interface_do): Likewise.
From-SVN: r63172
2003-02-20 18:51:46 +01:00
|
|
|
|
if (TREE_VEC_ELT (base_accesses, ix) == access_public_node)
|
2000-01-28 14:30:13 +01:00
|
|
|
|
flags |= 2;
|
2002-06-30 22:41:38 +02:00
|
|
|
|
tinfo = get_tinfo_ptr (BINFO_TYPE (base_binfo));
|
2001-07-24 10:56:12 +02:00
|
|
|
|
if (TREE_VIA_VIRTUAL (base_binfo))
|
|
|
|
|
{
|
|
|
|
|
/* We store the vtable offset at which the virtual
|
|
|
|
|
base offset can be found. */
|
Change base class access representation.
* tree.h (TREE_VIA_PUBLIC, TREE_VIA_PROTECTED,
TREE_VIA_PRIVATE): Remove.
(BINFO_BASEACCESSES): New binfo elt.
(BINFO_BASEACCESS): New accessor.
(BINFO_ELTS): Increase.
(TI_ACCESS_PUBLIC, TI_ACCESS_PROTECTED, TI_ACCESS_PRIVATE): New.
(access_public_node, access_protected_node,
access_private_node): New global nodes.
* tree.c (build_common_tree_nodes_2): Initialize access nodes.
* dbxout.c (dbxout_type): Adjust.
* dwarf2out.c (gen_inheritance_die): Add access parameter.
(gen_member_die): Adjust.
* dwarfout.c (output_inheritance_die): ARG is array of two trees.
(output_type): Adjust.
* tree-dump.c (dequeue_and_dump): Adjust binfo dumping.
Change base class access representation. Share virtual base
binfos.
* cp/call.c (build_special_member_call): Remove binfo_for_vbase
call.
* cp/class.c (build_base_path): Likewise.
(build_primary_vtable): Adjust BINFO_NEW_VTABLE_MARKED use.
(build_secondary_vtable): Remove FOR_TYPE arg. Adjust.
(make_new_vtable): Adjust.
(force_canonical_binfo_r): Delete.
(force_canonical_binfo): Delete.
(mark_primary_virtual_base): Delete.
(dfs_unshared_virtual_bases): Delete.
(mark_primary_bases): Adjust.
(maybe_warn_about_overly_private_class): Adjust.
(dfs_base_derived_from): Delete.
(base_derived_from): Follow the inheritance chain.
(struct find_final_overrider_data): Add vpath member.
(dfs_find_final_overrider): Adjust.
(dfs_find_final_overrider_q, dfs_find_final_overrider_post): New.
(find_final_overrider): Adjust.
(update_vtable_entry_for_fn): Adjust.
(modify_all_vtables): Adjust.
(walk_subobject_offsets): Adjust.
(layout_nonempty_base_or_field): Adjust.
(layout_empty_base): Remove last parameter. Adjust.
(build_base_field): Adjust.
(build_base_fields): Adjust.
(propagate_binfo_offsets): Remove last parameter. Adjust.
(dfs_set_offset_for_unshared_vbases): Delete.
(layout_virtual_bases): Adjust.
(finish_struct_1): Adjust.
(init_class_processing): Don't init access nodes.
(dfs_get_primary_binfo): Delete.
(get_primary_binfo): Adjust.
(dump_class_hierarchy_r): Remove most derived arg, add IGO
parameter. Adjust.
(dump_class_hierarchy): Adjust.
(finish_vtbls): Adjust.
(get_original_base): Delete.
(build_vtt_inits): Adjust.
(dfs_build_secondary_vptr_vtt_inits): Adjust.
(dfs_ctor_vtable_bases_queue_p): Adjust.
(build_ctor_vtbl_group): Adjust.
(dfs_accumulate_vtbl_inits): Adjust.
(build_vtbl_initializer): Adjust.
(build_vbase_offset_vtbl_entries): Adjust.
(add_vcall_offset_vtbl_entries_1): Adjust.
* cp/cp-tree.h (CPTI_ACCESS_*): Remove.
(access_*_node): Remove.
(CANONICAL_BINFO): Delete.
(BINFO_UNSHARED_MARKED): Remove.
(BINFO_MARKED): Set LANG_FLAG_0 directly.
(SET_BINFO_MARKED, CLEAR_BINFO_MARKED): Delete.
(BINFO_VTABLE_PATH_MARKED): Set LANG_FLAG_3 directly.
(SET_BINFO_VTABLE_PATH_MARKED, CLEAR_BINFO_VTABLE_PATH_MARKED):
Delete.
(BINFO_NEW_VTABLE_MARKED): Set LANG_FLAG_4 directly.
(SET_BINFO_NEW_VTABLE_MARKED): Adjust.
(SET_BINFO_PUSHDECLS_MARKED, CLEAR_BINFO_PUSHDECLS_MARKED):
Delete.
(BINFO_DEPENDENT_BASE_P): New.
(dfs_walk, dfs_walk_real): Queue function takes derived binfo and
index.
(markedp, unmarkedp): Adjust.
(dfs_unmarked_real_bases_queue_p, dfs_marked_real_bases_queue_p,
dfs_skip_vbases, marked_vtable_pathp, unmarked_vtable_pathp,
find_vbase_instance, binfo_for_vbase): Delete.
(copied_binfo, original_binfo): Declare.
(finish_base_specifier): Add virtual_p arg.
(unshare_base_binfos): Delete.
(copy_base_binfos): Declare.
(reverse_path): Delete.
* cp/decl.c (xref_basetypes): Access and virtuality passed
differently. Don't copy direct base binfos here. Call
copy_base_binfos.
* cp/init.c (dfs_initialize_vtbl_ptrs): Adjust.
(initialize_vtbl_ptrs): Adjust.
(expand_member_init): Adjust.
* cp/parser.c (cp_parser_base_specifier): Adjust.
* cp/pt.c (instantiate_class_template): Adjust.
(get_template_base_recursive): Adjust.
* cp/rtti.c (get_pseudo_ti_init): Adjust.
(get_pseudo_ti_desc): Adjust.
* cp/tree.c (unshare_base_binfos): Rename to ...
(copy_base_binfos): ... here, reimplement.
(make_binfo): Set BINFO_DEPENDENT_BASE_P.
(reverse_path): Remove.
* cp/typeck.c (get_delta_difference): Adjust error messages.
* cp/semantics.c (finish_base_specifier): Add virtual arg, adjust.
* cp/search.c (lookup_base_r): Adjust.
(dynamic_cast_base_recurse): Adjust.
(canonical_binfo): Remove.
(dfs_canonical_queue): Remove.
(dfs_assert_unmarked_p): Remove.
(assert_canonical_unmarked): Remove.
(shared_marked_p, shared_unmarked_p): Remove.
(BINFO_ACCESS, SET_BINFO_ACCESS): Use TREE_PUBLIC & TREE_PRIVATE.
(dfs_access_in_type): Adjust.
(access_in_type): Adjust.
(dfs_accessible_queue_p): Adjust.
(dfs_accessible_p): Adjust.
(is_subobject_of_p_1, is_subobject_of_p): Remove.
(struct lookup_field_info): Remove from_dep_base_p field.
(lookup_field_queue_p): Adjust, test BINFO_DEPENDENT_BASE_P.
(lookup_field_r): Remove dependent base code.
(lookup_member): Likewise.
(dfs_walk, dfs_walk_real): Add access arg to queue fn.
(dfs_unmarked_real_bases_queue_p): Remove.
(dfs_marked_real_bases_queue_p): Remove.
(dfs_skip_vbases): Remove.
(dfs_get_pure_virtuals): Adjust.
(markedp, unmarkedp): Adjust.
(marked_vtable_pathp, unmarked_vtable_pathp): Remove.
(marked_pushdecls_p, unmarked_pushdecls_p): Adjust.
(dfs_unmark): Adjust.
(dfs_get_vbase_types):Remove.
(dfs_build_inheritance_graph_order): Remove.
(get_vbase_types): Remove
(dfs_find_vbase_instance): Remove.
(find_vbase_instance): Remove.
(dfs_debug_unmarkedp): Adjust.
(dependent_base_p): Remove.
(dfs_push_type_decls): Adjust.
(dfs_push_decls): Adjust.
(dfs_no_overlap_yet): Adjust.
(copied_binfo): New function.
(original_binfo): New function.
(binfo_for_vbase): Remove.
Change base class access representation.
* java/class.c (set_super_info): Don't set TREE_VIA_PUBLIC.
(add_interface_do): Likewise.
From-SVN: r63172
2003-02-20 18:51:46 +01:00
|
|
|
|
offset = BINFO_VPTR_FIELD (base_binfo);
|
2001-07-24 10:56:12 +02:00
|
|
|
|
offset = convert (sizetype, offset);
|
|
|
|
|
flags |= 1;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
offset = BINFO_OFFSET (base_binfo);
|
2000-01-28 14:30:13 +01:00
|
|
|
|
|
2000-03-30 14:08:26 +02:00
|
|
|
|
/* combine offset and flags into one field */
|
2000-06-30 02:26:03 +02:00
|
|
|
|
offset = cp_build_binary_op (LSHIFT_EXPR, offset,
|
|
|
|
|
build_int_2 (8, 0));
|
|
|
|
|
offset = cp_build_binary_op (BIT_IOR_EXPR, offset,
|
|
|
|
|
build_int_2 (flags, 0));
|
2000-01-28 14:30:13 +01:00
|
|
|
|
base_init = tree_cons (NULL_TREE, offset, base_init);
|
|
|
|
|
base_init = tree_cons (NULL_TREE, tinfo, base_init);
|
tree.c (build_constructor): New function.
* tree.c (build_constructor): New function.
* tree.h: Prototype it.
* c-typeck.c (build_c_cast, pop_init_level)
* profile.c (build_function_info_value, build_gcov_info_value)
(create_profiler):
Use build_constructor.
* builtins.c (expand_builtin_args_info): Remove #if 0 blocks.
* objc/objc-act.c (build_constructor):
Rename objc_build_constructor. Use build_constructor.
(build_objc_string_object, objc_add_static_instance)
(init_def_list, init_objc_symtab, init_module_descriptor)
(generate_static_references, build_selector_translation_table)
(build_descriptor_table_initializer, generate_descriptor_table)
(build_protocol_initializer, build_ivar_list_initializer)
(generate_ivars_list, build_dispatch_table_initializer)
(generate_dispatch_table, generate_protocol_list)
(build_category_initializer, build_shared_structure_initializer):
Update to match.
ada:
* gigi.h, utils2.c (build_constructor):
Rename gnat_build_constructor. Use build_constructor.
* decl.c (gnat_to_gnu_entity)
* trans.c (tree_transform, pos_to_constructor, extract_values)
* ada/utils.c (build_template, convert_to_fat_pointer, convert)
(unchecked_convert)
* ada/utils2.c (build_binary_op, build_call_raise, build_allocator)
(fill_vms_descriptor):
Update to match.
cp:
* class.c (initialize_array)
* decl.c (reshape_init)
* decl2.c (build_expr_from_tree)
* init.c (build_zero_init)
* pt.c (tsubst_copy, tsubst_copy_and_build)
* rtti.c (tinfo_base_init, generic_initializer, ptr_initializer)
(ptm_initializer, class_initializer, get_pseudo_ti_init)
* semantics.c (finish_compound_literal)
* typeck.c (build_ptrmemfunc1)
* typeck2.c (store_init_value, process_init_constructor)
(build_functional_cast): Use build_constructor.
f:
* com.c (ffecom_build_complex_constant_, ffecom_expr_)
(ffecom_init_zero_, ffecom_transform_namelist_, ffecom_vardesc_)
(ffecom_vardesc_array_, ffecom_vardesc_dims_, ffecom_2)
* ste.c (ffeste_io_ialist_, ffeste_io_cilist_, ffeste_io_cllist_)
(ffeste_io_icilist_, ffeste_io_inlist_, ffeste_io_olist_):
Use build_constructor.
java:
* class.c (make_field_value, make_method_value, get_dispatch_table)
(make_class_data, emit_offset_symbol_table)
* constants.c (build_constants_constructor)
* java-tree.h (START_RECORD_CONSTRUCTOR)
* parse.y (maybe_build_array_element_wfl):
Use build_constructor.
From-SVN: r65539
2003-04-13 03:45:35 +02:00
|
|
|
|
base_init = build_constructor (NULL_TREE, base_init);
|
2002-10-11 18:50:44 +02:00
|
|
|
|
TREE_HAS_CONSTRUCTOR (base_init) = 1;
|
2000-01-28 14:30:13 +01:00
|
|
|
|
base_inits = tree_cons (NULL_TREE, base_init, base_inits);
|
|
|
|
|
}
|
tree.c (build_constructor): New function.
* tree.c (build_constructor): New function.
* tree.h: Prototype it.
* c-typeck.c (build_c_cast, pop_init_level)
* profile.c (build_function_info_value, build_gcov_info_value)
(create_profiler):
Use build_constructor.
* builtins.c (expand_builtin_args_info): Remove #if 0 blocks.
* objc/objc-act.c (build_constructor):
Rename objc_build_constructor. Use build_constructor.
(build_objc_string_object, objc_add_static_instance)
(init_def_list, init_objc_symtab, init_module_descriptor)
(generate_static_references, build_selector_translation_table)
(build_descriptor_table_initializer, generate_descriptor_table)
(build_protocol_initializer, build_ivar_list_initializer)
(generate_ivars_list, build_dispatch_table_initializer)
(generate_dispatch_table, generate_protocol_list)
(build_category_initializer, build_shared_structure_initializer):
Update to match.
ada:
* gigi.h, utils2.c (build_constructor):
Rename gnat_build_constructor. Use build_constructor.
* decl.c (gnat_to_gnu_entity)
* trans.c (tree_transform, pos_to_constructor, extract_values)
* ada/utils.c (build_template, convert_to_fat_pointer, convert)
(unchecked_convert)
* ada/utils2.c (build_binary_op, build_call_raise, build_allocator)
(fill_vms_descriptor):
Update to match.
cp:
* class.c (initialize_array)
* decl.c (reshape_init)
* decl2.c (build_expr_from_tree)
* init.c (build_zero_init)
* pt.c (tsubst_copy, tsubst_copy_and_build)
* rtti.c (tinfo_base_init, generic_initializer, ptr_initializer)
(ptm_initializer, class_initializer, get_pseudo_ti_init)
* semantics.c (finish_compound_literal)
* typeck.c (build_ptrmemfunc1)
* typeck2.c (store_init_value, process_init_constructor)
(build_functional_cast): Use build_constructor.
f:
* com.c (ffecom_build_complex_constant_, ffecom_expr_)
(ffecom_init_zero_, ffecom_transform_namelist_, ffecom_vardesc_)
(ffecom_vardesc_array_, ffecom_vardesc_dims_, ffecom_2)
* ste.c (ffeste_io_ialist_, ffeste_io_cilist_, ffeste_io_cllist_)
(ffeste_io_icilist_, ffeste_io_inlist_, ffeste_io_olist_):
Use build_constructor.
java:
* class.c (make_field_value, make_method_value, get_dispatch_table)
(make_class_data, emit_offset_symbol_table)
* constants.c (build_constants_constructor)
* java-tree.h (START_RECORD_CONSTRUCTOR)
* parse.y (maybe_build_array_element_wfl):
Use build_constructor.
From-SVN: r65539
2003-04-13 03:45:35 +02:00
|
|
|
|
base_inits = build_constructor (NULL_TREE, base_inits);
|
2002-10-11 18:50:44 +02:00
|
|
|
|
TREE_HAS_CONSTRUCTOR (base_inits) = 1;
|
2002-06-30 22:41:38 +02:00
|
|
|
|
base_inits = tree_cons (NULL_TREE, base_inits, NULL_TREE);
|
|
|
|
|
/* Prepend the number of bases. */
|
|
|
|
|
base_inits = tree_cons (NULL_TREE,
|
|
|
|
|
build_int_2 (nbases, 0), base_inits);
|
2002-09-14 14:07:44 +02:00
|
|
|
|
/* Prepend the hint flags. */
|
2002-06-30 22:41:38 +02:00
|
|
|
|
base_inits = tree_cons (NULL_TREE,
|
|
|
|
|
build_int_2 (hint, 0), base_inits);
|
|
|
|
|
|
|
|
|
|
return class_initializer (var_desc, type, base_inits);
|
2000-01-28 14:30:13 +01:00
|
|
|
|
}
|
|
|
|
|
break;
|
2001-02-04 09:35:11 +01:00
|
|
|
|
|
2000-01-28 14:30:13 +01:00
|
|
|
|
default:
|
2002-06-30 22:41:38 +02:00
|
|
|
|
return generic_initializer (var_desc, type);
|
2000-01-28 14:30:13 +01:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Generate the RECORD_TYPE containing the data layout of a type_info
|
|
|
|
|
derivative as used by the runtime. This layout must be consistent with
|
|
|
|
|
that defined in the runtime support. Also generate the VAR_DECL for the
|
|
|
|
|
type's vtable. We explicitly manage the vtable member, and name it for
|
|
|
|
|
real type as used in the runtime. The RECORD type has a different name,
|
|
|
|
|
to avoid collisions. Return a TREE_LIST who's TINFO_PSEUDO_TYPE
|
2002-06-30 22:41:38 +02:00
|
|
|
|
is the generated type and TINFO_VTABLE_NAME is the name of the
|
|
|
|
|
vtable. We have to delay generating the VAR_DECL of the vtable
|
|
|
|
|
until the end of the translation, when we'll have seen the library
|
|
|
|
|
definition, if there was one.
|
2000-01-28 14:30:13 +01:00
|
|
|
|
|
|
|
|
|
REAL_NAME is the runtime's name of the type. Trailing arguments are
|
|
|
|
|
additional FIELD_DECL's for the structure. The final argument must be
|
|
|
|
|
NULL. */
|
|
|
|
|
|
|
|
|
|
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
|
|
|
|
create_pseudo_type_info (const char *real_name, int ident, ...)
|
2000-01-28 14:30:13 +01:00
|
|
|
|
{
|
2002-06-30 22:41:38 +02:00
|
|
|
|
tree pseudo_type;
|
2000-01-28 14:30:13 +01:00
|
|
|
|
char *pseudo_name;
|
2002-12-16 19:23:00 +01:00
|
|
|
|
tree fields;
|
2000-01-28 14:30:13 +01:00
|
|
|
|
tree field_decl;
|
|
|
|
|
tree result;
|
builtins.c (validate_arglist): Eliminate libiberty VA_ macros, always use stdarg.
gcc:
* builtins.c (validate_arglist): Eliminate libiberty VA_ macros,
always use stdarg.
* c-errors.c (pedwarn_c99): Likewise.
* c-format.c (status_warning): Likewise.
* c-semantics.c (build_stmt): Likewise.
* calls.c (emit_library_call, emit_library_call_value): Likewise.
* collect2.c (notice, fatal_perror, fatal, error): Likewise.
* cpperror.c (cpp_error, cpp_error_with_line): Likewise.
* diagnostic.c (build_message_string, output_printf,
output_verbatim, verbatim, inform, warning, pedwarn, error, sorry,
fatal_error, internal_error, warning_with_decl, pedwarn_with_decl,
error_with_decl, fnotice): Likewise.
* dwarf2asm.c (dw2_asm_output_data, dw2_asm_output_delta,
dw2_asm_output_offset, dw2_asm_output_pcrel, dw2_asm_output_addr,
dw2_asm_output_addr_rtx, dw2_asm_output_nstring,
dw2_asm_output_data_uleb128, dw2_asm_output_data_sleb128,
dw2_asm_output_delta_uleb128, dw2_asm_output_delta_sleb128,
dw2_asm_output_encoded_addr_rtx): Likewise.
* emit-rtl.c (gen_rtx, gen_rtvec): Likewise.
* errors.c (warning, error, fatal, internal_error): Likewise.
* final.c (output_operand_lossage, asm_fprintf): Likewise.
* fix-header.c (fatal): Likewise.
* gcc.c (fatal, error, notice): Likewise.
* gcov.c (fnotice): Likewise.
* genattrtab.c (attr_rtx, attr_printf): Likewise.
* gengtype.c (error_at_line, xasprintf, oprintf): Likewise.
* gensupport.c (message_with_line): Likewise.
* mips-tfile.c (fatal, error): Likewise.
* protoize.c (notice): Likewise.
* ra-debug.c (ra_debug_msg): Likewise.
* read-rtl.c (fatal_with_file_and_line): Likewise.
* rtl-error.c (error_for_asm, warning_for_asm): Likewise.
* tree.c (build, build_nt, build_function_type_list): Likewise.
cp:
* error.c (cp_error_at, cp_warning_at, cp_pedwarn_at): Eliminate
libiberty VA_ macros, always use stdarg.
* rtti.c (create_pseudo_type_info): Likewise.
* tree.c (build_min_nt, build_min): Likewise.
From-SVN: r66919
2003-05-18 00:21:35 +02:00
|
|
|
|
va_list ap;
|
2001-08-27 08:48:43 +02:00
|
|
|
|
|
builtins.c (validate_arglist): Eliminate libiberty VA_ macros, always use stdarg.
gcc:
* builtins.c (validate_arglist): Eliminate libiberty VA_ macros,
always use stdarg.
* c-errors.c (pedwarn_c99): Likewise.
* c-format.c (status_warning): Likewise.
* c-semantics.c (build_stmt): Likewise.
* calls.c (emit_library_call, emit_library_call_value): Likewise.
* collect2.c (notice, fatal_perror, fatal, error): Likewise.
* cpperror.c (cpp_error, cpp_error_with_line): Likewise.
* diagnostic.c (build_message_string, output_printf,
output_verbatim, verbatim, inform, warning, pedwarn, error, sorry,
fatal_error, internal_error, warning_with_decl, pedwarn_with_decl,
error_with_decl, fnotice): Likewise.
* dwarf2asm.c (dw2_asm_output_data, dw2_asm_output_delta,
dw2_asm_output_offset, dw2_asm_output_pcrel, dw2_asm_output_addr,
dw2_asm_output_addr_rtx, dw2_asm_output_nstring,
dw2_asm_output_data_uleb128, dw2_asm_output_data_sleb128,
dw2_asm_output_delta_uleb128, dw2_asm_output_delta_sleb128,
dw2_asm_output_encoded_addr_rtx): Likewise.
* emit-rtl.c (gen_rtx, gen_rtvec): Likewise.
* errors.c (warning, error, fatal, internal_error): Likewise.
* final.c (output_operand_lossage, asm_fprintf): Likewise.
* fix-header.c (fatal): Likewise.
* gcc.c (fatal, error, notice): Likewise.
* gcov.c (fnotice): Likewise.
* genattrtab.c (attr_rtx, attr_printf): Likewise.
* gengtype.c (error_at_line, xasprintf, oprintf): Likewise.
* gensupport.c (message_with_line): Likewise.
* mips-tfile.c (fatal, error): Likewise.
* protoize.c (notice): Likewise.
* ra-debug.c (ra_debug_msg): Likewise.
* read-rtl.c (fatal_with_file_and_line): Likewise.
* rtl-error.c (error_for_asm, warning_for_asm): Likewise.
* tree.c (build, build_nt, build_function_type_list): Likewise.
cp:
* error.c (cp_error_at, cp_warning_at, cp_pedwarn_at): Eliminate
libiberty VA_ macros, always use stdarg.
* rtti.c (create_pseudo_type_info): Likewise.
* tree.c (build_min_nt, build_min): Likewise.
From-SVN: r66919
2003-05-18 00:21:35 +02:00
|
|
|
|
va_start (ap, ident);
|
2000-01-28 14:30:13 +01:00
|
|
|
|
|
2002-09-14 14:07:44 +02:00
|
|
|
|
/* Generate the pseudo type name. */
|
2000-01-28 14:30:13 +01:00
|
|
|
|
pseudo_name = (char *)alloca (strlen (real_name) + 30);
|
|
|
|
|
strcpy (pseudo_name, real_name);
|
|
|
|
|
strcat (pseudo_name, "_pseudo");
|
|
|
|
|
if (ident)
|
|
|
|
|
sprintf (pseudo_name + strlen (pseudo_name), "%d", ident);
|
|
|
|
|
|
2002-09-14 14:07:44 +02:00
|
|
|
|
/* First field is the pseudo type_info base class. */
|
2002-12-16 19:23:00 +01:00
|
|
|
|
fields = build_decl (FIELD_DECL, NULL_TREE, ti_desc_type_node);
|
2000-01-28 14:30:13 +01:00
|
|
|
|
|
|
|
|
|
/* Now add the derived fields. */
|
2002-12-16 19:23:00 +01:00
|
|
|
|
while ((field_decl = va_arg (ap, tree)))
|
|
|
|
|
{
|
|
|
|
|
TREE_CHAIN (field_decl) = fields;
|
|
|
|
|
fields = field_decl;
|
|
|
|
|
}
|
2000-01-28 14:30:13 +01:00
|
|
|
|
|
2002-09-14 14:07:44 +02:00
|
|
|
|
/* Create the pseudo type. */
|
2000-01-28 14:30:13 +01:00
|
|
|
|
pseudo_type = make_aggr_type (RECORD_TYPE);
|
2002-12-16 19:23:00 +01:00
|
|
|
|
finish_builtin_struct (pseudo_type, pseudo_name, fields, NULL_TREE);
|
2002-10-11 18:50:44 +02:00
|
|
|
|
CLASSTYPE_AS_BASE (pseudo_type) = pseudo_type;
|
2001-08-27 08:48:43 +02:00
|
|
|
|
|
2000-01-28 14:30:13 +01:00
|
|
|
|
result = tree_cons (NULL_TREE, NULL_TREE, NULL_TREE);
|
2002-06-30 22:41:38 +02:00
|
|
|
|
TINFO_REAL_NAME (result) = get_identifier (real_name);
|
|
|
|
|
TINFO_PSEUDO_TYPE (result) =
|
|
|
|
|
cp_build_qualified_type (pseudo_type, TYPE_QUAL_CONST);
|
2000-01-28 14:30:13 +01:00
|
|
|
|
|
builtins.c (validate_arglist): Eliminate libiberty VA_ macros, always use stdarg.
gcc:
* builtins.c (validate_arglist): Eliminate libiberty VA_ macros,
always use stdarg.
* c-errors.c (pedwarn_c99): Likewise.
* c-format.c (status_warning): Likewise.
* c-semantics.c (build_stmt): Likewise.
* calls.c (emit_library_call, emit_library_call_value): Likewise.
* collect2.c (notice, fatal_perror, fatal, error): Likewise.
* cpperror.c (cpp_error, cpp_error_with_line): Likewise.
* diagnostic.c (build_message_string, output_printf,
output_verbatim, verbatim, inform, warning, pedwarn, error, sorry,
fatal_error, internal_error, warning_with_decl, pedwarn_with_decl,
error_with_decl, fnotice): Likewise.
* dwarf2asm.c (dw2_asm_output_data, dw2_asm_output_delta,
dw2_asm_output_offset, dw2_asm_output_pcrel, dw2_asm_output_addr,
dw2_asm_output_addr_rtx, dw2_asm_output_nstring,
dw2_asm_output_data_uleb128, dw2_asm_output_data_sleb128,
dw2_asm_output_delta_uleb128, dw2_asm_output_delta_sleb128,
dw2_asm_output_encoded_addr_rtx): Likewise.
* emit-rtl.c (gen_rtx, gen_rtvec): Likewise.
* errors.c (warning, error, fatal, internal_error): Likewise.
* final.c (output_operand_lossage, asm_fprintf): Likewise.
* fix-header.c (fatal): Likewise.
* gcc.c (fatal, error, notice): Likewise.
* gcov.c (fnotice): Likewise.
* genattrtab.c (attr_rtx, attr_printf): Likewise.
* gengtype.c (error_at_line, xasprintf, oprintf): Likewise.
* gensupport.c (message_with_line): Likewise.
* mips-tfile.c (fatal, error): Likewise.
* protoize.c (notice): Likewise.
* ra-debug.c (ra_debug_msg): Likewise.
* read-rtl.c (fatal_with_file_and_line): Likewise.
* rtl-error.c (error_for_asm, warning_for_asm): Likewise.
* tree.c (build, build_nt, build_function_type_list): Likewise.
cp:
* error.c (cp_error_at, cp_warning_at, cp_pedwarn_at): Eliminate
libiberty VA_ macros, always use stdarg.
* rtti.c (create_pseudo_type_info): Likewise.
* tree.c (build_min_nt, build_min): Likewise.
From-SVN: r66919
2003-05-18 00:21:35 +02:00
|
|
|
|
va_end (ap);
|
2000-01-28 14:30:13 +01:00
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
|
2002-06-30 22:41:38 +02:00
|
|
|
|
/* Return a pseudo type info type node used to describe TYPE. TYPE
|
|
|
|
|
must be a complete type (or cv void), except at the end of the
|
|
|
|
|
translation unit. */
|
2000-01-28 14:30:13 +01: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
|
|
|
|
get_pseudo_ti_desc (tree type)
|
2000-01-28 14:30:13 +01:00
|
|
|
|
{
|
2002-06-30 22:41:38 +02:00
|
|
|
|
switch (TREE_CODE (type))
|
2000-01-28 14:30:13 +01:00
|
|
|
|
{
|
2002-06-30 22:41:38 +02:00
|
|
|
|
case POINTER_TYPE:
|
|
|
|
|
return TYPE_PTRMEM_P (type) ? ptm_desc_type_node : ptr_desc_type_node;
|
|
|
|
|
case ENUMERAL_TYPE:
|
|
|
|
|
return enum_desc_type_node;
|
|
|
|
|
case FUNCTION_TYPE:
|
|
|
|
|
return func_desc_type_node;
|
|
|
|
|
case ARRAY_TYPE:
|
|
|
|
|
return ary_desc_type_node;
|
|
|
|
|
case UNION_TYPE:
|
|
|
|
|
case RECORD_TYPE:
|
|
|
|
|
if (TYPE_PTRMEMFUNC_P (type))
|
|
|
|
|
return ptm_desc_type_node;
|
|
|
|
|
else if (!COMPLETE_TYPE_P (type))
|
|
|
|
|
{
|
2002-09-05 01:24:00 +02:00
|
|
|
|
if (!at_eof)
|
|
|
|
|
cxx_incomplete_type_error (NULL_TREE, type);
|
2002-06-30 22:41:38 +02:00
|
|
|
|
return class_desc_type_node;
|
|
|
|
|
}
|
|
|
|
|
else if (!CLASSTYPE_N_BASECLASSES (type))
|
|
|
|
|
return class_desc_type_node;
|
|
|
|
|
else
|
|
|
|
|
{
|
Change base class access representation.
* tree.h (TREE_VIA_PUBLIC, TREE_VIA_PROTECTED,
TREE_VIA_PRIVATE): Remove.
(BINFO_BASEACCESSES): New binfo elt.
(BINFO_BASEACCESS): New accessor.
(BINFO_ELTS): Increase.
(TI_ACCESS_PUBLIC, TI_ACCESS_PROTECTED, TI_ACCESS_PRIVATE): New.
(access_public_node, access_protected_node,
access_private_node): New global nodes.
* tree.c (build_common_tree_nodes_2): Initialize access nodes.
* dbxout.c (dbxout_type): Adjust.
* dwarf2out.c (gen_inheritance_die): Add access parameter.
(gen_member_die): Adjust.
* dwarfout.c (output_inheritance_die): ARG is array of two trees.
(output_type): Adjust.
* tree-dump.c (dequeue_and_dump): Adjust binfo dumping.
Change base class access representation. Share virtual base
binfos.
* cp/call.c (build_special_member_call): Remove binfo_for_vbase
call.
* cp/class.c (build_base_path): Likewise.
(build_primary_vtable): Adjust BINFO_NEW_VTABLE_MARKED use.
(build_secondary_vtable): Remove FOR_TYPE arg. Adjust.
(make_new_vtable): Adjust.
(force_canonical_binfo_r): Delete.
(force_canonical_binfo): Delete.
(mark_primary_virtual_base): Delete.
(dfs_unshared_virtual_bases): Delete.
(mark_primary_bases): Adjust.
(maybe_warn_about_overly_private_class): Adjust.
(dfs_base_derived_from): Delete.
(base_derived_from): Follow the inheritance chain.
(struct find_final_overrider_data): Add vpath member.
(dfs_find_final_overrider): Adjust.
(dfs_find_final_overrider_q, dfs_find_final_overrider_post): New.
(find_final_overrider): Adjust.
(update_vtable_entry_for_fn): Adjust.
(modify_all_vtables): Adjust.
(walk_subobject_offsets): Adjust.
(layout_nonempty_base_or_field): Adjust.
(layout_empty_base): Remove last parameter. Adjust.
(build_base_field): Adjust.
(build_base_fields): Adjust.
(propagate_binfo_offsets): Remove last parameter. Adjust.
(dfs_set_offset_for_unshared_vbases): Delete.
(layout_virtual_bases): Adjust.
(finish_struct_1): Adjust.
(init_class_processing): Don't init access nodes.
(dfs_get_primary_binfo): Delete.
(get_primary_binfo): Adjust.
(dump_class_hierarchy_r): Remove most derived arg, add IGO
parameter. Adjust.
(dump_class_hierarchy): Adjust.
(finish_vtbls): Adjust.
(get_original_base): Delete.
(build_vtt_inits): Adjust.
(dfs_build_secondary_vptr_vtt_inits): Adjust.
(dfs_ctor_vtable_bases_queue_p): Adjust.
(build_ctor_vtbl_group): Adjust.
(dfs_accumulate_vtbl_inits): Adjust.
(build_vtbl_initializer): Adjust.
(build_vbase_offset_vtbl_entries): Adjust.
(add_vcall_offset_vtbl_entries_1): Adjust.
* cp/cp-tree.h (CPTI_ACCESS_*): Remove.
(access_*_node): Remove.
(CANONICAL_BINFO): Delete.
(BINFO_UNSHARED_MARKED): Remove.
(BINFO_MARKED): Set LANG_FLAG_0 directly.
(SET_BINFO_MARKED, CLEAR_BINFO_MARKED): Delete.
(BINFO_VTABLE_PATH_MARKED): Set LANG_FLAG_3 directly.
(SET_BINFO_VTABLE_PATH_MARKED, CLEAR_BINFO_VTABLE_PATH_MARKED):
Delete.
(BINFO_NEW_VTABLE_MARKED): Set LANG_FLAG_4 directly.
(SET_BINFO_NEW_VTABLE_MARKED): Adjust.
(SET_BINFO_PUSHDECLS_MARKED, CLEAR_BINFO_PUSHDECLS_MARKED):
Delete.
(BINFO_DEPENDENT_BASE_P): New.
(dfs_walk, dfs_walk_real): Queue function takes derived binfo and
index.
(markedp, unmarkedp): Adjust.
(dfs_unmarked_real_bases_queue_p, dfs_marked_real_bases_queue_p,
dfs_skip_vbases, marked_vtable_pathp, unmarked_vtable_pathp,
find_vbase_instance, binfo_for_vbase): Delete.
(copied_binfo, original_binfo): Declare.
(finish_base_specifier): Add virtual_p arg.
(unshare_base_binfos): Delete.
(copy_base_binfos): Declare.
(reverse_path): Delete.
* cp/decl.c (xref_basetypes): Access and virtuality passed
differently. Don't copy direct base binfos here. Call
copy_base_binfos.
* cp/init.c (dfs_initialize_vtbl_ptrs): Adjust.
(initialize_vtbl_ptrs): Adjust.
(expand_member_init): Adjust.
* cp/parser.c (cp_parser_base_specifier): Adjust.
* cp/pt.c (instantiate_class_template): Adjust.
(get_template_base_recursive): Adjust.
* cp/rtti.c (get_pseudo_ti_init): Adjust.
(get_pseudo_ti_desc): Adjust.
* cp/tree.c (unshare_base_binfos): Rename to ...
(copy_base_binfos): ... here, reimplement.
(make_binfo): Set BINFO_DEPENDENT_BASE_P.
(reverse_path): Remove.
* cp/typeck.c (get_delta_difference): Adjust error messages.
* cp/semantics.c (finish_base_specifier): Add virtual arg, adjust.
* cp/search.c (lookup_base_r): Adjust.
(dynamic_cast_base_recurse): Adjust.
(canonical_binfo): Remove.
(dfs_canonical_queue): Remove.
(dfs_assert_unmarked_p): Remove.
(assert_canonical_unmarked): Remove.
(shared_marked_p, shared_unmarked_p): Remove.
(BINFO_ACCESS, SET_BINFO_ACCESS): Use TREE_PUBLIC & TREE_PRIVATE.
(dfs_access_in_type): Adjust.
(access_in_type): Adjust.
(dfs_accessible_queue_p): Adjust.
(dfs_accessible_p): Adjust.
(is_subobject_of_p_1, is_subobject_of_p): Remove.
(struct lookup_field_info): Remove from_dep_base_p field.
(lookup_field_queue_p): Adjust, test BINFO_DEPENDENT_BASE_P.
(lookup_field_r): Remove dependent base code.
(lookup_member): Likewise.
(dfs_walk, dfs_walk_real): Add access arg to queue fn.
(dfs_unmarked_real_bases_queue_p): Remove.
(dfs_marked_real_bases_queue_p): Remove.
(dfs_skip_vbases): Remove.
(dfs_get_pure_virtuals): Adjust.
(markedp, unmarkedp): Adjust.
(marked_vtable_pathp, unmarked_vtable_pathp): Remove.
(marked_pushdecls_p, unmarked_pushdecls_p): Adjust.
(dfs_unmark): Adjust.
(dfs_get_vbase_types):Remove.
(dfs_build_inheritance_graph_order): Remove.
(get_vbase_types): Remove
(dfs_find_vbase_instance): Remove.
(find_vbase_instance): Remove.
(dfs_debug_unmarkedp): Adjust.
(dependent_base_p): Remove.
(dfs_push_type_decls): Adjust.
(dfs_push_decls): Adjust.
(dfs_no_overlap_yet): Adjust.
(copied_binfo): New function.
(original_binfo): New function.
(binfo_for_vbase): Remove.
Change base class access representation.
* java/class.c (set_super_info): Don't set TREE_VIA_PUBLIC.
(add_interface_do): Likewise.
From-SVN: r63172
2003-02-20 18:51:46 +01:00
|
|
|
|
tree binfo = TYPE_BINFO (type);
|
|
|
|
|
tree base_binfos = BINFO_BASETYPES (binfo);
|
|
|
|
|
tree base_accesses = BINFO_BASEACCESSES (binfo);
|
|
|
|
|
tree base_binfo = TREE_VEC_ELT (base_binfos, 0);
|
|
|
|
|
int num_bases = TREE_VEC_LENGTH (base_binfos);
|
2002-06-30 22:41:38 +02:00
|
|
|
|
|
|
|
|
|
if (num_bases == 1
|
Change base class access representation.
* tree.h (TREE_VIA_PUBLIC, TREE_VIA_PROTECTED,
TREE_VIA_PRIVATE): Remove.
(BINFO_BASEACCESSES): New binfo elt.
(BINFO_BASEACCESS): New accessor.
(BINFO_ELTS): Increase.
(TI_ACCESS_PUBLIC, TI_ACCESS_PROTECTED, TI_ACCESS_PRIVATE): New.
(access_public_node, access_protected_node,
access_private_node): New global nodes.
* tree.c (build_common_tree_nodes_2): Initialize access nodes.
* dbxout.c (dbxout_type): Adjust.
* dwarf2out.c (gen_inheritance_die): Add access parameter.
(gen_member_die): Adjust.
* dwarfout.c (output_inheritance_die): ARG is array of two trees.
(output_type): Adjust.
* tree-dump.c (dequeue_and_dump): Adjust binfo dumping.
Change base class access representation. Share virtual base
binfos.
* cp/call.c (build_special_member_call): Remove binfo_for_vbase
call.
* cp/class.c (build_base_path): Likewise.
(build_primary_vtable): Adjust BINFO_NEW_VTABLE_MARKED use.
(build_secondary_vtable): Remove FOR_TYPE arg. Adjust.
(make_new_vtable): Adjust.
(force_canonical_binfo_r): Delete.
(force_canonical_binfo): Delete.
(mark_primary_virtual_base): Delete.
(dfs_unshared_virtual_bases): Delete.
(mark_primary_bases): Adjust.
(maybe_warn_about_overly_private_class): Adjust.
(dfs_base_derived_from): Delete.
(base_derived_from): Follow the inheritance chain.
(struct find_final_overrider_data): Add vpath member.
(dfs_find_final_overrider): Adjust.
(dfs_find_final_overrider_q, dfs_find_final_overrider_post): New.
(find_final_overrider): Adjust.
(update_vtable_entry_for_fn): Adjust.
(modify_all_vtables): Adjust.
(walk_subobject_offsets): Adjust.
(layout_nonempty_base_or_field): Adjust.
(layout_empty_base): Remove last parameter. Adjust.
(build_base_field): Adjust.
(build_base_fields): Adjust.
(propagate_binfo_offsets): Remove last parameter. Adjust.
(dfs_set_offset_for_unshared_vbases): Delete.
(layout_virtual_bases): Adjust.
(finish_struct_1): Adjust.
(init_class_processing): Don't init access nodes.
(dfs_get_primary_binfo): Delete.
(get_primary_binfo): Adjust.
(dump_class_hierarchy_r): Remove most derived arg, add IGO
parameter. Adjust.
(dump_class_hierarchy): Adjust.
(finish_vtbls): Adjust.
(get_original_base): Delete.
(build_vtt_inits): Adjust.
(dfs_build_secondary_vptr_vtt_inits): Adjust.
(dfs_ctor_vtable_bases_queue_p): Adjust.
(build_ctor_vtbl_group): Adjust.
(dfs_accumulate_vtbl_inits): Adjust.
(build_vtbl_initializer): Adjust.
(build_vbase_offset_vtbl_entries): Adjust.
(add_vcall_offset_vtbl_entries_1): Adjust.
* cp/cp-tree.h (CPTI_ACCESS_*): Remove.
(access_*_node): Remove.
(CANONICAL_BINFO): Delete.
(BINFO_UNSHARED_MARKED): Remove.
(BINFO_MARKED): Set LANG_FLAG_0 directly.
(SET_BINFO_MARKED, CLEAR_BINFO_MARKED): Delete.
(BINFO_VTABLE_PATH_MARKED): Set LANG_FLAG_3 directly.
(SET_BINFO_VTABLE_PATH_MARKED, CLEAR_BINFO_VTABLE_PATH_MARKED):
Delete.
(BINFO_NEW_VTABLE_MARKED): Set LANG_FLAG_4 directly.
(SET_BINFO_NEW_VTABLE_MARKED): Adjust.
(SET_BINFO_PUSHDECLS_MARKED, CLEAR_BINFO_PUSHDECLS_MARKED):
Delete.
(BINFO_DEPENDENT_BASE_P): New.
(dfs_walk, dfs_walk_real): Queue function takes derived binfo and
index.
(markedp, unmarkedp): Adjust.
(dfs_unmarked_real_bases_queue_p, dfs_marked_real_bases_queue_p,
dfs_skip_vbases, marked_vtable_pathp, unmarked_vtable_pathp,
find_vbase_instance, binfo_for_vbase): Delete.
(copied_binfo, original_binfo): Declare.
(finish_base_specifier): Add virtual_p arg.
(unshare_base_binfos): Delete.
(copy_base_binfos): Declare.
(reverse_path): Delete.
* cp/decl.c (xref_basetypes): Access and virtuality passed
differently. Don't copy direct base binfos here. Call
copy_base_binfos.
* cp/init.c (dfs_initialize_vtbl_ptrs): Adjust.
(initialize_vtbl_ptrs): Adjust.
(expand_member_init): Adjust.
* cp/parser.c (cp_parser_base_specifier): Adjust.
* cp/pt.c (instantiate_class_template): Adjust.
(get_template_base_recursive): Adjust.
* cp/rtti.c (get_pseudo_ti_init): Adjust.
(get_pseudo_ti_desc): Adjust.
* cp/tree.c (unshare_base_binfos): Rename to ...
(copy_base_binfos): ... here, reimplement.
(make_binfo): Set BINFO_DEPENDENT_BASE_P.
(reverse_path): Remove.
* cp/typeck.c (get_delta_difference): Adjust error messages.
* cp/semantics.c (finish_base_specifier): Add virtual arg, adjust.
* cp/search.c (lookup_base_r): Adjust.
(dynamic_cast_base_recurse): Adjust.
(canonical_binfo): Remove.
(dfs_canonical_queue): Remove.
(dfs_assert_unmarked_p): Remove.
(assert_canonical_unmarked): Remove.
(shared_marked_p, shared_unmarked_p): Remove.
(BINFO_ACCESS, SET_BINFO_ACCESS): Use TREE_PUBLIC & TREE_PRIVATE.
(dfs_access_in_type): Adjust.
(access_in_type): Adjust.
(dfs_accessible_queue_p): Adjust.
(dfs_accessible_p): Adjust.
(is_subobject_of_p_1, is_subobject_of_p): Remove.
(struct lookup_field_info): Remove from_dep_base_p field.
(lookup_field_queue_p): Adjust, test BINFO_DEPENDENT_BASE_P.
(lookup_field_r): Remove dependent base code.
(lookup_member): Likewise.
(dfs_walk, dfs_walk_real): Add access arg to queue fn.
(dfs_unmarked_real_bases_queue_p): Remove.
(dfs_marked_real_bases_queue_p): Remove.
(dfs_skip_vbases): Remove.
(dfs_get_pure_virtuals): Adjust.
(markedp, unmarkedp): Adjust.
(marked_vtable_pathp, unmarked_vtable_pathp): Remove.
(marked_pushdecls_p, unmarked_pushdecls_p): Adjust.
(dfs_unmark): Adjust.
(dfs_get_vbase_types):Remove.
(dfs_build_inheritance_graph_order): Remove.
(get_vbase_types): Remove
(dfs_find_vbase_instance): Remove.
(find_vbase_instance): Remove.
(dfs_debug_unmarkedp): Adjust.
(dependent_base_p): Remove.
(dfs_push_type_decls): Adjust.
(dfs_push_decls): Adjust.
(dfs_no_overlap_yet): Adjust.
(copied_binfo): New function.
(original_binfo): New function.
(binfo_for_vbase): Remove.
Change base class access representation.
* java/class.c (set_super_info): Don't set TREE_VIA_PUBLIC.
(add_interface_do): Likewise.
From-SVN: r63172
2003-02-20 18:51:46 +01:00
|
|
|
|
&& TREE_VEC_ELT (base_accesses, 0) == access_public_node
|
2002-06-30 22:41:38 +02:00
|
|
|
|
&& !TREE_VIA_VIRTUAL (base_binfo)
|
|
|
|
|
&& integer_zerop (BINFO_OFFSET (base_binfo)))
|
2002-09-14 14:07:44 +02:00
|
|
|
|
/* single non-virtual public. */
|
2002-06-30 22:41:38 +02:00
|
|
|
|
return si_class_desc_type_node;
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
tree var_desc;
|
|
|
|
|
tree array_domain, base_array;
|
|
|
|
|
|
|
|
|
|
if (TREE_VEC_LENGTH (vmi_class_desc_type_node) <= num_bases)
|
|
|
|
|
{
|
|
|
|
|
int ix;
|
|
|
|
|
tree extend = make_tree_vec (num_bases + 5);
|
|
|
|
|
|
|
|
|
|
for (ix = TREE_VEC_LENGTH (vmi_class_desc_type_node); ix--;)
|
|
|
|
|
TREE_VEC_ELT (extend, ix)
|
|
|
|
|
= TREE_VEC_ELT (vmi_class_desc_type_node, ix);
|
|
|
|
|
vmi_class_desc_type_node = extend;
|
|
|
|
|
}
|
|
|
|
|
var_desc = TREE_VEC_ELT (vmi_class_desc_type_node, num_bases);
|
|
|
|
|
if (var_desc)
|
|
|
|
|
return var_desc;
|
2000-01-28 14:30:13 +01:00
|
|
|
|
|
2003-01-17 21:14:44 +01:00
|
|
|
|
/* Create the array of __base_class_type_info entries.
|
|
|
|
|
G++ 3.2 allocated an array that had one too many
|
|
|
|
|
entries, and then filled that extra entries with
|
|
|
|
|
zeros. */
|
|
|
|
|
if (abi_version_at_least (2))
|
|
|
|
|
array_domain = build_index_type (size_int (num_bases - 1));
|
|
|
|
|
else
|
|
|
|
|
array_domain = build_index_type (size_int (num_bases));
|
2002-06-30 22:41:38 +02:00
|
|
|
|
base_array =
|
|
|
|
|
build_array_type (base_desc_type_node, array_domain);
|
|
|
|
|
|
|
|
|
|
push_nested_namespace (abi_node);
|
|
|
|
|
var_desc = create_pseudo_type_info
|
|
|
|
|
("__vmi_class_type_info", num_bases,
|
|
|
|
|
build_decl (FIELD_DECL, NULL_TREE, integer_type_node),
|
|
|
|
|
build_decl (FIELD_DECL, NULL_TREE, integer_type_node),
|
|
|
|
|
build_decl (FIELD_DECL, NULL_TREE, base_array),
|
|
|
|
|
NULL);
|
|
|
|
|
pop_nested_namespace (abi_node);
|
|
|
|
|
|
|
|
|
|
TREE_VEC_ELT (vmi_class_desc_type_node, num_bases) = var_desc;
|
|
|
|
|
return var_desc;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
default:
|
|
|
|
|
return bltn_desc_type_node;
|
|
|
|
|
}
|
2000-01-28 14:30:13 +01:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Make sure the required builtin types exist for generating the type_info
|
|
|
|
|
varable definitions. */
|
|
|
|
|
|
|
|
|
|
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
|
|
|
|
create_tinfo_types (void)
|
2000-01-28 14:30:13 +01:00
|
|
|
|
{
|
2002-06-30 22:41:38 +02:00
|
|
|
|
my_friendly_assert (!ti_desc_type_node, 20020609);
|
2000-01-28 14:30:13 +01:00
|
|
|
|
|
2002-06-30 22:41:38 +02:00
|
|
|
|
push_nested_namespace (abi_node);
|
2000-01-28 14:30:13 +01:00
|
|
|
|
|
|
|
|
|
/* Create the internal type_info structure. This is used as a base for
|
|
|
|
|
the other structures. */
|
|
|
|
|
{
|
2002-12-16 19:23:00 +01:00
|
|
|
|
tree field, fields;
|
2000-01-28 14:30:13 +01:00
|
|
|
|
|
|
|
|
|
ti_desc_type_node = make_aggr_type (RECORD_TYPE);
|
2002-12-16 19:23:00 +01:00
|
|
|
|
field = build_decl (FIELD_DECL, NULL_TREE, const_ptr_type_node);
|
|
|
|
|
fields = field;
|
|
|
|
|
|
|
|
|
|
field = build_decl (FIELD_DECL, NULL_TREE, const_string_type_node);
|
|
|
|
|
TREE_CHAIN (field) = fields;
|
|
|
|
|
fields = field;
|
|
|
|
|
|
|
|
|
|
finish_builtin_struct (ti_desc_type_node, "__type_info_pseudo",
|
|
|
|
|
fields, NULL_TREE);
|
2000-01-28 14:30:13 +01:00
|
|
|
|
TYPE_HAS_CONSTRUCTOR (ti_desc_type_node) = 1;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Fundamental type_info */
|
|
|
|
|
bltn_desc_type_node = create_pseudo_type_info
|
|
|
|
|
("__fundamental_type_info", 0,
|
|
|
|
|
NULL);
|
|
|
|
|
|
2002-09-14 14:07:44 +02:00
|
|
|
|
/* Array, function and enum type_info. No additional fields. */
|
2000-01-28 14:30:13 +01:00
|
|
|
|
ary_desc_type_node = create_pseudo_type_info
|
|
|
|
|
("__array_type_info", 0,
|
|
|
|
|
NULL);
|
|
|
|
|
func_desc_type_node = create_pseudo_type_info
|
|
|
|
|
("__function_type_info", 0,
|
|
|
|
|
NULL);
|
|
|
|
|
enum_desc_type_node = create_pseudo_type_info
|
|
|
|
|
("__enum_type_info", 0,
|
|
|
|
|
NULL);
|
|
|
|
|
|
|
|
|
|
/* Class type_info. Add a flags field. */
|
|
|
|
|
class_desc_type_node = create_pseudo_type_info
|
|
|
|
|
("__class_type_info", 0,
|
|
|
|
|
NULL);
|
|
|
|
|
|
2000-04-10 18:21:28 +02:00
|
|
|
|
/* Single public non-virtual base class. Add pointer to base class.
|
|
|
|
|
This is really a descendant of __class_type_info. */
|
2000-01-28 14:30:13 +01:00
|
|
|
|
si_class_desc_type_node = create_pseudo_type_info
|
|
|
|
|
("__si_class_type_info", 0,
|
2002-06-30 22:41:38 +02:00
|
|
|
|
build_decl (FIELD_DECL, NULL_TREE, type_info_ptr_type),
|
2000-01-28 14:30:13 +01:00
|
|
|
|
NULL);
|
|
|
|
|
|
|
|
|
|
/* Base class internal helper. Pointer to base type, offset to base,
|
2002-09-14 14:07:44 +02:00
|
|
|
|
flags. */
|
2000-01-28 14:30:13 +01:00
|
|
|
|
{
|
2002-12-16 19:23:00 +01:00
|
|
|
|
tree field, fields;
|
|
|
|
|
|
|
|
|
|
field = build_decl (FIELD_DECL, NULL_TREE, type_info_ptr_type);
|
|
|
|
|
fields = field;
|
2000-01-28 14:30:13 +01:00
|
|
|
|
|
2002-12-16 19:23:00 +01:00
|
|
|
|
field = build_decl (FIELD_DECL, NULL_TREE, integer_types[itk_long]);
|
|
|
|
|
TREE_CHAIN (field) = fields;
|
|
|
|
|
fields = field;
|
|
|
|
|
|
2000-01-28 14:30:13 +01:00
|
|
|
|
base_desc_type_node = make_aggr_type (RECORD_TYPE);
|
2002-12-16 19:23:00 +01:00
|
|
|
|
finish_builtin_struct (base_desc_type_node, "__base_class_type_info_pseudo",
|
|
|
|
|
fields, NULL_TREE);
|
2000-01-28 14:30:13 +01:00
|
|
|
|
TYPE_HAS_CONSTRUCTOR (base_desc_type_node) = 1;
|
|
|
|
|
}
|
|
|
|
|
|
2002-09-14 14:07:44 +02:00
|
|
|
|
/* General hierarchy is created as necessary in this vector. */
|
2000-01-28 14:30:13 +01:00
|
|
|
|
vmi_class_desc_type_node = make_tree_vec (10);
|
|
|
|
|
|
2000-05-26 10:50:47 +02:00
|
|
|
|
/* Pointer type_info. Adds two fields, qualification mask
|
|
|
|
|
and pointer to the pointed to type. This is really a descendant of
|
2002-09-14 14:07:44 +02:00
|
|
|
|
__pbase_type_info. */
|
2000-05-26 10:50:47 +02:00
|
|
|
|
ptr_desc_type_node = create_pseudo_type_info
|
|
|
|
|
("__pointer_type_info", 0,
|
|
|
|
|
build_decl (FIELD_DECL, NULL_TREE, integer_type_node),
|
2002-06-30 22:41:38 +02:00
|
|
|
|
build_decl (FIELD_DECL, NULL_TREE, type_info_ptr_type),
|
2000-05-26 10:50:47 +02:00
|
|
|
|
NULL);
|
|
|
|
|
|
2000-04-10 18:21:28 +02:00
|
|
|
|
/* Pointer to member data type_info. Add qualifications flags,
|
|
|
|
|
pointer to the member's type info and pointer to the class.
|
2000-05-26 10:50:47 +02:00
|
|
|
|
This is really a descendant of __pbase_type_info. */
|
|
|
|
|
ptm_desc_type_node = create_pseudo_type_info
|
2000-03-15 18:17:45 +01:00
|
|
|
|
("__pointer_to_member_type_info", 0,
|
2000-05-24 08:15:04 +02:00
|
|
|
|
build_decl (FIELD_DECL, NULL_TREE, integer_type_node),
|
2002-06-30 22:41:38 +02:00
|
|
|
|
build_decl (FIELD_DECL, NULL_TREE, type_info_ptr_type),
|
|
|
|
|
build_decl (FIELD_DECL, NULL_TREE, type_info_ptr_type),
|
2000-01-28 14:30:13 +01:00
|
|
|
|
NULL);
|
|
|
|
|
|
2000-03-21 17:12:25 +01:00
|
|
|
|
pop_nested_namespace (abi_node);
|
2000-01-28 14:30:13 +01:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Emit the type_info descriptors which are guaranteed to be in the runtime
|
|
|
|
|
support. Generating them here guarantees consistency with the other
|
|
|
|
|
structures. We use the following heuristic to determine when the runtime
|
2001-07-24 10:56:12 +02:00
|
|
|
|
is being generated. If std::__fundamental_type_info is defined, and its
|
2000-01-28 14:30:13 +01:00
|
|
|
|
destructor is defined, then the runtime is being built. */
|
|
|
|
|
|
|
|
|
|
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
|
|
|
|
emit_support_tinfos (void)
|
2000-01-28 14:30:13 +01:00
|
|
|
|
{
|
|
|
|
|
static tree *const fundamentals[] =
|
|
|
|
|
{
|
|
|
|
|
&void_type_node,
|
|
|
|
|
&boolean_type_node,
|
|
|
|
|
&wchar_type_node,
|
|
|
|
|
&char_type_node, &signed_char_type_node, &unsigned_char_type_node,
|
|
|
|
|
&short_integer_type_node, &short_unsigned_type_node,
|
|
|
|
|
&integer_type_node, &unsigned_type_node,
|
|
|
|
|
&long_integer_type_node, &long_unsigned_type_node,
|
|
|
|
|
&long_long_integer_type_node, &long_long_unsigned_type_node,
|
|
|
|
|
&float_type_node, &double_type_node, &long_double_type_node,
|
|
|
|
|
0
|
|
|
|
|
};
|
|
|
|
|
int ix;
|
|
|
|
|
tree bltn_type, dtor;
|
|
|
|
|
|
2000-03-21 17:12:25 +01:00
|
|
|
|
push_nested_namespace (abi_node);
|
2002-06-26 19:03:44 +02:00
|
|
|
|
bltn_type = xref_tag (class_type,
|
|
|
|
|
get_identifier ("__fundamental_type_info"),
|
|
|
|
|
/*attributes=*/NULL_TREE,
|
|
|
|
|
1);
|
2000-03-21 17:12:25 +01:00
|
|
|
|
pop_nested_namespace (abi_node);
|
tree.h (COMPLETE_TYPE_P): New macro.
gcc
* tree.h (COMPLETE_TYPE_P): New macro.
(COMPLETE_OR_VOID_TYPE_P): New macro.
(COMPLETE_OR_UNBOUND_ARRAY_TYPE_P): New macro.
* stor-layout.c (layout_type, case VOID_TYPE): Don't set TYPE_SIZE.
* c-aux-info.c (gen_type): Use them.
* c-common.c (c_expand_expr_stmt): Likewise.
* c-decl.c (poplevel, pushdecl, start_decl, finish_decl,
grokdeclarator, grokparms, finish_struct, start_function,
store_parm_decls, combine_parm_decls): Likewise.
* c-parse.y (cast_expr): Likewise.
* c-typeck.c (require_complete_type, c_sizeof, c_sizeof_nowarn,
c_size_in_bytes, c_alignof, build_component_ref,
build_indirect_ref, build_array_ref, convert_arguments,
build_binary_op, pointer_diff, build_unary_op, digest_init: Likewise.
* calls.c (initialize_argument_information): Likewise.
* convert.c (convert_to_integer): Likewise.
* dbxout.c (dbxout_typedefs, dbxout_type, dbxout_symbol): Likewise.
* dwarfout.c (location_or_const_value_attribute,
output_enumeration_type_die, output_structure_type_die,
output_union_type_die, output_type): Likewise.
* expr.c (safe_from_p, expand_expr): Likewise.
* function.c (assign_parms): Likewise.
* sdbout.c (sdbout_symbol, sdbout_one_type): Likewise.
* tree.c (build_array_type, build_function_type,
build_method_type, build_offset_type, build_complex_type): Likewise.
* c-parse.c, c-parse.h: Regenerated.
gcc/cp
* typeck.c (require_complete_type, complete_type,
complete_type_or_else, c_sizeof, c_sizeof_nowarn,
build_array_ref, convert_arguments, pointer_diff,
build_x_unary_op, build_unary_op, build_c_cast,
build_modify_expr): Use COMPLETE_TYPE_P etc.
* call.c (is_complete, convert_like_real,
build_new_method_call): Likewise.
* class.c (build_vbase_pointer_fields, check_bases,
build_base_field, finish_struct_1, pushclass): Likewise.
* cvt.c (cp_convert_to_pointer, convert_to_void): Likewise.
* decl.c (maybe_process_template_type_declaration, pushtag,
pushdecl, redeclaration_error_message, start_decl, start_decl_1,
layout_var_decl, check_initializer, cp_finish_decl,
grokdeclarator, require_complete_types_for_parms,
grok_op_properties, xref_tag, xref_basetypes,
check_function_type): Likewise.
* decl2.c (check_classfn, reparse_absdcl_as_casts): Likewise.
* friend.c (do_friend): Likewise.
* init.c (build_offset_ref): Likewise.
* parse.y (structsp): Likewise.
* pt.c (maybe_process_partial_specialization,
tsubst_friend_function, instantiate_class_template, tsubst,
do_type_instantiation, instantiate_pending_templates): Likewise.
* repo.c (repo_get_id): Likewise.
* rtti.c (build_typeid, get_typeid, build_dynamic_cast_1,
synthesize_tinfo_var, emit_support_tinfos): Likewise.
* search.c (lookup_fnfields_1, lookup_conversions): Likewise.
* semantics.c (begin_class_definition): Likewise.
* tree.c (build_cplus_method_type): Likewise.
* typeck2.c (digest_init, build_functional_cast,
add_exception_specifier): Likewise.
* parse.h, parse.c: Regenerated.
From-SVN: r32671
2000-03-21 19:10:48 +01:00
|
|
|
|
if (!COMPLETE_TYPE_P (bltn_type))
|
2000-01-28 14:30:13 +01:00
|
|
|
|
return;
|
|
|
|
|
dtor = TREE_VEC_ELT (CLASSTYPE_METHOD_VEC (bltn_type), 1);
|
|
|
|
|
if (DECL_EXTERNAL (dtor))
|
|
|
|
|
return;
|
|
|
|
|
doing_runtime = 1;
|
|
|
|
|
for (ix = 0; fundamentals[ix]; ix++)
|
|
|
|
|
{
|
|
|
|
|
tree bltn = *fundamentals[ix];
|
|
|
|
|
tree bltn_ptr = build_pointer_type (bltn);
|
|
|
|
|
tree bltn_const_ptr = build_pointer_type
|
|
|
|
|
(build_qualified_type (bltn, TYPE_QUAL_CONST));
|
|
|
|
|
tree tinfo;
|
|
|
|
|
|
|
|
|
|
tinfo = get_tinfo_decl (bltn);
|
|
|
|
|
TREE_USED (tinfo) = 1;
|
|
|
|
|
TREE_SYMBOL_REFERENCED (DECL_ASSEMBLER_NAME (tinfo)) = 1;
|
|
|
|
|
|
|
|
|
|
tinfo = get_tinfo_decl (bltn_ptr);
|
|
|
|
|
TREE_USED (tinfo) = 1;
|
|
|
|
|
TREE_SYMBOL_REFERENCED (DECL_ASSEMBLER_NAME (tinfo)) = 1;
|
|
|
|
|
|
|
|
|
|
tinfo = get_tinfo_decl (bltn_const_ptr);
|
|
|
|
|
TREE_USED (tinfo) = 1;
|
|
|
|
|
TREE_SYMBOL_REFERENCED (DECL_ASSEMBLER_NAME (tinfo)) = 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
|
|
|
|
/* Return true, iff T is a type_info variable which has not had a
|
2000-01-28 14:30:13 +01:00
|
|
|
|
definition emitted for it. */
|
|
|
|
|
|
2003-03-20 22:14:30 +01:00
|
|
|
|
static bool
|
|
|
|
|
unemitted_tinfo_decl_p (tree t)
|
2000-01-28 14:30:13 +01:00
|
|
|
|
{
|
2002-06-30 22:41:38 +02:00
|
|
|
|
if (/* It's a var decl */
|
|
|
|
|
TREE_CODE (t) == VAR_DECL
|
2002-12-19 18:16:26 +01:00
|
|
|
|
/* which has a name */
|
|
|
|
|
&& DECL_NAME (t)
|
|
|
|
|
/* whose name points back to itself */
|
2002-06-30 22:41:38 +02:00
|
|
|
|
&& IDENTIFIER_GLOBAL_VALUE (DECL_NAME (t)) == t
|
2002-09-29 20:27:02 +02:00
|
|
|
|
/* whose name's type is non-null */
|
2002-06-30 22:41:38 +02:00
|
|
|
|
&& TREE_TYPE (DECL_NAME (t))
|
2002-09-29 20:27:02 +02:00
|
|
|
|
/* and whose type is a struct */
|
2002-06-30 22:41:38 +02:00
|
|
|
|
&& TREE_CODE (TREE_TYPE (t)) == RECORD_TYPE
|
2002-09-29 20:27:02 +02:00
|
|
|
|
/* with a field */
|
|
|
|
|
&& TYPE_FIELDS (TREE_TYPE (t))
|
|
|
|
|
/* which is our pseudo type info */
|
2002-06-30 22:41:38 +02:00
|
|
|
|
&& TREE_TYPE (TYPE_FIELDS (TREE_TYPE (t))) == ti_desc_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 true;
|
|
|
|
|
return false;
|
2000-01-28 14:30:13 +01:00
|
|
|
|
}
|
|
|
|
|
|
2002-06-30 22:41:38 +02:00
|
|
|
|
/* Finish a type info decl. DECL_PTR is a pointer to an unemitted
|
|
|
|
|
tinfo decl. Determine whether it needs emitting, and if so
|
|
|
|
|
generate the initializer. */
|
2000-01-28 14:30:13 +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
|
|
|
|
bool
|
2003-03-20 22:14:30 +01:00
|
|
|
|
emit_tinfo_decl (tree decl)
|
2000-01-28 14:30:13 +01:00
|
|
|
|
{
|
2002-06-30 22:41:38 +02:00
|
|
|
|
tree type = TREE_TYPE (DECL_NAME (decl));
|
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 non_public;
|
2002-07-05 12:40:47 +02:00
|
|
|
|
int in_library = typeinfo_in_lib_p (type);
|
2002-06-30 22:41:38 +02:00
|
|
|
|
tree var_desc, var_init;
|
2003-03-20 22:14:30 +01:00
|
|
|
|
|
|
|
|
|
my_friendly_assert (unemitted_tinfo_decl_p (decl), 20030307);
|
2000-01-28 14:30:13 +01:00
|
|
|
|
|
2002-07-05 12:40:47 +02:00
|
|
|
|
import_export_tinfo (decl, type, in_library);
|
2002-06-30 22:41:38 +02:00
|
|
|
|
if (DECL_REALLY_EXTERN (decl) || !DECL_NEEDED_P (decl))
|
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-05-16 06:48:52 +02:00
|
|
|
|
|
2002-07-05 12:40:47 +02:00
|
|
|
|
if (!doing_runtime && in_library)
|
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-05-16 06:48:52 +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
|
|
|
|
non_public = false;
|
2002-06-30 22:41:38 +02:00
|
|
|
|
var_desc = get_pseudo_ti_desc (type);
|
|
|
|
|
var_init = get_pseudo_ti_init (type, var_desc, &non_public);
|
2002-07-05 12:40:47 +02:00
|
|
|
|
|
2002-06-30 22:41:38 +02:00
|
|
|
|
DECL_EXTERNAL (decl) = 0;
|
|
|
|
|
TREE_PUBLIC (decl) = !non_public;
|
2002-07-05 12:40:47 +02:00
|
|
|
|
if (non_public)
|
|
|
|
|
DECL_COMDAT (decl) = 0;
|
|
|
|
|
|
2002-06-30 22:41:38 +02:00
|
|
|
|
DECL_INITIAL (decl) = var_init;
|
|
|
|
|
cp_finish_decl (decl, var_init, NULL_TREE, 0);
|
2002-09-14 14:07:44 +02:00
|
|
|
|
/* cp_finish_decl will have dealt with linkage. */
|
2002-06-30 22:41:38 +02:00
|
|
|
|
|
|
|
|
|
/* Say we've dealt with it. */
|
|
|
|
|
TREE_TYPE (DECL_NAME (decl)) = NULL_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
|
|
|
|
return true;
|
2000-01-28 14:30:13 +01:00
|
|
|
|
}
|