Commit Graph

281 Commits

Author SHA1 Message Date
Kaveh R. Ghazi 83182544db c-parse.in (yyerror): Const-ification and/or static-ization.
* c-parse.in (yyerror): Const-ification and/or static-ization.
	* c-typeck.c (push_member_name): Likewise.
	* collect2.c (main): Likewise.
	* dbxout.c (dbxout_parms): Likewise.
	* diagnostic.c (format_with_decl): Likewise.
	* dwarf2out.c (output_ranges): Likewise.
	* dwarfout.c (fundamental_type_code): Likewise.
	* except.c (dw2_output_call_site_table): Likewise.
	* gcc.c (do_spec_1): Likewise.
	* genopinit.c (optabs): Likewise.
	* objc/objc-act.c (synth_id_with_class_suffix, start_class,
	gen_declaration_1, handle_impent): Likewise.
	* protoize.c (default_include, in_system_include_dir, abspath):
	Likewise.
	* sched-vis.c (visualize_stall_cycles): Likewise.
	* sdbout.c (plain_type_1, sdbout_end_function,
	sdbout_end_epilogue): Likewise.
	* varasm.c (decode_reg_name): Likewise.

	* 1750a.c (mod_regno_adjust): Likewise.
	* alpha.c (alpha_write_one_linkage,
	unicosmk_output_default_externs): Likewise.
	* arm.c (arm_condition_codes): Likewise.
	* arm.h (arm_condition_codes): Likewise.
	* avr.c (output_movsisf, encode_section_info): Likewise.
	* darwin.h (GEN_BINDER_NAME_FOR_STUB, GEN_SYMBOL_NAME_FOR_SYMBOL):
	Likewise.
	* i386.c (hi_reg_name, qi_reg_name, qi_high_reg_name): Likewise.
	* i386.h (hi_reg_name, qi_reg_name, qi_high_reg_name): Likewise.
	* m88k.c (output_function_profiler): Likewise.
	* mips.c (mips_output_conditional_branch): Likewise.
	* ns32k.c (ns32k_out_reg_names): Likewise.
	* ns32k.h (ns32k_out_reg_names): Likewise.
	* pj.c (pj_output_rval): Likewise.
	* rs6000.c (GEN_LOCAL_LABEL_FOR_SYMBOL): Likewise.
	* sparc.c (sparc_flat_function_prologue,
	sparc_flat_function_epilogue): Likewise.

cp:
	* decl.c (warn_extern_redeclared_static, cp_make_fname_decl):
	Const-ification.
	* pt.c (tsubst_decl): Likewise.

f:
	* bad.c (ffebad_finish): Const-ification and/or static-ization.
	* intrin.c (ffeintrin_cmp_name_): Likewise.
	* stc.c (ffestc_R904): Likewise.

java:
	* expr.c (expand_invoke): Const-ification.
	* parse.y (patch_method_invocation): Likewise.

From-SVN: r45581
2001-09-13 14:37:29 +00:00
Lars Brinkhoff 1322177dbd Makefile.in, [...]: replace "GNU CC" with "GCC".
* Makefile.in, alias.c, basic-block.h, bb-reorder.c, bitmap.c,
	bitmap.h, builtin-types.def, builtins.c, builtins.def,
	c-aux-info.c, c-common.c, c-common.def, c-common.h,
	c-convert.c, c-decl.c, c-dump.c, c-dump.h, c-errors.c,
	c-format.c, c-lang.c, c-lex.c, c-lex.h, c-parse.in,
	c-pragma.c, c-pragma.h, c-semantics.c, c-tree.h, c-typeck.c,
	caller-save.c, calls.c, collect2.c, collect2.h, combine.c,
	conditions.h, config.gcc, configure.frag, configure.in,
	conflict.c, convert.c, convert.h, cppspec.c, crtstuff.c,
	cse.c, cselib.c, cselib.h, dbxout.c, dbxout.h, defaults.h,
	dependence.c, df.c, df.h, diagnostic.c, diagnostic.h,
	doloop.c, dominance.c, dwarf.h, dwarf2.h, dwarf2asm.c,
	dwarf2asm.h, dwarf2out.c, dwarf2out.h, dwarfout.c,
	emit-rtl.c, errors.c, errors.h, except.c, except.h,
	exgettext, explow.c, expmed.c, expr.c, expr.h, final.c,
	fixproto, flags.h, flow.c, fold-const.c, fp-test.c,
	function.c, function.h, gbl-ctors.h, gcc.c, gcc.h, gcc.hlp,
	gccspec.c, gcov-io.h, gcse.c, genattr.c, genattrtab.c,
	gencheck.c, gencodes.c, genconfig.c, genemit.c,
	genextract.c, genflags.c, gengenrtl.c, genmultilib,
	genopinit.c, genoutput.c, genpeep.c, genrecog.c,
	gensupport.c, gensupport.h, ggc-callbacks.c, ggc-common.c,
	ggc-none.c, ggc-page.c, ggc-simple.c, ggc.h, global.c,
	graph.c, graph.h, gthr-aix.h, gthr-dce.h, gthr-posix.h,
	gthr-rtems.h, gthr-single.h, gthr-solaris.h, gthr-vxworks.h,
	gthr-win32.h, gthr.h, haifa-sched.c, halfpic.c, halfpic.h,
	hard-reg-set.h, hwint.h, ifcvt.c, input.h, insn-addr.h,
	integrate.c, integrate.h, jump.c, lcm.c, libgcc2.c,
	libgcc2.h, lists.c, local-alloc.c, loop.c, loop.h,
	machmode.def, machmode.h, main.c, mbchar.c, mbchar.h,
	mips-tdump.c, mips-tfile.c, mklibgcc.in, mkmap-flat.awk,
	mkmap-symver.awk, optabs.c, output.h, params.c, params.def,
	params.h, predict.c, predict.def, predict.h, prefix.c,
	prefix.h, print-rtl.c, print-tree.c, profile.c, protoize.c,
	read-rtl.c, real.c, real.h, recog.c, recog.h, reg-stack.c,
	regclass.c, regmove.c, regrename.c, regs.h, reload.c,
	reload.h, reload1.c, reorg.c, resource.c, resource.h, rtl.c,
	rtl.def, rtl.h, rtlanal.c, sbitmap.c, sbitmap.h,
	sched-deps.c, sched-ebb.c, sched-int.h, sched-rgn.c,
	sched-vis.c, sdbout.c, sdbout.h, sibcall.c, simplify-rtx.c,
	ssa-ccp.c, ssa-dce.c, ssa.c, ssa.h, stmt.c, stor-layout.c,
	stringpool.c, system.h, timevar.c, timevar.def, timevar.h,
	tlink.c, toplev.c, toplev.h, tree.c, tree.def, tree.h,
	tsystem.h, unroll.c, unwind-dw2-fde.c, unwind-dw2-fde.h,
	unwind-dw2.c, unwind-pe.h, unwind-sjlj.c, unwind.h,
	unwind.inc, varasm.c, varray.c, varray.h, xcoffout.c,
	xcoffout.h: replace "GNU CC" with "GCC".

From-SVN: r45105
2001-08-22 14:35:51 +00:00
Zack Weinberg 94aca34298 toplev.c (set_float_handler): Make static.
* toplev.c (set_float_handler): Make static.
	* toplev.h: Don't prototype set_float_handler.

	* simplify-rtx.c: Don't include setjmp.h.
	(simplify_unary_real, simplify_binary_real, simplify_binary_is2orm1):
	New functions.
	(simplify_unary_operation, simplify_binary_operation): Use them,
	via do_float_handler.

	* fold-const.c: Don't include setjmp.h.
	(exact_real_inverse_1): New function.
	(exact_real_inverse): Use it, via do_float_handler.

	* varasm.c: Don't include setjmp.h.
	(assemble_real_1): New function.
	(assemble_real): Use it, via do_float_handler.
	Call internal_error if we get a trap here.

	* c-parse.in, cse.c, cselib.c, ch/lex.c, config/i386/i386.c,
	config/pj/pj.c, config/s390/s390.c: Don't include setjmp.h.

	* java/lex.h: Don't include setjmp.h.  Don't define
	SET_FLOAT_HANDLER or prototype set_float_handler.

From-SVN: r44815
2001-08-12 01:56:10 +00:00
Neil Booth ef6e958a86 Makefile.in (CPPLIB_H): New, so that dependencies on cpplib.h are also on line-map.h.
* Makefile.in (CPPLIB_H): New, so that dependencies on cpplib.h
	are also on line-map.h.
	* cppfiles.c (stack_include_file): Update.
	* cpphash.h (struct cpp_buffer): New member return_at_eof.
	(_cpp_pop_buffer): New.
	* cppinit.c (cpp_destroy, cpp_finish): Update.
	(do_includes): Mark each buffer to return at EOF.
	* cpplex.c (_cpp_lex_token): Pop buffers at EOF.  Continue or
	return as requested.
	* cpplib.c (run_directive, do_line, cpp_push_buffer): Update.
	(cpp_pop_buffer): Rename _cpp_pop_buffer.  Stop skipping.
	* cpplib.h (cpp_pop_buffer): Remove.
	(cpp_scan_buffer_nooutput): Rename cpp_scan_nooutput.
	* cppmacro.c (cpp_scan_buffer_nooutput): Similarly.  No need to pop
	buffers.
	* cppmain.c (scan_buffer): Rename scan_translation_unit.  No need
	to pop buffers.
	(do_preprocessing): Update.
	* fix-header.c (read_scan_file): Update.  No need to pop buffers.
	* c-parse.in (_yylex): Similarly.
	* scan-decls.c (scan_decls): Similarly.
	* line-map.h: Update comments.

	* cp/spew.c (read_token): No need to pop buffers.

	* objc/Make-lang.in (objc-act.o): Update dependencies.

From-SVN: r44634
2001-08-04 12:01:59 +00:00
Ziemowit Laski f2e6e5307b c-parse.in (OBJC_NEED_RAW_IDENTIFIER): Define macro and flag for contextualizing Objective-C class name lookup by the...
2001-08-01  Ziemowit Laski  <zlaski@apple.com>

        * c-parse.in (OBJC_NEED_RAW_IDENTIFIER): Define macro and flag for
	contextualizing Objective-C class name lookup by the lexer.
	(typespec_reserved_nonattr): Disable ObjC class name lookup after
	seeing a TYPESPEC.
	(protocoldef): Add support for forward @protocol declarations.
	(yylexname): Suppress ObjC class name lookup in certain contexts;
	re-enable after lookup is complete.
	(_yylex): Re-enable ObjC class name lookup when certain
	punctuation marks are seen.

	* objc/objc-act.c (check_protocol_recursively): New function used
	for finding circular dependencies in protocols.
	(objc_declare_protocols): New function for handling forward
	@protocol declarations.
	(receiver_is_class_object): Detect the case when 'self' is used
	inside of a class method.
	(build_message_expr): Issue a warning if class method is desired
	but instance method is found instead.
	(conforms_to_protocol): Streamline.
	(objc_comptypes): Detect the fact that 'Bar<Foo> foo' conforms to
	protocol Foo, even if 'Bar foo' does not.
	(check_protocols): Streamline.
	(start_protocol): Add checks for circular and duplicate protocol
	definitions.
	(encode_aggregate_within): For typedefs of structs, encode the
	underlying struct.
	* objc/objc-act.h (PROTOCOL_DEFINED): New tree accessor.
	(objc_declare_protocols): New prototype.

From-SVN: r44536
2001-08-01 08:10:00 +00:00
Neil Booth c60e94a70e c-lex.c (c_lex): Remove CPP_INT, CPP_FLOAT cases.
* c-lex.c (c_lex): Remove CPP_INT, CPP_FLOAT cases.
	* c-parse.in (yyerror, _yylex): Similarly.
	* cppexp.c (parse_number, parse_defined, lex, _cpp_parse_expr):
	Don't use CPP_INT, CPP_FLOAT; CPP_NUMBER is enough.
	Update comments.
	* cpplib.h (CPP_INT, CPP_FLOAT): Remove.
	* cp/spew.c (read_token, yyerror): Remove CPP_INT, CPP_FLOAT cases.

From-SVN: r44144
2001-07-19 06:12:50 +00:00
Joseph Myers 4b01f8d817 c-parse.in (all_prefix_attributes): New variable.
* c-parse.in (all_prefix_attributes): New variable.
	(PUSH_DECLSPEC_STACK, POP_DECLSPEC_STACK): New macros.
	(maybe_resetattrs): New production.
	(c_parse_init, datadef, fndef, datadecl, setspecs, setattrs, decl,
	maybe_type_quals_setattrs, initdecls, notype_initdecls, initdcl,
	notype_initdcl, nested_function, notype_nested_function,
	component_decl, components, components_notype,
	component_declarator, component_notype_declarator,
	absdcl_maybe_attribute, parm, firstparm, setspecs_fp, ivar_decl,
	ivars, mydecl, myparm): Update.  Avoid prefix attributes just
	after a comma being applied to more than one declarator.
	* doc/extend.texi (Attribute Syntax): Update.  Remove
	documentation of bugs that are no longer present.

testsuite:
	* gcc.c-torture/compile/20010714-1.c, gcc.dg/format/attr-4.c: New
	tests.

From-SVN: r44070
2001-07-17 12:58:54 +01:00
Joseph Myers 59387d2e31 c-common.c (decl_attributes): Take a pointer to the node to which attributes are to be attached...
* c-common.c (decl_attributes): Take a pointer to the node to
	which attributes are to be attached, and a flags argument.
	* c-common.h (enum attribute_flags): New.
	(decl_attributes): Update prototype.
	* c-decl.c (start_decl, push_parm_decl, finish_struct,
	finish_enum, start_function): Update calls to decl_attributes.
	* c-parse.in (component_declarator, component_notype_declarator,
	label): Update calls to decl_attributes.

cp:
	* decl2.c (cplus_decl_attributes): Take a pointer to the node to
	which attributes are to be attached, and a flags argument.  Update
	call to decl_attributes.
	(grokfield): Update call to decl_attributes.
	* class.c (finish_struct): Update call to cplus_decl_attributes.
	* cp-tree.h (cplus_decl_attributes): Update prototype.
	* decl.c (start_decl, grokdeclarator, start_function): Update
	calls to decl_attributes and cplus_decl_attributes.
	* friend.c (do_friend): Update call to cplus_decl_attributes.
	* parse.y (parse_bitfield): Update call to cplus_decl_attributes.

From-SVN: r43995
2001-07-13 21:40:43 +01:00
Joseph Myers f7a4cec096 c-common.c (decl_attributes): Only take a single attributes parameter.
* c-common.c (decl_attributes): Only take a single attributes
	parameter.
	* c-common.h (decl_attributes): Update prototype.
	* c-decl.c (start_decl, start_function): Only take a single
	attributes parameter.  Update calls to decl_attributes.
	(finish_struct, finish_enum): Update calls to decl_attributes.
	(push_parm_decl): Expect unified list of attributes.  Update call
	to decl_attributes.
	* c-parse.in (fndef, initdcl, notype_initdcl, nested_function,
	notype_nested_function, component_declarator,
	component_notype_declarator, label): Update calls to
	decl_attributes.
	(absdcl_maybe_attribute, parm, firstparm, myparm): Unify attribute
	lists that are passed to push_parm_decl.
	* c-tree.h (start_function, start_decl): Update prototypes.
	* config/sh/sh-protos.h, config/sh/sh.c
	(sh_pragma_insert_attributes): Only take a single attributes
	parameter.
	* config/sh/sh.h (PRAGMA_INSERT_ATTRIBUTES): Likewise.
	* doc/tm.texi (INSERT_ATTRIBUTES): Update.
	* objc/objc-act.c (define_decl, generate_objc_symtab_decl,
	build_module_descriptor, generate_static_references,
	generate_strings, build_selector_translation_table,
	generate_descriptor_table, generate_protocols,
	generate_ivars_list, generate_dispatch_table,
	generate_protocol_list, generate_category,
	generate_shared_structures, really_start_method, add_objc_decls,
	generate_classref_translation_entry): Update calls to start_decl
	and start_function.
	(build_tmp_function_decl, start_method_def): Unify attribute lists
	that are passed to push_parm_decl.

cp:
	* decl.c (grokdeclarator), decl2.c (cplus_decl_attributes): Update
	calls to decl_attributes.

testsuite:
	* gcc.c-torture/compile/20010701-1.c,
	g++.old-deja/g++.ext/attrib6.C: New tests.

From-SVN: r43850
2001-07-08 20:58:19 +01:00
Zack Weinberg b8363a243d c-common.h (enum rid): Add RID_FIRST_AT, RID_LAST_AT, RID_LAST_PQ.
* c-common.h (enum rid): Add RID_FIRST_AT, RID_LAST_AT,
	RID_LAST_PQ.  Move RID_FIRST_PQ down with the other FIRST/LAST
	enumerators.
	(OBJC_IS_AT_KEYWORD, OBJC_IS_PQ_KEYWORD): New macros.

	* c-parse.in (OBJC_STRING): Kill.
	(objc_string): Decompose to [objc_string] '@' STRING.
	(reswords): Take the leading '@' off all the Objective C keywords.
	(objc_rid_sans_at): Kill.
	(init_reswords): Don't initialize it.
	(yylexname): Use OBJC_IS_AT_KEYWORD and OBJC_IS_PQ_KEYWORD.
	(_yylex): Kill reconsider label.  Look ahead one token after
	an '@'; if we get an identifier, check whether it's an
	Objective C @-keyword.  If so, return the keyword.  Otherwise,
	put back the token and return the '@' as a terminal.

	* cpplib.c (lex_macro_node): Remove unnecessary check for
	leading '@' on identifier.  Clarify control flow and commentary.

