blob: b321e9897472b684ee3d904341d83ca7d13c5fcd [file] [log] [blame]
1999-12-31 Mark Mitchell <mark@codesourcery.com>
* cp-tree.h (VF_NORMAL_VALUE): Remove.
* class.c (struct base_info): Remove vfield, vfields, and rtti.
(set_primary_base): New function, split out from ...
(finish_base_struct): ... here. Rename to ...
(determine_primary_base): ... this. Simplify.
(create_vtable_ptr): Tweak accordingly.
(finish_struct_1): Simplify.
* cp-tree.h (CLASSTYPE_VBASECLASSES): Update documentation.
(CLASSTYPE_N_BASECLASSES): Likewise.
(BINFO_FOR_VBASE): New macro.
(get_vbase_types): Change prototype.
* class.c (build_vbase_path): Use BINFO_FOR_VBASE.
(prepare_fresh_vtable): Likewise.
(finish_vtbls): Likewise.
(get_class_offset_1): Likewise.
(modify_all_indirect_vtables): Likewise.
(build_vbase_pointer_fields): Likewise.
* decl.c (xref_basetypes): Don't set CLASSTYPE_VBASECLASSES here.
* init.c (sort_base_init): Use BINFO_FOR_VBASE.
(expand_member_init): Likewise.
* search.c (get_base_distance): Likewise.
(lookup_field_queue_p): Likewise.
(virtual_context): Likewise.
(get_vbase_types): Don't return a value. Set
CLASSTYPE_VBASECLASSES here.
* typeck.c (get_delta_difference): Use BINFO_FOR_VBASE.
1999-12-30 Mark Mitchell <mark@codesourcery.com>
* class.c (fixup_inline_methods): Clear CLASSTYPE_INLINE_FRIENDS.
1999-12-29 Mark Mitchell <mark@codesourcery.com>
* class.c (create_vtable_ptr): Put the vtable at the beginning of
the class, not the end, in the new ABI.
* tree.c (propagate_binfo_offsets): Do the right thing for the new
ABI.
1999-12-29 Mark Mitchell <mark@codesourcery.com>
* cp-tree.h (lang_type): Add nearly_empty_p. Adjust dummy.
(CLASSTYPE_NEARLY_EMPTY_P): New macro.
* class.c (check_bases): Update CLASSTYPE_NEARLY_EMPTY_P.
(check_field_decls): Likewise.
(check_bases_and_members): Likewise.
1999-12-28 Mark Mitchell <mark@codesourcery.com>
* cp-tree.h (do_inline_function_hair): Remove.
* class.c (layout_class_type): New function, split out from
finish_struct_1.
(fixup_pending_inline): Likewise.
(fixup_inline_methods): New function.
* method.c (fixup_pending_inline): Remove.
(do_inline_function_hair): Likewise.
* decl.c (BOOL_TYPE_SIZE): Bools always have size `1' under the
new ABI.
* cp-tree.h (lang_type): Replace abstract_virtuals with pure_virtuals.
(CLASSTYPE_ABSTRACT_VIRTUALS): Rename to ...
(CLASSTYPE_PURE_VIRTUALS): ... this.
(lang_decl_flags): Replace abstract_virtual with pure_virtual.
(DECL_ABSTRACT_VIRTUAL_P): Rename to ...
(DECL_PURE_VIRTUAL_P): ... this.
(get_abstract_virtuals): Rename to ...
(get_pure_virtuals): ... this.
* call.c (build_new_method_call): Replace DECL_PURE_VIRTUAL_P with
DECL_ABSTRACT_VIRTUAL_P. Replace CLASSTYPE_ABSTRACT_VIRTUALS with
CLASSTYPE_PURE_VIRTUALS.
* class.c (build_vtable_entry): Likewise.
(finish_struct_bits): Likewise. Call get_pure_virtuals, not
get_abstract_virtuals.
(build_vtbl_initializer): Likewise.
(override_one_vtable): Likewise.
(check_methods): Likewise.
* decl.c (duplicate_decls): Likewise.
(redeclaration_error_message): Likewise.
(lang_mark_tree): Likewise.
* decl2.c (grok_function_init): Likewise.
(import_export_vtable): Likewise.
(import_expor_class): Likewise.
* typeck2.c (abstract_virtuals_error): Likewise.
* xref.c (GNU_xref_member): Likewise.
* search.c (get_abstract_virtuals): Rename to get_pure_virtuals.
1999-12-26 Zack Weinberg <zack@wolery.cumb.org>
* cp-tree.h: Replace ENABLE_CHECKING with ENABLE_TREE_CHECKING
throughout.
1999-12-26 Mark Mitchell <mark@codesourcery.com>
* decl.c (store_return_init): Use mode of old RTL generated for
DECL_RESULT, not the mode of DECL_RESULT itself.
* semantics.c (finish_named_return_value): Set DECL_UNINLINABLE
for functions that used named return values.
1999-12-24 Mark Mitchell <mark@codesourcery.com>
* semantics.c (expand_body): Use
note_deferral_of_defined_inline_function.
1999-12-22 Mark Mitchell <mark@codesourcery.com>
* dump.c (dequeue_and_dump): Handle CTOR_STMTs.
1999-12-22 Alexandre Oliva <oliva@lsd.ic.unicamp.br>
* error.c (dump_decl): Support named return values.
1999-12-20 Mark Mitchell <mark@codesourcery.com>
* cp-tree.h (CLASSTYPE_VFIELD_PARENT): Update comments.
(CLASSTYPE_HAS_PRIMARY_BASE_P): New macro.
(CLASSTYPE_PRIMARY_BINFO): Likewise.
* class.c (check_methods): Don't set TYPE_HAS_COMPLEX_INIT_REF,
TYPE_NEEDS_CONSTRUCTING, and CLASSTYPE_NON_AGGREGATE here.
(check_bases_and_members): Set them here instead.
(create_vtable_ptr): New function, split out from ...
(finish_struct_1): ... here. Use it. Tidy. Use
CLASSTYPE_HAS_PRIMARY_BASE_P and CLASSTYPE_PRIMARY_BINFO.
* search.c (dfs_init_vbase_pointers): Handle seeing TYPE_VFIELD as
the first field in the class.
* tree.c (layout_basetypes): Use CLASSTYPE_N_BASECLASSES. Handle
seeing TYPE_VFIELD as the first field in the class.
* cp-tree.h (TYPE_VIRTUAL_P): Rename to ...
(TYPE_POLYMORPHIC_P): ... this.
(TYPE_USES_COMPLEX_INHERITANCE): Rename to ...
(TYPE_BASE_CONVS_MAY_REQUIRE_CODE_P): ... this.
(TREE_CALLS_NEW): Remove.
(TREE_MANGLED): Likewise.
* call.c (build_vfield_ref): Use TYPE_BASE_CONVS_MAY_REQUIRE_CODE_P,
and TYPE_POLYMORPHIC_P.
* class.c (check_bases): Likewise.
(finish_base_struct): Likewise.
(finish_struct_bits): Likewise.
(check_for_override): Likewise.
(finish_struct_1): Likewise.
(get_vfield_name): Likewise.
* decl.c (xref_basetypes): Likewise.
* decl2.c (import_export_class): Likewise.
(import_export_decl): Likewise.
* error.c (dump_function_decl): Likewise.
* pt.c (instantiate_class_template): Likewise.
* repo.c (repo_inline_used): Likewise.
* rtti.c (build_headof): Likewise.
(get_tinfo_fn_dynamic): Likewise.
(build_x_typeid): Likewise.
(get_tinfo_var): Likewise.
(build_dynamic_cast_1): Likewise.
(synthesize_tinfo_fn): Likewise.
* search.c (lookup_field_1): Likewise.
(dfs_debug_mark): Likewise.
(maybe_suppress_debug_info): Likewise.
* typeck.c (build_component_ref): Likewise.
(build_component_addr): Likewise.
* typeck2.c (process_init_constructor): Likewise.
1999-12-20 Nathan Sidwell <nathan@acm.org>
* typeck.c (strip_all_pointer_quals): New static function.
(build_static_cast): Use it. Don't use at_least_as_qualified_p.
1999-12-16 Mark Mitchell <mark@codesourcery.com>
* cp-tree.h (cp_tree_index): Add CPTI_DSO_HANDLE.
(dso_handle_node): New macro.
(flag_use_cxa_atexit): New variable.
(declare_global_var): New function.
(start_anon_func): Remove declaration.
(end_anon_func): Likewise.
* decl.c (get_atexit_node): New function, split out from
destroy_local_static. Handle flag_use_cxa_atexit.
(get_dso_handle_node): Likewise.
(start_cleanup_fn): Renamed from start_anon_func. Moved here from
except.c. Handle flag_use_cxa_atexit.
(end_cleanup_fn): Renamed from end_anon_func. Moved here from
except.c.
(declare_global_var): New variable.
(destroy_local_static): Handle flag_use_cxa_atexit.
* decl2.c (flag_use_cxa_atexit): New variable.
(lang_f_options): Likewise.
* except.c (start_anon_func): Remove.
(end_anon_func): Liekwise.
* lang-options.h: Add -fuse-cxa-atexit and -fno-use-cxa-atexit.
* rtti.c (get_tinfo_var): Use declare_global_var.
1999-12-16 Mark Mitchell <mark@codesourcery.com>
* class.c (check_field_decls): Don't return a value.
(avoid_overlap): Moved here from tree.c.
(build_base_fields): Likewise.
(check_bases): New function, split out from finish_base_struct.
(check_bases_and_members): New function, split out from
finish_struct_1.
(struct base_info): Remove cant_have_default_ctor,
cant_have_const_ctor, cant_have_asn_ref.
(finish_base_struct): Split semantic analysis into check_bases.
(finish_struct_methods): Fix bogus assertion.
(check_field_decls): Call finish_struct_anon here.
(build_vbase_pointer_fields): Use CLASSTYPE_N_BASECLASSES.
(finish_struct_1): Use check_bases_and_members. Reorganize.
* cp-tree.h (CLASSTYPE_VBASECLASSES): Improve documentation.
(build_base_fields): Don't declare.
* tree.c (avoid_overlap): Remove.
(build_base_fields): Likewise.
* optimize.c (struct inline_data): Remove scope_stmt.
(remap_block): Don't use insert_block_after_note. Don't update
scope_stmt.
(expand_call_inline): Don't update scope_stmt.
(optimize_function): Don't initialize scope_stmt.
* semantics.c (expand_stmt): Set NOTE_BLOCK for newly emitted
NOTE_INSN_BLOCK_BEG/NOTE_INSN_BLOCK_END notes.
1999-12-15 Mark Mitchell <mark@codesourcery.com>
* class.c (handle_using_decl): Get TYPE_FIELDS and TYPE_METHODS
out of the class, rather than taking them as parameters.
(build_vbase_pointer_fields): Move here from tree.c.
(build_vtbl_or_vbase_field): New function.
(check_methods): Likewise.
(remove_zero_width_bitfields): Likewise.
(add_virtual_function): Use tree_cons instead of temp_tree_cons.
(delete_duplicate_fields_1): Tidy. Don't delete duplicate
USING_DECLs here.
(finish_struct_methods): Handle the case where there are no
methods here.
(get_basefndecls): Use tree_cons instead of temp_tree_cons.
(check_field_decls): Call delete_duplicate_fields here.
(finish_struct_1): Tidy. Use check_methods and
remove_zero_width_bitfields.
* cp-tree.h (build_vbase_pointer_fields): Remove.
* decl.c (grokdeclarator): Use tree_cons instead of
temp_tree_cons.
* decl2.c (qualified_lookup_using_namespace): Use tree_cons
instead of temp_tree_cons.
* lex.c (cons_up_default_function): Remove dead code.
* method.c (fixup_pending_inline): New function, split out from ...
(do_inline_function_hair): ... here.
* tree.c (build_vbase_pointer_fields): Remove.
1999-12-15 Jason Merrill <jason@casey.cygnus.com>
* tree.c (walk_tree): Walk operand subtrees in forward order.
* optimize.c (expand_call_inline): Likewise.
(optimize_function): Initialize id->scope_stmt to something useful.
(remap_block): Assume id->scope_stmt has a useful value.
1999-12-15 Nathan Sidwell <nathan@acm.org>
* typeck.c (build_c_cast): Expand warning message. Move pointer
alignment warning to after the cast. Don't warn about pointer
alignment when given a pointer to incomplete.
1999-12-15 Richard Henderson <rth@cygnus.com>
* cp-tree.h (make_aggr_type): Declare.
* lex.c (cp_make_lang_type): Don't SET_IS_AGGR_TYPE.
(make_aggr_type): New.
* decl.c (build_typename_type, init_decl_processing): Use it.
(build_ptrmemfunc_type, xref_tag): Likewise.
* except.c (call_eh_info): Likewise.
* init.c (init_init_processing): Likewise.
* pt.c (process_template_parm, lookup_template_class): Likewise.
* rtti.c (expand_class_desc): Likewise.
* semantics.c (begin_class_definition, finish_typeof): Likewise.
* tree.c (copy_template_template_parm): Likewise.
1999-12-15 Jason Merrill <jason@yorick.cygnus.com>
* cp-tree.def (TEMPLATE_PARM_INDEX): Calculate size using
sizeof (struct tree_common).
1999-12-14 Jason Merrill <jason@casey.cygnus.com>
* optimize.c (expand_call_inline): Set BLOCK_ABSTRACT_ORIGIN on the
outermost block to point to the inlined function decl.
* error.c (dump_decl): operator==, not operator ==.
(op_to_string): Likewise.
* decl.c (compute_array_index_type): Handle null name.
* decl2.c (ambiguous_decl): Fix to match comment.
(lookup_using_namespace): Adjust.
* decl2.c (import_export_class): Don't ignore dllimport.
1999-12-14 Mark Mitchell <mark@codesourcery.com>
* class.c (check_field_decls): Split out from ...
(finish_struct_1): ... here. Use it. Tidy.
* cp-tree.h (remap_save_expr): Add walk_subtrees parameter.
* optimize.c (copy_body_r): Pass it.
* tree.c (remap_save_expr): Clear walk_subtrees for an
already-handled SAVE_EXPR.
(cp_unsave_r): Pass walk_subtrees to remap_save_expr.
* dump.c (dequeue_and_dump): Dump DECL_NAMESPACE_ALIAS.
* ir.texi (DECL_NAMESPACE_ALIAS): Document it.
* error.c (dump_expr): Handle EXPR_WITH_FILE_LOCATION.
1999-12-14 Mumit Khan <khan@xraylith.wisc.edu>
* class.c (finish_base_struct): Allow multiple COM base classes
as well as non-COM bases as long as it's not the leftmost.
1999-12-13 Mumit Khan <khan@xraylith.wisc.edu>
* lex.c (saving_parse_to_obstack): New global.
(reinit_parse_for_block): Use.
(reinit_parse_for_expr): Use.
(check_newline): Use.
1999-12-13 Mark Mitchell <mark@codesourcery.com>
* optimize.c (initialize_inlined_parameters): Take FN to which the
parameters belong as an argument.
(expand_call_inline): Expand calls into the parameter
initializations before pushing the function onto the list of
functions we are presently expanding.
1999-12-11 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
* class.c (get_vtable_name): Use a literal format string and
VTABLE_NAME_PREFIX macro instead of VTABLE_NAME_FORMAT.
(prepare_fresh_vtable): Likewise.
* cp-tree.h (VTABLE_NAME_PREFIX): Define this instead of
VTABLE_NAME_FORMAT.
* decl.c (make_rtl_for_local_static): Remove unused variable `type'.
* init.c (build_vec_init): Initialize variable `try_body'.
* lex.c (yyerror): Don't call a variadic function with a
non-literal format string.
* optimize.c (optimize_function): Call memset, not bzero.
* pt.c (for_each_template_parm_r): Add static prototype.
1999-12-09 Andreas Jaeger <aj@suse.de>
* except.c (expand_throw): Add static attribute to match
prototype.
* Makefile.in (semantics.o): Add dependency on output.h.
* semantics.c: Include output.h for declaration of
make_function_rtl.
1999-12-09 Mark Mitchell <mark@codesourcery.com>
* decl.c (init_decl_processing): Reenable inlining on trees.
(finish_function): Likewise.
* expr.c (cplus_expand_expr): Don't handle AGGR_INIT_EXPR here.
* semantics.c (simplify_aggr_init_exprs): New function.
(expand_body): Use it.
* tree.c (walk_tree): Special-case TARGET_EXPRs since they
sometimes present the same sub-tree twice.
* dump.c (dequeue_and_dump): Abbreviate `class' as `cls', not
`csl'.
* semantics.c (finish_switch_cond): Do conversions here, not ...
* typeck.c (c_expand_start_case): Here.
* semantics.c (do_poplevel): Remove unused variable.
1999-12-06 Mark Mitchell <mark@codesourcery.com>
* tree.c (walk_tree): Don't recurse into DECL_INITIAL or DECL_SIZE
unless we're declaring the variable in question.
1999-12-06 Mark Mitchell <mark@codesourcery.com>
* decl.c (init_decl_processing): #if 0 last patch.
(finish_function): Likewise.
1999-12-05 Mark Mitchell <mark@codesourcery.com>
* decl.c (init_decl_processing): Set flag_inline_trees if
!flag_no_inline.
* cp-tree.h (calls_setjmp_p): Declare.
* decl.c (finish_function): Mark functions that call setjmp as
uninlinable.
* optimize.c (calls_setjmp_r): New function.
(calls_setjmp_p): Likewise.
1999-12-04 Mark Mitchell <mark@codesourcery.com>
* optimize.c (expand_call_inline): Wrap the expanded call in an
EXPR_WITH_FILE_LOCATION node to get correct line numbers for
inlined functions.
* optimize.c (inline_data): Remove fns_top. Add scope_stmt. Add
in_target_cleanup_p.
(remap_decl): New function.
(remap_block): Likewise.
(copy_scope_stmt): Likewise.
(copy_body_r): Use remap_decl and copy_scope_stmt.
(copy_body): Use VARRAY_TOP_TREE.
(initialize_inlined_parameters): Likewise.
(declare_return_variable): Likewise.
(inlinable_function_p): Check flag_inline_trees.
(expand_call_inline): Handle SCOPE_STMTs and TARGET_EXPRs
specially. Use VARRAY_PUSH_TREE. Create a BLOCK for the
parameters of the inlined function.
(optimize_function): Prevent recursion into partially complete
functions.
* cp-tree.def (SCOPE_STMT): Take one operand.
* cp-tree.h (SCOPE_STMT_BLOCK): New macro.
(SCOPE_NULLIFIED_P): Redefine.
(SCOPE_NO_CLEANUPS_P): New macro.
(add_scope_stmt): Change prototype.
* decl.c (poplevel): Tidy. Warn about unused variables here.
Record SCOPE_STMT_BLOCKs.
(finish_function): Keep DECL_INITIAL for functions that might be
inlined.
* ir.texi: Document SCOPE_NO_CLEANUPS_P.
* semantics.c: Include rtl.h.
(add_scope_stmt): Return the new scope statement and, for an
end-of-scope statement, its matching begin statement. Don't set
SCOPE_NULLIFIED_P.
(do_pushlevel): Simplify, now that we are always
function-at-a-time.
(do_poplevel): Likewise. Record SCOPE_STMT_BLOCKs.
(expand_stmt): Don't call expand_start_bindings or
expand_end_bindings for a scope with SCOPE_NO_CLEANUPS_P set.
* tree.c (copy_tree_r): Clear SCOPE_STMT_BLOCK rather than setting
SCOPE_NULLIFIED_P.
* Makefile.in (semantics.o): Depend on RTL_H.
* decl2.c (pending_statics_used): Make it a macro.
(saved_inlines_used): Likewise.
(finish_static_data_member_decl): Use VARRAY_PUSH_TREE.
(mark_inline_for_output): Likewise.
(ssdf_decls_used): Remove.
(start_static_storage_duration_function): Use VARRAY_PUSH_TREE.
(generate_ctor_or_dtor_function): Adjust accordingly.
1999-11-24 Geoffrey Keating <geoffk@cygnus.com>
Greg McGary <gkm@gnu.org>
* decl.c (duplicate_decls): Merge
DECL_NO_INSTRUMENT_FUNCTION_ENTRY_EXIT,
DECL_NO_CHECK_MEMORY_USAGE, DECL_NO_LIMIT_STACK.
1999-12-02 Mike Stump <mrs@wrs.com>
* init.c (perform_member_init): Handle parse errors better.
1999-12-01 Mark Mitchell <mark@codesourcery.com>
* cp-tree.h (min_tree_cons): Remove.
(scratch_ovl_cons): Likewise.
* decl.c (saveable_obstack): Don't declare.
(duplicate_decls): Tweak error-message.
(initialize_local_var): Explicitly mark the definition as static.
(finish_function): Call permanent_allocation, just so
that the middle-end sees the obstacks it expects.
(mark_cp_function_context): Likewise.
* init.c (build_new): Don't use min_tree_cons.
* lex.c (permanent_obstack): Don't declare.
(current_obstack, saveable_obstack): Likewise.
* spew.c (current_obstack, saveable_obstack): Likewise.
* tree.c (current_obstack, saveable_obstack): Likewise.
(scratch_ovl_cons): Remove.
(build_min_nt): Don't mess with obstacks.
(build_min): Likewise.
(min_tree_cons): Remove
* typeck.c (build_component_ref): Don't use scratch_ovl_cons.
(build_x_function_call): Likewise.
(build_c_cast): Don't use min_tree_cons.
1999-11-29 Mark Mitchell <mark@codesourcery.com>
* pt.c (tsubst_decl): Robustify.
1999-11-27 Mark Mitchell <mark@codesourcery.com>
* decl2.c (finish_file): Call expand_body for inline functions
that will be written out but that do not yet have RTL.
* semantics.c (expand_body): Do not generate RTL For inline
functions that do not yet need to be written out.
1999-11-25 Mark Mitchell <mark@codesourcery.com>
* Make-lang.in (CXX_SRCS): Add optimize.c.
* Makefile.in (CXX_OBJS): Add optimize.o.
(CXX_TREE_H): Add splay-tree.h, system.h, and $(CONFIG_H).
(spew.o, lex.o, decl.o, decl2.o, typeck2.o, typeck.o): Adjust.
(class.o, call.o, friend.o, init.o, method.o, cvt.o): Likewise.
(search.o, tree.o, ptree.o, rtti.o, except.o, expr.o): Likewise.
(xref.o, pt.o, error.o, errfn.o, repo.o, semantics.o): Likewise.
(dump.o): Likewise.
(optimize.o): New target.
* class.c: Don't include splay-tree.h.
* cp-tree.def (CTOR_COMPLETE): Rename to CTOR_STMT.
* cp-tree.h: Include splay-tree.h.
(DECL_UNINLINABLE): New macro.
(CTOR_BEGIN_P, CTOR_END_P): New macros.
(flag_inline_trees): New variable.
(local_variable_p): New function.
(nonstatic_local_decl_p): Likewise.
(optimize_function): Likewise.
(cplus_unsave_expr_now): Remove.
(copy_tree_r): Declare.
(remap_save_expr): Likewise.
* decl.c (local_variable_p): Don't
make it static.
(local_variable_p_walkfn): New function.
(make_rtl_for_local_static): Remove code to try to avoid writing
out static constants.
(emit_local_var): Fix indentation.
(nonstatic_local_decl_p): New function.
(check_default_argument): Use local_variable_p_walkfn, not
local_variable_p, when walking the tree.
(start_function): Set the DECL_CONTEXT for automatically generated
labels.
(finish_constructor_body): Use CTOR_STMT to mark the end of a
constructor.
* decl2.c: Don't include splay-tree.h.
(flag_inline_trees): Define.
* dump.c: Don't include
splay-tree.h.
* except.c (expand_end_catch_block): Fix comment formatting.
(expand_end_eh_spec): Set DECL_CONTEXT on temporary variables.
(expand_throw): Tidy comment.
* init.c (build_vec_delete_1): Use create_temporary_var.
* lex.c (cplus_tree_code_type): Make it static.
(cplus_tree_code_length): Likewise.
(cplus_tree_code_name): Likewise.
* optimize.c: New file.
* semantics.c (finish_goto_stmt): Set DECL_UNLINABLE for functions
with computed gotos.
(setup_vtbl_ptr): Mark the beginnings of constructors with
CTOR_STMT.
(expand_stmt): Handle CTOR_STMT, not CTOR_COMPLETE.
(expand_body): Call optimize_function. Save bodies if we're doing
inlining on trees.
* tree.c: Don't include splay-tree.h. Include insn-config.h and
integrate.h.
(copy_tree_r): Make it public.
(statement_code_p): New function.
(mark_local_for_remap_r): Likewise.
(cp_usave_r): Likewise.
(cp_unsave): Likewise.
(build_cplus_new): Set DECL_CONTEXT for temporary variables.
(walk_tree): Walk into `s' class nodes. Walk statement chains.
(copy_tree_r): Handle 's' class nodes. Restore chains for
statements. Nullify scopes. Don't copy types.
(init_tree): Set lang_unsave to cp_unsave.
(remap_save_expr): Define.
* ir.texi: Document CTOR_STMT.
1999-11-24 Jason Merrill <jason@casey.cygnus.com>
* search.c (note_debug_info_needed): Do perform this optimization
for dwarf2.
(maybe_suppress_debug_info): Likewise. Start by clearing
TYPE_DECL_SUPPRESS_DEBUG.
1999-11-24 Mark Mitchell <mark@codesourcery.com>
* pt.c (tsubst_decl): Copy TREE_ASM_WRITTEN for VAR_DECLs.
* decl2.c (finish_vtable_vardecl): Don't prune vtables here.
1999-11-23 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
* decl.c (pushdecl, grokdeclarator): Don't call a variadic
function with a non-literal format string.
* lex.c (do_identifier): Likewise.
* typeck.c (build_unary_op): Likewise.
1999-11-23 Mark Mitchell <mark@codesourcery.com>
* cp-tree.h (DECL_NEEDED_P): Tweak to match documentation.
1999-11-22 Mark Mitchell <mark@codesourcery.com>
* cp-tree.def (CTOR_COMPLETE): New tree node.
* decl.c (finish_constructor_body): Add it, to mark the end of the
constructor.
(finish_function): Don't call end_protect_partials here.
* ir.texi (CTOR_COMPLETE): Document it.
* semantics.c (expand_stmt): Handle it.
* cp-tree.def (FUNCTION_NAME): New tree node.
* cp-tree.h (current_function_name_declared): Tweak documentation.
(lang_decl_flags): Add pretty_function_p, adjust dummy.
(DECL_PRETTY_FUNCTION_P): New macro.
* decl.c (cp_finish_decl): Handle declarations of __FUNCTION__,
etc., in a template function. Use at_function_scope_p instead of
expanding it inline.
* pt.c (tsubst_decl): Handle DECL_PRETTY_FUNCTION_P declarations
specially.
(tsubst): Handle FUNCTION_NAME.
(tsubst_copy): Likewise.
(instantiate_decl): Prevent redeclarations of __PRETTY_FUNCTION__,
etc. in instantiation.
* semantics.c (begin_compound_stmt): Declare __FUNCTION__, etc.,
even in template functions.
(setup_vtbl_ptr): Don't declare __PRETTY_FUNCTION in the
conditional scope at the top of a destructor.
* error.c (dump_function_decl): Use `[ with ... ]' syntax for
specializations too.
1999-11-22 Nathan Sidwell <nathan@acm.org>
* semantics.c (finish_unary_op_expr): Only set TREE_NEGATED_INT
when actually negative.
* typeck.c (convert_for_assignment): Expand comment about
strange NULL check, moved from ...
(convert_for_initialization): ... here. Remove unneeded
code.
1999-11-21 Alexandre Oliva <oliva@lsd.ic.unicamp.br>
* cp-tree.h (build_vec_delete): Remove `auto_delete' argument.
* init.c (build_vec_delete, build_vec_delete_1): Likewise.
Always destruct virtual bases of array components, but never
delete them.
(build_vec_init): Adjust invocations.
(build_delete): Likewise.
* decl2.c (delete_sanity): Likewise.
1999-11-19 Nathan Sidwell <nathan@acm.org>
* cp-tree.h (grok_method_quals): Return this pointer qualifiers.
* decl.c (grokdeclarator): Adjust calls to grok_method_quals.
* decl2.c (grok_method_quals): Accept `restrict' as applying to
the object pointer. Return such qualifiers.
(grokclassfn): Apply this pointer qualifiers. Cleanup unused
variables.
1999-11-18 Mark Mitchell <mark@codesourcery.com>
* except.c (expand_end_catch_block): Fix typo.
(expand_exception_blocks): Simplify. Don't call
expand_leftover_cleanups.
1999-11-15 Jason Merrill <jason@casey.cygnus.com>
* cp-tree.h, decl.c (compute_array_index_type): Make nonstatic.
* pt.c (tsubst, case INTEGER_TYPE): Call it.
Check uses_template_parms.
* class.c (finish_struct): If we're a local class in a template
function, add a TAG_DEFN.
* pt.c (lookup_template_class): If this is a local class in a
template function, call pushtag.
(tsubst_expr, case TAG_DEFN): Handle classes, too.
Emit debug info with the vtable.
* search.c (maybe_suppress_debug_info): New function...
* class.c (finish_struct_1): ...split out from here.
* cp-tree.h: Declare it.
* decl2.c (finish_vtable_vardecl): Override TYPE_DECL_SUPPRESS_DEBUG
if we're writing out the vtable.
* decl.c, search.c (dfs_debug_mark, dfs_debug_unmarked_p,
note_debug_info_needed): #if 0 out.
1999-11-14 Mark Mitchell <mark@codesourcery.com>
* cp-tree.h (DECL_LOCAL_FUCNTION_P): New macro.
* call.c (equal_functions): Use DECL_LOCAL_FUCNTION_P, not
TREE_PERMANENT.
* decl.c (pushdecl): Set DECL_LOCAL_FUNCTION_P.
* decl2.c (lookup_arg_dependent): Use it.
* cp-tree.h (cp_finish_decl): Change prototype.
(finish_static_data_member_decl): Likewise.
(push_permanent_obstack): Remove declaration.
(push_expression_obstack): Likewise.
(push_scratch_obstack): Likewise.
(DECL_TEMPLATE_PARM_P): Robustify.
(SET_DECL_TEMPLATE_PARM_P): New macro.
* class.c (add_method): Don't manipulate obstacks.
(finish_vtbls): Likewise.
* cvt.c (build_up_reference): Adjust calls to cp_finish_decl.
* decl.c (binding_for_name): Don't manipulate obstacks.
(maybe_push_to_top_level): Likewise.
(pop_from_top_level): Likewise.
(duplicate_decls): Likewise.
(pushdecl): Likewise.
(implicitly_declare): Likewise.
(build_typename_type): Likewise.
(start_decl): Likewise.
(cp_finish_decl): Likewise.
(finish_decl): Likewise.
(destroy_local_static): Likewise.
(expand_static_init): Likewise.
(complete_array_type): Likewise.
(grokvardecl): Likewise.
(build_ptrmemfnc_type): Likewise.
(grokdeclarator): Likewise.
(xref_tag): Likewise.
(xref_basetypes): Likewise.
(start_enum): Likewise.
(finish_enum): Likewise.
(start_function): Likewise.
(finish_function): Likewise.
(start_method): Adjust call to cp_finish_decl.
* decl2.c (finish_static_data_member_decl): Don't manipulate
obstacks.
(grokfield): Likewise.
(grokbitfield): Likewise.
(get_temp_name): Likewise.
(get_sentry): Likewise.
(fnish_file): Likewise.
(lookup_arg_dependent): Likewise.
* except.c (call_eh_info): Likewise.
(push_eh_info): Likewise.
(do_pop_exception): Likewise.
(initialize_handler_parm): Likewise.
(expand_end_eh_spec): Likewise.
(alloc_eh_object): Likewise.
(expand_throw): Likewise.
* expr.c (extract_scalar_init): Likewise.
* init.c (build_java_class_ref): Likewise.
* lex.c (get_time_identifier): Likewise.
(snarf_defarg): Likewise.
(add_defarg_fn): Likewise.
(is_global): Simplify.
(do_identifier): Don't check TREE_PERMANENT.
* method.c (emit_thunk): Don't manipulate obstacks.
* parse.y (condition): Adjust call to cp_finish_decl.
(primary): Likewise.
(initdcl): Likewise.
(initdcl0_innards): Likewise.
(nomods_initdcl0): Likewise.
* pt.c (push_inline_template_parms_recursive): Use
SET_DECL_TEMPLATE_PARM_P.
(process_template_parm): Likewise.
(lookup_template_class): Don't manipulate obstacks.
(instantiate_class_template): Adjust call to
finish_static_data_member_decl.
(tsubst_decl): Don't manipulate obstacks.
(tsubst_expr): Likewise.
(instantiate_template): Likewise.
(instantiate_decl): Adjust calls to cp_finish_decl.
* rtti.c (call_void_fn): Don't manipulate obstacks.
(get_tinfo_var): Likewise.
(get_tinfo_fn_unused): Likewise.
(build_dynamic_cast_1): Likewise.
(expand_si_desc): Likewise.
(expand_class_desc): Likewise.
(expand_ptr_desc): Likewise.
(expand_attr_desc): Likewise.
(expand_generic_desc): Likewise.
(synthesize_tinfo_fn): Likewise.
* search.c (expand_upcast_fixups): Likewise.
* semantics.c (finish_asm_stmt): Likewise.
(finish_named_return_value): Likewise.
(begin_class_definition): Likewise.
(finish_class_definition): Likewise.
(finish_typeof): Likewise.
* tree.c (build_cplus_method_type): Likewise.
(reverse_path): Likewise.
(copy_template_template_parm): Likewise.
(build_expr_ptr_wrapper): Likewise.
(push_expression_obstack): Remove.
(push_permanent_obstack): Likewise.
* typeck.c (mark_addressable): Likewise.
1999-11-13 Mark Mitchell <mark@codesourcery.com>
* call.c (build_conditional_expr): Use build_target_expr_with_type.
(convert_like): Likewise.
(build_over_call): Likewise.
* cp-tree.h (build_target_expr): Remove.
(build_target_expr_with_type): New function.
* cvt.c (build_up_reference): Use get_target_expr.
* decl.c (build_target_expr): Move to ...
* tree.c (build_target_expr): Here. Make it static.
(build_target_expr_with_type): New function. Set DECL_CONTEXT on
the temporary VAR_DECLs.
(get_target_expr): Use it.
1999-11-13 Jason Merrill <jason@yorick.cygnus.com>
* decl.c (duplicate_decls): Propagate DECL_DEFER_OUTPUT.
* decl2.c (comdat_linkage): Set DECL_DEFER_OUTPUT.
* rtti.c (get_tinfo_fn_unused): Split out from get_tinfo_fn.
* class.c (set_rtti_entry): Use it.
1999-11-12 Mark Mitchell <mark@codesourcery.com>
* decl.c (cplus_expand_expr_stmt): Don't call break_out_cleanups
here.
* semantics.c (finish_expr_stmt): Call it here instead. Move
default_conversion logic to semantic-analysis time.
1999-11-12 Jason Merrill <jason@yorick.cygnus.com>
* rtti.c (synthesize_tinfo_fn): Set DECL_DEFER_OUTPUT.
Fri Nov 12 12:56:32 MST 1999 Diego Novillo <dnovillo@cygnus.com>
* init.c (init_init_processing): Re-instated Nov 11 patch after
approval.
Fri Nov 12 10:42:02 MST 1999 Diego Novillo <dnovillo@cygnus.com>
* init.c (init_init_processing): Undo patch from Nov 11, 1999.
Patch had not been approved yet.
1999-11-12 Mark Mitchell <mark@codesourcery.com>
* decl.c (compute_array_index_type): New function, split out from
grokdeclarator.
(create_array_type_for_decl): Likewise.
(grokdeclarator): Use them.
* semantics.c (expand_stmt): Don't suspend_momentary or
resume_momentary.
Thu Nov 11 12:42:11 MST 1999 Diego Novillo <dnovillo@cygnus.com>
* init.c (init_init_processing): Header information for
arrays allocated via `new' should have the same alignment used by
malloc.
1999-11-10 Mark Mitchell <mark@codesourcery.com>
* error.c (dump_function_name): Don't crash if given a friend
pseudo-instantiation.
* cp-tree.h (build_enumerator): Change prototype.
* decl.c (enum_next_value): Remove.
(enum_overflow): Likewise.
(init_decl_processing): Don't register enum_next_value as a root.
(start_enum): Clear TYPE_VALUES for a redefined enum.
(finish_enum): Reset the type of enumeration constants.
(build_enumerator): Fix indentation. Don't copy CONST_DECLs when
we don't need to. Maintain the TYPE_VALUES list and look there
for the previously defined enumeration constant. Let enumeration
constants have the type of their values until the enumeration type
is complete.
* parse.y (enumlist_opt, enumlist, enumerator): Don't return a value.
(structsp): Adjust.
* parse.c: Regenerated.
* pt.c (tsubst_enum): Adjust according to build_enumerator changes.
Wed Nov 10 12:43:21 1999 Philippe De Muyter <phdm@macqel.be>
Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
* cp-tree.h: Test `GCC_VERSION', not `HAVE_GCC_VERSION'.
1999-11-09 Mark Mitchell <mark@codesourcery.com>
* cp-tree.h (language_function): Remove x_last_dtor_insn and
x_last_parm_cleanup_insn.
* decl.c (last_dtor_insn): Remove.
(last_parm_cleanup_insn): Likewise.
(expand_start_early_try_stmts): Don't set them.
(store_parm_decls): Likewise.
(save_function_data): Or save them.
(mark_lang_function): Or mark them.
1999-11-08 Mark Mitchell <mark@codesourcery.com>
* decl.c (store_parm_decls): Generate cleanup code at
semantic-analysis time. Destroy objects in the correct order.
1999-11-07 Mark Mitchell <mark@codesourcery.com>
* cp-tree.h (begin_new_placement): Remove.
(finish_new_placement): Likewise.
* class.c (finish_struct_1): Don't suspend_momentary or
resume_momentary.
* decl.c (grokdeclarator): Likewise.
(maybe_build_cleanup_1): Likewise.
* except.c (push_eh_cleanup): Likewise.
(build_terminate_handler): Likewise.
* init.c (build_new_1): Likewise.
* parse.y (parse_decl): Change prototype.
(initdecls, notype_initdecls, initdcl): Don't return int.
(initdcl0, notype_initdcl0, initdcl0_innards): Likewise.
(.begin_new_placement): Remove.
(.finish_new_placement): Likewise.
(nonmomentary_expr): Likewise.
(suspend_mom): Likewise.
(condition): Don't suspend_momentary, resume_momentary, or keep
track of need to resume.
(unary_expr): Likewise.
(new_placement): Likewise.
(decl): Likewise.
(structsp): Likewise.
(new_type_id): Likewise.
(maybe_parmlist): Likewise.
(direct_after_type_declaration): Likewise.
(direct_new_declarator): Likewise.
(direct_abstract_declaration): Likewise.
* parse.c: Regenerated.
* pt.c (tsubst_expr): Don't suspend_momentary or resume_momentary.
* semantics.c (begin_new_placement): Remove.
(finish_new_placement): Likewise.
1999-11-05 Martin v. Löwis <loewis@informatik.hu-berlin.de>
* cp-tree.h (VAR_TEMPL_TYPE_OR_FUNCTION_DECL_CHECK): New macro.
(DECL_TEMPLATE_INFO): Use it.
* decl.c (warn_extern_redeclared_static): Do nothing for
TEMPLATE_DECLs.
* decl2.c (mark_used): Explicitly check for function or variable.
* semantics.c (finish_unary_op_expr): Check whether result is also
an INTEGER_CST.
1999-11-05 Mark Mitchell <mark@codesourcery.com>
* Makefile.in (typeck2.o): Depend on output.h.
* typeck2.c: Include output.h.
* decl.c (flag_ansi): Remove declaration.
* pt.c (tinst_level_tick): Make it static.
(last_template_error_tick): Likewise.
* cp-tree.h (mapcar): Remove declaration.
(search_tree): Likewise.
(walk_tree_fn): New typedef.
(walk_tree): New function.
* tree.c (bot_manip): Change prototype. Adjust to be called via
walk_tree.
(bot_replace): Likewise.
(no_linkage_helper): Likewise.
(copy_tree_r): New function.
(search_tree): Rename, and adjust, to become ...
(walk_tree): New function.
(mapcar): Remove.
(target_remap): Remove.
(target_remap_count): Likewise.
(break_out_target_exprs): Use walk_tree.
* decl.c (local_variable_p): Change prototype.
(check_default_argument): Use walk_tree.
* pt.c (for_each_template_parm_r): New function, split out from ...
(for_each_template_parm): Here. Use it, via walk_tree.
1999-11-03 Mark Mitchell <mark@codesourcery.com>
* class.c (check_bitfield_decl): New function, split out from
finish_stuct_1.
(check_field_decl): Likewise. Recursively examine members of
anonymous structs.
(finish_struct_1): Use them.
* cp-tree.h (ANON_UNION_TYPE_P): New macro.
1999-11-02 Mark Mitchell <mark@codesourcery.com>
* decl.c (grokfndecl): Remove dead code.
* dump.c (dequeue_and_dump): Fix thinko for catch-clauses.
1999-11-02 Scott Snyder <snyder@fnal.gov>
* decl2.c (build_expr_from_tree): Handle REALPART_EXPR and
IMAGPART_EXPR.
* pt.c (tsubst_copy): Likewise.
1999-11-01 Jason Merrill <jason@yorick.cygnus.com>
* decl2.c (maybe_make_one_only): Always make things comdat on
ELF targets, too.
1999-10-31 Mark Mitchell <mark@codesourcery.com>
* decl.c (finish_function): Call free_after_parsing for functions
we are not immediately turning into RTL.
1999-10-31 Brendan Kehoe <brendan@cygnus.com>
* cp-tree.h (flag_dump_translation_unit): Add decl.
Sat Oct 30 22:42:50 1999 Stephen L Moshier <moshier@mediaone.net>
* lex.c (yylex): Accept 'f' in mantissa of hex float constant.
1999-10-30 Mark Mitchell <mark@codesourcery.com>
* decl.c (pop_cp_function_context): Don't call free on a NULL
pointer.
* semantics.c: Include ggc.h.
(expand_body): Do garbage-collection after processing a template
function. Clear DECL_SAVED_TREE after generating RTL for a
function.
* Makefile.in (semantics.o): Depend on ggc.h.
1999-10-29 Mark Mitchell <mark@codesourcery.com>
* cp-tree.h (make_typename_type): Change prototype.
* decl.c (make_typename_type): Only complain if so requested.
* parse.y (nested_name_specifier): Adjust calls.
(typename_sub0): Likewise.
(typename_sub1): Likewise.
* parse.c: Regenerated.
* pt.c (convert_template_argument): Pass complain to
make_typename_type.
(tsubst): Likewise.
1999-10-28 Mark Mitchell <mark@codesourcery.com>
* semantics.c (finish_handler): End the scope of the handler
before attaching it to the statement-tree.
1999-10-28 Ian Lance Taylor <ian@zembu.com>
* rtti.c (build_dynamic_cast_1): Give a better error message for
an attempt to dynamic_cast from a non-polymorphic type.
1999-10-27 Mark Mitchell <mark@codesourcery.com>
* cp-tree.h (make_temp_vec): Remove.
(make_scratch_vec): Likewise.
* call.c (add_function_candidate): Use make_tree_vec.
(add_conv_candidate): Likewise.
(build_builtin_candidate): Likewise.
(add_template_candidate_real): Likewise.
* class.c (resolve_address_of_overloaded_function): Likewise.
* decl.c (start_function): Don't fool with the momentary obstack.
(finish_function): Likewise.
* init.c (expand_direct_vtbls_init): Likewise.
(begin_init_stmts): Likewise.
(finish_init_stmts): Likewise.
* pt.c (add_to_template_args): Use make_tree_vec.
(check_explicit_specialization): Likewise.
(coerce_template_parms): Likewise.
(lookup_template_class): Don't fool with the momentary obstack.
(instantiate_class_template): Likewise.
(tsubst_template_arg_vector): Use make_tree_vec.
(tsubst_aggr_type): Don't fool with the momentary obstack.
(tsubst_decl): Likewise. Use make_tree_vec.
(try_one_overload): Likewise.
(try_class_unification): Don't fool with the momentary obstack.
(get_bindings_real): Use make_tree_vec.
(set_mangled_name_for_template_decl): Likewise.
* rtti.c (synthesize_tinfo_fn): Don't fool with the momentary obstack.
* semantics.c (finish_expr_stmt): Likewise.
(finish_do_stmt): Likewise.
(finish_for_expr): Likewise.
(finish_switch_cond): Likewise.
(do_pushlevel): Likewise.
(do_poplevel): Likewise.
* tree.c (make_temp_vec): Remove.
* dump.c (dequeue_and_dump): Dump HANDLERs and SAVE_EXPRs. Dump
CLEANUP_P for a TRY_BLOCK.
* ir.texi: Document SAVE_EXPR.
Tue Oct 26 23:29:56 1999 Jeffrey A Law (law@cygnus.com)
* call.c (build_over_call): Check that the built-in function is
of class BUILT_IN_NORMAL before trying to recongize it as BUILT_IN_ABS.
* typeck.c (build_function_call_real): Similarly.
1999-10-26 Mark Mitchell <mark@codesourcery.com>
* decl.c (poplevel): Don't set BLOCK_TYPE_TAGS. Don't call
remember_end_note.
1999-10-24 Mark Mitchell <mark@codesourcery.com>
* decl.c (push_overloaded_decl_1): Use pushdecl.
* decl.c (auto_function): Replace #ifdef'd __inline with just
plain inline.
* lex.c (my_get_run_time): Likeise.
(yyprint): Likewise.
(identifier_type): Likewise.
* method.c (start_squangling): Likewise.
(end_squangling): Likewise.
(icat): Likewise.
(old_backref_index): Likewise.
(flush_repeats): Likewise.
(issue_ktype): Likewise.
* parse.y (empty_parms): Likewise.
* parse.c: Regenerated.
1999-10-21 Mark Mitchell <mark@codesourcery.com>
* dump.c (dequeue_and_dump): Replace several uses of
queue_and_dump_index with dump_child.
1999-10-21 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
* expr.c: Include tm_p.h.
1999-10-21 Mark Mitchell <mark@codesourcery.com>
* cp-tree.h (SCOPE_PARTIAL_P): New macro.
(pushlevel_temporary): Remove.
(add_scope_stmt): New function.
* decl.c (pushlevel_temporary): Remove.
(poplevel): Use add_scope_stmt.
(start_decl_1): Likewise.
* semantics.c (add_scope_stmt): New function.
(do_pushlevel): Use it.
(do_poplevel): Use it.
(expand_stmt): Check SCOPE_PARTIAL_P.
* cp-tree.def (EMPTY_CLASS_EXPR): New tree node.
* call.c (build_call): Use EMPTY_CLASS_EXPR instead of RTL_EXPR.
* expr.c (cplus_expand_expr): Expand it.
* ir.texi: Document EMPTY_CLASS_EXPR.
1999-10-20 Mark Mitchell <mark@codesourcery.com>
* cp-tree.h (DECL_NAMESPACE_SCOPE_P): Don't treat template
parameters as having namespace scope.
1999-10-19 Mark Mitchell <mark@codesourcery.com>
* method.c (PARM_CAN_BE_ARRAY_TYPE): Remove.
(mangling_flags): New type.
(build_overload_int): Change prototype.
(build_overload_value): Likewise.
(numeric_output_need_bar): Improve comment.
(mangle_expression): New function, broken out from ...
(build_overload_int): Here.
(build_overload_value): Adjust for use of mangling flags. Don't
warn about real-valued template parameters here. Do handle
complex expressions involving real-valued template parameters.
(build_template_parm_names): Encase non-type template parameters
in underscores, if necessary.
(process_overload_item): Remove conditional on
PARM_CAN_BE_ARRAY_TYPE.
1999-10-17 Mark Mitchell <mark@codesourcery.com>
* dump.c (dequeue_and_dump): Handle CLEANUP_POINT_EXPR.
* ir.texi: Clean up documentation of RETURN_INIT.
1999-10-15 Greg McGary <gkm@gnu.org>
* lex.c (lang_init_options): Set flag_bounds_check as "unspecified".
(lang_init): Set default for flag_bounds_check if still "unspecified".
1999-10-13 Andrew Haley <aph@cygnus.com>
* class.c (finish_struct_1): Force alignment of non-bitfields to
BITS_PER_UNIT.
Wed Oct 13 22:01:35 1999 J"orn Rennecke <amylaar@cygnus.co.uk>
* typeck2.c (process_init_constructor): Handle empty constructors.
1999-10-13 Jason Merrill <jason@yorick.cygnus.com>
* decl.c (lang_mark_tree): Mark NAMESPACE_LEVEL.
* pt.c (tsubst, case INTEGER_TYPE): Be more explicit in zero-size
array error.
1999-10-13 Mark Mitchell <mark@codesourcery.com>
* decl.c (make_rtl_for_local_static): Don't create register RTL
for addressable constants.
1999-10-13 Nathan Sidwell <nathan@acm.org>
* cp-tree.h (build_x_va_arg): Prototype new function.
* call.c (build_x_va_arg): Define it.
* parse.y (unary_expr): Call build_x_va_arg.
* cp-tree.h (convert_type_from_ellipsis): Prototype new function.
* call.c (convert_type_from_ellipsis): Define it.
* decl.c (init_decl_processing): Set lang_type_promotes_to.
* tree.c (lvalue_p_1): Accept VA_ARG_EXPR with aggregates.
1999-10-11 Jason Merrill <jason@yorick.cygnus.com>
* class.c (fixed_type_or_null): Always set *nonnull.
1999-10-10 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
* cp-tree.h: Use HAVE_GCC_VERSION instead of explicitly testing
__GNUC__ and __GNUC_MINOR__.
1999-10-09 Mark Mitchell <mark@codesourcery.com>
* cp-tree.h (make_rtl_for_local_static): New function.
* decl.c (make_rtl_for_nonlocal_decl): Move code to create RTL for
local statics ...
(make_rtl_for_local_static): Here.
* semantics.c (expand_stmt): Use make_rtl_for_local_static.
1999-10-08 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
* method.c: Include tm_p.h.
1999-10-7 Franz Sirl <Franz.Sirl-kernel@lauterbach.com>
* cp-tree.h (cp_make_lake_type): Renamed from make_lang_type.
* lex.c (cp_make_lake_type): Likewise.
* tree.c (init_tree): Init make_lang_type_fn.
1999-10-07 Mark Mitchell <mark@codesourcery.com>
* pt.c (tsubst_expr): Set DECL_TEMPLATE_INSTANTIATED for a catch
parameter.
* semantics.c (expand_stmt): Don't pretend to have asmspecs for
local statics if we don't really have them.
* ir.texi: Improve documentation for STMT_EXPR. Describe
CLEANUP_POINT_EXPR.
1999-10-07 Jason Merrill <jason@yorick.cygnus.com>
* class.c (build_vtable_entry_ref): Use finish_asm_stmt.
1999-10-07 Greg McGary <gkm@gnu.org>
* class.c (finish_struct_1): Use simpler method of
removing elements of a singly-linked list which doesn't
lose for classes without data members.
1999-10-07 Mark Mitchell <mark@codesourcery.com>
* friend.c (make_friend_class): Robustify.
* semantics.c (finish_object_call_expr): Reject calls to template
types.
1999-10-06 Mark Mitchell <mark@codesourcery.com>
* dump.c (dequeue_and_dump): Dump all three operands to a COND_EXPR.
* cp-tree.h (CLASSTYPE_VFIELD): Remove.
* call.c (build_vfield_ref): Use TYPE_VFIELD, not
CLASSTYPE_VFIELD.
* class.c (get_vfield_offset): Likewise.
(finish_base_struct): Likewise.
(modify_one_vtable): Likewise.
(fixup_vtable_deltas): Likewise.
(finish_struct_1): Likewise.
* init.c (expand_virtual_init): Likewise.
* search.c (lookup_field_1): Likewise.
(expand_upcast_fixups): Likewise.
* typeck.c (build_component_ref): Likewise.
(build_binary_op_nodefault): Likewise.
* dump.c (dqueue_and_dump): Dump TYPE_VFIELD.
* ir.texi: Document TYPE_VFIELD.
1999-10-06 Brendan Kehoe <brendan@cygnus.com>
* decl.c (grokdeclarator): Only warn about nonzero arrays if
!in_system_header (linux socketbits.h can give this for
__cmsg_data, which is using a GNU extension).
1999-10-05 Mark Mitchell <mark@codesourcery.com>
* decl2.c (start_static_storage_duration_function): Push the
function declaration so it ends up in namespace scope.
* dump.c (DUMP_CHILDREN): Remove.
(DUMP_BINFO): Adjust.
(struct dump_node_info): Remove dump_children_p.
(queue_and_dump_type): Remove dump_children_p parameter.
(queue): Don't set dump_children_p.
(dump_child): Pass DUMP_NONE, instead of DUMP_CHILDREN, to
queue_and_dump_index.
(dequeue_and_dump): Unconditionally print children. Adjust calls
to functions mentioned above.
(dump_node): Pass DUMP_NONE, instead of DUMP_CHILDREN to queue.
* ir.texi: Document BIND_EXPR, LOOP_EXPR, and EXIT_EXPR.
* dump.c (dequeue_and_dump): Dump them.
* method.c (synthesize_method): Call setup_vtbl_ptr for destructors.
* decl.c (start_function): Set current_in_charge_parm for
constructors, too, where appropriate.
* search.c (fixup_all_virtual_upcast_offsets): New function.
(expand_indirect_vtbls_init): Use it.
1999-10-04 Nathan Sidwell <nathan@acm.org>
* decl2.c (grok_alignof): Don't decay lvalues.
* init.c (build_new): Remove unused variable.
1999-10-04 Mark Mitchell <mark@codesourcery.com>
* cp-tree.h (struct language_function): Remove static_labelno.
(static_labelno): Remove macro.
* method.c (build_overload_nested_name): Make static_labelno
static here.
* pt.c (instantiate_decl): Use DECL_SAVED_TREE, not DECL_INITIAL,
to decide whether or not a function is defined.
* call.c (build_over_call): Don't set TREE_SIDE_EFFECTS for
situations where make_node will do it automatically.
* decl.c (grok_reference_init): Likewise.
(expand_static_init): Likewise.
(do_static_initialization): Likewise.
* init.c (perform_member_init): Likewise.
(expand_aggr_init_1): Likewise.
(build_new_1): Likewise.
* method.c (do_build_copy_constructor): Likewise.
(do_build_assign_ref): Likewise.
* search.c (expand_upcast_fixups): Likewise.
* semantics.c (finish_stmt_expr): Likewise.
* typeck.c (build_unary_op): Likewise.
(check_return_expr): Likewise.
1999-10-04 Jason Merrill <jason@yorick.cygnus.com>
* init.c (build_vec_delete_1): Fold COND_EXPRs.
1999-10-03 Mark Mitchell <mark@codesourcery.com>
* cp-tree.def (VEC_INIT_EXPR): Remove.
* cp-tree.h (struct stmt_tree): New type.
(struct saved_scope): Remove firstobj. Add x_saved_tree,
x_stmt_tree.
(class_cache_firstobj): Remove.
(struct language_function): Remove stmts_are_full_exprs_p,
x_last_tree, and x_last_expr_type. Add x_stmt_tree.
(current_stmt_tree): New macro.
(last_tree): Adjust.
(last_expr_type): Likewise.
(doing_semantic_analysis_p): Simplify.
(stmts_are_full_exprs_p): Adjust.
(begin_tree): Remove prototype.
(end_tree): Likewise.
(begin_stmt_tree): Change prototype.
(finish_stmt_tree): Likewise.
(building_stmt_tree): Simplify.
* decl.c (mark_stmt_tree): New function.
(mark_saved_scope): Use it.
(start_function): Rearrange slightly to call begin_stmt_tree
earlier.
(save_function_data): Tweak.
(finish_function): Adjust call to finish_stmt_tree.
(mark_lang_function): Use mark_stmt_tree.
* expr.c (cplus_expand_expr): Don't handle VEC_INIT_EXPR.
* init.c (build_new_1): Remove creation of VEC_INIT_EXPR.
(build_vec_init): Remove creation of stand-in initializer.
* pt.c (begin_tree): Remove.
(end_tree): Likewise.
* semantics.c (SET_LAST_STMT): New macro. Use it throughout.
(begin_compound_stmt): Handle a compound-statement outside of a
function.
(begin_stmt_expr): Handle a statement-expression outsidef of a
function.
(finish_stmt_expr): Likewise.
(begin_class_definition): Don't call begin_tree.
(finish_inline_definitions): Don't call end_tree.
(begin_stmt_tree): Take a pointer to tree, not a function as input.
(finish_stmt_tree): Likewise.
* tree.c (search_tree): Don't handle VEC_INIT_EXPR.
(mapcar): Likewise.
* parse.y (simple_stmt): Don't call finish_stmt unnecessarily.
* parse.c: Regenerated.
* dump.c (dqueue_and_dump): Dump bitfieldness.
* tree.c (lvalue_p_1): Use DECL_C_BIT_FIELD to check for
bitfields, rather than DECL_BIT_FIELD.
* ir.texi: Document how to tell whether or not a field is a
bitfield.
* lex.c (make_lang_type): Fix typo in comment.
1999-10-01 Jason Merrill <jason@yorick.cygnus.com>
* typeck.c (decay_conversion): Strip cv-quals from non-class rvalues.
1999-10-01 Mark Mitchell <mark@codesourcery.com>
* pt.c (tsubst_decl): If the type of a template instantiation is
bogus, so is the whole instantiation.
1999-09-30 Mark Mitchell <mark@codesourcery.com>
* decl.c (initialize_local_var): Handle static variables here.
(cp_finish_decl): Tweak handling of function-scope static
variables.
* semantics.c (expand_stmt): Handle DECL_STMTs for static
variables.
* method.c (emit_thunk): Don't crash when -fsyntax-only.
* cp-tree.h (lang_decl_flags): Add global_ctor_p and
global_dtor_p. Add init_priority.
(DECL_ACCESS): Adjust accordingly.
(DECL_GLOBAL_CTOR_P, DECL_GLOBAL_DTOR_P): New macros.
(GLOBAL_INIT_PRIORITY): Likewise.
* decl.c (lang_mark_tree): Adjust accordingly.
(start_objects): Set DECL_GLOBAL_CTOR_P, DECL_GLOBAL_DTOR_P,
and GLOBAL_INIT_PRIORITY.
* dump.c (dequeue_and_dump): Print them.
* ir.texi: Document them.
* decl2.c (struct priority_info_s): Remove initialization_sequence
and destruction_sequence.
(start_static_storage_duration_function): Return the body of the
function. Convert for function-at-a-time mode.
(generate_inits_for_priority): Remove.
(finish_static_storage_duration_function): Change prototype.
Adjust for function-at-a-time mode.
(do_static_initialization): Likewise.
(do_static_destruction): Likewise.
(do_static_initialization_and_destruction): Remove.
(start_static_initialization_or_destruction): New function.
(finish_static_initialization_or_destruction): Likewise.
(get_priority_info): Don't manipulation initialization_sequence or
destruction_sequence.
(prune_vars_needing_no_initialization): New function.
(write_out_vars): Likewise.
(finish_file): Use the various new functions instead of the old.
Thu Sep 30 00:13:27 1999 Dirk Zoller <duz@rtsffm.com>
* cp-tree.h (warn_float_equal): Declare.
* decl2.c (warn_float_equal): Define.
(lang_decode_option): Recognize -W[no-]float-equal.
* typeck.c (build_binary_op_nodefault): Conditionally warn
about equality tests of floating point types.
1999-09-29 Jason Merrill <jason@yorick.cygnus.com>
Support normal type_info-based EH mechanisms with -fno-rtti.
* except.c (build_eh_type_type): Remove special -fno-rtti handling.
(build_eh_type_type_ref): Likewise.
(build_eh_type): Remove.
(expand_throw): Call build_eh_type_type, not build_eh_type.
* decl2.c (import_export_decl): Don't associate the tinfo fn with
the vtable if -fno-rtti.
* decl.c (init_decl_processing): Always init_rtti_processing.
* rtti.c (get_typeid): Don't complain about -fno-rtti.
* class.c (class_cache_obstack, class_obstack): Remove.
(init_class_processing): Don't initialize class_obstack.
(push_cache_obstack): Remove.
(pushclass): Don't call it.
* cp-tree.h: Remove prototype for push_cache_obstack.
* decl.c (decl_obstack, decl_stack, push_decl_level): Remove.
(pushlevel_class): Don't push_decl_level.
(poplevel_class): Don't pop_stack_level.
(push_class_level_binding): Don't push_cache_obstack.
(init_decl_processing): Don't initialize decl_obstack.
* search.c (push_class_decls): Don't push_cache_obstack.
* tree.c (list_hash_add): Put hash node on permanent_obstack.
(hash_tree_cons): Don't mess with obstacks.
(print_lang_statistics): Don't print stats for class_obstack and
decl_obstack.
1999-09-29 Mark Mitchell <mark@codesourcery.com>
* dump.c (dequeue_and_dump): Dump DECL_EXTERNAL.
* ir.texi: Document DECL_EXTERNAL.
* dump.c (dequeue_and_dump): Improve support for dumping THUNK_DECLs.
* ir.texi: Document THUNK_DECLs.
* cp-tree.h (TMPL_ARGS_HAVE_MULTIPLE_LEVELS): Move here from pt.c.
(TMPL_ARGS_DEPTH, TMPL_ARGS_LEVEL, SET_TMPL_ARGS_LEVEL): Likewise.
(TMPL_ARG, SET_TMPL_ARG, NUM_TMPL_ARGS, TMPL_PARMS_DEPTH): Likewise.
* error.c (dump_template_bindings): Remove unused parameter.
Handle multiple levels of template parameters.
(dump_template_decl): Use `parms', not `args', for template
parameters. Fix thinko.
(dump_function_decl): Use DECL_TEMPLATE_INSTANTIATION. Don't pass
flags to dump_template_bindings.
* pt.c (TMPL_ARGS_HAVE_MULTIPLE_LEVELS): Move to cp-tree.h.
(TMPL_ARGS_DEPTH, TMPL_ARGS_LEVEL, SET_TMPL_ARGS_LEVEL): Likewise.
(TMPL_ARG, SET_TMPL_ARG, NUM_TMPL_ARGS, TMPL_PARMS_DEPTH): Likewise.
(tsubst_copy): Clarify variable name.
(most_general_template): Robustify.
1999-09-29 Nathan Sidwell <nathan@acm.org>
* error.c (dump_template_parms): Don't use TS_PEDANTIC_NAME
to change primary template rendering.
1999-09-29 Mark Mitchell <mark@codesourcery.com>
* cp-tree.h (UPT_TEMPLATE): Remove.
(UPT_PARMS): Likewise.
(DECL_NEEDED_P): New macro.
* decl2.c (finish_vtable_vardecl): Use it.
(finish_objects): Don't crash with -fsyntax-only.
(finish_file): Use DECL_NEEDED_P. Don't prune vtables when
-fsyntax-only.
* pt.c (tsubst_friend_function): Remove FIXME that talks about
obstacks.
(tsubst_expr): Correct handling of function try-blocks.
* semantics.c: Include flags.h.
(expand_body): Don't do RTL generation if -fsyntax-only.
* Makefile.in (semantics.o): Depends on flags.h.
1999-09-28 Gabriel Dos Reis <gdr@codesourcery.com>
* pt.c (most_general_template): Adjust declaration.
* cp-tree.h: (most_general_template): Declare.
* error.c (dump_template_value): Rename to ...
(dump_template_argument): This.
(dump_template_argument_list): New function.
(dump_type): Use it.
(dump_template_parameter): New function.
(dump_template_decl): Use it.
(dump_template_bindings): New function.
(dump_function_decl): Use it. Pretty print function template
instantiations.
1999-09-28 Nathan Sidwell <nathan@acm.org>
* decl.c (grokdeclarator): Distinguish parameter context for
diagnostics. Tidy up missing type diagnostic.
Diagnose `explicit' in one place. Diagnose `mutable' in one place.
1999-09-28 Mark Mitchell <mark@codesourcery.com>
* ir.texi: Improve documentation for TARGET_EXPR.
1999-09-27 Nathan Sidwell <nathan@acm.org>
Augment stringification of trees.
* cp-tree.h (tree_string_flags): New error stringifying enumeration.
(fndecl_as_string, type_as_string_real, args_as_string,
code_as_string, language_as_string, parm_as_string,
op_as_string, assop_as_string, cv_as_string): Remove.
(type_as_string, decl_as_string, expr_as_string): Adjust prototype.
(context_as_string): Declare new function.
* error.c (cp_printers): Move definition.
(OB_UNPUT): Remove.
(OB_END_TEMPLATE_ID): Adjust.
(interesting_scope_p): Remove.
(dump_scope): New static function.
(dump_qualifiers): Adjust prototype, reimplement.
(dump_template_value): Use tree_string_flags.
(dump_type_real): Move back to dump_type.
(dump_type): Adjust prototype. Use tree_string_flags.
(dump_aggr_type): Likewise. Use dump_template_parms.
(dump_type_prefix): Adjust prototype. Use tree_string_flags.
Return pad flag.
(dump_type_suffix): Adjust prototype. Use tree_string_flags.
(dump_simple_decl): Likewise.
(dump_decl): Likewise. Use dump_template_decl.
(dump_template_decl): New static function broken out of dump_decl.
(dump_function_decl): Adjust prototype. Use tree_string_flags.
(dump_parameters): Likewise. Prefix space.
(dump_exception_spec): Adjust prototype. Use tree_string_flags.
(dump_function_name): Likewise. Use dump_template_parms.
(dump_template_parms): New static function broken out of
dump_function_name.
(dump_expr_list): Adjust prototype. Use tree_string_flags.
(dump_expr): Likewise.
(fndecl_as_string): Removed
(type_as_string_real): Removed
(dump_binary_op): Adjust prototype. Use tree_string_flags.
(dump_unary_op): Likewise.
(type_as_string): Likewise.
(expr_as_string): Likewise.
(decl_as_string): Likewise.
(context_as_string): New function.
(lang_decl_name): Adjust.
(decl_to_string): New static print callback.
(expr_to_string): Likewise.
(fndecl_to_string): Likewise.
(code_as_string): Renamed to ...
(code_to_string): ... here. Adjust.
(language_as_string): Renamed to ...
(language_to_string): ... here. Adjust.
(parm_as_string): Renamed to ...
(parm_to_string): ... here.
(op_as_string): Renamed to ...
(op_to_string): ... here.
(assop_as_string): Renamed to ...
(assop_to_string): ... here.
(type_to_string): New static print callback.
(args_as_string): Renamed to ...
(args_to_string): ... here. Adjust.
(cv_as_string): Renamed to ...
(cv_to_string): ... here. Adjust.
* pt.c (mangle_class_name_for_template): Use tree_string_flags.
(print_template_context): Likewise.
1999-09-26 Mark Mitchell <mark@codesourcery.com>
* cp-tree.h (expand_throw): Remove prototype.
* except.c (expand_throw): Make it static. Use tree-generation
functions, rather than RTL-generation functions.
(build_throw): Use it.
* expr.c: Include except.h.
(cplus_expand_expr): Don't call expand_throw here.
* Makefile.in (expr.o): Depend on except.h.
* ir.texi: Update documentation for THROW_EXPR.
* decl.c (start_function): Set x_dont_save_pending_sizes rather
than calling get_pending_sizes.
* init.c (build_new): Don't save and restore
immediate_size_expand; instead, assert that it has the expected
value already.
1999-09-26 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
* lex.c (compiler_error): Add missing call to va_end().
1999-09-25 Mark Mitchell <mark@codesourcery.com>
* dump.c (dequeue_and_dump): Handle RESULT_DECL.
* ir.texi: Document RESULT_DECL and DECL_RESULT.
* cp-tree.h (check_return_expr): New function.
* decl.c (finish_constructor_body): New function.
(pushdecl): Put global friend functions in namespace binding
level, not the class binding level.
(finish_destructor_body): Make sure the dtor_label is always
defined. Fix typo in comment.
(finish_function): Move generation of constructor-termination code
to semantic-analysis time. Move generation of implicit `main'
return value to semantic-analysis time.
* semantics.c (finish_return_stmt): Generate goto's to
ctor_label/dtor_label here. Use check_return_expr to do semantic
analysis on the returned expression.
* typeck.c (maybe_warn_about_returning_address_of_local): New
function split out from c_expand_return.
(check_return_expr): Likewise.
(c_expand_return): Just generate the RTL for the return.
1999-09-24 Mark Mitchell <mark@codesourcery.com>
* cp-tree.h (CPTI_CLEANUP_TYPE): New macro.
(cleanup_type): Likewise.
(search_tree): Change prototype.
* decl.c (local_variable_p): Adjust for new interface to
search_tree.
(check_default_argument): Likewise.
* error.c (dump_expr): Handle INIT_EXPR.
* except.c (expand_throw): Don't make cleanup_type a local static.
* expr.c (cplus_expand_expr): Don't handle NEW_EXPR.
* init.c (build_new): Call build_new_1 directly, rather than
building a NEW_EXPR.
(build_new_1): Tidy. Don't build a VEC_INIT_EXPR except when
processing file-scope initializers.
* lex.c (init_parse): Add an opname_tab entry for INIT_EXPR.
* tree.c: Include splay-tree.h
(no_linkage_helper): Adjust for new interface to search_tree.
(search_tree): Pass around pointers to tree nodes, rather than the
nodes themselves. Handle VEC_INIT_EXPR.
(no_linkage_check): Adjust for new interface to search_tree.
(mapcar): Handle VEC_INIT_EXPR.
(target_remap): New variable.
(bot_manip): Use it.
(bot_replace): New function.
(break_out_target_exprs): Use it to remap all variables used in a
default argument expression.
* typeck.c (build_modify_expr): Don't crash when outside a
function and presented with an INIT_EXPR assignment
* Makefile.in (tree.o): Depend on splay-tree.h.
Fri Sep 24 10:48:10 1999 Bernd Schmidt <bernds@cygnus.co.uk>
* decl.c (duplicate_decls): Use DECL_BUILT_IN_CLASS rather than
DECL_BUILT_IN.
(builtin_function): New arg CLASS. Arg CODE now of type int. All
callers changed.
Set the builtin's DECL_BUILT_IN_CLASS.
1999-09-24 Mark Mitchell <mark@codesourcery.com>
* decl.c (pushdecl): Don't make local declarations of extern
variables give the variable a DECL_CONTEXT for the function.
(make_rtl_for_nonlocal_decl): Don't fuss with obstacks. Simplify.
Don't accidentally make RTL for local declarations.
(emit_local_var): Handle declarations with asm-specifiers here.
1999-09-23 Mark Mitchell <mark@codesourcery.com>
* ir.texi: Improve documentation for TARGET_EXPRs. Discuss
STMT_IS_FULL_EXPR_P.
* cp-tree.h (language_function): Add cannot_inline.
* decl.c (start_function): Restore current_function_cannot_inline
from the saved value.
(save_function_data): Save current_function_cannot_inline.
* decl2.c (start_objects): Change prototype. Build the function
in function-at-a-time mode.
(finish_objects): Likewise.
(generate_ctor_or_dtor_function): Adjust accordingly.
* cp-tree.h (DECL_ANON_UNION_ELEMS): New macro.
* decl2.c (finish_anon_union): Set DECL_ANON_UNION_ELEMS.
Don't call expand_anon_union_decl here
* semantics.c (exapnd_stmt): Call it here, instead.
* typeck.c (mark_addressable): Addressed variables are implicitly
used.
1999-09-23 Martin v. Löwis <loewis@informatik.hu-berlin.de>
* cp-tree.h (VAR_OR_FUNCTION_DECL_CHECK): New macro.
(RECORD_OR_UNION_TYPE_CHECK, LANG_IDENTIFIER_CAST): Likewise.
(DEFARG_NODE_CHECK): Remove; replace with DEFAULT_ARG_CHECK.
* cp-tree.h: Add tree checking macros to various tree access
macros.
* ptree.c (print_lang_decl): Test for function or variable
before accessing template info.
1999-09-23 Jason Merrill <jason@yorick.cygnus.com>
* lex.c: Get WCHAR_TYPE_SIZE from wchar_type_node.
* lang-specs.h: If -fshort-wchar, override __WCHAR_TYPE__.
* decl2.c (lang_f_options): Add -fshort-wchar.
* cp-tree.h: Declare flag_short_wchar.
* decl.c (init_decl_processing): If -fshort-wchar, use 'short unsigned
int' for wchar_t.
1999-09-23 Martin v. Löwis <loewis@informatik.hu-berlin.de>
* ir.texi: Fix formatting errors and typos.
1999-09-22 Mark Mitchell <mark@codesourcery.com>
* ir.texi: Document CLEANUP_STMT, SCOPE_STMT, and START_CATCH_STMT.
* decl.c (pushdecl): Do create a binding for extern "C" functions,
but not for their DECL_ASSEMBLER_NAMEs.
(lookup_name_current_level): Fix formatting.
(xref_tag): Likewise.
* decl2.c (start_objects): Mark static constructors and
destructors as used.
1999-09-22 Jason Merrill <jason@yorick.cygnus.com>
* decl.c (define_case_label): Don't crash if we're not in a switch.
* decl2.c (lang_decode_option): Don't bother explicitly ignoring flags.
* lang-options.h: Restore -fthis-is-variable. Remove help strings
for unsupported flags.
1999-09-21 Jason Merrill <jason@yorick.cygnus.com>
* decl2.c (lang_decode_option): Accept and ignore -finit-priority.
Accept and warn about -fthis-is-variable.
1999-09-21 Mark Mitchell <mark@codesourcery.com>
* dump.c (dequeue_and_dump): Handle START_CATCH_STMT,
CLEANUP_STMT, and SCOPE_STMT.
* decl2.c (lang_decode_option): Adjust, in the wake of recent
changes to option processing.
1999-09-21 Martin v. Löwis <loewis@informatik.hu-berlin.de>
* typeck.c (get_member_function_from_ptrfunc): Allow extraction of
function pointer from pmfs with no object given.
(convert_for_assignment): Do not return error when converting
pmfs.
1999-09-21 Alex Samuel <samuel@codesourcery.com>
* lex.c (internal_filename): New variable.
(INTERNAL_FILENAME): New macro.
(init_parse): Allocate internal_filename and mark as root. Use it
instead of a string constant.
1999-09-21 Nathan Sidwell <nathan@acm.org>
Reimplement dynamic cast and catch matching.
* cp-tree.h (get_dynamic_cast_base_type): Prototype new function
* search.c (dynamic_cast_base_recurse): New function.
(get_dynamic_cast_base_type): New function for dynamic cast.
* rtti.c (build_dynamic_cast_1): Determine source and target
class relationship. Call __dynamic_cast_2.
* tinfo.h (__user_type_info::upcast): New catch dispatcher.
(__user_type_info::dyncast): New dynamic cast dispatcher.
(__user_type_info::sub_kind): New nested enumeration.
(__user_type_info::contained_p): sub_kind predicate.
(__user_type_info::contained_public_p): Likewise.
(__user_type_info::contained_nonpublic_p): Likewise.
(__user_type_info::contained_nonvirtual_p: Likewise.
(__user_type_info::upcast_result): New nested struct.
(__user_type_info::dyncast_result): New nested struct.
(*::do_upcast): New catch function.
(*::do_dyncast): New dynamic cast function.
(__user_type_info::find_public_subobj): New dynamic cast
helper dispatcher.
(*::do_find_public_subobj): New dynamic cast helper function.
* tinfo.cc (__user_type_info::upcast): Define catch dispatcher.
(__user_type_info::dyncast): Define dynamic cast dispatcher.
(*::do_upcast): Define catch function.
(*::do_dyncast): Define dynamic cast function.
(*::do_find_public_subobj): Define dynamic cast helper function.
* tinfo2.cc (__throw_type_match_rtti_2): Use upcast.
(__dynamic_cast): Backwards compatibility wrapper. Use dyncast.
(__dynamic_cast_2): New dynamic cast runtime.
1999-09-20 Mark Mitchell <mark@codesourcery.com>
* cp-tree.h (finish_stmt_expr): Change prototype.
* expr.c (cplus_expand_expr): Adjust call accordingly.
* init.c (finish_init_stmts): Likewise.
* parse.y (primary): Likewise.
* pt.c (tsubst_copy): Likewise.
* semantics.c (finish_stmt_expr): Don't take two parameters.
Don't remove generated BLOCKs from the block-tree.
Remove support for assigning to `this'.
* NEWS: Note that fact.
* class.c (build_vbase_path): Don't check flag_this_is_variable.
* cp-tree.h (EXPR_STMT_ASSIGNS_THIS): Remove.
(language_function): Remove assigns_this, just_assigned_this, and
x_base_init_expr. Add x_vcalls_possible_p. Add vtbls_set_up_p.
(base_init_expr): Remove.
(current_vcalls_possible_p): New macro.
(vtbls_set_up_p): Likewise.
(emit_base_init): Change prototype.
* decl.c (finish_destructor_body): New function, split out from
finish_function.
(current_function_assigns_this): Remove.
(current_function_just_assigned_this): Likewise.
(start_function): Don't set them.
(finish_function): Don't check them. Don't emit
base-initialization code here. Generate code for destructors when
doing semantic analysis.
(finish_stmt): Don't check current_function_just_assigned_this.
* decl2.c (lang_f_options): Remove this-is-variable.
(lang_decode_option): Likewise.
(grokclassfn): Don't check flag_this_is_variable.
* init.c (emit_base_init): Return the expression generated.
(construct_virtual_bases): Don't push/pop obstacks. Fix
typo.
(build_new_1): Don't check flag_this_is_variable.
(get_temp_regvar): Don't set DECL_REGISTER.
(build_vec_init): Don't call use_variable.
* lang-options.h: Remove "-fthis-is-variable" and
"-fno-this-is-variable".
* pt.c (tsubst_expr): Don't check EXPR_STMT_ASSIGNS_THIS.
* search.c (expand_upcast_fixups): Use finish_expr_stmt, not
expand_expr_stmt.
* semantics.c (finish_expr_stmt_real): Rename to ...
(finish_expr_stmt): This. Remove assigned_this parameter.
(begin_if_stmt): Call do_pushlevel before starting the statement.
(begin_compound_stmt): Don't declare __FUNCTION__ in scope-less
blocks.
(setup_vtbl_ptr): Emit initialization code for bases and members
at semantic-analysis time. Emit code to initialize vtables in
destructors here.
(expand_stmt): Use finish_expr_stmt, not finish_expr_stmt_real.
Don't handle CTOR_INITIALIZER any more.
* typeck.c (build_modify_expr): Don't check for assignments to
this.
(c_expand_return): Don't suggest assigning to `this'.
* Makefile.in (decl.o): Depend on RTL_H.
(decl2.o): Likewise.
(class.o): Likewise.
(call.o): Likewise.
(method.o): Likewise.
(search.o): Likewise.
(tree.o): Likewise.
(pt.o): Likewise.
* decl.c (duplicate_decls): When a builtin function is redeclared
as static, make sure it is mangled correctly.
* ir.texi (CTOR_INITIALIZER): Remove mention. Fix typo. Add
detail about the statement-tree.
1999-09-20 Nathan Sidwell <nathan@acm.org>
* parse.y (primary): Use build_functional_cast for CV_QUALIFIER.
1999-09-20 Nick Clifton <nickc@cygnus.com>
* decl2.c (lang_decode_option): Extend comment.
Mon Sep 20 10:49:05 1999 Bernd Schmidt <bernds@cygnus.co.uk>
* typeck.c: Include "tm_p.h".
1999-09-19 Mark Mitchell <mark@codesourcery.com>
* ir.texi: New file.
1999-09-19 Paul Burchard <burchard@pobox.com>
* semantics.c (expand_stmt): Initialize return value.
1999-09-18 Paul Burchard <burchard@pobox.com>
* gxxint.texi: G++ now implements namespaces.
1999-09-18 Mark Mitchell <mark@codesourcery.com>
* decl.c (pop_label): Don't warn about unused labels more than
once.
* semantics.c (finish_goto_stmt): Always marked used labels as
used.
* decl.c (layout_var_decl): Change prototype. Call layout_decl
even when the declaration is external.
(cp_finish_decl): Adjust call to layout_var_decl.
* pt.c (tsubst_expr): Make sure to initialize stmt before using it.
1999-09-18 Martin von Löwis <loewis@informatik.hu-berlin.de>
* typeck.c (get_member_function_from_ptrfunc): Always consider
virtuality inside member pointer.
1999-09-17 Mark Mitchell <mark@codesourcery.com>
Turn on function-at-a-time processing.
* cp-tree.h (doing_semantic_analysis_p): New macro.
(SF_DEFAULT): Define to zero, not SF_EXPAND.
(start_handler_parms): Change prototype.
(expand_start_catch_block): Likewise.
(expand_end_catch_block): Likewise.
(expand_start_eh_spec): Likewise.
(expand_end_eh_spec): Declare.
(finish_handler_parms): Change prototype.
(begin_catch_block): Declare.
(finish_handler): Change prototype.
(do_pushlevel): Declare.
(do_poplevel): Likewise.
* decl.c (pushlevel): Don't create
binding levels when not doing semantic analysis.
(poplevel): Don't pop them.
(pushdecl): Assert that we are never called when not doing
semantic analysis.
(pushdecl_top_level): Use push_to_top_level.
(make_label_decl): Don't fiddle with obstacks. Make RTL For the
label when expanding.
(cp_finish_decl): Only inject for-scope variables when doing
semantic analysis. Add comments.
(start_handler_parms): Return the handler parm.
(start_function): Reorganize. Don't clear DECL_INITIAL if it is
already set. Reinitialize from saved function data if available.
Don't pushlevel when not doing semantic analysis.
(store_parm_decls): Only generate RTL when expanding. Only
pushdecl when doing semantic analysis. Set
current_eh_spec_try_block if appropriate.
(finish_function): Simplify. Use do_pushlevel and do_poplevel.
Combine common code. Don't poplevel when not doing semantic
analysis.
(push_cp_function_context): Don't expand functions without an
explicit call to expand_body.
(mark_lang_function): Make eh_spec_try_block and
x_scope_stmt_stack.
* except.c (expand_end_eh_spec): Don't
declare.
(process_start_catch_block): Likewise.
(push_eh_cleanup): Use finish_decl_cleanup.
(initialize_handler_parm): New function.
(expand_start_catch_block): Use it.
(expand_end_catch_block): Use tree-generation functions, not
RTL-generation functions.
(expand_start_eh_spec): Likewise.
(expand_end_eh_spec): Likewise.
(expand_exception_blocks): Simplify.
(start_anon_func): Use do_pushlevel.
(end_anon_func): Use do_poplvel. Call expand_body for the
function.
* expr.c (do_case): Don't call define_case_label.
* init.c (create_temporary_var): Set DECL_CONTEXT for local
variables.
* method.c (emit_thunk): Call expand_body for the
thunk.
(sythesize_method): Likewise.
* parse.y (handler_args): Give it ttype.
(eat_saved_input): Call expand_body.
(base_init): Use do_pushlevel.
(pending_inline): Call expand_body.
(handler): Adjust calls to finish_handler_parms and
finish_handler.
(handler_args): Don't call expand_start_catch_block. Return the
catch parameter. * pt.c (tsubst_expr): Adjust HANDLER handling.
* parse.c: Regenerated.
* rtti.c (synthesize_tinfo_fn): Call finish_function.
* semantics.c (do_pushlevel): Give it external linkage. Build
SCOPE_STMTs.
(do_poplevel): Likewise.
(finish_case_label): Call define_case_label when doing semantic
analysis.
(finish_goto_stmt): Create RTL for labels.
(finish_function_try_block): Set in_function_try_handler
unconditionally.
(finish_function_handler_sequence): Unset it.
(finish_handler_parms): Use expand_start_catch_block even when
building a statement-tree.
(begin_catch_block): New function.
(finish_handler): Move a little RTL-generation logic here.
(finish_decl_cleanup): Allow cleanups for empty declarations.
(finish_named_return_value): Don't pushdecl when not doing
semantic analysis.
(expand_stmt): Don't do semantic analysis for variable
declarations. Handle START_CATCH_STMT. Call expand_label
directly for a LABEL_STMT. Tweak handling of GOTO_STMT. Adjust
HANDLERs. Handle SCOPE_STMT, CTOR_INITIALIZER, and RETURN_INIT.
(expand_body): Let expand_stmt handle CTOR_INITIALIZER,
RETURN_INIT and function try blocks.
* cp-tree.h (language_function): Add x_eh_spec_try_block. Add
x_scope_stmt_stack. Add x_in_charge_parm.
(current_eh_spec_try_block): New macro.
(current_scope_stmt_stack): Likewise.
(current_in_charge_parm): Likewise.
* decl.c (start_function): Initialize current_in_charge_parm.
(finish_function): Use current_in_charge_parm rather than looking
up __in_chrg.
* search.c (expand_indirect_vtbls_init): Likewise.
* cp-tree.def (CLEANUP_STMT): Fix spelling in dumps.
(TRY_BLOCK): Likewise.
(HANDLER): Likewise.
(START_CATCH_STMT): New tree node.
(SCOPE_STMT): Likewise.
* cp-tree.h (SCOPE_BEGIN_P): New macro.
(SCOPE_NULLIFIED_P): Likewise.
(struct lang_decl_flags): Add pending_inline_p. Adjust dummy.
(struct lang_decl): Add saved_language_function.
(DECL_PENDING_INLINE_INFO): Adjust documentation.
(DECL_PENDING_INLINE_P): New macro.
(TYPE_TI_ARGS): Fix typo in comment.
(DECL_SAVED_TREE): Add to documentation.
(DECL_SAVED_FUNCTION_DATA): New macro.
(START_CATCH_TYPE): Likewise.
(SCOPE_END_P): New macro.
(declare_parm_level): Don't declare.
* decl.c (mark_lang_function): New function, split out from
mark_cp_function_context.
(save_function_data): New function.
(declare_parm_level): Remove.
(finish_function): Use save_function_data to squirrel away
important stuff for later use.
(mark_cp_function_context): Use mark_function_data.
(lang_mark_tree): Likewise.
* lex.c (begin_definition_of_inclass_inline): Set
DECL_PENDING_INLINE_P.
(store_pending_inline): Clear it.
* pt.c (tsubst_decl): Likewise.
1999-09-17 Nathan Sidwell <nathan@acm.org>
* call.c (perform_implicit_conversion): Deal with error_mark_node.
1999-09-17 Mark Mitchell <mark@codesourcery.com>
* decl.c (warn_extern_redeclared_static): Don't get confused by
static member functions.
(duplicate_decls): Merge DECL_THIS_STATIC.
* decl.c (expand_static_init): Make sure assignments to local
statics actually occur.
1999-09-17 Mark Mitchell <mark@codesourcery.com>
* cp-tree.h (poplevel_class): Declare.
* class.c (popclass): Use poplevel_class, not poplevel.
* decl.c (poplevel_class): Don't make it static. Don't return a
value.
(poplevel): Don't call poplevel_class; abort in a class
binding level is seen.
* semantics.c (finish_translation_unit): Use pop_everything.
* parse.y (member_init): Allow errors.
(pending_inline): Call finish_function.
* parse.c: Regenerated.
* Makefile.in (CONFLICTS): Adjust.
1999-09-17 Gabriel Dos Reis <gdr@codesourcery.com>
* error.c: Reduce code duplication.
(dump_template_value): New function.
(dump_type_real): Use it.
(dump_decl): Likewise.
(dump_function_name): Likewise.
(dump_function_decl): Don't be too talkative about function return
type variety.
1999-09-16 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
* lex.c (init_cpp_parse): Call xcalloc, not malloc/bzero.
* xref.c (SALLOC): Call xstrdup, not xmalloc/strcpy.
1999-09-16 Jason Merrill <jason@yorick.cygnus.com>
* decl2.c (finish_file): Also call check_global_declarations for
the pending_statics list.
1999-09-15 Jason Merrill <jason@yorick.cygnus.com>
* lex.c (cp_pragma_implementation): Allow #pragma implementation
in header files.
1999-09-15 Richard Henderson <rth@cygnus.com>
* lex.c (mark_impl_file_chain): Follow the next chain.
1999-09-15 Mark Mitchell <mark@codesourcery.com>
* decl.c (warn_extern_redeclared_static): Simplify. Catch
problems with extern "C" functions redeclared as static.
(duplicate_decls): When a builtin is redeclared static, make the
new function have internal linkage.
1999-09-15 Mark Mitchell <mark@codesourcery.com>
* decl2.c (build_expr_from_tree): Handle VA_ARG_EXPR.
* pt.c (tsubst_copy): Likewise.
* tree.c (search_tree): Likewise.
(mapcar): Likewise.
1999-09-15 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
* typeck2.c (ack): Don't declare progname.
1999-09-14 Alexandre Oliva <oliva@lsd.ic.unicamp.br>
* lex.c (cp_pragma_interface, cp_pragma_implementation): Copy
filenames with ggc_alloc_string.
1999-09-14 Mark Mitchell <mark@codesourcery.com>
* decl.c (build_target_expr): Set TREE_SIDE_EFFECTS on the
TARGET_EXPR.
* call.c (build_over_call): Don't set TREE_SIDE_EFFECTS on
the TARGET_EXPR.
* cvt.c (build_up_reference): Likewise.
* tree.c (build_cplus_new): Likewise.
(get_target_expr): Likewise.
Tue Sep 14 01:45:10 1999 Marc Espie <espie@cvs.openbsd.org>
* Makefile.in: Prepend $(SHELL) to move-if-change calls.
1999-09-13 Mark Mitchell <mark@codesourcery.com>
* cp-tree.h (build_target_expr): New function.
* call.c (build_conditional_expr): Use build_target_expr.
(convert_like): Likewise.
(build_over_call): Likewise.
* cvt.c (build_up_reference): Likewise.
* decl.c (build_cleanup_on_safe_obstack): Fold into ...
(destroy_local_var): Here.
(build_target_expr): New function.
* tree.c (build_cplus_new): Use it.
(get_target_expr): Likewise.
1999-09-13 Nathan Sidwell <nathan@acm.org>
* typeck.c (expr_sizeof): Don't decay arrays and functions.
Remove misleading comment.
(build_compound_expr): Don't decay arrays.
1999-09-13 Jason Merrill <jason@yorick.cygnus.com>
* call.c (build_conditional_expr): Always use a TARGET_EXPR for
class rvalues again.
Sun Sep 12 23:29:07 1999 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
* Make-lang.in (g++spec.o): Depend on system.h and gcc.h.
* g++spec.c: Include gcc.h.
(lang_specific_driver): Constify a char*. Call xcalloc, not
xmalloc/bzero. All calls to the function pointer parameter now
explicitly call `fatal'.
1999-09-12 Mark Mitchell <mark@codesourcery.com>
* call.c (implicit_conversion): Robustify. Handle OFFSET_REFs.
* cvt.c (ocp_convert): Complete the from and destination types.
Adjust warning about functions always being `true' in conditionals.
* decl.c (duplicate_decls): Don't play funny games with abort.
* error.c (dump_expr): Handle OVERLOADs.
* spew.c (probe_obstack): Remove.
* typeck.c (condition_conversion): Use perform_implicit_conversion.
1999-09-12 Bernd Schmidt <bernds@cygnus.co.uk>
* cp-tree.h (auto_function, define_function): Adjust prototypes.
* decl.c (define_function): Lose FUNCTION_CODE arg. All callers
changed.
(auto_function): Likewise, for CODE arg.
Move code to set DECL_BUILT_IN and DECL_FUNCTION_CODE to...
(builtin_function): ... here.
1999-09-11 Mark Mitchell <mark@codesourcery.com>
* decl.c (add_decl_to_level): Remove TREE_PERMANENT assertion.
(init_decl_processing): Don't set TREE_PERMANENT for the
error_mark_node.
(start_decl): Don't rebuild non-permanent ARRAY_TYPEs.
(grokdeclarator): Likewise.
(grokparms): Don't check TREE_PERMANENT when building up lists.
* decl2.c (grokfield): Don't assert TREE_PERMANENT.
(mark_inline_for_output): Likewise.
* expr.c (cplus_expand_expr): Don't check TREE_PERMANENT.
* init.c (build_offset_ref): Don't check TREE_PERMANENT.
* lex.c (check_newline): Don't check ggc_p; it is always one.
* pt.c (process_template_parm): Don't check TREE_PERMANENT.
* spew.c (yylex): Don't copy_node or probe_obstacks for
non-permanent CONSTANTs and STRINGs.
* tree.c (build_cplus_array_type_1): Don't fuss with
TREE_PERMANENT on ARRAY_TYPEs.
* cp-tree.def (CLEANUP_STMT): New node.
* cp-tree.h (language_function): Add name_declared.
(current_function_name_declared): New macro.
(CLEANUP_DECL): New macro.
(CLEANUP_EXPR): Likewise.
(emit_local_var): Likewise.
(finish_decl_cleanup): New function.
* cvt.c (build_up_reference): Simplify.
(ocp_convert): Remove dead code.
* decl.c (start_decl): Remove call to add_decl_stmt.
(grok_reference_init): Adjust, to handle bindings temporaries to
references. Remove dead code.
(initialize_local_var): Don't generate RTL for
declarations here, or build cleanups here. Don't fuss with
obstacks. Replace expand_start_target_temps calls with explicit
setting of stms_are_full_exprs_p.
(destroy_local_var): New function.
(emit_local_var): Likewise.
(cp_finish_decl): Use them, as appropriate.
(start_function): Announce template functions.
(store_parm_decls): Don't call declare_function_name here.
(finish_stmt): Don't start emit base-initialization code when just
building the statement-tree.
* init.c (create_temporary_var): Move add_decl_stmt call ...
(get_temp_regvar): Here.
* pt.c (tsubst_expr): Make DECL_INITIAL look like what
cp_finish_decl would expect. Don't call add_decl_stmt.
* semantics.c (begin_compound_stmt): Call declare_function_name,
if appropriate.
(finish_decl_cleanup): New function.
(expand_stmt): Use emit_local_var to output variables.
(expand_body): Set current_function_name_declared.
1999-09-10 Mark Mitchell <mark@codesourcery.com>
* cp-tree.h (finish_cleanup_try_block): New function.
* semantics.c (finish_cleanup_try_block): Add comment.
Fri Sep 10 10:32:32 1999 Bernd Schmidt <bernds@cygnus.co.uk>
* cp-tree.h: Delete declarations for all tree nodes now moved to
global_trees.
* decl.c: Delete their definitions.
(SHORT_TYPE_SIZE, INT_TYPE_SIZE, LONG_TYPE_SIZE, LONG_LONG_TYPE_SIZE,
FLOAT_TYPE_SIZE, DOUBLE_TYPE_SIZE, LONG_DOUBLE_TYPE_SIZE): Don't
provide defaults.
(init_decl_processing): Call build_common_tree_nodes and
build_common_tree_nodes_2 instead of building their nodes here.
Don't add gc roots for them.
1999-09-10 Mark Mitchell <mark@codesourcery.com>
* cp-tree.h (language_function): Rename expanding_p to
x_expanding_p. Rename named_label_uses to x_named_label_uses.
(expanding_p): Adjust accordingly.
(TREE_VIA_PRIVATE): Fix typo in comment.
(DECL_REFERENCE_SLOT): Remove.
(SET_DECL_REFERENCE_SLOT): Likewise.
* decl.c (named_label_uses): Adjust. Remove chicken comment.
(push_overloaded_decl): Don't truncate the chain of bindings when
adding an overloaded function.
(grok_reference_init): Don't use DECL_REFERENCE_SLOT.
(initialize_local_var): Fix typo in comment.
(store_parm_decls): Don't set DECL_REFERENCE_SLOT. Tidy up.
* decl2.c (start_objects): Make the fact that we are expanding
the generated function right away explicit.
(start_static_storage_duration_function): Likewise.
(finish_file): Fix typo in comment.
* init.c (build_vec_init): Correct bugs in handling cleanups.
* semantics.c (maybe_convert_cond): New function.
(FINISH_COND): Always store the condition, even if there's
a declaration.
(finish_if_stmt_cond): Use maybe_convert_cond.
(finish_while_stmt_cond): Likewise.
(finish_do_stmt): Likewise.
(finish_for_cond): Likewise.
(expand_cond): Adjust.
* cp-tree.h (FN_TRY_BLOCK_P): New macro.
* init.c (perform_member_init): Remove obstack machinations.
(expand_cleanup_for_base): Likewise.
(finish_init_stmts): Mark the statement-expression as used.
* method.c (emit_thunk): Use tree-generating functions, not
RTL.
(do_build_copy_constructor): Likewise.
(do_build_assign_ref): Likewise.
(synthesize_method): Likewise. Keep track of line numbers.
* pt.c (tsubst_expr): Handle various kinds of try blocks.
* semantics.c (expand_stmts): Remove.
(begin_function_try_block): Set FN_TRY_BLOCK_P.
(finish_function_try_block): Be careful rechaining
function try blocks.
(expand_stmt): Loop through all the statements at a given level.
(exapnd_body): Be careful with line-numbers here too. Prepare for
being called directly from the parser.
* cp-tree.h (finish_function): Adjust prototype.
* decl.c (finish_function): Return the function compiled.
* pt.c (instantiate_decl): Don't play games with obstacks.
* tree.c (mapcar): Handle OFFSET_REF and BIT_FIELD_REF.
(search_tree): Likewise.
* typeck.c: Fix typo in comment.
* typeck2.c (store_init_value): Add comment.
* cp-tree.h (CPTI_ATEXIT): New macro.
(atexit_node): Likewise.
* decl.c (destroy_local_static): New function, broken out from ...
(expand_static_init): Here.
* rtti.c (get_tinfo_var): These should always be global
(expand_si_desc): Use tree, not RTL, functions to generate code.
(expand_class_desc): Likewise.
(expand_ptr_desc): Likewise.
(expand_attr_desc): Likewise.
(expand_generic_desc): Likewise.
(synthesize_tinfo_fn): Likewise.
1999-09-09 Mark Mitchell <mark@codesourcery.com>
* semantics.c (RECHAIN_STMTS): Remove `last' parameter.
(RECHAIN_STMTS_FROM_LAST): Remove. Replace all uses with
RECHAIN_STMTS.
(RECHAIN_STMST_FROM_CHAIN): Likewise.
* parse.y (simple_stmt): Fix typo in last change.
* cp-tree.h (EXPR_STMT_ASSIGNS_THIS): New macro.
(STMT_IS_FULL_EXPR_P): Likewise.
(STMT_LINENO_FOR_FN_P): Likewise.
(prep_stmt): New function.
(building_stmt_tree): Tweak for safety.
* pt.c (tsubst_expr): Use prep_stmt throughout.
(add_tree): Move it to semantics.c
* semantics.c (add_tree): Move it here.
(finish_expr_stmt_real): New function.
(finish_expr_stmt): Use it.
(finish_if_stmt_cond): Use FINISH_COND.
(finish_while_stmt_cond): Likewise.
(finish_for_cond): Likewise.
(finish_stmt_tree): Tweak line-number handling.
(prep_stmt): New function.
(expand_stmt): Use it.
* cp-tree.h (begin_switch_stmt): Adjust prototype.
(finish_switch_cond): Likewise.
* parse.y (simple_stmt): Adjust accordingly.
* parse.c: Regenerated.
* pt.c (tsubst_expr): Adjust accordingly.
* semantics.c (expand_cond): New function.
(FINISH_COND): New macro.
(begin_switch_stmt): Build the SWITCH_STMT here.
(finish_switch_stmt_cond): Not here.
(expand_stmt): Adjust calls to begin_switch_stmt and
finish_switch_cond. Use expand_cond throughout.
* dump.c (dequeue_and_dump): Dump types for constants.
Describe DECL_ARG_TYPE more intuitively.
Handle ARRAY_REF.
* decl.c (lang_mark_tree): Mark TYPE_LANG_SPECIFIC.
(lang_cleanup_tree): Remove.
* lex.c (make_lang_type): Use ggc_alloc to allocate
TYPE_LANG_SPECIFIC.
Reorganize per-function data.
* cp-tree.h (saved_scope): Add function_decl, bindings.
(language_function): Rename binding_level to bindings.
(cp_function_chain): Use the current_function, not the
outer_function_chain.
(current_class_ptr): Make it work, even when there's no
current function.
(current_class_ref): Likewise.
(SF_DEFAULT, SF_PRE_PARSED, SF_INCLASS_INLINE, SF_EXPAND): New
macros.
(clear_temp_name): Remove.
* decl.c (check_function_type): New function, broken out from
start_function.
(current_binding_level): Adjust definition.
(pushlevel): Simplify.
(poplevel): Don't use named_label_uses when we're outside
a function scope.
(mark_saved_scope): Mark function_decl and bindings.
(maybe_push_to_top_level): Don't unconditionally push a new
function context. Save bindings and the current_function_decl.
Don't clear named_labels.
(pop_from_top_level): Pop function context if appropriate.
(init_decl_processing): Set init_lang_status and free_lang_status,
rather than save_lang_status and restore_lang_status.
(start_function): Take SF_* flags. Don't clear per-function data.
Reorder and simplify to use new per-function data code. Add
asserts.
(store_parm_decls): Don't call init_function_start here.
(finish_function): Adjust for new handling of per-function data.
(push_cp_function_context): Simplify.
(mark_cp_function_context): Change binding_level to bindings.
* decl2.c (clear_temp_name): Remove.
(start_objects): Use SF flags to start_function.
(start_static_storage_duration_function): Likewise.
* except.c (start_anon_func): Remove redundant calls to
push_function_context_to. Use SF flags to start function.
(end_anon_func): Remove redundant call to pop_function_context
from.
* lex.c (reinit_parse_for_function): Don't initialize per-function
data.
* method.c (emit_thunk): Clear current_function after calling
assemble_end_function. Use SF flags for start_function.
(synthesize_method): Use SF flags for start_function.
* parse.c: Regenerated.
* parse.y (fn.defpen): Likewise.
(pending_inline): Clear current_function, even if something goes
wrong.
* pt.c (instantiate_decl): Use SF flags to start_function.
Don't save and restore expanding_p.
(add_tree): Handle the case where we are outside any function.
(end_tree): Likewise.
* rtti.c (sythesize_tinfo_fn): Use SF flags to start_function.
* semantics.c (begin_function_definition): Likewise.
(expand_body): Likewise.
1999-09-09 Nathan Sidwell <nathan@acm.org>
* cp-tree.h (convert_to_void): Prototype new function.
(require_complete_type_in_void): Remove prototype.
* cvt.c (convert_to_void): New function.
(ocp_convert): Use convert_to_void.
* decl.c (cplus_expand_expr_stmt): Likewise, for complete
expressions.
* typeck.c (require_complete_type_in_void): Remove function.
(build_compound_expr): Use convert_to_void.
(build_static_cast): Likewise.
(build_c_cast): Likewise.
* semantics.c (finish_expr_stmt): Do not decay full expressions.
* typeck.c (build_x_compound_expr): Add FIXME.
1999-09-08 Mark Mitchell <mark@codesourcery.com>
* cp-tree.h (scratch_tree_cons): Remove.
* call.c: Replace all uses of expr_tree_cons, saveable_tree_cons,
and perm_tree_cons with plain tree_cons.
* class.c: Likewise.
* decl.c: Likewise.
* decl2.c: Likewise.
* except.c: Likewise.
* expr.c: Likewise.
* init.c: Likewise.
* lex.c: Likewise.
* method.c: Likewise.
* parse.y: Likewise.
* pt.c: Likewise.
* repo.c: Likewise.
* rtti.c: Likewise.
* search.c: Likewise.
* typeck.c: Likewise.
* parse.c: Regenerated.
* tree.c (build_srcloc): Simplify.
1999-09-08 Bruce Korb autogen@linuxbox.com
* Makefile.in: Give the gperf user a hint about why "gperf -F" fails.
1999-09-08 Mark Mitchell <mark@codesourcery.com>
* cp-tree.h (lang_decl_flags): Remove permanent_attr.
Remove next.
(LANG_DECL_PERMANENT): Remove.
* decl.c (duplicate_decls): Don't mess about with obstacks trying
to free memory.
(lang_mark_tree): Mark DECL_LANG_SPECIFIC.
* lex.c (free_lang_decl_chain): Remove.
(build_lang_decl): Don't use obstacks.
(retrofit_lang_decl): Likewise.
(copy_lang_decl): Likewise.
* cp-tree.h (saved_scope): Remove old_binding_level and
function_decl. Tidy up.
* decl.c (mark_saved_scope): Don't set them.
(maybe_push_to_top_level): Clear memory.
* decl.c (layout_var_decl): Change prototype. Don't complete
types for external objects.
(check_initializer): Likewise. Tidy.
(initialize_local_var): Complete types here.
(cp_finish_decl): Not here. Reorganize a little.
(grokvardecl): Don't complete types here.
* decl.c (start_function): Clear last_dtor_insn and
last_parm_cleanup_insn.
(push_cp_function_context): Just copy over a little of
the old context, not all of it.
* cp-tree.h (copy_to_permanent): Remove.
(permanent_p): Likewise.
* decl.c (building_typename_type): Don't use copy_to_permanent.
(start_decl): Likewise.
(grok_reference_init): Likewise.
(cp_finish_decl): Likewise.
* init.c (build_new_1): Don't use mapcar.
(build_vec_delete_1): Don't use copy_to_permanent.
(build_vec_init): Likewise.
* parse.y (primary): Likewise.
* parse.c: Regenerated.
* pt.c (push_template_decl_real): Don't use copy_to_permanent.
(lookup_template_class): Likewise.
(tsubst_friend_function): Likewise.
(instantiate_class_template): Likewise.
(tsubst_decl): Likewise.
(tsubst): Likewise.
(instantiate_template): Likewise.
(unify): Likewise.
* rtti.c (get_tinfo_fn): Likewise.
(build_dynamic_cast): Likewise.
* semantics.c (finish_if_stmt_cond): Likewise.
(finish_while_stmt_cond): Likewise.
(finish_do_stmt): Likewise.
(finish_for_cond): Likewise.
(finish_for_expr): Likewise.
(finish_cleanup): Likewise.
(add_decl_stmt): Likewise.
(finish_named_return_value): Likewise.
(finish_qualified_call_expr): Likewise.
* tree.c (perm_manip): Remove.
(build_exception_variant): Don't use copy_to_permanent.
(permanent_p): Remove.
(copy_to_permament): Remove.
(build_min_nt): Don't use copy_to_permanent.
(build_min): Likewise.
(min_tree_cons): Likewise.
* typeckc.c (build_static_cast): Likewise.
(build_reinterpret_cast): Likewise.
(build_const_cast): Likewise.
1999-09-07 Mark Mitchell <mark@codesourcery.com>
* decl.c (ggc_p): Set it to 1.
(mark_saved_scope): Add prototype.
1999-09-07 Richard Henderson <rth@cygnus.com>
* cp-tree.h (C_PROMOTING_INTEGER_TYPE_P): Delete.
* typeck.c (self_promoting_args_p): Delete.
1999-09-07 Jason Merrill <jason@yorick.cygnus.com>
* search.c (binfo_for_vtable): Use CLASSTYPE_VFIELD_PARENT.
(dfs_bfv_queue_p, dfs_bfv_helper, struct bfv_info): Remove.
1999-09-07 Mark Mitchell <mark@codesourcery.com>
* Makefile.in (tree.o): Depend on ggc.h.
* class.c (make_method_vec): Remove.
(free_method_vec): Likewise.
(free_method_vecs): Remove.
(add_method): Don't use them.
* cp-tree.def (PTRMEM_CST): Make it longer.
(TEMPLATE_PARM_INDEX): Make it shorter.
* cp-tree.h (BINDING_HAS_LEVEL_P): New macro.
(template_parm_index): Remove RTL field.
(ptrmem_cst): Add RTL field.
(finish_function): Removed parameter.
(process_next_inline): Change prototype.
(init_cplus_unsave): Rename to init_tree.
(binding_init): Remove.
* decl.c (free_binding_nodes): Remove.
(push_binding): Don't use them. Set BINDING_HAS_LEVEL_P.
(pop_binding): Don't use free_binding_nodes.
(free_binding_vecs): Remove.
(store_bindings): Don't use them.
(pop_from_top_level): Likewise.
(lookup_namespace_name): Simplify.
(build_typename_type): Don't use obstack_free.
(unqualified_namespace_lookup): Simplify.
(lookup_name_real): Simplify.
(start_function): Remove comment about leaks.
(finish_function): Removed nested parameter. Call
expand_end_bindings even when building_stmt_tree.
Call ggc_push_context and ggc_pop_context around
rest_of_compilation, if necessary.
(mark_cp_function_context): Handle a NULL language-context.
(lang_mark_false_label_stack): Fix typo.
(lang_mark_tree): Handle CPLUS_BINDING, OVERLOAD,
TEMPLATE_PARM_INDEX. Handle the funny TYPE_LANG_SPECIFIC on
pointer to method types.
(lang_cleanup_tree): Use free to free TYPE_LANG_SPECIFIC.
* decl2.c (finish_objects): Adjust call to finish_function.
(finish_static_store_duration_function): Likewise.
(do_nonmember_using_decl): Remove call to binding_init.
* except.c (end_anon_func): Adjust call to finish_function.
* lex.c (mark_impl_file_chain): New function.
(init_parse): Call init_tree, not init_cplus_unsave.
Add GC roots.
(cp_pramga_interface): Use xmalloc, not permalloc.
(cp_pragma_implementation): Likewise.
(begin_definition_of_inclass_inline): Simplify.
(process_next_inline): Adjust prototype.
(do_scoped_id): Don't call binding_init.
(make_lang_type): Allocate TYPE_LANG_SPECIFIC with xmalloc.
* method.c (emit_thunk): Adjust call to finish_function.
(synthesize_method): Likewise.
* parse.y (%union): Add a new `pi' variant.
(PRE_PARSED_FUNCTION_DECL): Use it.
(fn.defpen): Likewise.
(fndef): Adjust call to finish_function.
* pt.c (instantiate_decl): Likewise.
* rtti.c (syntheisze_tinfo_fn): Likewise.
* semantics.c (expand_body): Likewise.
* tree.c: Include ggc.h.
(mark_list_hash): New function.
(binding_init): Remove.
(init_cplus_unsave): Rename to ...
(init_tree): This. Add GC roots.
1999-09-05 Mark Mitchell <mark@codesourcery.com>
Get ready for garbage collection.
* Makefile.in (CXX_TREE_H): Add varray.h
(lex.o): Depend on ggc.h.
(decl.o): Likewise.
(decl2.o): Likewise.
(method.o): Likewise.
(search.o): Likewise.
(pt.o): Likewise.
(repo.o): Likewise.
* class.c: Include ggc.h.
(current_class_name): Remove.
(current_class_type): Likewise.
(current_access_specifier): Likewise.
(previous_class_type): Likewise.
(previous_class_values): Likewise.
(class_cache_firstobj): Likewise.
(current_lang_base): Likewise.
(current_lang_stack): Likewise.
(current_lang_stacksize): Likewise.
(lang_name_c): Likewise.
(lang_name_cplusplus): Likewise.
(lang_name_java): Likewise.
(current_lang_name): Likewise.
(base_layout_decl): Likewise.
(access_default_node): Likewise.
(access_public_node): Likewise.
(access_protected_node): Likewise.
(access_private_node): Likewise.
(access_default_virtual_node): Likewise.
(access_public_virtual_node): Likewise.
(access_protected_virtual_node): Likewise.
(access_private_virtual_node): Likewise.
(signed_zero_node): Likewise.
(init_class_processing): Don't build base_layout_decl.
(push_lang_context): Adjust now that current_lang_base is a varray.
(pop_lang_context): Likewise.
* cp-tree.h: Include varray.h.
(cp_global_trees): Add access_default, access_public,
access_protected, access_private, access_default_virtual,
access_public_virtual, access_protected_virtual,
access_private_virtual, ctor_identifier, delta2_identifier,
delta_identifier, dtor_identifier, in_charge_identifier,
index_identifier, nelts_identifier, this_identifier,
pfn_identifier, pfn_or_delta2_identifier, vptr_identifier,
lang_name_c, lang_name_cplusplus, lang_name_java,
empty_except_spec, null, jclass, minus_one, terminate.
(saved_scope): Move here from decl.c. Define globals in terms of
saved_scope: current_namespace, current_class_name,
current_class_type, current_access_specifier, current_lang_stack,
current_lang_base, current_lang_name, current_function_parms,
current_template_parms, processing_template_decl,
processing_specialization, processing_explicit_instantiation,
previous_class_type, previous_class_values, class_cache_firstobj.
(scope_chain): New variable.
(init_pt): New function.
* decl.c (current_namespace): Remove.
(this_identifier, in_charge_identifier, ctor_identifier): Likewise.
(dtor_identifier, pfn_identifier, index_identifier): Likewise.
(delta_identifier, delta2_identifier): Likewise.
(pfn_or_delta2_identifier, tag_identifier): Likewise
(vt_off_identifier, empty_except_spec, null_node): Likewise.
(current_function_parms, current_lang_base): Remove.
(current_lang_stack, previous_class_values): Remove.
(class_binding_level): Macroize.
(saved_scope): Remove.
(current_saved_scope): Rename to scope_chain.
(mark_saved_scope): Adjust for new scope structure.
(maybe_push_to_top_level): Likewise.
(pop_from_top_level): Likewise.
(duplicate_decls): Adjust now that current_lang_base is a varray.
(build_typename_type): Call ggc_add_tree_hash_table_root.
(init_decl_processing): Call init_pt. Call push_to_top_level to
set up globals. Add GC roots.
(xref_basetypes): Adjust now that current_lang_base is a varray.
* decl.h (this_identifier): Remove.
(in_charge_identifier): Likewise.
* decl2.c: Don't include varray.h.
(current_namespace): Remove.
(init_decl2): Add GC roots.
* except.c (Terminate): Remove.
(init_exception_processing): Use terminate_node instead.
(build_terminate_handler): Likewise.
* init.c (nc_nelts_field_id): Remove.
(minus_one): Likewise.
(init_init_processing): Use minus_one_node and nelts_identifier
instead. Add GC roots.
(jclass_node): Remove.
(build_new_1): Use nelts_identifier.
(build_vec_init): Likewise.
(build_vec_delete): Likewise.
* lex.c: Include ggc.h.
(defarg_fn): Move declaration early.
(defarg_parms): Likewise.
(init_parse): Add GC roots.
(handle_cp_pragma): Remove redundant declaration of
pending_vtables.
* method.c: Include ggc.h.
(btypelist): Make it a varray. All uses changed.
(ktypelist): Likewise.
(init_method): Add GC roots.
* pt.c: Don't include varray.h. Include ggc.h.
(current_template_parms): Remove.
(processing_template_decl): Likewise.
(processing_specialization): Likewise.
(processing_explicit_instantiation): Likewise.
(init_pt): New function.
* repo.c: Include ggc.h.
(init_repo): Add GC roots.
* search.c: Don't include varray.h.
(_vptr_name): Remove.
(lookup_field_1): Use vtpr_identifier instead.
(expand_indirect_vtbls_init): Remove redundant declaration of
in_charge_identifier.
(init_search_processing): Use vptr_identifier.
1999-09-05 Richard Henderson <rth@cygnus.com>
Bernd Schmidt <bernds@cygnus.co.uk>
Mark Mitchell <mark@codesourcery.com>
* Makefile.in (parse.o): Depend on ggc.h.
(decl2.o): Depend on ggc.h.
(init.o): Depend on ggc.h.
* cp-tree.h (init_decl2): Declare.
(cp_parse_init): Likewise.
* decl.c (ggc_p): Define to zero.
(mark_saved_scope): New function.
(init_decl_processing): Call cp_parse_init, and cp_decl2.
Register GC roots.
(expand_static_init): Add GC roots.
* decl2.c: Include ggc.h.
(init_decl2): New function.
* init.c: Include ggc.h.
(init_init_processing): Add GC roots.
* parse.y: Include ggc.h.
(cp_parse_init): New function.
1999-09-04 Mark Mitchell <mark@codesourcery.com>
* decl.c (init_decl_processing): Set mark_lang_status.
(lang_mark_false_label_stack): Adjust prototype.
* decl2.c (grok_function_init): Remove extraneous declaration of
abort_fndecl.
* Make-lang.in (cc1plus): Remove dependency on GGC.
* Makefile.in (OBJS): Don't mention ggc-simple.o.
(OBJDEPS): Don't mention ggc-simple.o.
* Make-lang.in (cc1plus): Depend on $(GGC).
* Makefile.in (OBJS): Add ggc-simple.o.
(OBJDEPS): Likewise.
* cp-tree.h (language_function): Rename members to `x_' versions;
we now have x_named_labels, x_ctor_label, x_dtor_label,
x_base_init_list, x_member_init_list, x_base_init_expr,
x_current_class_ptr, x_current_class_ref, x_last_tree,
x_last_expr_type, x_last_dtor_insn, x_last_parm_cleanup_insn, and
x_result_rtx.
(dtor_label, ctor_label, current_base_init_list,
current_member_init_list, base_init_expr, current_class_ptr,
current_class_ref, last_tree, last_expr_type): Adjust accordingly.
* decl.c: Include ggc.h.
(last_dtor_insn): Adjust to use x_ names.
(last_parm_cleanup_insn): Likewise.
(original_result_rtx): Likewise.
(named_labels): Likewise.
(mark_binding_level): New function.
(mark_cp_function_context): Likewise.
(mark_false_label_stack): Likewise.
(lang_mark_tree): Likewise.
(lang_cleanup_tree): Likewise.
1999-09-03 Mark Mitchell <mark@codesourcery.com>
* Makefile.in (CXX_TREE_H): Include function.h.
(decl.o): Don't depend on function.h.
(decl2.o): Likewise.
(typeck.o): Likewise.
(init.o): Likewise.
(method.o): Likewise.
* cp-tree.h: Include function.h.
(cp_function): Rename to language_function. Remove next.
(cp_function_chain): Make it a macro, not a variable.
(push_cp_function_context): Don't declare.
(pop_cp_function_context): Likewise.
* decl.c: Don't include function.h.
(push_cp_function_context): Make it static. Make it suitable for
a save_lang_status callback.
(pop_cp_function_context): Likewise.
(maybe_push_to_top_level): Call push_function_context_to, not
push_cp_function_context.
(pop_from_top_level): Call pop_function_context_from, not
pop_cp_function_context.
(init_decl_processing): Set save_lang_status and
restore_lang_status. Call push_function_context_to, not
push_cp_function_context.
(cp_function_chain): Remove.
* decl2.c: Don't include function.h.
* except.c: Don't include function.h.
(start_anon_func): Call push_function_context_to, not
push_cp_function_context.
(end_anon_func): Call pop_function_context_from, not
pop_cp_function_context.
* init.c: Don't include function.h.
* lex.c (begin_definition_of_inclass_inline): Call
push_function_context_to, not push_cp_function_context.
(process_next_inline): Call pop_function_context_from, not
pop_cp_function_context.
* method.c: Don't include function.h.
(synthesize_method): Call push_function_context_to, not
push_cp_function_context. Call pop_function_context_from, not
pop_cp_function_context.
* typeck.c: Don't include function.h.
* decl.c (expand_static_init): Tweak handling of static
initializations for objects without constructors.
1999-09-03 Nathan Sidwell <nathan@acm.org>
* typeck.c (build_indirect_ref): Reject dereference of pointer to
void.
1999-09-02 Mark Mitchell <mark@codesourcery.com>
* cp-tree.h (cp_function): Move here, from decl.c.
(cp_function_chain): Declare.
(dtor_label): New macro, instead of variable.
(ctor_label): Likewise.
(current_base_init_list): Likewise.
(current_member_init_list): Likewise.
(base_init_expr): Likewise.
(current_class_ptr): Likewise.
(current_class_ref): Likewise.
(last_tree): Likewise.
(last_expr_type): Likewise.
(current_function_returns_value): Likewise.
(current_function_returns_null): Likewise.
(current_function_just_assigned_this): Likewise.
(current_function_parms_stored): Likewise.
(temp_name_counter): Likewise.
(static_labelno): Likewise.
(expanding_p): Likewise.
(stmts_are_full_exprs_p): Likewise.
(in_function_try_handler): Likewise.
(lang_type): Remove nested type_flags. All uses changed.
* call.c (ctor_label): Remove.
(dtor_label): Likewise.
* class.c (current_class_ptr): Remove.
(current_class_ref): Likewise.
* decl.c (static_labelno): Remove.
(dtor_label): Likewise.
(last_dtor_insn): New macro, instead of variable.
(last_parm_cleanup_insn): Likewise.
(original_result_rtx): Likewise.
(in_function_try_handler): Remove.
(named_label_uses): New macro, instead of variable.
(named_labels): Likewise.
(current_function_returns_value): Remove.
(current_function_returns_null): Likewise.
(current_function_assigns_this): New macro, instead of variable.
(current_function_just_assigned_this): Likewise.
(current_binding_level): Likewise.
(init_decl_processing): Call push_cp_function_context.
(cp_function): Move to cp-tree.h
(cp_function_chain): Make it global.
(temp_name_counter): Remove.
(push_cp_function_context): Simplify.
(pop_cp_function_context): Likewise.
* decl2.c (temp_name_counter): Remove.
* init_c (current_base_init_list): Likewise.
(current_member_init_list): Likewise.
(base_init_expr): Likewise.
* method.c (static_labelno): Likewise.
* pt.c (last_tree): Likewise.
* semantics.c (expanding_p): Likewise.
(stmts_are_full_exprs_p): Likewise.
(last_expr_type): Likewise.
* typeck.c (dtor_label): Likewise.
(ctor_label): Likewise.
1999-09-01 Alex Samuel <samuel@codesourcery.com>
* decl2.c (arg_assoc_template_arg): New prototype. New function.
(arg_assoc_class): Use arg_assoc_template_arg for template
arguments.
(arg_assoc): Likewise.
* pt.c (mangle_class_name_for_template): Allow member template
template arguments.
1999-09-02 Nathan Sidwell <nathan@acm.org>
* call.c (build_conditional_expr): Warn on enum mismatches.
(convert_arg_to_ellipsis): Move non-pod check to after
conversion.
1999-09-01 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
* gxx.gperf (hash, is_reserved_word): Add prototypes.
* init.c (build_vec_init): Initialize variable `try_block'.
* lex.c (init_parse): Call memcpy, not bcopy, to avoid casts.
Likewise for bzero/memset.
(token_getch, token_put_back): Add static prototypes. Remove
`inline' from the definitions.
(retrofit_lang_decl): Call memset, not bzero, to avoid casts.
1999-09-01 Mark Mitchell <mark@codesourcery.com>
* cp-tree.h (lang_type): Move align into type_flags.
(CLASSTYPE_ALIGN): Adjust accordingly.
* call.c (direct_reference_binding): Remove misleading comment.
1999-08-30 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
* parse.y (language_string): Constify.
1999-08-30 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
* repo.c (getpwd): Don't prototype.
* xref.c (getpwd): Likewise
1999-08-30 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
* Makefile.in (LIBS, LIBDEPS): Link with & depend on libiberty.a.
Remove hacks for stuff which now comes from libiberty.
1999-08-30 Jason Merrill <jason@yorick.cygnus.com>
* cp-tree.h (IS_AGGR_TYPE_2): Fix typo.
1999-08-30 Mark Mitchell <mark@codesourcery.com>
* cp-tree.h (begin_init_stmts): Declare.
(finish_init_stmts): Likewise.
* cvt.c (build_up_reference): Wrap the declaration of a temporary
in a statement-expression so that we will see it when expanding
tree structure later.
* init.c (begin_init_stmts): Don't make it static.
(finish_init_stmts): Likewise.
* cp-tree.h (start_handler_parms): New function.
(expand_start_catch_block): Take only one parameter.
(start_handler_parms): New function.
* decl.c (start_handler_parms): Define it.
* except.c (process_start_catch_block): Take only one parameter.
Don't call grokdeclarator here.
(expand_start_catch_block): Don't call grokdeclarator here,
either.
* parse.y (handler_args): Adjust call to
expand_start_catch_block. Use start_handler_parms.
* pt.c (push_template_decl_real): Make permanent lists have
permanent elements.
(tsubst_expr): Adjust calls to expand_start_catch_block
appropriately.
* semantics.c (expand_stmt): Likewise.
1999-08-29 Alex Samuel <samuel@codesourcery.com>
* pt.c (push_template_decl_real): Use template declaration from
class type if it exists.
1999-08-29 Mark Mitchell <mark@codesourcery.com>
* cp-tree.h (TYPE_NEEDS_CONSTRUCTING): Remove #if 0'd definition.
(maybe_inject_for_scope_var): Declare it.
(initialize_local_var): Likewise.
* decl.c (maybe_inject_for_scope_var): Make it global.
(initialize_local_var): Likewise. Move cleanup handling here,
from cp_finish_decl.
(make_rtl_for_nonlocal_decl): Use
push_obstacks_nochange/pop_obstacks, rather than
end_temporary_allocation/resume_temporary_allocation.
(cp_finish_decl): Try to complete the type of a variable when it
is declared. Move cleanup-handling to initialize_local_var.
(expand_static_init): Use tree-building code, rather than
RTL-building code.
* decl2.c (get_temp_name): Assert non-initializedness of
temporaries.
* init.c (create_temporary_var): Move RTL-assigning code to ...
(get_temp_regvar): Here.
* pt.c (tsbust_expr): Fix indentation. Call cp_finish_decl here.
* semantics.c (expand_stmt): Don't call cp_finish_decl here. Just
call initialize_local_var to generate initialization code.
1999-08-29 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
* cp-tree.h (fndecl_as_string, type_as_string,
type_as_string_real, args_as_string, decl_as_string,
expr_as_string, code_as_string, language_as_string,
parm_as_string, op_as_string, assop_as_string, cv_as_string,
lang_decl_name, cp_file_of, lang_printable_name): Constify a char*.
* errfn.c (cp_printer): Likewise.
* error.c (cp_printer, fndecl_as_string, type_as_string_real,
type_as_string, expr_as_string, decl_as_string, lang_decl_name,
cp_file_of, code_as_string, language_as_string, parm_as_string,
op_as_string, assop_as_string, args_as_string, cv_as_string):
Likewise.
* tree.c (lang_printable_name): Likewise.
1999-08-28 Richard Henderson <rth@cygnus.com>
* decl2.c (arg_assoc_class): Bail if the class is a builtin type.
1999-08-28 Mark Mitchell <mark@codesourcery.com>
* cp-tree.h (strip_array_types): New function.
* decl.c (maybe_deduce_size_from_array_init): New function, split
out from cp_finish_decl.
(layout_var_decl): Likewise.
(maybe_commonize_var): Likewise.
(maybe_inject_for_scope_var): Likewise.
(initialize_local_var): Likewise.
(build_cleanup_on_safe_obstack): Likewise.
(check_initializer): Likewise.
(make_rtl_for_nonlocal_decl): Likewise.
(cp_finish_decl): Use them.
* typeck.c (strip_array_types): New function.
* cp-tree.def (LABEL_STMT): New tree node.
* cp-tree.h (LABEL_STMT_LABEL): New macro.
(shadow_label): Remove.
(declare_local_label): New function.
(finish_label_decl): Likewise.
* decl.c (make_label_decl): New function, split out from
lookup_label.
(shadowed_labels): Remove.
(binding_level): Add shadowed_labels.
(clear_binding_level): Remove.
(push_binding_level): Just bzero the new binding level.
(pushlevel): Fix indentation.
(pop_label): New function.
(pop_labels): Likewise, split out from poplevel.
(poplevel): Pop local labels. Use pop_labels.
(maybe_push_to_top_level): Don't clear shadowed_labels.
(lookup_label): Use make_label_decl.
(shadow_label): Remove.
(declare_local_label): New function.
(define_label): Simplify.
(start_function): Don't clear shadowed_labels.
(cp_function): Remove shadowed_labels.
(push_cp_function_context): Don't save shadowed_labels.
(pop_cp_function_context): Don't restore it.
* dump.c (dequeue_and_dump): Handle LABEL_STMT.
* parse.y (label_decl): Use finish_label_decl.
* pt.c (tsubst_expr): Handle LABEL_STMTs, and local label
declarations.
* semantics.c (finish_label_stmt): Add a LABEL_STMT when
building_stmt_tree.
(finish_label_decl): New function.
(expand_stmt): Handle LABEL_STMTs and local label declarations.
1999-08-26 Mark Mitchell <mark@codesourcery.com>
* decl.c (lookup_label): Build labels on the permanent obstack
when building statement trees. Don't build RTL for labels when
building statement trees.
* semantics.c (finish_goto_stmt): Use LABEL_DECLs even when
building statement trees.
(finish_label_stmt): Likewise.
(expand_stmt): Adjust accordingly.
* pt.c (tsubst_expr); Likewise.
(do_decl_instantiation): Robustify.
* cp-tree.h (AGGR_INIT_VIA_CTOR_P): New macro.
* tree.c (build_cplus_new): Set it.
* expr.c (cplus_expand_expr): Use it.
* dump.c (deque_and_dump): Handle AGGR_INIT_EXPR.
* decl.c (store_parm_decls): Reset immediate_size_expand.
(finish_function): Likewise.
* tree.c (cplus_unsave_expr_now): Don't return a value.
* semantics.c (do_poplevel): Always initialize the return value.
1999-08-26 Gavin Romig-Koch <gavin@cygnus.com>
* cp-tree.h (cplus_unsave_expr_now) : Correct return type.
* tree.h (cplus_unsave_expr_now) : Same.
1999-08-25 Mark Mitchell <mark@codesourcery.com>
* decl.c (grokdeclarator): Amend comment.
* except.c (expand_start_catch_block): Call push_template_decl for
catch-block parameters.
* method.c (synthesize_method): Build an empty compound statement
for the body of a constructor.
1999-08-25 Jason Merrill <jason@yorick.cygnus.com>
* tree.c (cp_build_qualified_type_real): If we're asking for the
same quals we already have, just return.
1999-08-25 Mark Mitchell <mark@codesourcery.com>
* cp-tree.def (SUBOBJECT): New tree node.
* cp-tree.h (CLEANUP_P): New macro.
(SUBOBJECT_CLEANUP): Likewise.
(keep_next_level): Add parameter.
(get_temp_regvar): Don't declare.
(emit_base_init): Remove parameter.
(expand_aggr_init): Rename to build_aggr_init.
(expand_vec_init): Rename to build_vec_init.
(do_pushlevel): Remove.
(do_poplevel): Likewise.
(finish_cleanup): New function.
(finish_subobject): Likewise.
(stmts_are_full_exprs_p): New variable.
* decl.c (keep_next_level): Add parameter.
(cp_finish_decl): Use build_aggr_init, not
expand_aggr_init. Use finish_expr_stmt to expand the code.
(expand_static_init): Use tree-generating, not RTL-generating,
functions to handle the initialization.
(start_function): Remove dead code. Always have a momentary
obstack inside the function, even before hitting the first curly
brace.
(cplus_expand_expr_stmt): Move calls to
expand_{start,end}_target_temps into semantics.c.
(cp_function): Add stmts_are_full_exprs_p.
(push_cp_function_context): Save it.
(pop_cp_function_context): Restore it.
* decl2.c (get_temp_regvar): Move to init.c.
(do_static_initialization): Use build_{aggr,vec}_init.
(do_static_destruction): Fix typo in comment.
* dump.c (dequeue_and_dump): Handle INIT_EXPR.
* except.c (expand_throw): Use create_temporary_var.
* expr.c (cplus_expand_expr): Use build_{aggr,vec}_init.
* init.c (expand_vec_init_try_block): Remove.
(expand_vec_init_catch_clause): Likewise.
(get_temp_regvar): New function.
(begin_init_stmts): Likewise.
(finish_init_stmts): Likewise.
(perform_member_init): Use build_{aggr,vec}_init. Build up tree
structure here.
(emit_base_init): Likewise. Remove unused parameter.
(expand_virtual_init): Likewise.
(expand_cleanup_for_base): Use finish_subobject.
(expand_aggr_vbase_init_1): Simplify.
(construct_virtual_bases): Use tree-generating functions to build
up initialization.
(expand_aggr_init): Likewise. Rename to build_aggr_init.
(expand_default_init): Likewise.
(expand_aggr_init_1): Likewise.
(expand_vec_init): Rename to build_vec_init.
* method.c (do_build_copy_constructor): Use tree-generating
functions. Don't call clear_last_expr.
(do_build_assign_ref): Likewise.
(synthesize_method): Call clear_last_expr here.
* parse.y (base_init): Don't call clear_last_expr here.
(nodecls): Likewise.
* pt.c (tsubst_expr): Handle a TRY_BLOCK with CLEANUP_P set.
* semantics.c (do_pushlevel): Move to here.
(do_poplevel): Likewise.
(stmts_are_full_exprs_p): New variable.
(finish_expr_stmt): Handle logic for temoprary cleanup here.
(finish_for_stmt): Use finish_expr_stmt.
(finish_cleanup): New function.
(finish_function_try_block): Fix indentation.
(finish_subobject): New function.
(setup_vtbl_ptr): Call keep_next_level here.
(finish_stmt_expr): Handle a block with no scope inside the
statement-expression.
(expand_stmt): Handle a TRY_BLOCK with CLEANUP_P set. Handle
SUBOBJECT.
* tree.c (search_tree): Handle INIT_EXPR.
(mapcar): Likewise.
* typeck.c (build_modify_expr): Don't build an RTL_EXPR.
* typeck2.c (store_init_value): Change expand_aggr_init to
build_aggr_init in comment.
1999-08-25 Mark Mitchell <mark@codesourcery.com>
* dump.c (dequeue_and_dump): Dump TARGET_EXPRs.
1999-08-25 Nathan Sidwell <nathan@acm.org>
* decl2.c (handle_class_head): Be graceful about additional
scope qualifiers. Adjust comments to reflect reality.
1999-08-24 Jason Merrill <jason@yorick.cygnus.com>
* call.c (build_conditional_expr): Fix typo.
* typeck.c (build_modify_expr, COND_EXPR): Make sure we've got an
lvalue before trying to mess with the sides.
* error.c (dump_expr, CONVERT_EXPR): Handle (void) properly.
Mon Aug 23 22:17:20 1999 Mumit Khan <khan@xraylith.wisc.edu>
* g++spec.c (lang_specific_driver): Add room for NULL in arglist.
1999-08-23 Jason Merrill <jason@yorick.cygnus.com>
* exception.cc (__cplus_type_matcher): Call __throw_type_match_rtti_2.
Return arbitrary pointer or NULL.
(check_eh_spec): Call __throw_type_match_rtti_2.
* tinfo.h (*::dcast): Return int. Add valp parm.
* tinfo.cc (*::dcast): Likewise. Adjust to allow for null pointers.
* tinfo2.cc (__throw_type_match_rtti_2): Likewise.
(__throw_type_match_rtti): Now just a wrapper.
* except.c: Lose CatchMatch, FirstExceptionMatch, and Unwind.
(init_exception_processing): Don't initialize them.
1999-08-23 Paul Burchard <burchard@pobox.com>
* decl.c (check_default_argument): Fix typo.
1999-08-22 Mark Mitchell <mark@codesourcery.com>
* cp-tree.def (STMT_EXPR): Fix typo in node name.
* dump.c (dump_next_stmt): New function.
(dequeue_and_dump): Use it.
* pt.c (tsubst_copy): Make sure to initialize return value for a
STMT_EXPR, even when processing_template_decl.
* semantics.c (finish_stmt_expr): A statement-expression whose
last statement is not an expression-statement has type `void'.
1999-08-20 Mark Mitchell <mark@codesourcery.com>
* semantics.c (finish_stmt_expr): Fix typo in comment.
* tree.c (search_tree): Handle EXIT_EXPR, LOOP_EXPR.
(mapcar): Likewise.
* init.c (build_vec_delete_1): Make the children of a permanent
BIND_EXPR permanent.
* pt.c (register_specialization): Don't register a specialization
more than once.
1999-08-18 Andrew Haley <aph@cygnus.com>
* method.c (process_overload_item): Call build_mangled_C9x_name ()
for all integer parameter types larger than long long.
1999-08-19 Mark Mitchell <mark@codesourcery.com>
* pt.c (redeclare_class_template): Merge default template
arguments in both directions.
* typeck.c (common_type): Undo 1999-08-18 change. Remove
compiler_error message.
1999-08-19 Jason Merrill <jason@yorick.cygnus.com>
* cp-tree.h: Declare flag_use_repository.
* pt.c (do_decl_instantiation): Don't complain about duplicate
instantiation with -frepo.
(do_type_instantiation): Likewise.
* pt.c (push_template_decl_real): Complain about everything
that isn't a valid template.
* decl2.c (import_export_decl): If -fnew-abi, class linkage doesn't
affect inlines.
1999-08-19 Mark Mitchell <mark@codesourcery.com>
* cp-tree.def (PSEUDO_DTOR_EXPR): New tree code.
* decl2.c (build_expr_from_tree): Handle it.
* error.c (dump_expr): Likewise.
* pt.c (for_each_template_parm): Likewise.
(tsubst_copy): Likewise.
* tree.c (search_tree): Likewise.
* semantics.c (finish_pseudo_destructor_call): Create it.
1999-08-18 Mark Mitchell <mark@codesourcery.com>
* search.c (setup_class_bindings): Robustify.
* typeck.c (common_type): Use same_type_p, not pointer equality,
to compare types.
* cp-tree.h (build_lang_field_decl): Remove.
* class.c (build_vtable): Replace calls to build_lang_field_decl
with build_lang_decl.
(prepare_fresh_vtable): Likewise.
(finish_struct_1): Likewise.
(init_class_processing): Likewise.
* decl.c (push_using_decl): Likewise.
(init_decl_processing): Likewise.
(grokvardecl): Likewise.
(build_ptrmemfunc_type): Likewise.
(grokdeclarator): Likewise.
(build_enumerator): Likewise.
* decl2.c (grok_x_components): Likewise.
(do_class_using_decl): Likewise.
* except.c (call_eh_info): Likewise.
* init.c (init_init_processing): Likewise.
* rtti.c (expand_class_decl): Likewise.
* tree.c (build_base_fields): Likewise.
(build_vbase_pointer_fields): Likewise.
* lex.c (build_lang_decl): Build declarations on the permanent
obstack if we're building statmeent trees.
(retrofit_lang_decl): Handle both the full lang_decl and also the
smaller lang_decl_flags here.
(build_lang_field_decl): Remove.
* pt.c (push_template_decl_real): Issue errors for variable
declarations that are not static members.
1999-08-18 Richard Henderson <rth@cygnus.com>
* tree.c (search_tree): Handle TRUTH_{AND,OR,XOR}_EXPR too.
(mapcar): Likewise.
1999-08-17 Mark Mitchell <mark@codesourcery.com>
* cp-tree.h (back_end_hook): New variable.
* decl2.c (back_end_hook): Define it.
(finish_file): If it's non-NULL, call it.
* decl.c (add_decl_to_level): New function.
(push_local_binding): Use it.
(find_binding): Fix typo in comment.
(pushdecl): Use add_decl_to_level. Put templates on the
corresponding namespace-scope binding levels.
* dump.c (dequeue_and_dump): Print the specializations of a
template.
* pt.c (push_template_decl_real): Don't push a template multiple
times.
1999-08-17 Mark Mitchell <mark@codesourcery.com>
* cp-tree.h (CALL_DECLARATOR_PARMS): New macro.
(CALL_DECLARATOR_QUALS): Likewise.
(CALL_DECARATOR_EXCEPTION_SPEC): Likewise.
* decl.c (grokdeclarator): Adjust to use them.
* decl2.c (grokfield): Likewise.
(reparse_absdcl_as_casts): Likewise.
* lex.c (make_call_declarator): Likewise.
(set_quals_and_spec): Likewise.
* pt.c (tsubst): Likewise.
* tree.c (mapcar): Remove special hack to handle third operand of
a CALL_EXPR.
1999-08-16 Mark Mitchell <mark@codesourcery.com>
* cp-tree.h (CAN_HAVE_FULL_LANG_DECL_P): New macro.
* class.c (build_vtable): Use build_lang_field_decl to build the
VAR_DECLs for vtables.
(prepare_fresh_vtable): Likewise.
* decl.c (duplicate_decls): Only copy DECL_SAVED_TREE if
CAN_HAVE_FULL_LANG_DECL_P.
(push_using_decl): Use build_lang_decl to build USING_DECLs.
(grokdeclarator): Use build_lang_decl to build TYPE_DECLs.
* lex.c (retrofit_lang_decl): Check CAN_HAVE_FULL_LANG_DECL_P.
(build_lang_field_decl): Likewise.
(copy_lang_decl): Use CAN_HAVE_FULLLANG_DECL_P to decide how much
to copy.
* cp-tree.def (STMT_EXPR): New tree node.
* cp-tree.h (STMT_EXPR_STMT): New macro.
(store_return_init): Change prototype.
(finish_named_return_value): New function.
(expand_stmt): Likewise.
(expand_body): Likewise.
(begin_stmt_tree): Likewise.
(finish_stmt_tree): Likewise.
(expanding_p): New variable.
(last_expr_type): Likewise.
(building_stmt_tree): New macro.
* decl.c (start_function): Use building_stmt_tree, not
processing_template_decl, where appropriate.
(store_parm_decls): Likewise.
(store_return_init): Move most of the body to semantics.c.
(finish_function): Use building_stmt_tree.
(finish_stmt): Clear last_expr_type here.
(cp_function): Add expanding_p, last_tree, last_expr_type.
(push_cp_function_context): Save them.
(pop_cp_function_context): Restore them.
* decl2.c (setup_vtbl_ptr): Move to semantics.c.
* error.c (dump_expr): Handle STMT_EXPR.
* except.c (expand_start_catch_block): Use building_stmt_tree.
Use add_decl_stmt.
* expr.c (cplus_expand_expr): Handle STMT_EXPR.
(do_case): Move add_tree call to semantics.c.
* parse.y (return_init): Use finish_named_return_value.
(for.init.statement): Use finish_expr_stmt.
* parse.c: Regenerated.
* pt.c (do_pushlevel): Move to semantics.c.
(do_poplevel): Likewise.
(tsubst_copy): Handle STMT_EXPR instead of BIND_EXPR.
(tsubst_expr): Don't expand all the way to RTL here. Handle
RETURN_INIT and CTOR_INITIALIZER.
(instantiate_decl): Call expand_body after tsubst'ing into
DECL_SAVED_TREE.
* semantics.c (expand_stmts): New function.
(expanding_p): New variable.
(last_expr_type): Likewise.
(finish_expr_stmt): Use building_stmt_tree.
(begin_if_stmt): Likewise.
(finish_if_stmt_cond): Likewise.
(finish_then_clause): Likewise.
(begin_else_clause): Likewise.
(finish_else_clause): Likewise.
(begin_while_stmt): Likewise.
(finish_while_stmt_cond): Likewise.
(finish_while_stmt): Likewise.
(finish_do_body): Likewise.
(finish_do_stmt): Likewise.
(finish_return_stmt): Likewise.
(begin_for_stmt): Likewise.
(fnish_for_init_stmt): Likewise.
(finish_for_cond): Likewise.
(finish_for_expr): Likewise.
(finish_for_stmt): Likewise.
(finish_break_stmt): Likewise.
(finish_continue_stmt): Likewise.
(finish_switch_cond): Likewise.
(finish_switch_stmt): Likewise.
(finish_case_label): Call add_tree here if necessary.
(finish_goto_statement): Use building_stmt_tree.
(begin_try_block): Likewise.
(begin_function_try_block): Likewise.
(finish_try_block): Likewise.
(finish_function_try_block): Likewise.
(finish_handler_sequence): Likewise.
(finish_function_handler_sequence): Likewise.
(begin_handler): Likewise.
(finish_handler_parms): Likewise.
(finish_handler): Likewise.
(begin_compound_stmt): Likewise.
(finish_compound_stmt): Likewise.
(finish_asm_stmt): Likewise.
(finish_label_stmt): Likewise.
(finish_named_return_value): New function.
(setup_vtbl_ptr): Moved here from decl2.c.
(do_pushlevel): Moved here from pt.c.
(do_poplevel): Likewise.
(begin_stmt_expr): Use building_stmt_tree.
(finish_stmt_expr): Likewise. Build a STMT_EXPR, not a BIND_EXPR,
when building_stmt_tree.
(begin_stmt_tree): New function.
(finish_stmt_tree): Likewise.
(expand_stmt): Likewise.
(expand_body): Likewise.
* tree.c (build_cplus_method_type): Make sure the argument types
end up on the same obstack as the METHOD_TYPE.
(search_tree): Handle COMPOUND_EXPR, MODIFY_EXPR,
THROW_EXPR, STMT_EXPR.
(mapcar): Break out common cases. Handle COMPOUND_EXPR,
MODIFY_EXPR, THROW_EXPR, STMT_EXPR, RTL_EXPR. Abort, rather than
sorry, if an unsupported node is encountered.
* typeck.c (require_complete_type_in_void): Handle BIND_EXPR.
(c_expand_return): Don't call add_tree here.
1999-08-15 Mark Mitchell <mark@codesourcery.com>
* pt.c (check_default_tmpl_args): Don't check in local scopes.
(tsubst_decl): Make sure the declaration is on a saveable
obstack. Clear DECL_DEAD_FOR_LOCAL when making a copy of a local
variable.
(tsubst_expr): Adjust now that DECL_STMTs really contain DECLs.
1999-08-14 Jason Merrill <jason@yorick.cygnus.com>
Speed up Koenig lookup.
* decl.c (unqualified_namespace_lookup): Nonstatic. Add spacep parm
to return namespaces we've looked at.
* decl2.c (lookup_using_namespace): Likewise.
(add_function): Don't call ovl_member.
(lookup_arg_dependent): Initialize k.namespaces to the list of
namespaces seen in unqualified lookup.
* call.c (equal_functions): Move here from tree.c.
(joust): Use it to handle duplicate candidates.
* tree.c (ovl_member): Use ==.
1999-08-13 Mark Mitchell <mark@codesourcery.com>
* cp-tree.def (DECL_STMT): Make it smaller.
* cp-tree.h (lang_decl_flags): Move saved_tree to ...
(lang_decl): ... here. Add next.
(DECL_SAVED_TREE): Adjust accordingly.
(DECL_IMPLICIT_TYPEDEF_P): New macro.
(SET_DECL_IMPLICIT_TYPEDEF_P): Likewise.
(DECL_STMT_DECL): Likewise.
(create_implicit_typedef): New function.
(maybe_push_decl): Likewise.
(tsubst_default_argument): New function.
(at_function_scope_p): Likewise.
(add_decl_stmt): Likewise.
(push_permanent_obstack): Likewise.
* call.c (convert_default_arg): Use tsubst_default_argument.
* class.c (add_method): Use push_permanent_obstack.
(build_self_reference): Create a TEMPLATE_DECL for the
self-reference, if necessary.
* decl.c (pseudo_global_level_p): Only look at the current binding
level.
(push_binding): Use push_permanent_obstack.
(create_implicit_typedef): New function.
(pushtag): Use it.
(duplicate_decls): Use push_permanent_obstack.
(maybe_push_decl): New function.
(start_decl): Use it. Remove dead code. Use add_decl_stmt.
(start_decl_1): Remove dead code.
(cp_finish_decl): Remove DECL_STMT handling here. Don't use
pseudo_global_level_p.
(grokvardecl): Create DECL_LANG_SPECIFIC for a VAR_DECL in a
template.
(grokdeclarator): Likewise, for TYPE_DECLs. Don't use
pseudo_global_level_p.
* decl2.c (grokfield): Call push_template_decl for a TYPE_DECL in
a template.
(get_sentry): Use push_permanent_obstack.
* dump.c (dequeue_and_dump): Enable DECL_STMT.
* except.c (call_eh_info): Use push_permanent_obstack.
(build_eh_type_ref): Likewise.
(do_pop_exception): Likewise.
(expand_eh_spec): Likewise.
(alloc_eh_object): Likewise.
(expand_throw): Likewise.
* init.c (build_java_class_ref): Likewise.
* lex.c (get_time_identifier): Likewise.
(free_lang_decl_chain): Correct type.
(retrofit_lang_decl): Adjust accordingly.
(build_lang_field_decl): Likewise.
* lex.h (free_lang_decl_chain): Likewise.
* parse.y (lang_extdef): Don't use pseudo_global_level_p.
* parse.c: Regenerated.
* pt.c (tsubst_default_arguments): New function.
(retrieve_local_specialization): Likewise.
(register_local_specialization): Likewise.
(push_template_decl_real): Use DECL_IMPLICIT_TYPEDEF_P. Just use
pseudo_global_level_p to determine whether or not a template is
primary.
(lookup_template_class): Likewise. Use create_implicit_typedef.
(instantiate_class_template): Call tsubst_default_arguments for
member functions, if appropriate.
(tsubst_default_argument): New function.
(tsubst_decl): Use it. Change TYPE_DECL handling to match VAR_DECLs.
* search.c (at_function_scope_p): New function.
* semantics.c (finish_asm_stmt): Use push_permanent_obstack.
(finish_label_stmt): Likewise.
(add_decl_stmt): New function.
(begin_class_definition): Likewise.
(finish_typeof): Likewise.
* tree.c (copy_template_template_parm): Likewise.
(copy_to_permanent): Likewise.
(push_permanent_obstack): Define.
(mark_addressable): Use it.
* typeck.c (mark_addressable): Likewise.
1999-08-13 Gavin Romig-Koch <gavin@cygnus.com>
* cp-tree.h (init_cplus_unsave): New.
(cplus_unsave_expr_now): New.
* lex.c (init_parse): Call init_cplus_unsave.
* tree.c (init_cplus_unsave): New.
(cplus_unsave_expr_now): New.
1999-08-13 Mark Mitchell <mark@codesourcery.com>
* pt.c (tsubst): Back out 1999-08-06 patch. Use fold and
decl_constant_value to simplify array bounds.
1999-08-11 Jason Merrill <jason@yorick.cygnus.com>
* lang-options.h: Add -fms-extensions.
* cp-tree.h: Declare flag_ms_extensions.
* decl2.c: Define it.
* class.c (instantiate_type): Don't complain about taking the address
of a bound member function if -fms-extensions.
* typeck.c (build_unary_op): Likewise.
* decl.c (grokdeclarator): Or about implicit int.
* init.c (resolve_offset_ref): Or about implicit '&'.
1999-08-11 Mark Mitchell <mark@codesourcery.com>
* cp-tree.h (minimal_parse_mode): Remove.
(finish_label_stmt): New function.
* decl.c (saved_scope): Remove minimal parse mode.
(maybe_push_to_top_level): Don't save it.
(pop_from_top_level): Don't restore it.
(define_label): Split out template-handling code to semantics.c.
(start_decl): Don't use minimal_parse_mode.
(cp_finish_decl): Likewise.
(start_function): Don't increment it.
(store_return_init): Don't use it.
(finish_function): Don't decrement it.
* parse.y (label_colon): Use finish_label_stmt throughout.
* parse.c: Regenerated.
* pt.c (minimal_parse_mode): Don't define it.
(tsubst_expr): Use finish_label_stmt.
* semantics.c (finish_label_stmt): New function.
* dump.c (queue): Be careful when computing bitmasks.
(dequeue_and_dump): Describe binfos as binfos, not as
vectors.
* parse.y (pedantic): Give it itype. Adjust usage accordingly
throughout.
* parse.c: Regenerated.
* Make-lang.in (CXX_SRCS): Remove sig.c.
* Makefile.in (CXX_OBJS): Remove sig.o.
(sig.o): Remove.
* cp-tree.h (CPTI_OPAQUE_TYPE): Remove.
(CPTI_SIGNATURE_TYPE): Likewise.
(CPTI_SIGTABLE_ENTRY_TYPE): Likewise.
(opaque_type_node): Likewise.
(signature_type_node): Likewise.
(sigtable_entry_type): Likewise.
(flag_handle_signatures): Likewise.
(lang_type): Remove is_signature, is_signature_pointer,
is_signature_reference, has_opaque_typedecls,
sigtables_has_been_generated. Adjust dummy. Remove signature,
signature_pointer_to, signature_reference_to.
(IS_SIGNATURE): Remove.
(SET_SIGNATURE): Remove.
(CLEAR_SIGNATURE): Remove.
(IS_SIGNATURE_POINTER): Remove.
(IS_SIGNATURE_REFERENCE): Remove.
(SIGNATURE_HAS_OPAQUE_TYPEDECLS): Remove.
(SIGTABLE_HAS_BEEN_GENERATED): Remove.
(CLASSTYPE_SIGNATURE): Remove.
(SIGNATURE_TYPE): Remove.
(SIGNATURE_METHOD_VEC): Remove.
(SIGNATURE_POINTER_TO): Remove.
(SIGNATURE_REFERENCE_TO): Remove.
(lang_decl_flags): Remove is_default_implementation. Rename
memfunc_pointer_to to saved_tree.
(IS_DEFAULT_IMPLEMENTATION): Remove.
(DECL_MEMFUNC_POINTER_TO): Remove.
(DECL_MEMFUNC_POINTING_TO): Remove.
(DECL_SAVED_TREE): Adjust definition.
(tag_types): Remove signature_type_node.
(SIGNATURE_FIELD_NAME): Remove.
(SIGNATURE_FIELD_NAME_FORMAT): Likewise.
(SIGNATURE_OPTR_NAME): Likewise.
(SIGNATURE_SPTR_NAME): Likewise.
(SIGNATURE_POINTER_NAME): Likewise.
(SIGNATURE_POINTER_NAME_FORMAT): Likewise.
(SIGNATURE_REFERENCE_NAME): Likewise.
(SIGNATURE_REFERNECE_NAME_FORMAT): Likewise.
(SIGTABLE_PTR_TYPE): Likewise.
(SIGTABLE_NAME_FORMAT): Likewise.
(SIGTABLE_NAME_FORMAT_LONG): Likewise.
(SIGTABLE_TAG_NAME): Likewise.
(SIGTABLE_VB_OFF_NAME): Likewise.
(SIGTABLE_VT_OFF_NAME): Likewise.
(finish_base_specifiers): Change prototype.
(build_signature_pointer_type): Remove.
(build_signature_reference_type): Remove.
(build_signature_pointer_constructor): Remove.
(build_signature_method_call): Remove.
(build_optr_ref): Likewise.
(append_signature_fields): Likewise.
(signature_error): Likewise.
* call.c (build_this): Remove signature support.
(build_over_call): Likewise.
(build_new_method_call): Likewise.
* class.c (add_implicitly_declared_members): Likewise.
(finish_struct_1): Likewise.
(finish_struct): Likewise.
* cvt.c (cp_convert_to_pointer): Likewise.
(convert_to_pointer_force): Likewise.
(ocp_convert): Likewise.
* decl.c (sigtable_decl_p): Remove.
(init_decl_processing): Remove support for signatures.
(cp_finish_decl): Likewise.
(grokdeclarator): Likewise.
(grokparms): Likewise.
(xref_tag): Likewise.
(start_function): Likewise.
(start_method): Likewise.
* decl2.c (finish_sigtable_vardecl): Remove.
(flag_handle_signatures): Remove.
(lang_f_options): Remove handle-signatures.
(grokfield): Remove support for signatures.
(grokbitfield): Likewise.
(finish_file): Likewise.
(reparse_absdcl_as_casts): Likewise.
* error.c (dump_type_real): Likewise.
(dump_function_decl): Likewise.
* friend.c (make_friend_class): Likewise.
* gxx.gperf: Remove __signature__, signature, __sigof__, sigof.
* hash.h: Regenerated.
* init.c (build_new_1): Remove support for signatures.
* lang-options.h: Remove -fhandle-signatures,
-fno-handle-signatures.
* lex.c (init_parse): Remove support for signatures.
(yyprint): Likewise.
* lex.h (rid): Remove RID_SIGNATURE.
* method.c (build_decl_overload_real): Remove support for
signatures.
(hack_identifier): Likewise.
* parse.y (base_class): Likewise.
(base_class.1): Likewise.
(access_specifier): Likewise.
* search.c (lookup_member): Likewise.
* semantics.c (finish_qualified_object_call_expr): Likewise.
(finish_template_type_parm): Likewise.
(begin_class_definition): Likewise.
(finish_base_specifier): Likewise.
* sig.c: Remove.
* tree.c (build_cplus_method_type): Remove support for signatures.
* typeck.c (require_complete_type): Likewise.
(c_sizeof): Likewise.
(c_alignof): Likewise.
(build_object_ref): Likewise.
(build_component_ref): Likewise.
(build_indirect_ref): Likewise.
(build_c_cast): Likewise.
(build_modify_expr): Likewise.
(convert_for_initialization): Likewise.
* typeck2.c (signature_error): Remove.
(store_init_value): Remove support for signatures.
(digest_init): Likewise.
(build_x_arrow): Likewise.
(build_functional_cast): Likewise.
* xref.c (GNU_xref_decl): Likewise.
1999-08-10 Martin v. Löwis <martin@mira.isdn.cs.tu-berlin.de>
* lex.c (do_identifier): Remove unnecessary lookup of class field.
1999-08-09 Martin v. Löwis <martin@mira.isdn.cs.tu-berlin.de>
* decl2.c (set_decl_namespace): Do not complain about non-matching
decls if processing a template.
1999-08-09 Mark Mitchell <mark@codesourcery.com>
* decl.c (build_ptrmemfunc_type): Handle qualified
pointer-to-member types here.
* tree.c (cp_build_qualified_type_real): Simplify handling here.
1999-08-09 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
* lex.c (lang_identify): Likewise.
1999-08-09 Bernd Schmidt <bernds@cygnus.co.uk>
* Makefile.in: Update dependencies.
* class.c (finish_struct_1): Don't initialize DECL_SAVED_INSNS with
NULL_RTX.
* decl.c: Include "function.h"
(cleanup_label, return_label): Delete declarations.
(store_parm_decls): Don't initialize DECL_SAVED_INSNS with NULL_RTX.
(finish_function): Rename last_parm_insn variable to
fn_last_parm_insn. Don't compare DECL_SAVED_INSNS to NULL_RTX.
* decl2.c: Include "function.h".
(rtl_expr_chain): Delete declaration.
* method.c: Include "function.h"
* tree.c (build_vbase_pointer_fields): Don't initialize
DECL_SAVED_INSNS with NULL_RTX.
* typeck.c: Include "function.h"
1999-08-09 Jason Merrill <jason@yorick.cygnus.com>
* semantics.c (begin_function_try_block, finish_function_try_block,
finish_function_handler_sequence): New fns.
* parse.y (function_try_block): Use them.
* pt.c (instantiate_decl): Likewise.
* cp-tree.h: Declare in_function_try_handler.
* decl.c: Define it.
(start_function): Clear it.
(struct cp_function, push_cp_function_context): Save it.
(pop_cp_function_context): Restore it.
* parse.y (function_try_block): Set and clear it.
* except.c (expand_end_catch_block): Rethrow if we reach the end
of a function-try-block handler in a ctor or dtor.
* typeck.c (c_expand_return): Complain about returning from a
function-try-block handler of a ctor.
* parse.y (function_try_block): Call end_protect_partials
before expand_start_all_catch.
1999-08-08 Jason Merrill <jason@yorick.cygnus.com>
* decl.c (struct binding_level): Add eh_region field.
(push_binding_level): Set it.
(define_label): Complain about jumping into an EH block.
* ptree.c (print_lang_type): Print the real type of a PMF.
Print what exceptions a fn type throws.
1999-08-07 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
* class.c (count_fields, add_fields_to_vec): Add static prototype.
* cp-tree.h (opname_tab, assignop_tab, operator_name_string,
get_id_2, composite_pointer_type, dump_node_to_file): Constify a
char*.
* decl.c (named_label_list, cp_finish_decl, grokdeclarator):
Constify a char*.
* decl2.c (finish_static_data_member_decl, grokfield): Constify a
char*.
* dump.c (queue_and_dump_index, dump_int, dump_string,
dump_string_field, dequeue_and_dump, dump_node_to_file): Constify
a char*.
(dump_stmt): Add static prototype.
* errfn.c (cp_thing): Constify a char*.
* error.c (dump_unary_op, dump_binary_op, aggr_variety,
dump_aggr_type, dump_global_iord, dump_decl, dump_function_name,
dump_expr): Constify a char*.
* lex.c (extend_token_buffer_to, pragma_getc, pragma_ungetc,
read_line_number): Add static prototype.
(opname_tab, assignop_tab, operator_name_string): Constify a char*.
(real_yylex): Move label `letter' into the scope where it is used.
* method.c (build_mangled_template_parm_index, build_overload_int,
build_decl_overload_real, get_id_2): Constify a char*.
* search.c (check_final_overrider): Make static.
* typeck.c (composite_pointer_type): Constify a char*.
1999-08-06 Jason Merrill <jason@yorick.cygnus.com>
* pt.c (maybe_get_template_decl_from_type_decl): Make sure that
we're looking at a class.
* decl.c (lookup_name_real): Set the complain flag if we're
looking for a namespace member.
* lex.c (real_yylex): We can have a number with no digits.
* cvt.c (cp_convert_to_pointer): Don't force pmf conversions.
* search.c (binfo_from_vbase): New fn.
* cp-tree.h: Declare it.
* cvt.c (cp_convert_to_pointer): Use it to diagnose conversion
from pointer to member of virtual base.
* typeck.c (get_delta_difference): Likewise.
1999-08-06 Alexandre Oliva <oliva@dcc.unicamp.br>
* pt.c (tsubst): Use build_index_type to build in-template array
index type. Fixes g++.oliva/dwarf1.C.
* decl.c (grokdeclarator): Likewise, just for consistency, as it
doesn't seem to trigger the bug without it.
1999-08-06 Jason Merrill <jason@yorick.cygnus.com>
* typeck2.c (add_exception_specifier): Use complete_type.
1999-08-06 Mark Mitchell <mark@codesourcery.com>
* error.c (dump_expr): Handle EXACT_DIV_EXPR.
(dump_binary_op): Bulletproof.
* lex.c (init_parse): Set opname_tab[EXACT_DIV_EXPR].
* tree.c (search_tree): Don't enumerate all the nodes of classes
`1', `2', and `<'; handle them generically. Don't be sorry about
"unrecognized tree codes"; just abort.
(no_linkage_check): Don't do linkage checks for templates.
* tree.c (cp_build_qualified_type_real): Handle
pointer-to-member-function types correctly.
1999-08-05 Jason Merrill <jason@yorick.cygnus.com>
* decl.c (pushdecl): Only give an error for shadowing a parm
from *this* function.
Thu Aug 5 02:40:42 1999 Jeffrey A Law (law@cygnus.com)
* typeck2.c: Update URLs and mail addresses.
1999-08-04 Nathan Sidwell <nathan@acm.org>
* cp-tree.h (empty_except_spec): New global var.
(compexcepttypes): Remove prototype.
(comp_except_specs): Prototype new global function.
(add_exception_specifier): Prototype new global function.
* decl.c (empty_except_spec): Define new global var.
(duplicate_decls): Use comp_except_specs, reword error message.
(init_decl_processing): Initialize empty_except_spec.
Adjust build_exception_variant calls.
* parse.y (exception_specification_opt): Use empty_except_spec.
(ansi_raise_identifier): Call check_for_new_type.
(ansi_raise_identifiers): Use add_exception_specifier.
* pt.c (tsubst): Use add_exception_specifier to build exception
specifier.
* search.c (check_final_overrider): New static function, broken
out of get_matching_virtual. Check throw specifiers, reword
diagnostics.
(get_matching_virtual): Use check_final_overrider.
* tree.c (build_exception_variant): Use comp_except_specs.
* typeck.c (compexcepttypes): Remove.
(comp_except_types): New static function, helper for
comp_except_specs. Compare two types as exception specifiers.
(comp_except_specs): New global function, compare two exception
specifiers.
(comptypes): Adjust for comp_except_specs.
* typeck2.c (add_exception_specifier): New global function.
* class.c (check_for_override): Reword error message.
1999-08-03 Nathan Sidwell <nathan@acm.org>
* call.c (convert_arg_to_ellipsis): Use pod_type_p.
* cp-tree.h (struct lang_type): Added non_pod_class flag.
(CLASSTYPE_NON_POD_P): New macro to access it.
* class.c (finish_struct_1): Determine non-PODness.
Check for arrays of pointers (-Weffc++).
Remove array inspection duplicated code.
* tree.c (pod_type_p): Detect non-pod non-aggregate types.
Use CLASSTYPE_NON_POD_P.
1999-08-03 Nathan Sidwell <nathan@acm.org>
* class.c (duplicate_tag_error): Preserve template information.
1999-08-03 Nathan Sidwell <nathan@acm.org>
* decl.c (start_enum): Show location of previous definition.
* parse.y (enumlist_opt): New reduction.
(structsp): Simplify enum rules to use enumlist_opt.
1999-08-03 Jason Merrill <jason@yorick.cygnus.com>
* lex.c (yyprint): Handle PFUNCNAME.
* decl2.c (build_expr_from_tree, case METHOD_CALL_EXPR): Only
build_expr_from_tree on the args of a TEMPLATE_ID_EXPR.
1999-08-03 Mumit Khan <khan@xraylith.wisc.edu>
* decl.c (start_decl): Set attributes before duplicate_decls call.
1999-08-02 Mark Mitchell <mark@codesourcery.com>
* Make-lang.in (CXX_SRCS): Add dump.c.
* Makefile.in (CXX_OBJS): Add dump.o.
(dump.o): New target.
* cp-tree.h (DECL_CONV_FN_P): Document.
(DECL_OVERLOADED_OPERATOR_P): New function.
(TYPE_PTRMEM_CLASS_TYPE): New macro.
(TYPE_PTRMEM_POINTED_TO_TYPE): Likewise.
(PTRMEM_CST_CLASS): Use TYPE_PTRMEM_CLASS_TYPE.
(ASM_VOLATILE_P): New macro.
(STMT_LINENO): Likewise.
(cp_namespace_decls): New function.
(dump_node_to_file): New function.
* decl.c (cp_namespace_decls): New function.
(walk_namespaces_r): Use it.
(wrapup_globals_for_namespace): Likewise.
* decl2.c (flag_dump_translation_unit): New variable.
(lang_decode_option): Handle -fdump-translation-unit.
(finish_file): If flag_dump_translation_unit is set, dump the
translation unit.
* dump.c: New file.
* lang-options.h: Add -fdump-translation-unit.
* pt.c (tsubst_template_parms): Robustify.
(tsubst_decl): Use DECL_OVERLOADED_OPERATOR_P.
(tsubst_expr): Use STMT_LINENO.
* semantics.c (finish_asm_stmt): Eliminate duplicate code. Check
for invalid cv-qualifiers even while building templates.
1999-08-02 Richard Henderson <rth@cygnus.com>
* call.c: Include defaults.h instead of expr.h.
* decl.c: Likewise.
* pt.c: Likewise.
* typeck.c: Include defaults.h.
1999-08-02 Mark Mitchell <mark@codesourcery.com>
* lex.c (errorcount, sorrycount): Don't declare.
* repo.c (errorcount, sorrycount): Likewise.
* typeck2.c (errorcount, sorrycount): Likewise.
1999-08-02 Jakub Jelinek <jj@ultra.linux.cz>
* call.c (convert_default_arg, build_over_call): Change all uses of
PROMOTE_PROTOTYPES, so that it tests it as a C expression.
Ensure expr.h is included.
* decl.c (grokparams): Ditto.
* pt.c (tsubst_decl): Ditto.
* typeck.c (convert_arguments): Ditto.
1999-08-02 Jason Merrill <jason@yorick.cygnus.com>
* class.c (mark_overriders): Fix order of args to overrides.
(warn_hidden): Likewise. Fix for having virtual and non-virtual
functions with the same name.
1999-08-02 Richard Henderson <rth@cygnus.com>
* cp-tree.h (TYPE_PTRMEMFUNC_P): Check TYPE_LANG_SPECIFIC non-null.
1999-08-01 Mark Mitchell <mark@codesourcery.com>
* call.c (build_conditional_expr): Fix typo in comment.
1999-08-01 Bernd Schmidt <bernds@cygnus.co.uk>
* decl.c (finish_stmt): Don't declare and test cond_stack, loop_stack,
case_stack; use in_control_zone_p.
* typeck.c (c_expand_return): Likewise.
1999-07-31 Bernd Schmidt <bernds@cygnus.co.uk>
* except.c (catch_clauses): Delete declaration.
1999-07-30 Mark Mitchell <mark@codesourcery.com>
* call.c (build_conditional_expr): Call convert_from_reference to
avoid reference/non-reference type confusion. Fix typo.
1999-07-30 Richard Henderson <rth@cygnus.com>
* typeck2.c (initializer_constant_valid_p): Moved to c-common.c.
* cp-tree.h (initializer_constant_valid_p): Remove.
1999-07-28 Mark Mitchell <mark@codesourcery.com>
* call.c (conditional_conversion): Don't build BASE_CONVs for
conversions between things that have the same type.
(build_conditional_expr): Tweak.
(convert_like): Some BASE_CONVs really do require the generation
of code.
* init.c (perform_member_init): Don't go through build_modify_expr
for simple initializations.
1999-07-27 Jason Merrill <jason@yorick.cygnus.com>
* cp-tree.h (DECL_VIRTUAL_CONTEXT): New macro.
* typeck.c (expand_ptrmemfunc_cst): Calculate delta correctly for
virtual functions and MI. Simplify.
* method.c: Remove prototype for largest_union_member.
* pt.c (determine_specialization): Fix uninitialized warning.
* lex.c (real_yylex): Likewise.
1999-07-27 Mark Mitchell <mark@codesourcery.com>
* class.c (override_one_vtable): Adjust the use of BINFO_VIRTUALS
here too.
* cp-tree.h (BINFO_VIRTUALS): Document new format.
* class.c (modify_one_vtable): Change prototype accordingly.
(modify_all_vtables): Likewise.
(modify_all_direct_vtables): Likewise.
(modify_all_indirect_vtables): Likewise.
(build_vtable_entry_for_fn): New function.
(set_rtti_entry): Simplify for new BINFO_VIRTUALS format.
(modify_vtable_entry): Likewise.
(add_virtual_function): Likewise.
(build_vtbl_initializer): New function.
(finish_vtbls): Simplify for new BINFO_VIRTUALS format.
(fixup_vtable_deltas1): Likewise.
(fixup_vtable_deltas): Likewise.
(override_one_vtable): Likewise.
(finish_struct_1): Likewise.
* error.c (dump_expr): Likewise.
* search.c (get_abstract_virtuals_1): Likewise.
(get_abstract_virtuals): Likewise.
(expand_upcast_fixups): Likewise.
* tree.c (debug_binfo): Likewise.
* decl2.c (mark_vtable_entries): Don't bash abstract virtuals to
__pure_virtual here.
1999-07-26 Mark Mitchell <mark@codesourcery.com>
* tree.c (build_cplus_new): Adjust call to abstract_virtuals_error
as per 1999-07-26 change.
* typeck.c (c_sizeof): Don't allow non-static data members.
(expr_sizeof): Likewise.
1999-07-26 Jason Merrill <jason@yorick.cygnus.com>
* input.c (feed_input): Only touch lineno and input_filename
if !USE_CPPLIB. Save the old values before setting the new ones.
* input.c (feed_input): Add file, line parms.
* lex.c (begin_definition_of_inclass_inline, feed_defarg): Adjust.
(real_yylex): Check linemode before input_redirected().
* typeck.c (c_expand_return): Downgrade pedwarn about returning NULL
from op new to warning.
1999-07-26 Mark Mitchell <mark@codesourcery.com>
* cp-tree.h (ncp_convert): Rename to perform_implicit_conversion.
* call.c: All uses changed.
* typeck.c: Likewise.
1999-07-26 Nathan Sidwell <nathan@acm.org>
* exception.cc (__cplus_type_matcher): Match __eh_matcher
prototype.
1999-07-26 Mark Mitchell <mark@codesourcery.com>
* cp-tree.h (CP_INTEGRAL_TYPE_P): New macro.
(ARITHMETIC_TYPE_P): Adjust definition for standard conformance.
(strip_top_quals): Declare.
(ncp_convert): Likewise.
(type_after_usual_arithmetic_conversions): Likewise.
(composite_pointer_type): Likewise.
* call.c (strip_top_quals): Don't make it static.
(promoted_arithmetic_type_p): New function.
(conditional_conversion): Likewise.
(null_ptr_cst_p): Allow `false' as a NULL pointer constant.
(standard_conversion): Use same_type_p. Don't build BASE_CONVs
for converting a type to itself.
(reference_binding): Honor LOOKUP_NO_TEMP_BIND.
(implicit_conversion): Make sure the from and to types are
complete.
(add_builtin_candidate): Correct handling of ?: operator.
(add_builtin_candidates): Improve documentation.
(build_conditional_expr): New function.
(can_convert): Implement in terms of can_convert_arg.
(ncp_convert): New function.
* typeck.c (type_after_usual_arithmetic_conversions): New
function, split out from common_type.
(composite_pointer_type): New function, split out from
build_conditional_expr.
(common_type): Use type_after_usual_arithmetic_conversions.
Remove redundant attribute merging.
(comptypes): Tidy. Handle COMPLEX_TYPE.
(build_binary_op_nodefault): Use null_ptr_cst_p.
(build_conditional_expr): Remove.
(convert_for_assignment): Use new conversion functions.
* cp-tree.h (abstract_virtuals_error): Change declaration.
* typeck2.c (abstract_virtuals_error): Check to see if an error
occurred, and return a boolean value accordingly.
(build_functional_cast): Adjust accordingly.
* class.c (finish_struct_1): Likewise.
* cvt.c (ocp_convert): Likewise.
* decl.c (cp_finish_decl): Likewise.
(grokparams): Likewise.
(grok_op_properties): Likewise.
(start_function): Likewise.
* init.c (build_new_1): Likewise.
* pt.c (unify): Don't get confused by pointers-to-member functions.
* search.c (build_cplus_new): Robustify.
1999-07-24 Richard Henderson <rth@cygnus.com>
* gxx.gperf (__builtin_va_arg): New.
* parse.y (VA_ARG): New token.
(unary_expr): Recognize it.
Sun Jul 25 15:24:21 1999 Jeffrey A Law (law@cygnus.com)
* g++FAQ.texi: Deleted per Joe Buck's request.
* Makefile.in: Corresponding changes.
1999-07-23 Jason Merrill <jason@yorick.cygnus.com>
* lex.c: Sync with C frontend.
(whitespace_cr): New fn.
(skip_white_space): Use it.
(init_parse): Reorder.
(yyprint): Support CONSTANT.
(pragma_getc, pragma_ungetc): Bring back.
(read_line_number): Change in_system_header directly.
(handle_generic_pragma, handle_cp_pragma, yyerror): Move up in file.
(parse_float): Update to C version.
(yylex): Handle '$' under the letter case.
Remove looking_for_typename handling.
Support hex floating point constants.
Follow C's lead for choosing type of integer constants.
Rearrange stuff to match C frontend.
(yyungetc, reinit_parse_for_block, yylex): Support indent_level.
* spew.c (yylex): Clear looking_for_typename if we see a TYPESPEC.
1999-07-23 Mark Mitchell <mark@codesourcery.com>
* call.c (reference_binding): Tweak.
(mayble_handle_implicit_object): Use direct_reference_binding to
create the right implicit conversion sequence.
1999-07-22 Mark Mitchell <mark@codesourcery.com>
* pt.c (convert_nontype_argument): Don't call decl_constant_value
if we're converting to a reference type.
* call.c (NEED_TEMPORARY_P): New macro.
(standard_conversion): Set it, for derived-to-base conversions.
(reference_related_p): New function.
(reference_compatible_p): Likewise.
(convert_class_to_reference): Likewise.
(direct_reference_binding): Likewise.
(reference_binding): Rework for standards-compliance.
(convert_like): Adjust accordingly.
(maybe_handle_ref_bind): Simplify; the right conversion sequences
are now built up in reference_binding.
(initialize_reference): New function.
* cp-tree.h (ICS_USER_FLAG): Document.
(ICS_THIS_FLAG): Likewise.
(ICS_BAD_FLAG): Likewise.
(NEED_TEMPORARY_P): Likewise.
(cp_lvalue_kind): New type.
(real_lvalue_p): Return it.
* error.c (dump_expr): Provide more accurate representation for
AGGR_INIT_EXPRs.
* init.c (expand_default_init): Do not try to perform implicit
conversions for a brace-enclosed initializer.
* search.c (lookup_conversions): Document.
* tree.c (lvalue_p_1): Return a cp_lvalue_kind. Calculate
appropriately.
(real_lvalue_p): Adjust accordingly.
(lvalue_p): Likewise.
(build_cplus_new): Don't allow the creation of an abstract class.
* typeck.c (convert_for_initialization): Use initialize_reference.