Commit Graph

46 Commits

Author SHA1 Message Date
Jeffrey A Law 8d052bc70c call.c: Include system.h.
* call.c: Include system.h.  Remove includes, declarations and
        defines provided by system.h.
        * class.c, cvt.c, decl.c, decl2.c, errfn.c error.c: Likewise.
        * except.c, expr.c friend.c, g++spec.c, init.c, input.c: Likewise.
        * lex.c, parse.y, pt.c, ptree.c repo.c rtti.c, search.c: Likewise.
        * semantics.c, sig.c, spew.c, tree.c, typeck.c: Likewise.
        * typeck2.c, xref.c: Likewise.
        * Makefile.in: Dependencies updated as appropriate.
        * Make-lang.in: Likewise.
system.h cutover from the cp subdir

From-SVN: r18917
1998-03-31 06:25:46 -07:00
Mark Mitchell 050367a36d cplus-dem.c (optable): Add sizeof.
* cplus-dem.c (optable): Add sizeof.
	(demangle_template_value_parm): New function containing code
	previously found in demangle_template.
	(demangle_integral_value): New function which handles complicated
	integral expressions.
	(demangle_template): Use them.
	* error.c (dump_expr): Remove unused variable `l'.
	* pt.c (for_each_template_parm): New function, created by
	converting uses_template_parms.
	(tree_fn_t): New typedef.
	(uses_template_parms): Use it.
	(mark_template_parm): New function.
	(push_template_decl): Check that the argument list of a partial
	specialization uses all the template parameters.
	* Make-lang.in (c++filt): Don't delete cxxmain.c after we're done
	with it; we might want it for debugging.
	* cp-tree.h (type_unification): Change interface.
	* class.c (finish_struct_1): Skip nested template types, just like
	ordinary nested types.
	(instantiate_type): Use new interface to type_unification.
	* lex.c (init_lex): Add __sz as opname for sizeof.
	* method.c (build_overload_scope_ref): New function.
	(build_overload_int): Handle complex expressions.  Set
	numeric_output_need_bar if necessary.
	(build_overload_value): Handle non-PARM_DECL nodes; this
	routine is now used by build_overload_int.  Remove some
	assignments to numeric_output_need_bar.  Use
	build_overload_scope_ref.
	(build_qualified_name): Note that some template mangled names end
	with digits, and set numeric_output_need_bar appropriately.  Use
	build_underscore_int.
	* pt.c (unify): Change interface.
	(type_unification_real): Likewise.
	(determine_specialization): Use new interfaces.
	(tsubst): Deal gracefully with situations in which the argument
	vector is not fully filled.
	(fn_type_unification): Use new interfaces.
	(type_unification): Likewise.  Remove NOP_EXPR hack.
	(type_unification_real): Likewise.
	(unify): Likewise.  Deal with unification of complex expresions.

From-SVN: r18795
1998-03-24 10:25:44 +00:00
Nick Clifton a73cab0f26 Makefile.in: Various fixes for building cygwin32 native toolchains.
* Makefile.in: Various fixes for building cygwin32 native toolchains.
        * Make-lang.in: Likewise.

Co-Authored-By: Geoff Noer <noer@cygnus.com>

From-SVN: r18745
1998-03-21 16:49:35 -07:00
Mark Mitchell ad32129310 semantics.c: New file, containing routines to perform the semantic phase of parsing.
* semantics.c: New file, containing routines to perform the
	semantic phase of parsing.
	* parse.y: Use it.
	* pt.c (tsubst_expr): Likewise.
	* cp-tree.h: Declare the various functions in semantics.c.
	Provide macros to access _STMT tree nodes.
	* cp-tree.def: Add ASM_STMT tree node.
	* Makefile.in, Make-lang.in: Add dependencies on and for
	semantics.c.

From-SVN: r18658
1998-03-18 10:52:04 +00:00
Jason Merrill f84b4be9a7 Support for friend templates.
* typeck.c (build_x_function_call): Handle static member function
	templates like non-templates.  Handle friend templates like normal
	function templates.
	* pt.c (tsubst, *_PARM): Don't use orig_level.
	(get_bindings): Don't call add_to_template_args.
	(instantiate_template): Likewise.
	(tsubst, FUNCTION_DECL): Call add_to_template_args as appropriate.
	* ptree.c (print_lang_type): Print index/level for template parms.
	* Make-lang.in (cc1plus): Note that cc1plus depends on
	cp/cp-tree.h and cp/cp-tree.def.
	* cp-tree.def (TEMPLATE_CONST_PARM): Remove.
	(TEMPLATE_PARM_INDEX): New tree code, used to indicate a
	position in a template parameter list.
	* cp-tree.h (template_parm_index): New structure, used as the tree
	structure for a TEMPLATE_PARM_INDEX.
	(TEMPLATE_PARM_IDX): New macro.
	(TEMPLATE_PARM_LEVEL): Likewise.
	(TEMPLATE_PARM_DESCENDANTS): Likewise.
	(TEMPLATE_PARM_ORIG_LEVEL): Likewise.
	(TEMPLATE_PARM_DECL): Likewise.
	(TEMPLATE_TYPE_PARM_INDEX): Likewise.
	(TEMPLATE_TYPE_ORIG_LEVEL): Likewise.
	(TEMPLATE_TYPE_DECL): Likewise.
	(TEMPLATE_CONST_IDX): Remove.
	(TEMPLATE_CONST_LEVEL): Likewise.
	(TEMPLATE_CONST_SET_INFO): Likewise.
	(TEMPLATE_TYPE_SET_INFO): Likewise.
	(TEMPLATE_TYPE_IDX): Redefine in terms of TEMPLATE_PARM_INDEX
	node.
	(TEMPLATE_TYPE_LEVEL): Likewise.
	* decl.c (decls_match): Call comp_template_parms, rather than
	expanding it inline.
	(duplicate_decls): If two template declarations are being merged,
	then their TEMPLATE_INFOs should be merged as well.
	(grokfndecl): Save template-id information when declaring a friend
	with explicit template arguments.  Pass arguments to
	check_explicit_specialization via correct convention; at some
	point check_explicit_specialization changed, but these call-sites
	did not.
	(grokdeclarator): Tidy up slightly.
	* decl2.c (check_classfn): Tidy up slightly.  Don't assume that
	two template functions with the same DECL_ASSEMBLER_NAME the same,
	since the names are not yet mangled.
	* error.c (dump_decl): Use TEMPLATE_PARM_INDEX instead of
	TEMPLATE_CONST_PARM.
	(dump_expr): Likewise.  Use the TEMPLATE_PARM_DECL to get at the
	decl for a non-type parameter, rather than printing `<tparm ...>'.
	* friend.c (is_friend): Handle TEMPLATE_DECL friends.
	(do_friend): Deal with template friends.
	* lex.c (do_pending_inlines): Call
	maybe_begin_member_template_processing, rather than
	conditionally calling begin_member_template_processing.
	(process_next_inline): Likewise.  Call
	maybe_end_member_template_processing, rather than
	conditionally calling end_member_template_processing.
	(do_pending_defargs): Likewise.
	(do_identifier): Use TEMPLATE_PARM_INDEX instead of
	TEMPLATE_CONST_PARM.
	* method.c (build_mangled_template_parm_index): New function.
	(build_overload_value): Use it.
	(build_overload_name): Likewise.
	* pt.c (finish_member_template_decl): Allow friend declarations.
	(template_class_depth): New function.
	(is_member_template): Rename, and modify, to become...
	(is_member_or_friend_template): New function.
	(end_member_template_processing): Rename, and modify, to become...
	(maybe_end_member_template_processing).
	(build_template_parm_index): New function.
	(reduce_template_parm_level): New function.
	(process_template_parm): Modify to use build_template_parm_index.
	(current_template_args): Change name to current_template_parms.
	(push_template_decl): Deal with friend templates.
	(uses_template_parms): Use TEMPLATE_PARM_INDEX instead of
	TEMPLATE_CONST_PARM.
	(tsubst_friend_function): New function.
	(instantiate_class_template): Generate the DECL_FRIENDLIST
	for a new instantiation by using tsubst_friend_function rather
	than just tsubst.
	(tsubst): Don't tsubst into a type which is a TEMPLATE_DECL.
	Use TEMPLATE_PARM_INDEX instead of TEMPLATE_CONST_PARM, and the
	appropriate new macros.  Use reduce_template_parm_level to
	generate lower-level template parameters.  Handle tsubst'ing into
	TEMPLATE_DECLS that declare TEMPLATE_TEMPLATE_PARMS.  Don't forget
	to tsubst the DECL_CONTEXT and DECL_CLASS_CONTEXT of newly created
	templates.  Similarly for the template parameters for a new
	template.
	(tsubst_copy): Tidy up slightly.  Use TEMPLATE_PARM_INDEX instead
	of TEMPLATE_CONST_PARM.  Handle TYPE_DECLs by tsubsting into them.
	(unify): Use TEMPLATE_PARM_INDEX instead of TEMPLATE_CONST_PARM.
	(get_bindings): Call add_to_template_args if necessary.
	(instantiate_decl): Handle instantiations of friend templates.
	* search.c (lookup_field_1): Don't treat the TYPE_FIELDS of a
	TEMPLATE_TYPE_PARM as a list of fields; it's not!
	* spew.c (yylex): Do a little manual constant propogation to
	clarify the code.