From-SVN: r43674
2001-07-01 18:48:13 +00:00
Gabriel Dos Reis 2a2b2d432e Makefile.in (c-parse.o): Depend on diagnostic.h
gcc/

2001-06-10  Mark Mitchell <mark@codesourcery.com>
	    Gabriel Dos Reis  <gdr@codesourcery.com>

	* Makefile.in (c-parse.o): Depend on diagnostic.h
	(dwarf2out.o): Likewise.

	* dwarf2out.c: #include diagnostic.h

	* toplev.h (warningcount, errorcount, sorrycount): Remove
	declarations.

	* toplev.c (warningcount, errorcount, sorrycount): Remove
	definitions.

	* diagnostic.h (struct output_buffer): Reorder fields.
	(diagnostic_kind_count): New macro.
	(errorcount, warningcount, sorrycount): Define as macros.
	(diagnostic_report_warnings_p): New macro.
	(output_state): Add diagnostic_count field.

	* diagnostic.c (warningcount, errorcount, inhibit_warnings):
	Remove tentative declaration.
	(count_error): Use diagnostic_report_warnings_p.

	* c-parse.in: #include diagnostic.h

ch/

2001-06-10  Gabriel Dos Reis  <gdr@codesourcery.com>

	* decl.c: #include diagnostic.h
	* actions.c: #include diagnostic.h
	* Makefile.in (actions.o): Depend on diagnostic.h
	(decl.o): Depend on diagnostic.h

cp/

2001-06-10  Mark Mitchell <mark@codesourcery.com>
	    Gabriel Dos Reis  <gdr@codesourcery.com>

	* Make-lang.in (cp/call.o): Depend on diagnostic.h
	(cp/typeck.o): Depend on diagnostic.h
	(cp/typeck2.o): Depend on diagnostic.h
	(cp/repo.o): Depend on dignostic.h
	* typeck.c: #include diagnostic.h
	(convert_for_initialization): Remove extern declaration for
	warningcount and errorcount.

	* call.c: #include diagnostic.h
	(convert_like_real): Remove extern declaration for warnincount and
	errorcount.

	* repo.c: #include diagnostic.h
	* typeck2.c: #include diagnostic.h

From-SVN: r43140
2001-06-10 13:48:04 +00:00
Neil Booth d3c733f95f * c-parse.in (notype_initdcl): Remove redundant line.
From-SVN: r42581
2001-05-25 19:44:20 +00:00
Joseph Myers 0e03329a6f c-parse.in (array_declarator): New.
* c-parse.in (array_declarator): New.  Handle C99 constructs.
	Don't restrict [*] declarators to C only.
	(after_type_declarator, parm_declarator_starttypename,
	parm_declarator_nostarttypename, notype_declarator,
	direct_absdcl1): Use it.
	* c-decl.c (build_array_declarator, set_array_declarator_type):
	New functions.  Warn that [*] isn't properly implemented; pedwarn
	for [*] outside C99 mode if pedantic rather than giving a hard
	error.
	(grokdeclarator): Handle static and type qualifiers in parameter
	array declarators.
	* c-tree.h (build_array_declarator, set_array_declarator_type):
	Declare.
	* extend.texi (Attribute Syntax): Document attributes in parameter
	array declarators.

testsuite:
	* gcc.dg/c90-arraydecl-1.c, gcc.dg/c99-arraydecl-1.c: New tests.

From-SVN: r42574
2001-05-25 12:12:47 +01:00
Joseph Myers 97d2451609 re PR c/166 (C syntax problem in gcc)
* c-parse.in (parm_declarator): Split into
	parm_declarator_starttypename and parm_declarator_nostarttypename.
	(parm_declarator_starttypename, parm_declarator_nostarttypename):
	New.  Allow parenthesised sub-declarators which don't begin with a
	TYPENAME.  Fixes PR c/166.

testsuite:
	* gcc.c-torture/compile/20010114-1.x: Remove.

From-SVN: r42315
2001-05-19 21:19:24 +01:00
Neil Booth 0b1cdaf229 c-parse.in (methodtype): New production.
* c-parse.in (methodtype): New production.
	(methoddef, methodproto): Collapse separate '-' and '+'
	handlers into 1.

From-SVN: r42133
2001-05-16 06:34:34 +00:00
Neil Booth 4c521bad98 c-common.h (RID_FIRST_PQ): New.
* c-common.h (RID_FIRST_PQ): New.
	* c-parse.in (objc_pq_context): New.
	(objc parser): Set objc_pq_context rather than calling
	remember_protocol_qualifiers and forget_protocol_qualifiers.
	Don't call save_and_forget_protocol_qualifiers.
	(yylexname): Handle objc protocol qualifiers here.
	* stringpool.c (struct str_header): Replace with sp_hashnode.
	(SP_EMPTY, SP_LEN, SP_TREE, SP_STR, SP_VALID): New.
	(alloc_string): Rename alloc_ident.  Use the SP_ accessors.
	Allocate an IDENTIFIER_NODE for each identifier.
	(FORALL_STRINGS, set_identifier): Delete.
	(FORALL_IDS, expand_string_table, stringpool_statistics): Update.
	(ggc_alloc_string): Use an obstack.
	(get_identifier, maybe_get_identifier, mark_string_hash): Update.
	* tree.h: Update comments.
	(set_identifier): Delete.
	* objc/objc-act.c (N_PQ, saved_pq, saved_not_pq,
	save_and_forget_protocol_qualifiers, forget_protocol_qualifiers,
	remember_protocol_qualifiers): Delete.

From-SVN: r42132
2001-05-16 06:22:15 +00:00
Neil Booth a3eaca15d9 c-parse.in (bison parser, [...]): Remove uses of doing_objc_thang.
* c-parse.in (bison parser, init_reswords): Remove uses of
	doing_objc_thang.
	* c-tree.h (doing_objc_thang): Remove.

From-SVN: r42000
2001-05-12 17:58:41 +00:00
Neil Booth 15b732b288 c-common.c (finish_label_expr): New function, lifted from from cp/semantics.c.
* c-common.c (finish_label_expr): New function, lifted from
	from cp/semantics.c.
	* c-common.h (finish_label_expr, lookup_label): New prototypes.
	* c-parse.in: Move 3 blocks of parser code into new functions.
	* c-typeck.c (simple_asm_stmt, c_cast_expr): New functions.
	* c-tree.h (simple_asm_stmt, c_cast_expr): New prototypes.
	(lookup_label): Remove.

From-SVN: r41959
2001-05-11 06:38:48 +00:00
Joseph Myers 25d78ace72 c-parse.in: Remove many shift/reduce conflicts.
* c-parse.in: Remove many shift/reduce conflicts.  Update
	%expect values.
	(declspecs_nosc_nots_nosa_noea, declspecs_nosc_nots_nosa_ea,
	declspecs_nosc_nots_sa_noea, declspecs_nosc_nots_sa_ea,
	declspecs_nosc_ts_nosa_noea, declspecs_nosc_ts_nosa_ea,
	declspecs_nosc_ts_sa_noea, declspecs_nosc_ts_sa_ea,
	declspecs_sc_nots_nosa_noea, declspecs_sc_nots_nosa_ea,
	declspecs_sc_nots_sa_noea, declspecs_sc_nots_sa_ea,
	declspecs_sc_ts_nosa_noea, declspecs_sc_ts_nosa_ea,
	declspecs_sc_ts_sa_noea, declspecs_sc_ts_sa_ea, declspecs_ts,
	declspecs_nots, declspecs_ts_nosa, declspecs_nots_nosa,
	declspecs_nosc_ts, declspecs_nosc_nots, declspecs_nosc, declspecs,
	maybe_type_quals_setattrs, typespec_nonattr, typespec_attr,
	typespec_reserved_nonattr, typespec_reserved_attr,
	typespec_nonreserved_nonattr, maybe_setattrs, structsp_attr,
	structsp_nonattr, components_notype, component_notype_declarator,
	absdcl1_ea, absdcl1_noea, direct_absdcl1, absdcl_maybe_attribute,
	firstparm, setspecs_fp): New
	(typed_declspecs, reserved_declspecs, typed_typespecs,
	reserved_typespecquals, declmods, typespec, typespecqual_reserved,
	typed_declspecs_no_prefix_attr reserved_declspecs_no_prefix_attr
	declmods_no_prefix_attr, nonempty_type_quals, structsp,
	type_quals): Remove.  Users updated.
	(initdecls, notype_initdecls, after_type_declarator,
	parm_declarator, notype_declarator, absdcl1, components, ivars):
	Don't allow attributes at the start of a declarator; include them
	in the production containing the declarator instead.  Always
	require type specifiers before trying to redeclare a typedef name.
	(typename): Allow for attributes but warn that they are ignored.
	(parmlist, firstparm, setspecs_fp): Include attributes in
	parmlist; suck them off the parser stack in firstparm using
	setspecs_fp.

testsuite:
	* gcc.c-torture/compile/20010313-1.c: New test.

From-SVN: r41940
2001-05-10 17:17:07 +01:00
Nathan Sidwell 0ba8a114c7 Lazy __FUNCTION__ generation.
gcc:
	Lazy __FUNCTION__ generation.
	* c-common.h (RID_FUNCTION_NAME, RID_PRETTY_FUNCTION_NAME,
	RID_C99_FUNCTION_NAME): New _RIDs.
	(CTI_FUNCTION_ID, CTI_PRETTY_FUNCTION_ID, CTI_FUNC_ID): Remove.
	(CTI_FUNCTION_NAME_DECL, CTI_PRETTY_FUNCTION_NAME_DECL,
	CTI_C99_FUNCTION_NAME_DECL, CTI_SAVED_FUNCTION_NAME_DECLS): New
	global tree slots.
	(function_id_node, pretty_function_id_node, func_id_node): Remove.
	(c99_function_name_decl_node, function_name_decl_node,
	pretty_function_name_decl_node, saved_function_name_decls):
	Declare.
	(struct language_function): Remove x_function_name_declared_p.
	(make_fname_decl): Remove a parameter.
	(declare_function_names): Remove prototype.
	(start_fname_decls, finish_fname_decls): Prototype.
	(fname_as_string): Likewise.
	(fname_string, fname_decl): Likewise.
	* c-common.c (make_fname_decl): Adjust.
	(struct fname_var_t): New struct.
	(fname_vars): New static array.
	(declare_function_name): Remove.
	(start_fname_decls, finish_fname_decls): New functions.
	(fname_as_string): New function from remnants of
	declare_function_name.
	(fname_string, fname_decl): New functions.

	* c-decl.c (c_function_name_declared_p): Remove.
	(init_decl_processing): Don't generate __FUNCTION__ et al ids,
	don't call declare_function_name. Call start_fname_decls.
	(c_make_fname_decl): Adjust parameters. Generate the name. Don't
	clobber the line number. Call finish_decl.
	(start_function): Call start_fname_decls.
	(finish_function): Call finish_fname_decls.
	Remove c_function_name_declared_p.
	(push_c_function_context): Don't push c_function_name_declared_p.
	(pop_c_function_context): Don't pop c_function_name_declared_p.
	(c_begin_compound_stmt): Don't check c_function_name_declared_p.
	* c-parse.in (STRING_FUNC_NAME, VAR_FUNC_NAME): New tokens.
	(program): Call finish_fname_decls for C.
	(primary): Add VAR_FUNC_NAME.
	(reswords): Add slots for __FUNCTION__ et al.
	(rid_to_yy): Add mappings for __FUNCTION__ et al.
	(yylexname): If it's a STRING_FUNC_NAME generate the function name
	now. Don't look for VAR_DECLs containing __FUNCTION__ et al.
	* c-semantics.c (prune_unused_decls): Remove.
	(finish_stmt_tree): Don't call prune_unused_decls.
	(genrtl_decl_stmt): Don't prune unused decls here.
cp:
	Lazy __FUNCTION__ generation.
	* cp-tree.def (FUNCTION_NAME): Remove.
	* cp-tree.h (function_name_declared_p): Remove.
	(cp_fname_init): Prototype.
	* decl.c (init_decl_processing): Don't generate __FUNCTION__ et al ids,
	don't call declare_function_name. Call start_fname_decls.
	(cp_make_fname_decl): Adjust parameters. Generate the name. Don't
	clobber the line number.
	(cp_fname_init): New function.
	(start_function): Call start_fname_decls.
	(finish_function): Call finish_fname_decls.
	* lex.c (reswords): Add slots for __FUNCTION__ et al.
	(rid_to_yy): Add mappings for __FUNCTION__ et al.
	* optimize.c (maybe_clone_body): Remove function_name_declared_p.
	* parse.y (VAR_FUNC_NAME): New token.
	(primary): Add VAR_FUNC_NAME.
	* pt.c (tsubst_decl): Adjust a DECL_PRETTY_FUNCTION_P's
	generation.
	(tsubst, FUNCTION_NAME case): Remove.
	(tsubst_copy, FUNCTION_NAME case): Remove.
	(tsubst_expr, DECL_STMT case): Be careful with a
	DECL_PRETTY_FUNCTION_P.
	(instantiate_decl): Remove function_name_declared_p.
	* semantics.c (begin_compound_statement): Don't call
	declare_function_name here.
	(setup_vtbl_ptr). Don't save & restore function_name_declared_p.
	(finish_translation_unit): Call finish_fname_decls.
	(expand_body): Remove function_name_declared_p.
	* typeck2.c (digest_init): Allow any ERROR_MARK.
testsuite:
	* gcc.dg/c99-func-2.c: Remove xfail.
	* gcc.dg/c99-func-3.c: Remove xfail.
	* gcc.dg/c99-func-4.c: Remove xfail.

From-SVN: r41520
2001-04-24 08:22:06 +00:00
Zack Weinberg cc93758139 c-parse.in (yylexname): New function, split out of _yylex.
* c-parse.in (yylexname): New function, split out of _yylex.
	(objc_rid_sans_at): New table.
	(init_reswords): Initialize it.
	(_yylex): Give labels clearer names.  Handle CPP_ATSIGN by
	retrieving the next token and checking it for significance as
	an ObjC keyword or string constant.

	* cpplex.c (_cpp_lex_token): Just return CPP_ATSIGN for '@'.
	* cpplib.h (TTYPE_TABLE): Add CPP_ATSIGN, drop CPP_OSTRING.

	* c-lex.c, c-parse.in, cppmacro.c, cpplex.c, cp/spew.c: Remove
	references to CPP_OSTRING.

From-SVN: r40279
2001-03-07 01:32:01 +00:00
Zack Weinberg 71b7be38c3 stringpool.c (set_identifier): New function.
* stringpool.c (set_identifier): New function.
	* tree.h: Prototype it.

	* c-parse.in: Kill D_YES. If compiled for objc, call
	save_and_forget_protocol_qualifiers from init_reswords.
	* objc/objc-act.c (remember_protocol_qualifiers,
	forget_protocol_qualifiers): Don't diddle C_IS_RESERVED_WORD.
	Swap out the non-keyword IDENTIFIER_NODEs for keyword ones, or
	vice versa.
	(save_and_forget_protocol_qualifiers): New function.
	* c-lex.h: Prototype save_and_forget_protocol_qualifiers.

