OSDN Git Service

* decl.c (initialize_local_var): Handle static variables here.
[pf3gnuchains/gcc-fork.git] / gcc / cp / ChangeLog
index 51f48da..a97890d 100644 (file)
@@ -1,3 +1,333 @@
+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 intialize 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.