From-SVN: r18198
1998-02-22 22:17:44 -05:00
Manfred Hollstein 5b47722461 Make-lang.in (DEMANGLER_INSTALL_NAME, [...]): New macros.
* Make-lang.in (DEMANGLER_INSTALL_NAME, DEMANGLER_CROSS_NAME): New
	macros.
	(c++.install-common): Install c++filt properly as native or as cross
	variant.
	(c++.uninstall): Add c++filt.

From-SVN: r18000
1998-02-14 10:56:38 -05:00
Jason Merrill d8b55a76ef cp-tree.h: Add access_protected_virtual_node.
* cp-tree.h: Add access_protected_virtual_node.
	* class.c (init_class_processing): Initialize it.
	* decl.c (xref_basetypes): Use it.
	* parse.y (base_class_access_list): Likewise.
	* Make-lang.in (DEMANGLER_PROG): Add $(exeext).
	(c++.install-common): Install c++filt.

From-SVN: r17894
1998-02-12 19:30:37 -05:00
Jeff Law 956d69504d Merge from gcc-2.8
From-SVN: r16987
1997-12-06 17:31:01 -07:00
Jason Merrill ced78d8b0c Makefile.in (LIB2FUNCS): Remove C++ memory management support.
./:	* Makefile.in (LIB2FUNCS): Remove C++ memory management support.
	* libgcc2.c: Remove __builtin_new, __builtin_vec_new, set_new_handler,
	__builtin_delete, and __builtin_vec_delete.

	* except.c (output_exception_table): Don't bother with
 	__EXCEPTION_END__.