From-SVN: r40170
2001-03-02 00:40:00 +00:00
Richard Kenner 400500c4a5 diagnostic.h (set_internal_error_function): Renamed.
* diagnostic.h (set_internal_error_function): Renamed.
	* toplev.h (internal_error): Renamed from fatal.
	(pfatal_with_name): Deleted.
	(fatal_io_error): Now has printf-style arguments.
	* diagnostic.c (pfatal_with_name): Deleted.
	(fatal_io_error): Rework to have args in printf-style.
	(set_internal_error_function): Renamed from set_fatal_function.
	(internal_error): Renamed from fatal.
	(error_recursion, fancy_abort): Call internal_error instead of fatal.
	* dwarf2out.c (get_cfa_from_loc_descr): Likewise.
	* emit-rtl.c (gen_realpart, gen_imagpart): Likewise.
	* expr.c (check_max_integer_computation_mode, expand_expr): Likewise.
	* flow.c (verify_flow_info): Likewise.
	* config/arm/arm.c (thumb_unexpanded_epilogue): Likewise.
	* config/mips/mips.c (save_restore_insns): Likewise.
	* cp/init.c (build_java_class_ref): Likewise.
	(dsp16xx_reg_class_from_letter): Likewise.
	(limit_reload_class, double_reg_to_memory): Likewise.
	(print_operand_address, emit_1600_code_shift): Likewise.
	(gen_tst_reg, gen_compare_reg): Likewise.
	* config/m68hc11/m68hc11.c (m68hc11_emit_libcall): Likewise.
	* cp/decl.c (pushdecl): Likewise.
	* java/check-init.c (check_init): Likewise.
	* java/expr.c (java_lang_expand_expr): Likewise.
	* java/jcf-parse.c (get_constant): Likewise.
	* java/mangle.c (java_mangle_decl): Likewise.
	* java/parse.y (make_nested_class_name, java_complete_lhs): Likewise.
	(operator_string): Likewise.

	* except.c (duplicate_eh_handlers): Call abort instead of fatal.
	* flow.c (verify_flow_info): Likewise.
	* ch/convert.c (convert): Likewise.
	* ch/except.c (pop_handler, chill_check_no_handlers): Likewise.
	* ch/expr.c (chill_expand_expr): Likewise.
	* ch/parse.c (peek_token_, pushback_token, require): Likewise.
	* config/arm/arm.c (thumb_load_double_from_address): Likewise.
	* config/avr/avr.c (pttreg_to_str, unique_section): Likewise.
	(avr_normalize_condition): Likewise.
	* config/c4x/c4x.c (c4x_emit_libcall, c4x_valid_operands): Likewise.
	* config/dsp16xx/dsp16xx.c (dsp16xx_reg_class_from_letter): Likewise.
	(limit_reload_class, double_reg_to_memory): Likewise.
	(print_operand_address, emit_1600_code_shift): Likewise.
	(gen_tst_reg, gen_compare_reg): Likewise.
	* config/m68hc11/m68hc11.c (m68hc11_emit_libcall): Likewise.
	* cp/decl.c (pushdecl): Likewise.
	* java/check-init.c (check_init): Likewise.
	* java/class.c (build_class_ref): Likewise.
	* java/constants.c (write_constant_pool): Likewise.
	* java/decl.c (start_java_method): Likewise.
	* java/expr.c (push_type, java_stack_pop, java_stack_swap): Likewise.
	(java_stack_dup, encode_newarray_type): Likewise.
	(build_java_array_length_access): Likewise.
	(build_java_check_indexed_type, expand_java_pushc): Likewise.
	(build_java_soft_divmod, build_invokeinterface): Likewise.
	* java/java-tree.h (INNER_CLASS_P): Likewise.
	* java/jcf-parse.c (parse_signature, get_name_constant): Likewise.
	(give_name_to_class, get_class_constant): Likewise.
	* java/jcf-write.c (CHECK_PUT, CHECK_OP, get_access_flags): Likewise.
	(find_constant_index, generate_bytecode_conditional): Likewise.
	(generate_bytecode_insns, perform_relocations): Likewise.
	* java/lex.c (java_unget_unicode, java_lex): Likewise.
	* java/mangle.c (mangle_type, mangle_record_type): Likewise.
	(mangle_pointer_type, mangle_array_type, init_mangling): Likewise.
	(finish_mangling): Likewise.
	* java/parse.h (MARK_FINAL_PARMS): Likewise.
	* java/parse.y (pop_current_osb, unreachable_stmt_error): Likewise.
	(obtain_incomplete_type, java_complete_class): Likewise.
	(java_check_regular_methods, java_complete_expand_method): Likewise.
	(cut_identifier_in_qualified, check_deprecation): Likewise.
	(patch_invoke, find_applicable_accessible_methods_list): Likewise.
	(java_complete_lhs, lookup_name_in_blocks): Likewise.
	(check_final_variable_indirect_assignment, build_unaryop): Likewise.
	* java/typeck.c (set_local_type, parse_signature_type): Likewise.
	(parse_signature_string, build_java_signature): Likewise;
	(set_java_signature): Likewise.
	* java/verify.c (type_stack_dup, CHECK_PC_IN_RANGE): Likewise.

	* c-parse.in (methoddef): Call fatal_error instead of fatal.
	* objc/objc-act.c (build_ivar_chain): Likewise.
	* cp/except.c (decl_is_java_type): Likewise.
	* cp/init.c (build_java_class_ref): Likewise.
	* cp/init.c (build_new_1): Likewise.
	* f/com.c (ffecom_init_0): Likewise.
	* java/class.c (add_method, build_static_field_ref): Likewise.
	* java/expr.c (build_known_method_ref, expand_invoke): Likewise.
	* java/jcf-parse.c (get_constant, jcf_parse): Likewise.
	* java/lex.c (java_new_new_lexer): Likewise.
	* java/jv-scan.c (main): Likewise.
	(fatal_error): Renamed from fatal.

	* dwarfout.c (dwarfout_init): Call fatal_io_error instead of
	pfatal_with_name.
	* graph.c (clean_graph_dump_file): Likewise.
	* profile.c (init_branch_prob): Likewise.
	* ch/grant.c (write_grant_file): Likewise.
	* ch/lex.c (init_parse, same_file, yywrap): Likewise.
	* f/com.c (init_parse): Likewise.
	* java/jcf-parse.c (yyparse): Likewise.
	* objc/objc-act.c (objc_init): Likewise.

	* java/jcf-parse.c (jcf_parse_source): Call fatal_io_error, not fatal.
	(yyparse): Likewise.
	* java/jcf-write.c (make_class_file_name, write_classfile): Likewise.
	* java/lex.c (java_get_line_col): Likewise.

	* hash.c (hash_allocate): Don't check for failure returns from
	obstack functions that can't fail.
	(hash_table_init_n, hash_table_init): Likewise; also now return void.
	* hash.h (hash_table_init_n, hash_table_init): Now return void.
	* cp/decl.c (build_typename_type): hash_table_init now returns void.

	* ch/lang.c (GNU_xref_begin, GNU_xref_end): Deleted.
	* ch/lex.c (convert_bitstring): Delete check for alloca failure.
	* config/dsp16xx/dsp16xx.c (dsp16xx_invalid_register_for_compare):
	Deleted.
	* config/dsp16xx/dsp16xx.md (unnamed cmphi): Call abort instead of it.

	* f/com.c (ffecom_decode_include_option_): Make errors non-fatal.
	* f/lex.c (ffelex_cfelex_, ffelex_get_directive_line_): Likewise.
	(ffelex_hash_): Likewise.
	* config/arm/arm.c (arm_override_options): Likewise.
	* config/avr/avr.c (avr_override_options): Likewise.
	* config/c4x/c4x.c (c4x_expand_prologue): Likewise.
	* config/dsp16xx/dsp16xx.c (function_prologue): Likewise.
	* config/h8300/h8300.c (h8300_init_once): Likewise.
	* config/mips/mips.c (override_options): Likewise.
	* config/i386/i386.c (override_options): Likewise, rework.
	* config/m68k/m68k.c (override_options): Likewise.
	* cp/decl.c (init_decl_processing): Likewise.
	* java/jcf-parse.c (load_class): Likewise.

	* config/dsp16xx/dsp16xx.c (print_operand): Call output_operand_lossage
	instead of fatal.
	* config/mips/mips.c (print_operand): Likewise.

	* java/lex.c (byteswap_init, need_byteswap): Only #ifdef HAVE_ICONV.
	* objc/objc_act.c (objc_check_decl): Remove unneeded fatal call.
	(get_object_reference): Likewise.

From-SVN: r39443
2001-02-04 17:44:12 -05:00
Joseph Myers 0aca1a4fd3 c-parse.in (structsp): Pedwarn when "enum foo" refers to an incomplete type.
* c-parse.in (structsp): Pedwarn when "enum foo" refers to an
	incomplete type.
	(typename): Call pending_xref_error after parsing typed_typespecs.
	* c-decl.c (lookup_tag): Give error immediately rather than
	leaving it pending if the tag of the wrong type is in the same
	binding level.
	(xref_tag): Don't pedwarn for forward declarations of enum types
	here.
	* gcc.texi (Actual Bugs): Remove entry for misuse of struct, union
	and enum tags.

testsuite:
	* gcc.dg/c99-tag-1.c: New test.

From-SVN: r39372
2001-01-31 10:24:40 +00:00
Joseph Myers cedd825f0f c-parse.in (cast_expr): Move compound literals from here ...
* c-parse.in (cast_expr): Move compound literals from here ...
	(primary): ... to here.  Use standard terminology "compound
	literal" instead of "constructor expression".

testsuite:
	* gcc.c-torture/compile/20010124-1.c: New test.

From-SVN: r39246
2001-01-24 20:41:49 +00:00
Neil Booth 400023a387 c-parse.in (finish_parse): Add comment about cpp_destroy.
* c-parse.in (finish_parse): Add comment about cpp_destroy.
        * cp/lex.c (finish_parse): Similarly.
        * cppinit.c (cpp_cleanup): Rename cpp_destroy for clarity.
        Return the number of errors encountered.
        * cpplib.h (cpp_cleanup): Rename cpp_destroy, return int.
        * cppmain.c (main): Don't call cpp_destroy.

From-SVN: r39020
2001-01-14 22:00:20 +00:00
Neil Booth b61c5ed005 c-lex.c (init_c_lex): Use cpp_get_callbacks to set callbacks.
* c-lex.c (init_c_lex): Use cpp_get_callbacks to set
        callbacks.
        * c-parse.in (finish_parse): Use cpp_errors.
        (__yylex): Use return value of cpp_pop_buffer.
        * cp/lex.c (finish_parse): Use cpp_errors.
        * cp/spew.c (read_token): Use return value of cpp_pop_buffer.

From-SVN: r38982
2001-01-13 14:23:04 +00:00
Richard Henderson 4f78b9a896 c-common.h (ASM_INPUT_P): New.
* c-common.h (ASM_INPUT_P): New.
        * c-parse.in (asm): Set it when needed.
        * c-semantics.c (genrtl_asm_stmt): Test it instead of the
        existance of an operand.

        * cp/parse.y (asm): Set ASM_INPUT_P.

From-SVN: r38638
2001-01-02 15:49:45 -08:00
Geoffrey Keating fb8b656c65 c-parse.in (select_or_iter_stmt): Use truthvalue_conversion on the condition of a FOR statement...
2000-12-28  Geoffrey Keating  <geoffk@redhat.com>

	* c-parse.in (select_or_iter_stmt): Use truthvalue_conversion
	on the condition of a FOR statement, so that it gets typechecked
	and optimised.

2000-12-28  Geoffrey Keating  <geoffk@redhat.com>

	* gcc.dg/noncompile/20001228-1.c: New test.

From-SVN: r38527
2000-12-29 08:27:40 +00:00
Richard Henderson 64094f6a65 c-typeck.c (build_asm_stmt): New, broken out from ...
* c-typeck.c (build_asm_stmt): New, broken out from ...
        (c_expand_asm_operands): ... here.  Just do rtl expansion.
        (c_expand_return): Return the new stmt node.
        (c_start_case, do_case): Likewise.
        * c-common.c (c_expand_expr_stmt): Likewise.
        * c-common.h: Update declarations.
        * c-tree.h: Likewise.
        * c-semantics.c (build_stmt): Use STMT_LINENO not TREE_COMPLEXITY.
        * c-parse.in (fndef): Set DECL_SOURCE_LINE to the open brace.
        (nested_function, notype_nested_function): Likewise.
        (compstmt): Return the compound statement not the binding level.
        (lineno_labeled_stmt): Simplify.
        (lineno_stmt, lineno_label): Set STMT_LINENO.
        (stmt, label): Return the new stmt node.

From-SVN: r38402
2000-12-20 10:18:24 -08:00
Richard Henderson 7dfe7bd6e9 c-parse.in (finish_parse): Update for parse_in type change.
* c-parse.in (finish_parse): Update for parse_in type change.
        (_yylex): Likewise.

From-SVN: r37832
2000-11-28 14:52:26 -08:00
Neil Booth 056487e747 Makefile.in: Remove MAYBE_CPPLIB and maybe_cpplib.
* Makefile.in: Remove MAYBE_CPPLIB and maybe_cpplib.
        * c-decl.c: Remove parse_in declaration.
        * c-lang.c: Similarly.
        * c-lex.c: Similarly.
        * c-parse.in: Similarly.
        * c-pragma.c: Similarly.
        * configure.in: Similarly.
        * cp/Make-lang.in: Similarly.
        * cp/spew.c: Similarly.
        * cp/decl2.c: Remove check for lang-c++ option.
        * cp/lang-specs.h: Remove -lang-c++ from cc1plus command line.
        * cp/lex.c (lang_init_options): With cpp_reader_init, default to C++.
        * c-lex.h: Add declaration of parse_in.
        * cppinit.c: Call set_lang after allocating pfile->pending.
        * configure: Regenerate.

From-SVN: r37754
2000-11-26 10:48:50 +00:00
Neil Booth a32f2771a5 c-common.c: Remove USE_CPPLIB conditional inclusions.
* c-common.c: Remove USE_CPPLIB conditional inclusions.
        * c-common.h: Similarly.
        * c-decl.c: Similarly.
        * c-lang.c: Similarly.
        * c-lex.c: Similarly.
        * c-parse.in: Similarly.
        * c-pragma.c: Similarly.
        * c-pragma.h: Similarly.
        * gcc.c: Similarly.
        * toplev.c: Similarly.
        * cp/cp-tree.h: Similarly.
        * cp/decl2.c: Similarly.
        * cp/lang-specs.h: Similarly.
        * cp/lex.c: Similarly.
        * cp/lex.h: Similarly.
        * cp/spew.c: Similarly.
        * java/lang-options.h: Similarly.
        * objc/lang-specs.h: Similarly.
        * objc/objc-act.c: Similarly.

        * configure.in: Remove configure option.
        * config.in: Regenerate.
        * configure: Regenerate.

From-SVN: r37742
2000-11-25 19:28:44 +00:00
Nathan Sidwell 2f401cc807 c-parse.in (unary_expr): Move VA_ARG from here ...
* c-parse.in (unary_expr): Move VA_ARG from here ...
        (primary): ... to here.
cp:
        * parse.y (unary_expr): Move VA_ARG from here ...
        (primary): ... to here.

testsuite:
        * g++.old-deja/g++.other/vaarg4.C: New test.
        * gcc.c-torture/compile/20001123-1.c: New test.

From-SVN: r37703
2000-11-24 10:30:46 +00:00
Richard Henderson 3aac38d70c parse.y (yyparse_1): Rename the parser entry point.
* cp/parse.y (yyparse_1): Rename the parser entry point.

        * c-lex.c (orig_filename): New variable.
        (init_c_lex): Set it.  Move call to cpp_start_read ...
        (yyparse): ... here.  New function.
        * c-parse.in (yyparse_1): Rename the parser entry point.
        * c-tree.h: Declare it.

From-SVN: r37607
2000-11-20 23:39:52 -08:00
Joseph Myers 77c4d6c06a c-decl.c (check_for_loop_decls): New function.
* c-decl.c (check_for_loop_decls): New function.
	* c-parse.in (for_init_stmt): New.
	(select_or_iter_stmt): Use for_init_stmt.
	* c-tree.h (check_for_loop_decls): New declaration.

testsuite:
	* gcc.dg/c90-fordecl-1.c, gcc.dg/c99-fordecl-1.c,
	gcc.dg/c99-fordecl-2.c: New tests.

From-SVN: r37549
2000-11-18 23:18:36 +00:00
Zack Weinberg 520a57c81c stringpool.c: New file.
* stringpool.c: New file.
	* ggc-common.c (ggc_mark_string_ptr, ggc_add_string_root): Delete.
	(ggc_alloc_string): Now in stringpool.o.
	* ggc-page.c, ggc-simple.c: Do not define or allocate empty_string.
	* ggc.h: Delete prototype of ggc_add_string_root.  #define
	ggc_add_string_root and ggc_mark_string to nothing.  Prototype
	init_stringpool and stringpool_statistics.
	(ggc_alloc_string): Returns a const char *.
	* tree.c (hash_table, do_identifier_warnings): Delete.
	(init_obstacks): Don't initialize the identifier hash table.
	(get_identifier, maybe_get_identifier, start_identifier_warnings,
	set_identifier_size): Now in stringpool.c.
	* tree.h (struct tree_string): Constify pointer field.
	(approx_sqrt): Prototype.

	* Makefile.in (stringpool.o): Add rule, mention in OBJS.

	* toplev.c (approx_sqrt): New function.
	(compile_file): Call stringpool_statistics if mem_report is on.
	(main): Call init_stringpool.

	* builtins.c (c_strlen), c-decl.c (finish_decl), c-lex.c
	(process_directive), c-typeck.c (constructor_asmspec, struct
	initializer_stack, start_init), except.c (create_rethrow_ref),
	stmt.c (digit_strings), toplev.c (decode_f_option), tree.c
	(built_in_filename), varasm,c (in_named_name,
	assemble_static_space, struct constant_descriptor, struct
	deferred_string, struct pool_constant, force_const_mem),
	i386.c (pic_label_name, global_offset_table_name), rs6000.c
	(rs6000_emit_prologue, rs6000_emit_epilogue) : Constify a char *.

	* c-common.c (combine_strings): Combine strings in scratch
	buffer, then pass to build_string.
	* optabs.c (init_libfuncs), profile.c (init_edge_profiler,
	output_func_start_profiler), stmt.c (init_stmt), alpha.c
	(alpha_need_linkage), arm.c (arm_encode_call_attribute),
	i386.c (load_pic_register), ia64.c (ia64_encode_section_info),
	rs6000.c (rs6000_encode_section_info): Create string in
	scratch buffer, then pass to ggc_alloc_string.

	* stmt.c (expand_asm_operands): If we must adjust the
	constraint strings, do so by creating a new one, not by
	modifying the old one in place.  Constify some char *s.
	* config/pa/pa.c (hppa_encode_label): Drop unnecessary second
	argument.  Create string in scratch buffer, then pass to
	ggc_alloc_string.
	* config/pa/pa-protos.h: Update prototype.
	* config/pa/elf.h, config/pa/pa.h, config/pa/som.h:
	hppa_encode_label takes only one argument.

	* c-parse.in (if_prefix): Find the filename and line number at
	$-2 and $-1 respectively.
	* diagnostic.c (error_recursion): Add missing newline, use
	fputs, translate string.

