Mark Mitchell [Tue, 28 Jul 1998 11:45:32 +0000 (11:45 +0000)]
cplus-dem.c (type_kind_t): New type.
* cplus-dem.c (type_kind_t): New type.
(demangle_template_value_parm): Add type_kind_t parameter. Rely
on this paramter, rather than demangling the type again.
(demangle_integral_value): Pass tk_integral.
(demangle_template_: Pass the value returned from do_type.
(do_type): Return a type_kind_t. Pass tk_integral to
demangle_template_value_parm for array bounds.
(demangle_fund_type): Likewise.
Mark Mitchell [Tue, 28 Jul 1998 01:03:16 +0000 (01:03 +0000)]
cp-tree.h (TI_USES_TEMPLATE_PARMS): Remove.
* cp-tree.h (TI_USES_TEMPLATE_PARMS): Remove.
(build_template_decl_overload): Remove.
(set_mangled_name_for_decl): New function.
(innermost_args): Remove is_spec parameter.
(most_specialized, most_specialized_class): Remove declarations.
(lookup_template_class): Add entering_scope parameter.
(maybe_process_partial_specialization): New function.
(finish_template_decl): Likewise.
(finish_template_type): Likewise.
* class.c (finish_struct): Clean up processing of member template
specializations.
* decl.c (pushtag): Fix formatting.
(lookup_tag): Improve handling of pseudo-global levels.
(make_typename_type): Adjust call to lookup_template_class.
(shadow_tag): Use maybe_process_partial_specialization.
(xref_tag): Improve handling of member friends.
(start_function): Call push_nested_class before
push_template_decl. Don't call push_template_decl for
specializations.
* decl2.c (grok_x_components): Don't call xref_tag for
template instantiations. Handle UNION_TYPEs like RECORD_TYPEs.
(grokclassfn): Use set_mangled_name_for_decl.
(arg_assoc_class): Adjust call to innermost_args.
(mark_used): Don't call instantiate_decl for a TEMPLATE_DECL.
* error.c (dump_function_name): Improve printing of template
function names.
* friend.c (is_friend): Don't compare types of decls to determine
friendship, unless flag_guiding_decls.
(make_friend_class): Partial specializations cannot be friends.
(do_friend): Use set_mangled_name_for_decl. Call
push_template_decl_real instead of push_template_decl.
* method.c (build_decl_overload_real): Remove prototype. Give it
external linkage.
(build_overload_identififer): Adjust call to innermost_args.
(build_template_decl_overload): Remove.
(set_mangled_name_for_decl): New function.
* parse.y (.finish_template_type): New non-terminal.
(template_def): Use finish_template_decl. Use template_extdef
instead of extdef.
(template_extdef, template_datadef): New non-terminals, containing
only those rules for things which can be templates.
(datadef): Tidy.
(template_type, self_template_type): Use .finish_template_type.
(named_class_head): Use maybe_process_partial_specialization.
* pt.c (mangle_class_name_for_template): Remove context parameter.
(get_class_bindings): Remove outer_args parameter.
(complete_template_args): Remove.
(add_outermost_template_args): New function.
(register_specialization): Return the specialization.
(unregister_specialization): New function.
(tsubst_template_parms): Likewise.
(most_specialized, most_specialized_class): Prototype here as
static.
(original_template): Rename to most_general_template.
(tsubst_template_parms): New function.
(set_mangled_name_for_template_decl): Likewise.
(TMPL_ARGS_DEPTH): New macro.
(TMPL_ARGS_HAVE_MULTIPLE_LEVELS): Adjust.
(TMPL_ARGS_LEVEL): New macro.
(SET_TMPL_ARGS_LEVEL): Likewise.
(TMPL_ARG): Likewise.
(SET_TMPL_ARG): Likewise.
(TMPL_ARGS_DEPTH): Likewise.
(finish_member_template_decl): Use finish_template_decl.
(maybe_process_partial_specialization): New function, split out
from tsubst.
(inline_needs_template_parms): Use TMPL_PARMS_DEPTH.
(maybe_begin_member_template_processing): Use new macros.
(is_member_template): Likewise.
(is_member_template_class): Likewise.
(add_to_template_args): Likewise. Deal with multiple levels of
args.
(maybe_process_partial_specialization): New function.
(retrieve_specialization): Add consistency check.
(determine_specialization): Return full argument list.
(check_explicit_specialization): Tweak friend handling. Use full
argument lists. Simplify.
(current_template_args): Use new macros.
(push_template_decl_real): Change ill-named mainargs to specargs.
Check that a partial specialization actually specializes at least
one parameter. Improve friend handling. Modify for full
template arguments.
(classtype_mangled_name): Don't mangle the names of
specializations.
(lookup_template_class): Add entering_scope parameter. Use it to
avoid finding a template type when an instantiation is required.
Simplify. Use full template arguments.
(tsubst_friend_function): Use unregister_specialization. Use new
macros. Use full template arguments.
(tsubst_friend_class): Substitute, using tsubst_template_parms,
into the template parameters before passing them to
redeclare_class_template.
(instantiate_class_template): Simplify. Use full template
arguments. Adjust calls to get_class_bindings. Use
SET_IDENTIFIER_TYPE_VALUE where needed. Improve friend handling.
(innermost_args): Use new macros.
(tsubst_aggr_type): New function, split out from tsubst.
(tsubst): Use tsubst_aggr_type, tsubst_template_parms, new calling
conventions for lookup_tmeplate_class. Refine handling of partial
instantiations. Remove calls to complete_template_args.
Simplify. Add consistency checks. Use set_mangled_name_for_decl
and set_mangled_name_for_template_decl.
(tsubst_copy): Use tsubst_aggr_type.
(instantiate_template): Use full template arguments.
(more_specialized): Improve formatting.
(more_specialized_class): Adjust calls to get_class_bindings.
(get_bindings_real): Don't call complete_template_args.
(most_specialized): Don't overwrite input; create a new list.
(most_specialized_class): Use most_general_template.
(regenerate_decl_from_template): Use unregister_specialization.
Use full template arguments.
(instantiate_decl): Use full template arguments.
(set_mangled_name_for_template_decl): New function.
* semantics.c (begin_class_definition): Use
maybe_process_partial_specialization.
(finish_member_class_template): New function.
(finish_template_decl): Likewise.
(finish_template_type): Likewise.
(typeck.c): Don't crash after issuing a compiler_error.
* Makefile.in (CONFLICTS): Adjust; we removed a s/r conflict.
Dave Love [Sat, 25 Jul 1998 05:38:51 +0000 (05:38 +0000)]
Makefile.in (s-libe77, [...]): Rely on VPATH, dropping explicit use of $(srcdir) in various places.
1998-07-24 Dave Love <d.love@dl.ac.uk>
* Makefile.in (s-libe77, ${srcdir}/configure, g2c.h, Makefile,
config.status, rebuilt): Rely on VPATH, dropping explicit use of
$(srcdir) in various places.
Jason Merrill [Fri, 24 Jul 1998 12:36:55 +0000 (12:36 +0000)]
cp-tree.h: Add prototype for set_identifier_local_value.
* cp-tree.h: Add prototype for set_identifier_local_value.
* decl.c (set_identifier_local_value_with_scope): Make static,
prototype.
* search.c (covariant_return_p): Likewise.
* except.c (build_terminate_handler, alloc_eh_object): Likewise.
* call.c (build_method_call): Only pull out the type of a destructor
if it's a template type parm.
* decl.c (lookup_name_real): Never return the from_obj value.
Jason Merrill [Thu, 23 Jul 1998 19:11:48 +0000 (15:11 -0400)]
except.c (process_start_catch_block_old): Call start_decl_1 for catch parm.
* except.c (process_start_catch_block_old): Call start_decl_1 for
catch parm.
* decl.c (start_decl_1): Avoid duplicate error.
* init.c (expand_default_init): Only perform the initialization if
it will do something.
* parse.y (base_class): Check for invalid base class.
Jason Merrill [Thu, 23 Jul 1998 02:29:34 +0000 (02:29 +0000)]
class.c (build_vtable): Pass at_eof to import_export_vtable.
* class.c (build_vtable): Pass at_eof to import_export_vtable.
(prepare_fresh_vtable): Likewise.
* decl2.c (import_export_class): Split out...
(finish_prevtable_vardecl): From here.
* class.c (finish_struct_1): Call import_export_class if at_eof.
* decl.c (start_function): #if 0 mysterious code I wrote and have
forgotten why.
* rtti.c (get_tinfo_fn): If this is for a class type, set
DECL_CONTEXT.
Jason Merrill [Wed, 22 Jul 1998 17:54:26 +0000 (17:54 +0000)]
exception: Change terminate and unexpected to ().
* inc/exception: Change terminate and unexpected to ().
* parse.y (named_class_head_sans_basetype_defn): A
named_class_head_sans_basetype followed by '{' or ':' is a defn.
tree.def (EXPR_WITH_FILE_LOCATION): Defined as an 'e' expression so WFL are expanded correctly when...
�
* tree.def (EXPR_WITH_FILE_LOCATION): Defined as an 'e' expression
so WFL are expanded correctly when contained in a COMPOUND_EXPR.
* tree.h (EXPR_WFL_EMIT_LINE_NOTE): Change macro not to use
lang_flag_0. Added documentation in the flag table.
Per Bothner [Wed, 22 Jul 1998 12:38:21 +0000 (05:38 -0700)]
tree.def (EXPR_WITH_FILE_LOCATION): Defined as an 'e' expression so WFL are expanded correctly when...
* tree.def (EXPR_WITH_FILE_LOCATION): Defined as an 'e' expression
so WFL are expanded correctly when contained in a COMPOUND_EXPR.
* tree.h (EXPR_WFL_EMIT_LINE_NOTE): Change macro not to use
lang_flag_0. Added documentation in the flag table.
alpha.md (fix_truncdfsi2, [...]): Remove the define_expands, but keep the insns and splits.
* alpha.md (fix_truncdfsi2, fix_truncsfsi2): Remove the define_expands,
but keep the insns and splits. Adjust so when the ultimate destination
is memory, use cvtql.
Ken Raeburn [Mon, 20 Jul 1998 19:53:04 +0000 (19:53 +0000)]
mips.md (reload_outsi): Added missing REGNO call.
* mips.md (reload_outsi): Added missing REGNO call.
(smulsi3_highpart, umulsi3_highpart): Provide prototype for function pointer.
(mul_acc_di, mul_acc_64bit_di): Don't use match_op_dup, use another
match_operator and compare the codes.
* mips.h (MASK_DEBUG_E, MASK_DEBUG_I): Set to zero.
* MIPS multiply pattern fixes:
* mips.h (enum reg_class, REG_CLASS_NAMES, REG_CLASS_CONTENTS): Add union
classes for HI, LO, or HILO plus general registers.
(GENERATE_MADD): Deleted.
* mips.md (mulsi3_mult3): Don't disparage output-LO alternative. Add
TARGET_MAD to condition.
(mulsi3): Test HAVE_mulsi3_mult3, not specific flags.
(mul_acc_si): Expand GENERATE_MADD here; it's the only use. Use "*d" for
accumulator, to give preference to LO initially but not during reload.
Dave Brolley [Mon, 20 Jul 1998 13:36:43 +0000 (13:36 +0000)]
lex.c (mbchar.h): #include it.
1998-07-20 Dave Brolley <brolley@cygnus.com>
* lex.c (mbchar.h): #include it.
(GET_ENVIRONMENT): New macro.
(init_parse): Set character set based on LANG environment variable.
(real_yylex): Handle multibyte characters in character literals.
(real_yylex): Handle multibyte characters in string literals.
Dave Brolley [Mon, 20 Jul 1998 13:35:38 +0000 (13:35 +0000)]
configure.in (enable_c_mbchar): New configure option.
Mon Jul 20 16:16:38 1998 Dave Brolley <brolley@cygnus.com>
* configure.in (enable_c_mbchar): New configure option.
(extra_cpp_objs): Always available now.
* cexp.y (mbchar.h): #include it.
(yylex): Handle Multibyte characters in character literals.
* cccp.c (mbchar.h): #include it.
(main): Set character set based on LANG environment variable.
(rescan): Handle multibyte characters in comments.
(skip_if_group): See above.
(validate_else): See above.
(skip_to_end_of_comment): See above.
(macarg1): See above.
(discard_comments): See above.
(rescan): Handle multibyte characters in string and character literals.
(collect_expansion): See above.
(skip_quoted_string): See above.
(macroexpand): See above.
(macarg1): See above.
(discard_comments): See above.
(change_newlines): See above.
* c-lex.c (mbchar.h): #include it.
(GET_ENVIRONMENT): New macro.
(init_lex): Set character set based on LANG environment variable.
(yylex): Handle multibyte characters in character literals.
(yylex): Handle multibyte characters in string literals.
* Makefile.in (mbchar.o): New target.
(cccp$(exeext)): @extra_cpp_objs@ is always available.
(cppmain$(exeext)): @extra_cpp_objs@ is always available.
* mbchar.[ch]: New files for multibyte character handling.
David S. Miller [Mon, 20 Jul 1998 02:20:07 +0000 (02:20 +0000)]
jump.c (jump_optimize): When simplifying noop moves and PUSH_ROUNDING...
* jump.c (jump_optimize): When simplifying noop moves and
PUSH_ROUNDING, fix thinko so we use same criterion for identifying
the PUSHes to rewrite in second loop as we did in the first.
* lang-options.h: Fix up doc strings.
Remove the unimplemented -fdcp-intrinsics-* options.
* str-1t.fin: Change mixed-case spelling of `GoTo' from
`Goto'.
Jason Merrill [Sun, 19 Jul 1998 23:47:18 +0000 (23:47 +0000)]
lex.c (do_identifier): Look for class value even if we don't have a global value.
* lex.c (do_identifier): Look for class value even if we don't
have a global value. Do implicit declaration if parsing is 2.
* semantics.c (finish_call_expr): Pass 2 if we're doing Koenig
lookup.
Mark Mitchell [Sun, 19 Jul 1998 18:55:38 +0000 (18:55 +0000)]
decl.c (pushtag): Revert previous change.
* decl.c (pushtag): Revert previous change.
* pt.c (lookup_template_class): Don't put out debugging
information for types that use template parameters.