cp/:
	* Make-lang.in (CXX_LIB2FUNCS): Add new op new and op delete objs.
	(various.o): Likewise.
	* inc/new: Add placement deletes.  Add throw specs for default new.
	* new.cc (set_new_handler): Move here from libgcc2.
	* new1.cc (new (nothrow)): Catch a bad_alloc thrown from the handler.
	(new): Move from libgcc2.  Throw bad_alloc.
	* new2.cc: Move the rest of the op news and op deletes from libgcc2.
	* decl.c (init_decl_processing): Update exception specs on new and
	delete.

From-SVN: r16617
1997-11-20 18:17:48 -05:00
Jason Merrill c7ae64f2cc stmt.c (expand_decl_cleanup_no_eh): New fn.
* stmt.c (expand_decl_cleanup_no_eh): New fn.

	* except.c (expand_leftover_cleanups): do_pending_stack_adjust.

	Complete nested exception support.
	* except.c (do_pop_exception): Split out...
	(push_eh_cleanup): From here.  Handle the EH region by hand.
	(expand_start_catch_block): Add a new level for the catch parm.
	Move the rethrow region outside the two cleanup regions.
	Protect the initializer for the catch parm with terminate.
	(expand_end_catch_block): Likewise.  End the region for the eh_cleanup.
	* exception.cc (__cp_pop_exception): Now takes two parms.  Handle
	popping off the middle of the stack.
	* tree.c (lvalue_p, real_lvalue_p): Handle TRY_CATCH_EXPR,
	WITH_CLEANUP_EXPR, and UNSAVE_EXPR.
	(build_cplus_new): Only wrap CALL_EXPRs.
	* init.c (expand_default_init): Handle a TRY_CATCH_EXPR around
	the constructor call.

From-SVN: r16419
1997-11-10 15:03:49 -05:00
Jeff Law e9a25f70a0 Update mainline egcs to gcc2 snapshot 971021.
From-SVN: r16278
1997-11-02 14:19:36 -07:00
Jim Wilson ac64120eeb Add Fred Fish's LN/LN_S patch.
From-SVN: r15415
1997-09-11 13:39:08 -07:00
Jason Merrill da20811c09 merge
From-SVN: r14852
1997-08-19 18:37:19 -04:00
Mike Stump 8dff10278c 92th Cygnus<->FSF quick merge
From-SVN: r14576
1997-08-01 17:21:46 +00:00
Jim Meyering 27b81fc2de (cplib2.ready): Also depend on $(LANGUAGES).
From H.J. Lu.