cp:
	* lex.c (struct impl_files, internal_filename): Constify a char *.
java:
	* jcf-parse.c (get_constant), parse.y (do_merge_string_cste):
	Create string in scratch buffer, then pass to build_string.

From-SVN: r37514
2000-11-17 06:05:31 +00:00
Joseph Myers ebf025238d c-parse.in (stmts_and_decls): Deprecate use of label at end of compound statement.
* c-parse.in (stmts_and_decls): Deprecate use of label at end of
	compound statement.

testsuite:
	* gcc.dg/wtr-label-1.c, gcc.dg/990214-1.c: Add semicolons after
	labels at end of compound statements.

From-SVN: r37435
2000-11-13 20:00:22 +00:00
Joseph Myers b74384156a c-parse.in (ends_in_label): Remove from %union and %type.
* c-parse.in (ends_in_label): Remove from %union and %type.
	(decls, stmts, lineno_stmt_or_labels, xstmts,
	lineno_stmt_or_label, stmt_or_label): Remove.
	(stmts_and_decls, lineno_stmt_decl_or_labels_ending_stmt,
	lineno_stmt_decl_or_labels_ending_decl,
	lineno_stmt_decl_or_labels_ending_label,
	lineno_stmt_decl_or_labels_ending_error,
	lineno_stmt_decl_or_labels, compstmt_contents_nonempty,
	lineno_stmt, lineno_label): New.
	(compstmt_nostart): Use compstmt_contents_nonempty.

testsuite:
	* gcc.dg/c99-mixdecl-1.c, gcc.dg/c90-mixdecl-1.c: New tests.

From-SVN: r37429
2000-11-13 14:20:04 +00:00
Joseph Myers 19552aa572 c-common.c (boolean_increment): New function.
* c-common.c (boolean_increment): New function.
	* c-common.h (enum c_tree_index): Add CTI_C_BOOL_TYPE,
	CTI_C_BOOL_TRUE and CTI_C_BOOL_FALSE.
	(c_bool_type_node, c_bool_true_node, c_bool_false_node): Define.
	(boolean_increment): Declare.
	* c-convert.c (convert): Allow for BOOLEAN_TYPE.
	* c-decl.c (init_decl_processing): Create boolean nodes.
	(finish_struct): Allow for _Bool bitfields.
	* c-parse.in (reswords): Add _Bool.
	(rid_to_yy): Allow for RID_BOOL.
	* c-typeck.c (default_conversion): Make booleans promote to int.
	(convert_arguments, build_unary_op, build_modify_expr,
	convert_for_assignment): Allow for booleans.
	* ginclude/stdbool.h: Make conforming to C99.

cp:
	* typeck.c (build_unary_op): Use boolean_increment from
	c-common.c, moving the relevant code there.

testsuite:
	* gcc.dg/c99-bool-1.c: New test.

From-SVN: r37428
2000-11-13 14:14:44 +00:00
Joseph Myers 444ca59fa4 c-parse.in (c99_block_start, [...]): New.
* c-parse.in (c99_block_start, c99_block_end,
	c99_block_lineno_labeled_stmt): New.
	(simple_if, do_stmt_start): Use c99_block_lineno_labeled_stmt.
	(stmt): Split off selection and iteration statements into...
	(select_or_iter_stmt): New.  Use c99_block_lineno_labeled_stmt.

testsuite:
	* gcc.dg/c99-scope-1.c: Remove xfail.
	* gcc.dg/c99-scope-2.c: New test.

From-SVN: r37427
2000-11-13 14:08:09 +00:00
Joseph Myers 26d4fec72e c-parse.in (initelt): Give appropriate pedantic warnings...
* c-parse.in (initelt): Give appropriate pedantic warnings,
	depending on flag_isoc99, for non-ISO syntax and for C99 syntax
	outside C99 mode.
	(designator): If pedantic, pedwarn for a designator specifying a
	range of elements.
	* c-typeck.c (set_init_index, set_init_label): Don't pedwarn for
	these cases.
	* extend.texi: Document the C99 syntax as the preferred syntax,
	and the pre-2.5 syntax as obsolete.  Mention use of designator
	lists for nested subobjects.

From-SVN: r37421
2000-11-13 13:31:16 +00:00
Zack Weinberg 23356f9386 c-lex.c (init_c_lex): Update cpp_start_read call.
* c-lex.c (init_c_lex): Update cpp_start_read call.
        (cb_ident): Update for new callback prototype.
        (cb_def_pragma): Update for new cpp_get_token prototype.
        (c_lex): Similarly.  Use cpp_get_line.

        * c-parse.in (finish_parse): Update for new cpp_finish
        prototype.

        * cp/lex.c (finish_parse): Similarly.

From-SVN: r37201
2000-11-02 08:05:45 +00:00
Neil Booth 12c4f523b1 c-parse.in (_yylex): Remove CPP_BACKSLASH case.
* c-parse.in (_yylex): Remove CPP_BACKSLASH case.
	* cp/spew.c: Similarly.
	* cpplex.c (_cpp_lex_token): Backslashes are now CPP_OTHER.
	* cppmacro.c (stringify_arg): Similarly.
	* cpplib.h (CPP_BACKSLASH): Delete.

From-SVN: r37182
2000-11-01 07:32:23 +00:00
Mark Mitchell 8f17b5c5cb splay-tree.c (splay_tree_predecessor): Fix typo in comment.
* splay-tree.c (splay_tree_predecessor): Fix typo in comment.

	Convert the C front-end to use function-at-a-time mode.
	* c-common.h: Include splay-tree.h.
	(C_DECLARED_LABEL_FLAG): New macro.
	(struct language_function): Add x_scope_stmt_stack and
	x_function_name_declared_p.
	(RECHAIN_STMTS): Move definition.
	(lang_statment_code_p): Likewise.
	(lang_expand_stmt): Likewise.
	(lang_expand_decl_stmt): New variable.
	(lang_expand_function_end): Likewise.
	(current_scope_stmt_stack): New function.
	(add_decl_stmt): Likewise.
	(add_scope_stmt): Likewise.
	(mark_stmt_tree): Likewise.
	(struct c_lang_decl): New structure.
	(DECL_SAVED_TREE): Define.
	(c_mark_lang_decl): New function.
	(c_expand_start_cond): Change prototype.
	(c_finish_then): New function.
	(c_finish_else): Likewise.
	(current_function_name_declared): Remove.
	(set_current_function_name_declared): Likewise.
	(mark_c_language_function): Declare.
	(case_compare): Likewise.
	(c_add_case_label): Likewise.
	(c_expand_expr): Likewise.
	(c_safe_from_p): Likewise.
	* c-common.c (lang_expand_function_end): New variable.
	(struct if_elt): Add if_stmt.
	(c_expand_start_cond): Add the if-statement to the statement-tree,
	rather than generating RTL.
	(c_finish_then): New function.
	(c_expand_start_else): Don't generate RTL.
	(c_finish_else): New function.
	(c_expand_expr_stmt): Don't generate RTL.
	(statement_code_p): Add SCOPE_STMT.
	(case_compare): New function.
	(c_add_case_label): Likewise.
	(mark_stmt_tree): Likewise.
	(c_mark_lang_decl): Likewise.
	(mark_c_language_function): Likewise.
	(c_expand_expr): Likewise.
	(c_safe_from_p): Likewise.
	* c-decl.c (c_stmt_tree): New variable
	(c_scope_stmt_stack): Likewise.
	(c_function_name_declared_p): Likewise.
	(lang_expand_expr_stmt): Remove.
	(poplevel): Don't call output_inline_function for nested
	functions.
	(pushdecl): Don't set DECL_CONTEXT for a local declaration of an
	`extern' function.
	(redeclaration_error_message): Change means of computing whether
	or not a function is nested.
	(lookup_label): Don't call label_rtx.
	(init_decl_processing): Add more GC roots.
	(start_decl): Add DECL_STMTs to the statement-tree, rather than
	calling rest_of_decl_compilation.
	(finish_decl): Don't call expand_decl.
	(store_parm_decls): Begin the statement-tree, but don't generate
	RTL.
	(finish_function): Tie off the statement-tree.  Call c_expand_body
	if appropriate.
	(c_expand_body): New function.
	(push_c_function_context): Save more information.
	(pop_c_function_contxt): Likewise.
	(copy_lang_decl): Now that we use DECL_LANG_SPECIFIC, copy it.
	(lang_mark_tree): Mark it.
	(current_stmt_tree): Adjust.
	(current_scope_stmt_stack): New function.
	(do_case): Remove.
	(set_current_name_declared): Likewise.
	(c_begin_compound_stmt): Define.
	(c_expand_decl_stmt): Likewise.
	* c-lang.c: Include rtl.h and expr.h.
	(lang_init): Set more language-specific hooks.
	* c-lex.c: Include expr.h.
	* c-parse.in: Changes throughout to add statements to the
	statement-tree, rather than generating RTL after every statement.
	* c-semantics.c (lang_expand_decl_stmt): Define.
	(add_decl_stmt): New function.
	(add_scope_stmt): Likewise.
	(finish_stmt_tree): Tweak.
	(genrtl_expr_stmt): Likewise.
	(genrtl_decl_stmt): Handle local labels, and call
	lang_expand_decl_stmt if required.
	(genrtl_for_stmt): Fix line-number handling.
	(genrtl_case_label): Handle cleanups.
	(genrtl_asm_stmt): Don't call combine_strings.
	(genrtl_compound_stmt): Simplify.
	(expand_stmt): Handle SCOPE_STMTs.
	* c-tree.h (struct lang_decl): New structure.
	(C_DECLARED_LABEL_FLAG): Remove.
	(c_begin_compound_stmt): Declare.
	(c_expand_decl_stmt): Likewise.
	(c_expand_start_case): Rename to c_start_case.
	(c_finish_case): New function.
	* c-typeck.c (start_init): Tweak setting of
	constructor_incremental.
	(c_expand_asm_operands): Tweak error-handling.  Add to the
	statement-tree.
	(c_expand_return): Add to the statement-tree.
	(c_expand_start_case): Rename to ...
	(c_start_case): ... this.
	(struct c_switch): New type.
	(switch_stack): New variable.
	(do_case): Simplify.
	(c_finish_case): New function.
	* dependence.c: Include expr.h.
	(enum dependence_type): Change spelling of enumerals.
	(check_node_dependence): Adjust.
	* expr.h (lang_safe_from_p): Declare.
	(safe_from_p): Likewise.
	* expr.c (lang_safe_from_p): New variable.
	(safe_from_p): Give it external linkage.  Use lang_safe_from_p.
	* stmt.c (expand_expr_stmt): Avoid clobberring of last_expr_type.
	* toplev.c (rest_of_decl_compilation): Robustify.
	* tree.c (contains_placeholder_p): Likewise.
	* Makefile.in: Update dependencies.
	* objc/objc-act.h: Adjust calculation of value for dummy_tree_code.
	* objc/objc-act.c: Include rtl.h, expr.h, and c-common.h.
	(objc_expand_function_end): New function.
	(finish_method_def): Use it.
	(init_objc): Initialize more language-specific hooks.
	* objc/Make-lang.in: Update dependencies.

	* cp-tree.h (struct cp_language_function): Remove
	x_scope_stmt_stack and name_declared.
	(current_scope_stmt_stack): Remove.
	(function_name_declared_p): New macro.
	(struct lang_decl_flags): Use c_lang_decl as a base class.
	(context): Remove.
	(struct lang_decl): Replace saved_tree with context.
	(DECL_FRIEND_CONTEXT): Adjust accordingly.
	(SET_DECL_FRIEND_CONTEXT): Likewise.
	(DECL_VIRTUAL_CONTEXT): Likewise.
	(DECL_SAVED_TREE): Remove.
	(C_DECLARED_LABEL_FLAG): Likewise.
	(cplus_expand_expr_stmt): Don't declare.
	(add_decl_stmt): Likewise.
	(add_scope_stmt): Likewise.
	* decl.c (mark_stmt_tree): Remove.
	(case_compare): Likewise.
	(finish_case_label): Use c_add_case_label.
	(init_decl_processing): Set more language-specific hooks.
	(build_enumerator): Fix typo in comment.
	(cplus_expand_expr_stmt): Remove.
	(mark_lang_function): Use mark_c_language_function.
	(lang_mark_tree): Use c_mark_lang_decl.
	* decl2.c: Change order of inclusion.
	* except.c: Likewise.
	* expr.c (cplus_expand_expr): Remove handling of STMT_EXPR.  Fall
	back on c_expand_expr.
	* friend.c: Include expr.h.
	* init.c: Change order of inclusion.
	* Makefile.in: Update dependencies.
	* lex.h (free_lang_decl_chain): Remove.
	* optimize.c (maybe_clone_body): Use function_name_declared_p.
	* pt.c (build_template_decl): Don't copy DECL_VIRTUAL_CONTEXT if
	it doesn't exist.
	(instantiate_decl): Use function_name_declared_p.
	* semantics.c (lang_expand_expr_stmt): Remove.
	(set_current_function_name_declared): Likewise.
	(current_function_name_declared): Likewise.
	(begin_compound_stmt): Use function_name_declared_p.
	(add_decl_stmt): Remove.
	(setup_vtbl_ptr): Use function_name_declared_p.
	(add_scope_stmt): Remove.
	(current_scope_stmt_stack): New function.
	(cp_expand_stmt): Don't handle SCOPE_STMTs.
	(expand_body): Use function_name_declared_p.
	* tree.c (cp_statement_code_p): Don't include SCOPE_STMT.
	* typeck.c: Change order of includes.
	(convert_sequence): Remove.

From-SVN: r36464
2000-09-17 07:38:23 +00:00
Joseph Myers d9dbd9b14c c-parse.in (reswords): Add _Complex.
* c-parse.in (reswords): Add _Complex.

cp:
	* lex.c (reswords): Add _Complex.

From-SVN: r36422
2000-09-15 00:44:47 +01:00
Mark Mitchell 56cb97339b c-common.h (add_stmt): Change prototype.
* c-common.h (add_stmt): Change prototype.
	(RECHAIN_STMTS): New macro.
	(CASE_LABEL_DECL): Likewise.
	(genrtl_case_label): Change prototype.
	(c_expand_start_case): Remove prototype.
	(build_case_label): Change prototype.
	(decl_constant_value): Declare.
	* c-common.c (check_case_value): Handle C++'s extensions to C
	semantics.
	* c-commnon.def (CASE_LABEL): Add room for the CASE_LABEL_DECL
	field.
	* c-parse.in (stmt): Adjust handling of return statements and case
	laels.
	* c-semantics.c (add_stmt): Return the new statement.
	(genrtl_return_stmt): Take the RETURN_STMT as input, not the
	returned expression.  Directly generate RTL, rather than calling
	c_expand_return.
	(genrtl_switch_stmt): Don't call c_expand_start_case.
	(build_case_label): Take the LABEL_DECL as input, too.
	(genrtl_case_label): Just call add_case_node.
	(expand_stmt): Adjust calls to genrtl_return_stmt and
	genrtl_case_label.
	* c-tree.h (c_expand_start_case): Declare.
	* c-typeck.c (decl_constant_value): Give it external linkage.
	(c_expand_return): Don't call expand_return or expand_null_return;
	use genrtl_return_stmt instead.
	* stmt.c (struct nesting): Remove num_ranges field.
	(add_case_node): Give it external linkage.
	(expand_start_case): Don't set num_ranges.
	(expand_start_case_dummy): Don't clear it.
	(pushcase): Rely on add_case_node to handle `default' labels.
	(add_case_node): Handle `default' labels.
	* tree.c (tree_int_cst_compare): New function.
	* tree.h (tree_int_cst_compare): Declare.
	(add_case_node): Likewise.

	* cp-tree.h (push_switch): Change prototype.
	(check_cp_case_value): Remove declaration.
	(decl_constant_value): Likewise.
	* decl.c (struct cp_switch): Add switch_stmt and cases.
	(case_compare): New function.
	(push_switch): Set switch_stmt.  Initialize cases.
	(pop_switch): Clean up cases.
	(define_case_label): Rename to ...
	(finish_case_label): ... this.  Do semantic analysis for case
	labels here.
	(start_function): Correct comment.
	* decl2.c (check_cp_case_value): Remove.
	* expr.c (do_case): Remove.
	* pt.c (tsubst_expr): Adjust call to finish_case_label.
	* semantics.c (genrtl_do_poplevel): Remove declaration.
	(RECHAIN_STMTS): Remove.
	(finish_break_stmt): Use build_break_stmt.
	(finish_continue_stmt): Use build_continue_stmt.
	(finish_switch_cond): Adjust condition here, rater than in
	c_expand_start_case.
	(finish_case_label): Remove.
	* typeck.c (c_expand_return): Remove.
	(c_expand_start_case): Likewise.

From-SVN: r36305
2000-09-10 21:34:41 +00:00
Richard Henderson aac02f4e6b c-parse.in: Revert last change.
* c-parse.in: Revert last change.
        (init_reswords): Do not enter disabled keywords into the ridpointers
        table, modulo objc weirdness.
        (_yylex): Return the canonical spelling for a keyword.

From-SVN: r36303
2000-09-10 14:00:16 -07:00
Richard Henderson 1d0f6d8982 * c-parse.in (asm patterns): Fix volatile check.
From-SVN: r36286
2000-09-10 00:07:20 -07:00
Zack Weinberg 8b97c5f8ef c-pragma.h: Define HANDLE_GENERIC_PRAGMAS if REGISTER_TARGET_PRAGMAS is defined.
* c-pragma.h: Define HANDLE_GENERIC_PRAGMAS if
	REGISTER_TARGET_PRAGMAS is defined.  Duplicate some
	definitions from cpplib.h.
	* cpplib.h: Don't typedef struct cpp_reader if c-pragma.h has
	already done it.
	* tm.texi: Document HANDLE_PRAGMA as no longer supported.  Add
	documentation for REGISTER_TARGET_PRAGMAS.

	* c-lex.c: Include cpplib.h before c-pragma.h.  Define a
	default-pragma callback to implement -Wunknown-pragmas if
	USE_CPPLIB.
	* c-parse.in: Move all includes to top of file.
	* c-pragma.c: Include cpplib.h before c-pragma.h.  Include
	tm_p.h.
	(dispatch_pragma): Put the namespace in the -Wunknown-pragmas
	warning.
	(init_pragma): If REGISTER_TARGET_PRAGMAS is defined, call it.

	* arm.h, arm-protos.h, arm.c,
	  c4x.h, c4x-protos.h, c4x.c,
	  h8300.h, h8300-protos.h, h8300.c,
	  i370.h, i370-protos.h, i370.c,
	  i960.h, i960-protos.h, i960.c,
	  sh.h, sh-protos.h, sh.c,
	  v850.h, v850-protos.h, v850.c: Convert HANDLE_PRAGMA-based
	pragmata scheme to use REGISTER_TARGET_PRAGMAS instead.

	* d30v.h: Don't mention HANDLE_PRAGMA in comment.  Add
	multiple include guard.
	* i370.md (untyped_call): Use GEN_CALL.
	(umodsi3): Remove unused variable.
	* sh/elf.h: Don't undef HANDLE_SYSV_PRAGMA.
	* v850.c (output_move_single, output_move_double): Constify
	return value.
	(print_operand): Constify a char *.
	* v850.h (struct small_memory_info): Constify name member.

From-SVN: r36249
2000-09-07 22:24:34 +00:00
Zack Weinberg 0e5921e8a0 Integrated preprocessor.
top level:
	* Makefile.in: Remove all references to c-parse.gperf,
	c-gperf.h, and c-parse.h.  Remove -d from yacc command line
	generating c-parse.c.  Update dependencies.
	* c-parse.gperf, c-gperf.h: Delete.

	* c-common.c: Don't define parse_options, cpp_token, yy_cur,
	yy_lim, or yy_get_token.  Don't define get_directive_line if
	USE_CPPLIB.
	* c-common.h: Add multiple include guard.  Define RID values
	for every keyword in C, C++, and Objective C.  Put all the
	modifiers first.
	(struct c_fileinfo, get_fileinfo, dump_time_statistics): New.
	* c-decl.c (c_decode_option): Handle -lang-objc here.
	(print_lang_identifier): Handle C_IS_RESERVED_WORD case.
	(grokdeclarator): Adjust for new RID scheme.
	(extract_interface_info): New stub.
	* c-lang.c: Don't declare yy_cur or parse_options.
	(lang_init_options): Call cpp_init.  Don't call
	cpp_options_init.
	(lang_init): Don't call check_newline if USE_CPPLIB.

	* c-lex.c: Don't include c-parse.h.  Do include timevar.h.
	Elide lots of unnecessary code if USE_CPPLIB.  Delete code
	rendered unnecessary by new architecture.  Move routines not
	shared with C++ to c-parse.in.  Maintain a local idea of the
	line number.    Handle C++ as well as C.
	[USE_CPPLIB]: Declare and register callbacks for #ident and
	for entering/leaving files.
	(init_c_lex, c_lex): Are now the entry points to this file.
	(check_newline): Break out directive handling to
	process_directive.
	(read_ucs, is_extended_char, utf8_extend_token): Moved here
	from C++ front end.
	(readescape, parse_float): Overhaul.
	(lex_number, lex_string, lex_charconst): Break out of c_lex
	(n'ee yylex).
	(get_fileinfo, update_header_times, dump_one_header,
	dump_time_statistics): New and/or moved here from C++.
	Support per-file data needed by C++ and per-header timing
	statistics (C++ only, at the moment).
	* c-lex.h: Update prototypes.  Add multiple include guard.
	* c-tree.h (struct lang_identifier): Add rid_code field.
	(C_IS_RESERVED_WORD, C_RID_CODE): New.

	* c-parse.in: Include c-pragma.h. Remove unnecesary calls to
	reinit_parse_for_function and/or position_after_white_space.
	(save_filename, save_lineno): Look ahead before saving.
	(label -> identifier ':'): Save file and line before shifting ':'.
	(reservedwords): No need to call get_identifier.
	(init_parse, finish_parse, yyerror, yylex, yyprint,
	make_pointer_declarator): Are now here for C/ObjC.
	(rid_to_yy): Conversion table from RID constants to Yacc codes.

	* c-pragma.c: Rewrite parsing logic to fit with cpplib's
	#pragma registry.  Provide dummy implementation of that
	interface if !USE_CPPLIB.
	* c-pragma.h: Update to match.

	* flags.h: Add multiple include guard.
	(flag_detailed_statistics): Moved here from C++.
	* toplev.c: Define flag_detailed_statistics.

	* gcc.c (C specs): Use %(trad_capable_cpp) for -E|-M|-MM case
	#if USE_CPPLIB.
	* timevar.def (TV_CPP, TV_LEX): New.
	* timevar.h: Add multiple include guard.

	* objc/lang-specs.h: Use %(trad_capable_cpp) for -E|-M|-MM case
	#if USE_CPPLIB.
	* objc/objc-act.c: Don't mention yy_cur or parse_options.
	Initialize cpplib properly.  Force lineno to 0 after first
	call to check_newline.  Don't handle -lang-objc here.
	Move forget_protocol_qualifiers and remember_protocol_qualifiers here.

cp:
	* Make-lang.in, Makefile.in: Remove all references to input.c,
	gxx.gperf, and hash.h.  Add ../c-lex.o to C_OBJS.
	* gxx.gperf, hash.h, input.c: Delete.
	* lang-specs.h: Pass -lang-c++ to cc1plus so cpplib is
	initialized properly.

	* class.c (fixup_pending_inline): Take a tree, not a
	struct pending_inline *.  All callers changed.
	(init_class_processing): Set RID_PUBLIC, RID_PRIVATE,
	RID_PROTECTED entries in ridpointers[] array here.
	* decl.c (duplicate_decls): Do not refer to struct
	pending_inline.
	(record_builtin_type, init_decl_processing): Use RID_MAX not
	CP_RID_MAX.
	(grokdeclarator): Use C_IS_RESERVED_WORD.
	* decl2.c (lang_decode_option): Ignore -lang-c++ for sake of
	cpplib.
	(grok_x_components): Do not inspect pending_inlines chain.

	* cp-tree.h (struct lang_identifier): Add rid_code entry.
	(C_IS_RESERVED_WORD, C_RID_CODE, C_RID_YYCODE): New.
	(flag_no_gnu_keywords, flag_operator_names, rid_to_yy): Declare.
	(DEFARG_LENGTH, struct pending_inline, TIME_IDENTIFIER_TIME,
	TIME_IDENTIFIER_FILEINFO): Kill.
	Update prototypes.
	* lex.h: Expunge cp_rid.  Rewrite RIDBIT macros to use just a
	single 32-bit word.
	* parse.y: Call do_pending_inlines unconditionally.
	reinit_parse_for_method is now snarf_method.  fn.defpen is no
	longer necessary.  Remove unnecessary <itype> annotation on
	SCOPE.  Do not refer to end_of_file or struct pending_inline.
	* semantics.c (begin_inline_definitions): Call
	do_pending_inlines unconditionally.

	* lex.c: Remove all code now shared with C front end.
	Initialize cpplib properly if USE_CPPLIB.  Put reserved words
	into the get_identifier table.  Rewrite pragma handling to
	work with the registry.  Move code to save tokens for later
	processing to spew.c.

	* spew.c: Rewrite everything in terms of token streams instead
	of text.  Move routines here from lex.c / input.c as
	appropriate.  GC-mark trees hanging off the pending inlines
	chain.

testsuite:
	* g++.old-deja/g++.benjamin/13478.C: Put meaningful tags on
	ERROR markers.
	* g++.old-deja/g++.brendan/crash8.C: Move ERROR marker up one line.
	* gcc.dg/c99-array-nonobj-1.c: Don't expect func[] cases to fail.
	* gcc.dg/wtr-label-1.c: Don't use unconstrained .* in error regexps.
	* gcc.dg/wtr-suffix-1.c: Correct error regexps.
	* gcc.dg/cpp/unc1.c, gcc.dg/cpp/unc2.c, gcc.dg/cpp/unc3.c:
	Preprocess only.
	* gcc.dg/cpp/unc4.c: Adjust line number in dg-error line.
	* gcc.dg/noncompile/const-ll-1.c: Generalize error regexp.

From-SVN: r36216
2000-09-07 00:37:14 +00:00
Kaveh R. Ghazi 6ad79f1b8b c-decl.c (define_label): Call warning_with_file_and_line and error_with_file_and_line instead of plain...
* c-decl.c (define_label): Call warning_with_file_and_line and
	error_with_file_and_line instead of plain warning or error.

	* c-parse.in (label): Use save_filename/save_lineno to ensure
	correct values for calls to define_label.

From-SVN: r36040
2000-08-29 17:34:26 +00:00
Mark Mitchell 83bab8db08 Makefile.in (C_AND_OBJC_OBJS): Remove c-iterate.o.
* Makefile.in (C_AND_OBJC_OBJS): Remove c-iterate.o.
	(c-iterate.o): Remove target.
	* gcc/c-common.h (enum rid): Remove RID_ITERATOR.
	* gcc/c-decl.c (init_decl_processing): Remove call to init_iterators.
	(finish_decl): Don't handle iterators.
	(grokdeclarator): Likewise.
	* gcc/c-parse.gperf: Remove __iterator and __iterator__ keywords.
	* gcc/c-gperf.h: Regenerated.
	* gcc/c-iterate.c: Removed.
	* gcc/c-lex.c (init_lex): Don't handle iterators.
	* gcc/c-parse.in (primary): Remove pop_iterator_stack call.
	(compstmt_primary_start): Remove push_iterator_stack call.
	(stmt): Don't allow iterator statements.  Replace iterator_expand
	with expand_expr_stmt.
	(all_iter_stmt): Remove.
	(all_iter_stmt_simple): Likewise.
	(all_iter_stmt_with_decl): Likewise.
	* gcc/c-tree.h (ITERATOR_P): Remove.
	(ITERATOR_BOUND_P): Likewise.
	(init_iterators): Remove declaration.
	(iterator_expand): Likewise.
	(iterator_for_loop_start): Likewise.
	(iterator_for_loop_end): Likewise.
	(iterator_for_loop_record): Likewise.
	(push_iterator_stack): Likewise.
	(pop_iterator_stack): Likewise.
	* gcc/c-typeck.c (decl_constant_value): Don't check ITERATOR_P.
	(readonly_warning): Likewise.
	* gcc/tree.h (ITERATOR_BOUND_P): Don't mention it.

	* Make-lang.in (cc1chill): Don't depend on c-iterate.o.

	* gcc.dg/noncompile/930622-2.c: Adjust error message.

From-SVN: r35967
2000-08-25 00:58:27 +00:00
Kaveh R. Ghazi aac625acc6 * c-parse.in (unop +): Restrict -Wtraditional warnings to user code.
From-SVN: r35899
2000-08-23 01:00:52 +00:00
Kaveh R. Ghazi 402d11e13f c-parse.in (cast_expr): Avoid -Wstrict-prototype warnings for unprototyped function pointer casts on...
* c-parse.in (cast_expr): Avoid -Wstrict-prototype warnings for
	unprototyped function pointer casts on integer constants.

From-SVN: r35638
2000-08-11 16:25:02 +00:00
Joseph Myers 89abf8d1d7 c-common.c (combine_strings, [...]): Refer to ISO C or ISO C89 instead of ANSI C.
* c-common.c (combine_strings, check_format_info): Refer to ISO C
	or ISO C89 instead of ANSI C.
	* c-decl.c (grokdeclarator, xref_tag, finish_struct,
	build_enumerator, do_case): Likewise.
	* c-lex.c (parse_float, yylex): Likewise.
	* c-parse.in: Likewise.
	* c-typeck.c (common_type, build_array_ref, build_binary_op,
	build_unary_op, pedantic_lvalue_warning, build_conditional_expr,
	build_c_cast, convert_for_assignment, set_init_index,
	set_init_label, c_expand_start_case): Likewise.
	* toplev.c (documented_lang_options, display_help): Likewise.

From-SVN: r35576
2000-08-09 00:19:11 +01:00
Ovidiu Predescu 24feaa95a4 Changed the language string for Objective-C to "GNU Objective-C".
From-SVN: r35539
2000-08-07 06:47:34 +00:00
Zack Weinberg ba89d661ac cpplex.c (parse_name): Might have to glue a CPP_OTHER token before the name.
* cpplex.c (parse_name): Might have to glue a CPP_OTHER token
	before the name.
	(lex_line): Glue @ onto the beginning of identifiers and
	string constants, in Objective-C mode.
	(output_token, spell_token): Handle CPP_OSTRING.
	(can_paste, maybe_paste_with_next): Handle pasting @ onto the
	beginning of a NAME or a STRING, in objc mode.

	* cpplib.c (get_define_node): Do not permit identifiers that
	begin with @ to be #defined.
	* cppmacro.c (CAN_PASTE_AFTER): Add CPP_OTHER.
	* cpplib.h (TTYPE_TABLE): Add CPP_OSTRING.

	* c-lang.c, objc/objc-act.c (build_objc_string): Delete.
	* c-tree.h (build_objc_string): Delete prototype.
	* objc/objc-tree.def: Delete OBJC_STRING_CST.
	* c-lex.c (yylex): Use build_string for all three kinds of strings.

	* gcc.dg/cpp/20000625-2.c: Don't expect a warning on line 4.

From-SVN: r35470
2000-08-04 01:30:06 +00:00
Geoff Keating fbddce27a7 c-parse.in (extdefs): Call ggc_collect between external definitions.
* c-parse.in (extdefs): Call ggc_collect between external
definitions.

From-SVN: r35367
2000-07-31 08:28:01 +00:00
Kaveh R. Ghazi 3dc8d16901 c-parse.in (string): For -Wtraditional, warn about string concatenation only once per line.
* c-parse.in (string): For -Wtraditional, warn about string
	concatenation only once per line.

From-SVN: r35290
2000-07-27 15:35:32 +00:00
Kaveh R. Ghazi 895ea61453 c-decl.c (define_label): Warn about identifier conflicts with labels in traditional C.
* c-decl.c (define_label): Warn about identifier conflicts with
	labels in traditional C.

	* c-parse.in (unop +): Warn about the unary plus operator for
	traditional C.

	* c-typeck.c (store_init_value): Warn about automatic aggregate
	initialization for traditional C.

	* invoke.texi (-Wtraditional): Document new warnings.

From-SVN: r34997
2000-07-12 20:15:20 +00:00
Kaveh R. Ghazi 20217ac124 Warning fixes:
* c-decl.c (set_current_function_name_declared, anon_aggr_type_p,
	lang_expand_stmt): Mark parameters with ATTRIBUTE_UNUSED.

	* c-parse.in (stmt): Delete unused variables.

	* convert.c (convert_to_vector): Likewise.

	* gensupport.c (process_rtx): Declare attr as `rtvec' not `rtx'.

	* tree.c (finish_vector_type): Prototype.

From-SVN: r34987
2000-07-12 16:17:15 +00:00
Benjamin Chelf 0dfdeca6e0 c-common.h (build_stmt): Declare.
2000-07-10  Benjamin Chelf  <chelf@codesourcery.com>

	* c-common.h (build_stmt): Declare.
	(build_continue_stmt): Likewise.
	(build_break_stmt): Likewise.
	(build_return_stmt): Likewise.

	* c-decl.c (do_case): Rewrite to do what previously done in
	c-parse.in.

	* c-semantics.c (build_stmt): Define.
	(build_return_stmt): Likewise.
	(build_break_stmt): Likewise.
	(build_continue_stmt): Likewise.
	(build_case_label): Likewise.

	* c-parse.in (BREAK): Change to build tree, then generate RTL.
	(CONTINUE): Likewise.
	(RETURN): Likewise.
	(CASE): Likewise.
	(DEFAULT): Likewise.

	* c-parse.y: Regenerate.
	* c-pasre.c: Likewise.

	* cp/semantics.c (finish_for_stmt): Remove call to emit_line_note.
	(finish_continue_stmt): Likewise.
	(begin_for_stmt): Remove call to note_level_for_for.
	(finish_goto_stmt): Change call from build_min_nt
	to build_stmt.
	(finish_expr_stmt): Likewise.
	(begin_if_stmt): Likewise.
	(begin_while_stmt): Likewise.
	(finish_while_stmt): Likewise.
	(finish_return_stmt): Likewise.
	(begin_for_stmt): Likewise.
	(finish_for_stmt): Likewise.
	(finish_break_stmt): Likewise.
	(begin_switch_stmt): Likewise.
	(finish_case_label): Likewise.
	(genrtl_try_block): Likewise.
	(begin_try_block): Likewise.
	(begin_handler): Likewise.
	(begin_compound_stmt): Likewise.
	(finish_asm_stmt): Likewise.
	(finish_label_stmt): Likewise.
	(add_decl_stmt): Likewise.
	(finish_subobject): Likewise.
	(finish_decl_cleanup): Likewise.
	(finish_named_return_value): Likewise.
	(setup_vtbl_ptr): Likewise.
	(add_scope_stmt): Likewise.
	* cp/decl.c (finish_constructor_body): Likewise.
	(finish_destructor_body): Likewise.
	* cp/optimize.c (copy_body_r): Likewise.
	(initialize_inlined_parameters): Likewise.
	(declare_return_variable): Likewise.
	(expand_call_inline): Likewise.