From-SVN: r14394
1997-07-07 04:00:34 +00:00
Mike Stump 6633d6367f 91th Cygnus<->FSF quick merge
From-SVN: r14253
1997-06-18 02:25:37 +00:00
Mike Stump eb66be0e6c 91th Cygnus<->FSF merge
From-SVN: r13971
1997-04-23 22:39:53 +00:00
Mike Stump bd6dd8453c 90th Cygnus<->FSF quick merge
From-SVN: r13831
1997-04-02 03:58:33 +00:00
Mike Stump 824b9a4c45 90th Cygnus<->FSF quick merge
From-SVN: r13604
1997-02-04 02:31:49 +00:00
Mike Stump f7da60971f 90th Cygnus<->FSF quick merge
From-SVN: r13343
1996-12-27 19:34:34 +00:00
Mike Stump d2e5ee5c70 90th Cygnus<->FSF quick merge
From-SVN: r13321
1996-12-18 02:46:25 +00:00
Mike Stump faf5394a1b 90th Cygnus<->FSF quick merge
From-SVN: r13319
1996-12-18 01:44:21 +00:00
Mike Stump f49422dada 89th Cygnus<->FSF quick merge
From-SVN: r12978
1996-10-18 18:33:44 +00:00
Mike Stump 5156628f9f 89th Cygnus<->FSF quick merge
From-SVN: r12883
1996-09-30 21:34:04 +00:00
Mike Stump 9e9ff70986 80th Cygnus<->FSF merge
From-SVN: r11150
1996-02-01 19:32:00 +00:00
Douglas Rupp ccef7c3f6c (cc1plus) : Removed unnecessary $(exeext).
From-SVN: r10328
1995-09-12 17:31:04 -04:00
Richard Kenner 31a00187df (DEMANGLER_PROG): Add LIBS.
From-SVN: r9997
1995-06-16 15:06:59 -04:00
Richard Kenner de18aff348 Change FSF address.
From-SVN: r9988
1995-06-15 17:06:59 -04:00
Paul Eggert 227c77e2b7 (c++.mostlyclean): Remove $(DEMANGLER_PROG).
From-SVN: r9837
1995-05-29 12:44:40 -04:00
H.J. Lu 7869653866 (cxxmain.o): Replace single quotes with backslashes.
From-SVN: r9798
1995-05-24 14:40:42 -04:00
Richard Kenner 251580eeff (g++, g++-cross, cc1plus, DEMANGLER_PROG):
Use $@ instead of output name so works even if have .exe.
(cxxmain.o): Use cp if ln -s fails.
(c++.install-man): Use $(exeext) in executable names.
(c++.mostlyclean, stage[1-4]): Use $(objext) in object file names.

From-SVN: r9767
1995-05-22 17:37:40 -04:00
Mike Stump 863adfc08e 69th Cygnus<->FSF merge
From-SVN: r9606
1995-05-10 02:58:06 +00:00
Richard Kenner f1908d7025 Change "realclean" to "maintainer-clean".
From-SVN: r9450
1995-04-25 18:07:11 -04:00
Mike Stump faae18abc2 62nd Cygnus<->FSF merge
From-SVN: r9298
1995-04-03 19:28:01 +00:00
Douglas Rupp be81d4d77c Modify "ln" commands to try a "cp" if "ln" fails.
($exeext, $objext, $oldobjext): New macros.

From-SVN: r9006
1995-02-21 18:38:37 -05:00
Mike Stump 5edb8b93cb 51st Cygnus<->FSF merge
From-SVN: r8676
1994-12-20 22:14:37 +00:00
Mike Stump 6060a79633 50th Cygnus<->FSF merge
From-SVN: r8657
1994-12-16 02:07:31 +00:00
Mike Stump db5ae43ff2 49th Cygnus<->FSF merge
From-SVN: r8570
1994-11-29 00:59:16 +00:00
Doug Evans 04dbaf1f25 (c++.install-man): Use program_transform_name on g++.1.
(c++.uninstall): Likewise.

From-SVN: r8502
1994-11-18 01:32:08 +00:00
Doug Evans 8aa3abc805 (CXX_INSTALL_NAME) Use program_transform_name.
(GXX_INSTALL_NAME) Likewise.
(CXX_CROSS_NAME) Use program_transform_cross_name.
(GXX_CROSS_NAME) Likewise.

From-SVN: r8501
1994-11-18 01:10:14 +00:00
Mike Stump a0a339271a 39th Cygnus<->FSF merge
From-SVN: r7439
1994-06-03 21:42:31 +00:00
Jason Merrill 223d33d992 (cc1plus): Don't depend on OBJS or BC_OBJS, since stamp-objlist does.
From-SVN: r7196
1994-05-03 23:08:42 +00:00
Doug Evans f697d371c6 (cc1plus): Depend on stamp-objlist.
From-SVN: r7180
1994-04-29 05:18:33 +00:00
Doug Evans 187ce4326e (c++.distdir): mkdir tmp/cp first.
From-SVN: r7177
1994-04-29 02:14:06 +00:00
Doug Evans ffb823ad58 (c++.install-common): Check for g++-cross.
From-SVN: r7149
1994-04-25 18:01:51 +00:00
Doug Evans a594307580 Initial revision
From-SVN: r7135
1994-04-22 07:25:56 +00:00