From-SVN: r34943
2000-07-10 03:56:23 -07:00
Zack Weinberg 7e585d16ce c-parse.in (undeclared_variable_notice): Moved to c-typeck.c.
* c-parse.in (undeclared_variable_notice): Moved to c-typeck.c.
	(primary: IDENTIFIER): Just call build_external_ref.
	* c-parse.y, c-parse.c, objc/objc-parse.y, objc/objc-parse.c:
	Regenerate.
	* c-lex.c (lastiddecl): Remove.
	(yylex): Replace all instances of lastiddecl with local
	variables.

	* c-typeck.c (build_external_ref): New function.  Treat decls
	with C_DECL_ANTICIPATED mostly the same as nonexistent decls.
	Look up the decl from the id here.  Call lookup_objc_ivar.
	* c-lang.c (lookup_objc_ivar): Stub.
	* objc/objc-act.c (lookup_objc_ivar): New function.

	* c-tree.h: Prototype lookup_objc_ivar and build_external_ref.
	* c-lex.h: Don't declare lastiddecl.

From-SVN: r34602
2000-06-19 22:28:28 +00:00
Nathan Sidwell 71653180cf tree.h (VOID_TYPE_P): New macro.
* tree.h (VOID_TYPE_P): New macro.
	(COMPLETE_OR_VOID_TYPE_P): Use VOID_TYPE_P.
	* c-decl.c (grokdeclarator): Use VOID_TYPE_P.
	(get_parm_info): Likewise.
	(store_parm_decls): Likewise.
	(combine_parm_decls): Likewise.
	(finish_function): Likewise.
	* c-typeck.c (build_function_call): Likewise.
	(build_binary_op): Likewise.
	(build_conditional_expr): Likewise.
	(internal_build_compound_expr): Likewise.
	(convert_for_assignment): Likewise.
	* stmt.c (expend_expr_stmt): Likewise.
	(warn_if_unused_value): Likewise.
	(expand_return): Likewise.
	* c-parse.in (primary): Likewise.
	* c-parse.y, c-parse.c, c-parse.h: Regenerate.
	* objc/objc-parse.y, objc/objc-parse.c: Regenerate.

From-SVN: r34402
2000-06-05 13:16:14 +00:00
Zack Weinberg 3b304f5b7d top level:
* Makefile.in (WARN_CFLAGS): Add -Wwrite-strings.
	(tree.o): Depend on output.h.

	* c-decl.c (pending_invalid_xref_file,
	current_function_prototype_file): Constify.
	(pushdecl): Constify a local char *.
	(define_label): Constify filename parameter.
	* c-lex.c (init_parse): Constify parameter and return value.
	* c-typeck.c (c_expand_asm_operands): Constify filename parameter.
	* c-tree.h: Update prototypes.
	* c-parse.in: Constify filename member of %union, and if_stmt_file.
	* c-parse.y, c-parse.c, c-parse.h, objc/objc-parse.y,
	objc/objc-parse.c: Regenerate.

	* dwarfout.c (dwarfout_init): Constify main_input_filename parameter.
	* dwarfout.h: Update prototypes.
	* expr.c (expand_expr): Constify a local char *.
	* flags.h: Constify main_input_filename.
	* function.c (expand_function_end): Constify filename parameter.
	* genrecog.c (make_insn_sequence): Use a character array for
	c_test_pos.
	(main): Remove unused variables.
	* input.h: Constify input_filename, main_input_filename, and
	file_stack.name.  Update prototypes.
	* output.h: Declare first_global_object_name and
	weak_global_object_name here, as const char *.
	* stmt.c (expand_asm_operands): Constify filename parameter.
	* toplev.c (compile_file, push_srcloc, debug_start_source_file):
	Constify filename parameter.
	(input_filename, main_input_filename): Constify.
	* toplev.h: Update prototypes.
	* tree.c: Include output.h.  Don't declare
	first_global_object_name or weak_global_object_name.  Clean up string
	bashing in get_file_function_name_long.
	* tree.h (struct tree_decl): Constify filename member.
	(input_filename): Constify.
	Update prototypes.
	* varasm.c (first_global_object_name, weak_global_object_name):
	Constify.
	(assemble_start_function, assemble_variable): Clean up string bashing.

	* gcc.c: Constify all spec-related strings initialized,
	transitively, from string constants.  Constify all strings
	and string variables related to multilibs.
	(set_spec, read_specs): Cast argument to free to PTR.
	(used_arg): Do not modify multilib_matches.  Use strncmp plus
	length comparison to compare multilib switches.
	* genmultilib: Constify everything declared in multilib.h.

ch:
	* ch-tree.h: Update prototypes.  Remove prototypes for
	functions declared elsewhere.
	* decl.c (define_label): Constify filename parameter.
	* grant.c (globalize_decl, set_default_grant_file): Constify
	local char * variables.  Don't declare
	first_global_object_name or asm_out_file.
	* lang.c (chill_real_input_filename): Constify.
	* lex.c (init_parse): Constify parameter and return value.
	* parse.c: Don't declare input_filename.
	(ch_expand_asm_operands): Constify filename parameter.
	(parse_multi_dimension_case_action): Constify local char *.
	* satisfy.c (safe_satisfy_decl): Constify local char *.

cp:
	* cp-tree.h: Constify tree_srcloc.filename, tinst_level.file,
	and pending_inline.filename.  Update prototypes.
	* decl.c (define_label): Constify filename parameter.
	* decl2.c (warn_if_unknown_interface): Constify local char *.
	* input.c Constify input_source.filename. Don't declare
	input_filename or lineno.  Constify filename parameter to feed_input.
	* lex.c (init_parse): Constify parameter and return value.
	(cp_pragma_interface, cp_pragma_implementation): Constify
	filename argument.
	(reinit_parse_for_method, reinit_parse_for_block,
	reinit_parse_for_expr, feed_defarg, handle_cp_pragma):
	Constify local char *.
	* pt.c: Don't declare lineno or input_filename.
	(print_template_context, tsubst_friend_function, tsubst_decl,
	tsubst, instantiate_decl): Constify local char *.
	* semantics.c (expand_body): Constify local char *.
	* tree.c (build_srcloc): Constify filename parameter.
	* typeck.c (c_expand_asm_operands): Constify filename
	parameter.

f:
	* com.c (ffecom_subscript_check_): Constify array_name
	parameter. Clean up string bashing.
	(ffecom_arrayref_, ffecom_char_args_x_): Constify array_name
	parameter.
	(ffecom_do_entry_, ffecom_gen_sfuncdef_, ffecom_start_progunit_,
	ffecom_sym_transform_, ffecom_sym_transform_assign_): Constify
	local char *.
	(init_parse): Constify parameter and return value.
	* lex.c: Include dwarfout.h instead of prototyping dwarfout_*
	functions here.
	(ffelex_file_pop_, ffelex_file_push_): Constify filename parameter.
	(ffelex_hash_, ffelex_include_): Constify local char *.
	* std.c (ffestd_exec_end): Constify local char *.
	* where.c (ffewhere_file_new): Constify filename parameter.
	* where.h: Update prototypes.

java:
	* check_init.c (check_init): Constify local char *.
	* class.c (push_class): Constify local char *.
	* java_tree.h: Update prototypes.
	* jcf-io.c (open_class): Constify filename parameter and
	return value.
	(find_class): Remove redundant string copy.  Cast return from
	open_class.
	* jcf-parse.c (read_class, parse_class_file, yyparse):
	Constify local char *.
	* jcf-write.c (generate_bytecode_insns, generate_classfile):
	Constify local char *.
	* jcf.h (JCF): Constify filename and classname.
	(JCF_FINISH): Cast args to FREE to char * when appropriate.
	* lang.c (init_parse): Constify parameter and return value.
	* lex.c (java_get_line_col): Constify filename parameter.
	* parse.h: Constify parser_ctxt.filename.  Update prototypes.
	* parse.y (java_parser_context_suspend,
	issue_warning_error_from_context, safe_layout_class): Constify
	local char *.
	* parse.c: Regenerate.

From-SVN: r33804
2000-05-09 19:56:01 +00:00
Jakub Jelinek bcdb110625 objc-act.c: Include ggc.h.
* objc/objc-act.c: Include ggc.h.
	(objc_tree_index, objc_global_trees): Convert most of the
	static tree variables into a static array with previous names
	as defines.
	(objc_ellipsis_node): New variable.
	(lang_init): Call objc_act_parse_init and c_parse_init.
	Create objc_ellipsis_node.
	(build_selector_translation_table): Use objc_ellipsis_node instead
	of (tree)1.
	(hack_method_prototype): Likewise.
	(get_arg_type_list): Likewise.
	(start_method_def): Likewise.
	(continue_method_def): Likewise.
	(gen_method_decl): Likewise.
	(ggc_mark_imp_list): New function.
	(ggc_mark_hash_table): New function.
	(objc_act_parse_init): New function.
	* objc/objc-act.h (objc_ellipsis_node): Add extern variable.
	* c-parse.in (c_parse_init): For objc add roots of objc specific
	local tree variables.
	* objc/objc-parse.y: Rebuilt.
	* objc/objc-parse.c: Rebuilt.
	(opt_parm_list): Use objc_ellipsis_node instead of (tree)1.

	* Object.m (strlen): Provide prototype on all 64bit platforms,
	not only alpha.
	* sarray.c (memcpy): Likewise.
	* encoding.c (objc_layout_finish_structure): Don't use
	ROUND_TYPE_ALIGN on sparc.

From-SVN: r33092
2000-04-12 09:22:32 +02:00
Jeffrey A Law 64463c2a7b c-parse.in (cast_expr): Move change from March 21 into c-parse.in since it is used to generate c-parse.y.
* c-parse.in (cast_expr): Move change from March 21 into c-parse.in
        since it is used to generate c-parse.y.
        * objc-parse.c, objc-parse.y: Regenerated.

From-SVN: r32840
2000-03-30 18:05:27 -07:00
Martin v. Löwis 949d707dcf c-parse.in (SAVE_WARN_FLAGS): Use size_int.
* c-parse.in (SAVE_WARN_FLAGS): Use size_int.
	* c-parse.y, c-parse.c, objc/objc-parse.y, objc/objc-parse.c:
	Regenerated.

From-SVN: r32648
2000-03-20 13:22:38 +00:00
Richard Kenner 665f250366 * Clean up usages of TREE_INT_CST_LOW.
* c-parse.in (RESTORE_WARN_FLAGS): Use tree_low_cst.
	* c-parse.y, c-parse.c, objc/objc-parse.y, objc/objc-parse.c:
	Regenerated.
	* c-tree.h (min_precision): Move declaration to here.
	* c-typeck.c (build_binary_op): Use host_integerp and tree_low_cst.
	(build_unary_op, add_pending_init): Use bit_position.
	(pending_init_member, process_init_element): Likewise.
	(really_start_incremental_init, push_init_level, pop_init_level):
	Don't make copies of nodes or modify them in place, use consistent
	types when tracking positions, and use tree routines computations.
	(set_init_index, output_init_element): Likewise.
	(output_pending_init_elements, process_init_element): Likewise.
	* dbxout.c (dbxout_type_fields): Use bit_position, host_integerp,
	tree_low_cst and int_bit_position; also minor cleanup.
	(dbxout_type_method_1, dbxout_range_type, dbxout_type): Likewise.
	(print_cst_octal): Precision is unsigned.
	(dbxout_symbol): Ensure DECL_INITIAL is in-range and use tree_low_cst.
	* dwarf2out.c (ceiling): Input and output are unsigned HOST_WIDE_INT.
	(simple_type_align_in_bits): Result is unsigned int.
	Use tree_int_low_cst and host_integerp.
	(simple_type_size_in_bits): Result is unsigned HOST_WIDE_INT.
	(field_byte_offset): Result is HOST_WIDE_INT.
	Change types of internal variables so alignments are unsigned int,
	offsets are HOST_WIDE_INT and sizes are unsigned HOST_WIDE_INT.
	Use host_integerp, tree_low_cst, and int_bit_position.
	(add_bit_offset_attribute): Likewise.
	(add_data_member_location_attribute): Use tree_cst_low.
	(add_bound_info): Use host_integerp, integer_zerop, and integer_onep.
	(add_bit_size_attribute): Use tree_low_cst.
	(add_pure_or_virtual_attribute, gen_enumeration_type_die): Likewise.
	* dwarfout.c: Similar changes to dwarf2out.c.
	* expr.c (expand_expr, case ARRAY_REF): Remove redundant code.
	* genoutput.c (n_occurences): Return -1 for null string.
	(strip_whitespace): Accept null string and make into function.
	(scan_operands): Reflect above changes.
	* sdbout.c (plain_type_1): Use host_integerp and tree_low_cst.
	(sdbout_field_types, sdbout_one_type): Likewise; also use bit_position.
	* ssa.c (rename_registers): Add missing cast of arg to bzero.
	* tree.c (int_size_in_bytes): Check for too big to represent.
	(bit_position, int_bit_position, host_integerp, tree_low_cst): New fns.
	* tree.h (host_integerp, tree_low_cst, bit_position, int_bit_position):
	New declarations.
	(min_precision): Delete from here.
	* varasm.c (decode_addr_const): Use host_integerp, bit_position,
	and int_bit_position.
	* objc/objc-act.c (encode_method_prototype): Sizes are HOST_WIDE_INT.
	(encode_method_def): Likewise.
	(build_ivar_list_initializer): Use int_bit_position.
	(generate_shared_structures): Convert size.
	(encode_type, encode_complete_bitfield): Use integer_zerop.
	(encode_bitfield): Use tree_low_cst and int_bit_position.
	* ch/typeck.c (min_precision): New function.
	(build_chill_slice): Use host_integerp and tree_low_cst.
	(expand_constant_to_buffer): Likewise and also int_bit_position.
	LO is unsigned HOST_WIDE_INT
	(build_chill_array_ref_1): Make `i' be HOST_WIDE_INT; use tree_low_cst.
	(extract_constant_from_buffer): Sizes are now HOST_WIDE_INT.
	Use host_integerp and tree_low_cst.
	(build_chill_bin_type): Use host_integerp and tree_low_cst.
	(layout_chill_range_type): Use tree_int_cst_sgn, compare_tree_int,
	tree_low_cst, and min_precision.
	(apply_chill_array_layout): Cleanups for types of variables
	and use tree_int_cst_sgn, compare_tree_int, and tree_low_cst.
	(apply_chill_field_layout): Likewise.
	* cp/class.c (build_vbase_path): Use integer_zerop.
	(build_vtable_entry): Use tree_low_cst.
	(get_vfield_offset): Use bit_position.
	(dfs_modify_vtables): New variable vindex_val; `i' is HOST_WIDE_INT.
	Use tree_low_cst.
	(check_bitfield_decl): Set DECL_SIZE using convert.
	(build_base_field): Set DECL_SIZE and DECL_SIZE_UNIT using size_binop.
	(layout_virtual_bases): DSIZE is unsigned HOST_WIDE_INT.
	Use tree_low_cst.
	(finish_struct_1): Use bit_position.
	(dump_class_hierarchy): Use tree_low_cst.
	* cp/cp-tree.h (min_precision): Add declaration.
	* cp/decl.c (xref_tag, xref_basetypes): Use tree_low_cst.
	* cp/error.c (dump_type_suffix): Use host_integerp and tree_low_cst.
	(dump_expr): Use integer_zerop, host_integerp, and tree_low_cst.
	* cp/expr.c (cplus_expand_constant): Use bit_position.
	* cp/init.c (build_vec_init): Use host_integerp and tree_low_cst.
	* cp/rtti.c (get_base_offset): Use bit_position.
	* cp/typeck.c (build_binary_op): Use integer_zerop, compare_tree_int,
	host_integerp, and tree_low_cst.
	(pointer_int_sum): Use integer_zerop.
	(build_component_addr): Use bit_position.
	* java/class.c (make_field_value): Properly handle sizes.
	(get_dispatch_vector): Use tree_low_cst and host_integerp.
	(layout_class_method): Count using trees.
	* java/decl.c (push_promoted_type): Set TYPE_{MIN,MAX}_VALUE with
	copy_node.
	* java/expr.c (java_array_data_offset): Use int_bit_position.
	(build_newarray, build_anewarray): Use host_integerp and tree_low_cst.
	(build_invokevirtual): Use tree_low_cst and do computations with trees.

From-SVN: r32607
2000-03-17 12:31:58 -05:00
Greg McGary 4b4f19ec78 c-lex.h (enum rid): Add RID_BOUNDED & RID_UNBOUNDED.
* c-lex.h (enum rid): Add RID_BOUNDED & RID_UNBOUNDED.
	* c-lex.c (init_lex): Handle RID_BOUNDED & RID_UNBOUNDED.
	* c-parse.gperf (__bounded, __bounded__, __ptrbase, __ptrbase__,
	__ptrextent, __ptrextent__, __ptrvalue, __ptrvalue__,
	__unbounded, __unbounded__): New keywords.
	* c-parse.in (PTR_VALUE PTR_BASE PTR_EXTENT): New tokens.

From-SVN: r32540
2000-03-14 19:42:11 +00:00
Jeff Law 3c71940faf Copyright fixes
From-SVN: r32172
2000-02-25 22:54:31 -07:00
Zack Weinberg b919445a10 c-parse.in: Apply Ulrich's changes from c-parse.y.
* c-parse.in: Apply Ulrich's changes from c-parse.y.
	* c-parse.y, objc/objc-parse.y, c-parse.c, objc/objc-parse.c:
	Regenerate.

From-SVN: r31698
2000-01-30 03:44:04 +00:00
Zack Weinberg 4dd7201eac c-common.c, [...]: Remove all references to obstack functions obsoleted by GC...
* c-common.c, c-decl.c, c-lang.c, c-lex.c, c-parse.in, c-pragma.c,
	c-typeck.c, objc/objc-act.c: Remove all references to obstack
	functions obsoleted by GC, such as push_obstacks_nochange,
	end_temporary_allocation, savealloc, saveable_tree_cons, etc.
	and code which existed only to decide whether or not to call
	them.  Remove now-unused NESTED argument from start_function;
	all callers changed.  Do not change behavior based on ggc_p.
	The use of the ixp_obstack in c-iterate.c and the util_obstack
	in objc/objc-act.c remain; these are not obsoleted by garbage
	collection.
	* c-tree.h: Update prototype for start_function.

	* c-parse.y, c-parse.c, objc/objc-parse.c, objc/objc-parse.y: Rebuild.

From-SVN: r31611
2000-01-25 17:13:14 +00:00
Martin v. Löwis 101e59f492 c-parse.in (SAVE_WARN_FLAGS): Create an INTEGER_CST.
* c-parse.in (SAVE_WARN_FLAGS): Create an INTEGER_CST.
	(RESTORE_WARN_FLAGS): Unpack it.
	Change semantic type of extension to ttype.
	* c-common.c (split_specs_attrs): Expect an INTEGER_CST.
	* c-parse.y, c-parse.c, objc/objc-parse.y,
	objc/objc-parse.c: Regenerate.

From-SVN: r31478
2000-01-18 00:01:06 +00:00
Kaveh R. Ghazi 6e090c767a c-common.c: PROTO -> PARAMS.
* c-common.c: PROTO -> PARAMS.
        * c-common.h: Likewise.
        * c-decl.c: Likewise.
        * c-iterate.c: Likewise.
        * c-lang.c: Likewise.
        * c-lex.c: Likewise.
        * c-lex.h: Likewise.
        * c-parse.in: Likewise.
        * c-pragma.c: Likewise.
        * c-pragma.h: Likewise.
        * c-tree.h: Likewise.
        * c-typeck.c: Likewise.
        * objc/objc-act.c: Likewise.
        * objc/objc-act.h: Likewise.

From-SVN: r31362
2000-01-12 22:47:13 +00:00
Zack Weinberg cdfff38e3d c-parse.in (string action): Do not warn about ANSI string concatenation in system headers.
1999-12-17 13:21 -0800  Zack Weinberg  <zack@rabi.columbia.edu>

	* c-parse.in (string action): Do not warn about ANSI string
	concatenation in system headers.  Affects C parser only.
	* c-parse.y, c-parse.c, c-parse.h: Rebuild.

From-SVN: r30998
1999-12-17 21:23:38 +00:00
Kaveh R. Ghazi bb66adcad3 c-parse.in (string): With -Wtraditional, warn if ANSI string concatenation is utilized.
* c-parse.in (string): With -Wtraditional, warn if ANSI string
        concatenation is utilized.

        * invoke.texi (-Wtraditional): Document it.

From-SVN: r30863
1999-12-10 21:00:34 +00:00
Kaveh R. Ghazi ec0ce6e261 c-parse.in (cast_expr): Constify.
* c-parse.in (cast_expr): Constify.

        * cccp.c (special_symbol): Likewise.

        * cse.c (hash_cse_reg_info, cse_reg_info_equal_p): Likewise.

        * dwarf2out.c (base_type_die): Likewise.

        * global.c (allocno_compare): Likewise.

        * local-alloc.c (qty_compare_1, qty_sugg_compare_1): Likewise.

        * regclass.c (fix_register): Likewise.

        * rtl.h (fix_register): Likewise.

        * stupid.c (stupid_reg_compare): Likewise.

        * toplev.c (decode_f_option): Likewise.

        * tree.c (build_complex_type): Likewise.

From-SVN: r30196
1999-10-26 18:13:38 +00:00
Alastair J. Houghton ffc3b0f915 c-parse.in (component_decl): Support anonymous struct/union.
* c-parse.in (component_decl): Support anonymous struct/union.
        (%expect): Update.
        * c-parse.y: Regenerate.
        * c-parse.c: Likewise.
        * objc/objc-parse.y: Likewise.
        * objc/objc-parse.c: Likewise.
        * c-decl.c (finish_struct): Don't sort the fields.
        (field_decl_cmp): Delete unused function.

Co-Authored-By: Mumit Khan <khan@xraylith.wisc.edu>

From-SVN: r30016
1999-10-15 02:42:02 -06:00
Jim Kingdon c3b6e11400 c-parse.in: save and restore warn_pointer_arith on __extension__ along with pedantic.
* c-parse.in: save and restore warn_pointer_arith on __extension__
        along with pedantic.
        (SAVE_WARN_FLAGS, RESTORE_WARN_FLAGS): Added.
        Set the type of extension to itype rather than $<itype>1 kludge.
        * extend.texi (Alternate Keywords): Adjust documentation.
        * c-parse.c, c-parse.y, objc-parse.c, objc-parse.y: Rebuilt.

From-SVN: r29588
1999-09-22 06:58:30 -06:00
Jeff Law c5c7673583 Merge in gcc2-ss-010999
From-SVN: r29150
1999-09-06 23:49:18 -06:00
Bernd Schmidt 1526a0606b Makefile.in (C_AND_OBJC_OBJS): Remove ggc-callbacks.o.
* Makefile.in (C_AND_OBJC_OBJS): Remove ggc-callbacks.o.
	(c-parse.o, c-decl.o, c-lang.o, c-lex.o, c-common.o,
	$(out_object_file)): Depend on ggc.h.
	* c-common.c: Include "ggc.h".
	(combine_strings): If doing GC, use ggc_alloc_string.
	* c-decl.c: Include "ggc.h".
	(ggc_p): Define with value 0.
	(mark_binding_level): New function.
	(init_decl_processing): Add GC roots.
	(mark_c_function_context): New function.
	(lang_mark_false_label_stack): New function.
	(lang_mark_tree): New function.
	(lang_cleanup_tree): New function.
	* c-lang.c: Include "ggc.h".
	(lang_init): Call c_parse_init.
	* c-lex.c: Include "ggc.h".
	(check_linenum): If doing GC, don't copy filenames to permanent
	obstack.
	* c-parse.in: Include "ggc.h".
	(c_parse_init): New function.
	* c-tree.h (c_parse_init, mark_c_function_context): Declare.
	* objc/Make-lang.in (objc-parse.o): Depend on ggc.h.

	* except.c (mark_eh_state): Mark more state.
	* function.c (mark_function_state): Likewise.
	* ggc-simple.c (ggc_alloc_rtvec): Bring in sync with non-gc version.
	(ggc_alloc_string) [GGC_DUMP]: Fix typo.
	* toplev.c (mark_file_stack): New function.
	(compile_file): If doing GC, use ggc_alloc_string on input filename.
	(main): Add root for input_file_stack.

	* i386.c: Include "ggc.h".
	(ix86_mark_machine_status): New function.
	(override_options): Set mark_machine_status.

From-SVN: r29143
1999-09-06 21:28:22 +00:00
Bernd Schmidt e2ecd91c7b c-decl.c (struct language_function): Renamed from struct c_function.
* c-decl.c (struct language_function): Renamed from struct c_function.
	Delete elt NEXT.
	(c_function_chain): Delete.
	(push_c_function_context): New arg F.  Don't warn about nested
	functions here.  Fill LANGUAGE elt of F.  Delete code to update
	c_function_chain.  Don't call push_function_context.
	(pop_c_function_context): New arg F.  Restore from there instead of
	from c_function_chain.  Don't call pop_function_context.  Clear out
	LANGUAGE field of F when done.
	* c-lang.c: Include "function.h"
	(lang_init): Initialize save_lang_status and restore_lang_status.
	* c-parse.in (nested_function, nested_function_notype): Warn about
	nested functions.  Call push_function_context/pop_function_context
	instead of the _c_ variants.
	* c-tree.h (push_c_function_context, pop_c_function_context): Update
	prototype.
	* Makefile.in (c-lang.o): Update dependencies.

	* emit-rtl.c (init_emit): Use xmalloc to allocate regno_reg_rtx,
	regno_pointer_flag, regno_pointer_align.
	(gen_reg_rtx): Use xrealloc to enlarge them.
	(free_emit_status): New function.
	* function.c (mark_machine_status, mark_lang_status): New variables.
	(assign_stack_local_1): Renamed from assign_outer_stack_local.  Merge
	in some bits from assign_stack_local.  All callers changed to use new
	name.
	(assign_stack_local): Just call assign_stack_local_1.
	(free_after_compilation): New function.
	(put_reg_into_stack): Simplify to always call assign_stack_local_1.
	(trampoline_address): Likewise.
	(assign_parms): Use xcalloc/xrealloc to allocate parm_reg_stack_loc.
	(prepare_function_start): Explicitly clear some more variables.
	* function.h (struct function): New elt can_garbage_collect.
	(mark_machine_status, mark_lang_status): Declare variables.
	(free_after_compilation, free_emit_status, free_varasm_status,
	init_varasm_status): Declare functions.
	* toplev.c (rest_of_compilation): Call free_after_compilation when
	done with the current function.
	* varasm.c (free_varasm_status): New function.

From-SVN: r29117
1999-09-05 01:06:48 +00:00
Richard Henderson d0668a7393 c-parse.in (compstmt_primary_start): New, broken out of first part of compstmt handling in primary.
* c-parse.in (compstmt_primary_start): New, broken out of first
        part of compstmt handling in primary.
        (primary): Use it.  Add an error clause.
        (compstmt_nostart): Renamed from compstmt; remove all
        initial invocations of compstmt_start.
        (compstmt): New.

From-SVN: r29059
1999-09-02 10:20:19 -07:00
Kaveh R. Ghazi f425a8879b c-parse.in (language_string): Constify.
* c-parse.in (language_string): Constify.

	* dwarf2out.c (language_string): Remove declaration.

	* dwarfout.c (language_string): Likewise.

	* toplev.c (language_string, init_parse, finish_parse): Likewise.

	* tree.h (language_string, init_parse, finish_parse): Declare.

	* i386/sun386.h (language_string): Remove declaration.

	* mips.h (language_string): Likewise.

	* nextstep.h (language_string): Likewise.

	* nextstep21.h (language_string): Likewise.

	* rs6000.c (language_string): Likewise.

In ch:
	* parse.c (language_string): Constify.
In cp:
	* parse.y (language_string): Constify.
In f:
	* com.c (language_string): Constify.
In java:
	* lang.c (language_string): Constify.

From-SVN: r29000
1999-08-31 02:16:34 +00:00
Jason Merrill fbb186135d c-lex.c: Sync with C++ frontend.
* c-lex.c: Sync with C++ frontend.
	(linemode): New variable.
	(parse_float): imag, conversion_errno, and type are output only.
	(yylex): Adjust.  Move initial '.' case into main switch.
	Use linemode.
	(handle_generic_pragma): Just deal with tokens.
	(readescape): Use ISXDIGIT and ISGRAPH.
	* c-parse.in: Add END_OF_LINE token.

	* c-lex.c (lang_init): Generalize.
	(nextchar): Remove.  Replace uses with UNGETC.
	(skip_white_space): Handle linemode here.  Optimize for cpplib.
	(skip_white_space_on_line): Remove.
	(extend_token_buffer_to): New fn.
	(extend_token_buffer): Use it.
	(read_line_number, check_newline): Just deal with tokens.
	(token_getch, token_put_back): New fns.
	(yylex): Use them.  More cpplib optimizations.  Simplify.

	* c-lex.c (init_parse): Set cpp_token to CPP_DIRECTIVE.
	(consume_string): Make this smart about USE_CPPLIB.
	(check_newline): Rewrite to be intelligent about USE_CPPLIB.
	(yylex): Rewrite to be intelligent about USE_CPPLIB.
	Also, clean up cases where we redundantly set token_buffer[0].
	(read_line_number): New fn.
	(ignore_escape_flag): New variable.

From-SVN: r28507
1999-08-04 15:55:31 -04:00
Richard Henderson d3707adb79 builtins.c (expand_builtin_saveregs): Remove static, remove exp and ignore arguments, bail if no EXPAND_BUILTIN_SAVEREGS.
* builtins.c (expand_builtin_saveregs): Remove static, remove exp
        and ignore arguments, bail if no EXPAND_BUILTIN_SAVEREGS.
        (expand_builtin_next_arg): Accept ARGLIST not EXP.
        (stabilize_va_list): New function.
        (std_expand_builtin_va_start): New function.
        (expand_builtin_va_start): New function.
        (get_varargs_alias_set): New function.
        (std_expand_builtin_va_arg): New function.
        (expand_builtin_va_arg): New function.
        (expand_builtin_va_end): New function.
        (expand_builtin_va_copy): New function.
        (expand_builtin): Call them.
        * c-common.c (c_common_nodes_and_builtins): Build __builtin_va_list,
        __builtin_{varargs_start,stdarg_start,end,copy}.
        (build_va_arg): New function.
        * c-common.h (CTI_PTR_TYPE, ptr_type_node): Delete.
        (build_va_arg): Declare.
        * c-decl.c (ptr_type_node, va_list_type_node): New.
        * c-parse.gperf (__builtin_va_arg): New.
        * c-parse.in (VA_ARG): New token.
        (unary_expr): Recognize it.
        * expr.c (expand_expr): Expand VA_ARG_EXPR.
        * expr.h (std_expand_builtin_va_start): Declare.
        (std_expand_builtin_va_arg): Declare.
        (expand_builtin_va_arg): Declare.
        (get_varargs_alias_set): Declare.
        * tree.def (VA_ARG_EXPR): New.
        * tree.h (BUILT_IN_VARARGS_START): New.
        (BUILT_IN_STDARG_START, BUILT_IN_VA_END): New.
        (ptr_type_node, va_list_type_node): Declare.
        * tm.texi (EXPAND_BUILTIN_SAVEREGS): Kill unused ARGLIST argument.
        * m32r.h (EXPAND_BUILTIN_SAVEREGS): Likewise.
        * m88k.h, m88k.c: Likewise.
        * mn10300.h, mn10300.c: Likewise.
        * pa.h, pa.c: Likewise.
        * rs6000.h, rs6000.c: Likewise.
        * sh.h, sh.c: Likewise.
        * sparc.h, sparc.c: Likewise.

        * emit-rtl.c (operand_subword): Copy alias set.
        (change_address): Likewise.

From-SVN: r28243
1999-07-25 18:21:03 -07:00
Mumit Khan 112cedb09b c-parse.in (absdcl1): Allow attributes in explicit typespecs.
* c-parse.in (absdcl1): Allow attributes in explicit typespecs.
        (%expect): Update.
        * c-parse.y: Regenerate.
        * c-parse.c: Likewise.
        * objc/objc-parse.c: Likewise.
        * objc/objc-parse.y: Likewise.

Co-Authored-By: Donn Terry <donn@interix.com>

From-SVN: r26663
1999-04-26 16:35:58 -06:00
Richard Henderson 19d6ff234b c-parse.in (expr_no_commas): Verify we've an expr before calling C_SET_EXP_ORIGINAL_CODE.
* c-parse.in (expr_no_commas): Verify we've an expr before
        calling C_SET_EXP_ORIGINAL_CODE.

From-SVN: r26590
1999-04-22 15:04:02 -07:00
Jeff Law ad83f53748 Fix copyrights.
From-SVN: r24529
1999-01-06 12:48:38 -07:00
Kaveh R. Ghazi 736b02fdfa c-common.c (decl_attributes): Allow applying attribute `unused' on a LABEL_DECL.
* c-common.c (decl_attributes): Allow applying attribute `unused'
        on a LABEL_DECL.
        * c-parse.in (label): Parse attributes after a label, and call
        `decl_attributes' to handle them.
        * gansidecl.h (ATTRIBUTE_UNUSED_LABEL): Define.
        * genrecog.c (OUTPUT_LABEL, write_tree_1, write_tree): When
        generating labels, mark them with ATTRIBUTE_UNUSED_LABEL.
        * invoke.texi: Note that labels can be marked `unused'.

From-SVN: r24478
1999-01-04 07:48:37 +00:00
Ulrich Drepper 6f4d72224e c-common.c (declare_function_name): Declare predefinied variable `__func__'.
* c-common.c (declare_function_name): Declare predefinied variable
        `__func__'.
        * c-decl.c (flag_isoc9x): Set to 1 by default.
        (c_decode_option): Handle -std= option.  Remove -flang-isoc9x.
        (grokdeclarator): Always emit warning about implicit int for ISO C 9x.
        * c-parse.in: Allow constructors in ISO C 9x.
        Rewrite designator list handling.
        Allow [*] parameters.
        Don't warn about comma at end of enum definition for ISO C 9x.
        * cccp.c (c9x): New variable.
        (rest_extension): New variable.
        (print_help): Document new -std= option.
        (main): Recognize -std= option.  Set c9x appropriately.
        (create_definition): Recognize ISO C 9x vararg macros.
        * gcc.c (default_compilers): Adjust specs for -std options.
        (option_map): Add --std.
        (display_help): Document -std.
        * toplev.c (documented_lang_options): Add -std and remove
        -flang-isoc9x.
        * c-lex.c (yylex): Recognize hex FP constants and call REAL_VALUE_ATOF
        or REAL_VALUE_HTOF based on base of the constants.
        * fold-const.c (real_hex_to_f): New function.  Replacement function
        for hex FP conversion if REAL_ARITHMETIC is not defined.
        * real.c (asctoeg): Add handling of hex FP constants.
        * real.h: Define REAL_VALUE_HTOF if necessary using ereal_atof or
        real_hex_to_f.

Co-Authored-By: Richard Henderson <rth@cygnus.com>
Co-Authored-By: Stephen L Moshier <moshier@world.std.com>

From-SVN: r24049
1998-12-01 13:05:17 -08:00
Mark Mitchell 3932261a55 invoke.texi: Document -flang-isoc9x.
* invoke.texi: Document -flang-isoc9x.
	* Makefile.in (OBJS): Add splay-tree.o.
	(c-common.o): Depend on rtl.h.
	(splay-tree.o): List dependencies and provide build rule.
	* rtl.h (record_alias_subset): New function.
	* alias.c: Include splay-tree.h.
	(alias_set_entry): New type.
	(CHECK_ALIAS_SETS_FOR_CONSISTENCY): Remove.
	(DIFFERENT_ALIAS_SETS_P): Use mem_in_disjoint_alias_sets_p.
	(mems_in_disjoin_alias_sets_p): New function.
	(alias_set_compare): Likewise.
	(insert_subset_children): Likewise.
	(get_alias_set_entry): Likewise.
	* tree.h (TYPE_RESTRICT): New macro.
	(TYPE_UNQUALIFIED): New manifest constant.
	(TYPE_QUAL_CONST): Likewise
	(TYPE_QUAL_VOLATILE): Likewise.
	(TYPE_QUAL_RESTRICT): Likewise.
	(tree_type): Add restrict_flag.  Reduce count of free bits.
	(DECL_POINTER_ALIAS_SET): New macro.
	(DECL_POINTER_ALIAS_SET_KNOWN_P): Likewise.
	(tree_decl): Add pointer_alias_set.
	(build_qualified_type): New function.
	(build_type_variant): Define in terms of build_qualified_type.
	* tree.c (set_type_quals): New function.
	(make_node): Initializae DECL_POINTER_ALIAS_SET.
	(build_type_attribute_variant): Use build_qualified_type and
	set_type_quals.
	(build_type_variant): Rename, and modify, to become...
	(build_qualified_type): New function.
	(build_complex_type): Use set_type_quals.
	* c-tree.h (C_TYPE_OBJECT_P): New macro.
	(C_TYPE_FUNCTION_P): Likewise.
	(C_TYPE_INCOMPLETE_P): Likewise.
	(C_TYPE_OBJECT_OR_INCOMPLETE_P): Likewise.
	(c_apply_type_quals_to_decl): New function.
	(c_build_qualified_type): New function.
	(c_build_type_variant): Define in terms of c_build_qualified_type.
	(flag_isoc9x): Declare.
	* c-typeck.c (qualify_type): Use c_build_qualified_type.
	(common_type): Change to use TYPE_QUALS.
	(comptypes): Likewise.
	(convert_for_assignment): Likewise.
	* c-aux-info.c (gen_type): Likewise.  Deal with `restrict'.
	* c-decl.c (flag_isoc9x): Define.
	(c_decode_option): Handle -flang-isoc9x.
	(grokdeclarator): Update to handle restrict.  Use TYPE_QUALS,
	c_build_qualified_type, etc.  Use c_apply_type_quals_to_decl.
	* c-lex.c (init_lex): Deal with restrict.
	(init_lex): Don't treat restrict as a reserved word in
	-traditional mode, or without -flang-isoc9x.
	* c-lex.h (rid): Add RID_RESTRICT.
	* c-parse.gperf (restrict, __restrict, __restrict__): Make
	equivalent to RID_RESTRICT.
	* c-parse.in (TYPE_QUAL): Update comment.
	* c-common.c: Include rtl.h.
	(c_find_base_decl): New function.
	(c_build_type_variant): Rename, and modify, to become ...
	(c_build_qualified_type): New function.
	(c_apply_type_quals_to_decl): Likewise.
	(c_get_alias_set): For INDIRECT_REFs, check to see if we can find
	a particular alias set for the reference.
	* toplev.c (documented_lang_options): Add -flang-isoc9x.

From-SVN: r23212
1998-10-21 09:53:40 +00:00
Jason Merrill 4051959be9 c-parse.in (struct_head, [...]): New nonterminals.
* c-parse.in (struct_head, union_head, enum_head): New nonterminals.
        (structsp): Use them.  Update files generated from c-parse.in.
        * extend.texi (Type Attributes): Document it.

From-SVN: r20971
1998-07-06 16:30:16 -06:00
Robert Lipe 5f6da3024b toplev.h: New file.
Wed May  6 06:35:38 1998  Robert Lipe  <robertl@dgii.com>
        * toplev.h: New file.   Protypes for functions in toplev.c.
        * tree.h, rtl.h: Deleted protos for functions in toplev.c.
        * c-common.c, c-convert.c, c-decl.c, c-iterate.c, c-lex.c,
        c-parse.in, c-parse.y, c-pragma.c, c-typeck.c, calls.c,
        convert.c, dwarf2out.c, except.c, expr.c, final.c, fold-const.c,
        function.c, hash.c, profile.c, real.c, reg-stack.c, regclass.c,
        reload.c, reload1.c, stmt.c, stor-layout.c, tlink.c, tree.c,
        varasm.c: include it.

From-SVN: r19563
1998-05-06 04:45:47 +00:00
Jeff Law f5963e6170 * Check in merge from gcc2. See ChangeLog.12 for details.
From-SVN: r19553
1998-05-05 17:18:02 -06:00
Kaveh R. Ghazi 944fc8abef More system.h cutover patches:
* c-parse.in: Include system.h, and remove stuff now made redundant.
        * cccp.c: Likewise.
        * cexp.y: Likewise.
        * protoize.c: Likewise.  Properly check for cpp stringification.
        * Makefile.in (c-parse.o, cccp.o, cexp.o, protoize.o, unprotoize.o):
        Depend on system.h.
        * objc/Make-lang.in (objc-parse.o): Likewise.

From-SVN: r19020
1998-04-06 14:01:33 +00:00
Jeff Law e5e809f419 * Check in merge from gcc2. See ChangeLog.11 and ChangeLog.12
for details.

        * haifa-sched.c: Mirror recent changes from gcc2.

From-SVN: r18984
1998-04-04 06:32:39 -07:00
H.J. Lu 990ac8d730 c-parse.in: Recognize protocol qualifiers in class definitions for objc.
* c-parse.in: Recognize protocol qualifiers in class
        definitions for objc.
        Include "output.h".
        (yyerror): Remove redundant decl.
        (yyprint): Fix prototype.

From-SVN: r18788
1998-03-23 15:59:18 -07:00
Jeffrey A Law 818e50a59d c-parse.in (undeclared variable error): Tweak error message to be clearer.
* c-parse.in (undeclared variable error): Tweak error message to
        be clearer.

From-SVN: r18341
1998-03-01 09:46:44 -07:00
Richard Kenner ae9cb2081c (expr_no_commas): Do not store temporary skip_evaluation increments on yacc value stack...
(expr_no_commas): Do not store temporary skip_evaluation increments on
yacc value stack; the code was buggy and occasionally wrote past the
end of the stack.

From-SVN: r13720
1997-03-17 13:46:42 -05:00
Jason Merrill 72acf258c6 x
From-SVN: r13478
1997-01-07 21:58:22 +00:00
Richard Kenner 5f8f4a0743 (unary_expr, expr_no_commas): Increment skip_evaluation when analyzing an expression that is known not to be evaluated.
(unary_expr, expr_no_commas): Increment skip_evaluation when analyzing an
expression that is known not to be evaluated.
(sizeof, alignof): New rules.

From-SVN: r13231
1996-12-07 17:50:45 -05:00
Richard Kenner 084c4c25c1 Update number of shift/reduce conflicts.
({typed_declspecs,reserved_declspecs,declmods}_no_prefix_attr): New.
(current_declspecs): Initialize to NULL_TREE.
(fndef): Pass current_declspecs, not $1, to start_function.
(old_style_parm_decls): Renamed from xdecls.
(datadecl, declmods): Add references to new rules.
(setspecs): Call split_specs_attrs.
(absdcl1): Remove case with setattrs.

From-SVN: r12924
1996-10-09 07:35:27 -04:00
Richard Kenner c4c1f6d58b Update number of shift/reduce conflicts for objc.
From-SVN: r12023
1996-05-18 10:25:57 -04:00
Richard Kenner 957a1c3293 (typespec): Made <SomeProtocol> equivalent to (id <SomeProtocol>).
(non_empty_protocolrefs): New nonterminal.

From-SVN: r11858
1996-04-20 19:55:24 -04:00
Paul Eggert e64bb70660 (stmt): Warn about `goto *expr;' if pedantic.
(label): Warn about `case expr ... expr:' if pedantic.

From-SVN: r11160
1996-02-02 17:42:40 +00:00
Richard Kenner a0d074e106 (enumlist): Propagate error_mark_node.
From-SVN: r10396
1995-09-22 19:08:27 -04:00
Richard Kenner 28a19afce3 (ends_in_label): New %union member.
(stmts, stmt_or_label): Use new member to avoid lexical lookahead hack.
(lineno_stmt_or_labels): New rule.
(lineno_stmt_or_label, stmt_or_label): Yield nonzero if it ends in a label.

From-SVN: r10302
1995-08-31 18:38:14 -04:00
Richard Kenner 940d9d638b Update FSF address.
From-SVN: r9959
1995-06-15 07:33:25 -04:00
Richard Kenner 9fe9dd86e6 Revert most of last change.
From-SVN: r9946
1995-06-14 13:23:47 -04:00
Richard Kenner 866890d94a (fndef, nested_function, notype_nested_function): Support attributes
after function definition.

From-SVN: r9942
1995-06-14 08:06:01 -04:00
Richard Kenner d27543a720 Objc shift/reduce conflicts now 48.
(parm): Use setspecs/restore here.
(parmlist_or_identifiers): Not here.

From-SVN: r9776
1995-05-23 07:22:29 -04:00
Richard Kenner 962a2496a0 (datadef, fndef, ivar_decl, mydecls): Restore declspec_stack since setspecs is used.
(datadef, fndef, ivar_decl, mydecls): Restore declspec_stack since
setspecs is used.
(parmlist_or_identifiers): Use setspecs before parsing parms and
restore after parsing parms.

From-SVN: r9760
1995-05-21 08:39:16 -04:00
Richard Kenner ddd5a7c180 Fix typos in comments.
From-SVN: r9711
1995-05-16 08:14:26 -04:00
Richard Kenner f6999fed2e (myparm): Handle attributes.
From-SVN: r9657
1995-05-12 15:53:36 -04:00
Richard Kenner ee2897efdb Adjust number of shift/reduce conflicts.
(parm): Support attributes.

From-SVN: r9638
1995-05-12 07:08:56 -04:00
Richard Kenner 67b0763ea8 (nested_function, notype_nested_function): Allow old-style arg
definitions (use xdecls).

From-SVN: r9628
1995-05-11 19:27:13 -04:00
Richard Kenner 41ddaaa4d5 Update number of shift/reduce conflicts.
(structsp): Pass attribute arg to finish_struct.
Support attributes on enums and pass to finish_enum.

From-SVN: r9487
1995-04-26 17:24:51 -04:00
Richard Kenner f365e8f673 (attrib): Permit null-length argument list to attributes.
From-SVN: r9458
1995-04-25 18:57:39 -04:00
Richard Kenner 99ac47b5d2 (initdcl, notype_initdcl): Pass attributes to start_decl; delete call
to decl_attributes.

From-SVN: r9442
1995-04-25 16:06:00 -04:00
Doug Evans 6353cbd59d (update expected conflict count)
From-SVN: r9377
1995-04-13 23:57:25 +00:00
Richard Kenner af6f30c465 (structsp): Correct error in last change.
From-SVN: r9270
1995-03-31 07:26:06 -05:00
Richard Kenner 5d7a33dca4 Now have 27 shift/reduce conflicts.
(attribute_list): Just make chain of all attributes.
(attrib): Consistently put name as PURPOSE, args, if any, as VALUE.
(structsp): Allow attributes on any struct or union.

From-SVN: r9260
1995-03-30 08:58:33 -05:00
Richard Kenner d10b562e27 (initdcl): Only call decl_attributes once.
From-SVN: r9240
1995-03-29 06:47:07 -05:00
Richard Kenner ee7d912e9b (fndef, nested_function): Pass prefix_attributes to start_function.
(setspecs): Save prefix_attributes in declspec_stack.
(decl rules): Restore prefix_attributes along with current_declspecs.
(setattrs): Concatenate prefix_attributes to previous value.

From-SVN: r9151
1995-03-09 21:33:33 -05:00
Richard Kenner eadaebabd3 Fix typo in last change.
From-SVN: r9111
1995-03-02 18:13:29 -05:00
Richard Kenner fa4f1d3636 Update shift/reduce conflict documentation.
From-SVN: r9109
1995-03-02 15:51:00 -05:00
Richard Kenner 347248143d New rules to allow attributes in a prefix position.
From-SVN: r8995
1995-02-21 17:58:19 -05:00
Richard Kenner 5ed7f7b137 (ALIGN): Remove unused token.
From-SVN: r8924
1995-02-13 08:45:33 -05:00
Richard Kenner e72260ea6f (unary_expr): If -pedantic, give error for &&.
From-SVN: r8748
1995-01-13 20:15:11 -05:00
Jason Merrill 2c5f4139a9 __attribute__ ((constructor))
From-SVN: r8747
1995-01-14 01:09:01 +00:00
Richard Kenner aff2a12b70 (parmlist_2): Give error for function with only ELLIPSIS as an
argument.

From-SVN: r7969
1994-08-24 17:45:11 -04:00
Richard Kenner 218d0f8a84 (stmt): Don't give more than one error message if a nested `if' has an
empty body.

From-SVN: r7722
1994-07-11 18:17:57 -04:00
Richard Kenner a78bdb8ef8 (initelt): The equal sign is optional when positioning to a single
element of an array.

From-SVN: r7637
1994-07-01 19:09:49 -04:00
Richard Kenner 9d4e73d622 (init...
(init, compstmt, stmt, all_iter_stmt_with_decl): If the lookahead
token is a constant and we need to pop the momentary obstack, don't
free it.

From-SVN: r7382
1994-05-28 22:44:55 -04:00
Richard Stallman adc3b521ec (enumlist): Add error alternative.
From-SVN: r7316
1994-05-16 22:38:23 +00:00
Richard Kenner 660b43c865 Rewrite attribute parsing; update the expected conflicts and state
numbers.

From-SVN: r7252
1994-05-06 18:28:47 -04:00
Richard Stallman 309c23f7dd (attrib): Handle string args as expressions,
merging the two rules.  `mode' attribute now takes a string arg.
Delete the rule for an identifier as arg.

From-SVN: r6913
1994-03-28 01:27:48 +00:00
Doug Evans 423b04b06f Back out this patch:
(attrib): Use `identifier' instead of `IDENTIFIER' since names that
are (e.g.) typedef names are still OK.

From-SVN: r6912
1994-03-27 19:42:26 +00:00
Richard Kenner c386df78f6 (primary): Remove decl of unused variable CONTEXT.
From-SVN: r6873
1994-03-25 13:56:40 -05:00
Richard Kenner d8a6c3ebeb (attrib): Use `identifier' instead of `IDENTIFIER' since names that
are (e.g.) typedef names are still OK.

From-SVN: r6828
1994-03-19 18:02:29 -05:00
Doug Evans 7ffa4f13f0 (attrib): Handle attribute ((section ("string"))).
From-SVN: r6581
1994-02-17 22:48:19 +00:00
Richard Kenner 06c6bfb17b (maybe_attribute): Allow multiple __attribute__ clauses on a
declaration.

From-SVN: r6389
1994-01-13 06:14:08 -05:00
Richard Kenner ba09c753fb (attrib): Allow expressions instead of constants.
From-SVN: r6299
1993-12-24 07:37:56 -05:00
Richard Stallman 5bb92565c0 Don't fail to set $$.
From-SVN: r6144
1993-11-23 21:54:55 +00:00
Richard Kenner e1eb754f60 (init): Remove extraneous pop_momentary in error case.
From-SVN: r5926
1993-10-28 21:30:29 -04:00
Richard Stallman aa2e6789a8 (initdcl, notype_initdcl): Call decl_attributes
before init as well as after.

From-SVN: r5779
1993-10-13 20:40:41 +00:00
Richard Stallman bf0add700f (stmt): Don't call default_conversion on top-level expressions.
From-SVN: r5725
1993-10-11 03:04:47 +00:00