Commit Graph

281 Commits

Author SHA1 Message Date
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
Richard Stallman 6126f4db33 (initdcl, notype_initdcl, init): Undo previous change.
(init): Use pop_momentary_nofree if the initializer has real data.

From-SVN: r5702
1993-10-10 05:20:15 +00:00
Richard Stallman ea8daa3ba3 (initdcl, notype_initdcl): Call push_momentary and pop_momentary here.
(init): Not here.

From-SVN: r5679
1993-10-08 12:20:44 +00:00
Richard Stallman d8e29a65dd (attrib): Support attribute `volatile' with alias `noreturn', and `const'.
(stmt): In an expr stmt, call default_conversion for arrays/functions.

From-SVN: r5083
1993-08-06 01:09:27 +00:00
Jim Wilson 7f3d4b2f75 (simple_if, if_prefix, stmt): Undo Jul 7 change.
(if_prefix): Store stmt_count in $$ not $1.
(stmt): Add comment explaining why empty-if warning is here.

From-SVN: r5029
1993-07-28 11:06:21 -07:00
Richard Stallman 42e651a63c (cast_expr): Use new initializer parsing functions.
(initdcl, notype_initdcl): Likewise.
(init): Likewise.
(initlist_maybe_comma, initlist1): These replace initlist.
(initelt): New nonterminal.
Change specified index syntax to `[INDEX]='.
Change specified field syntax to `.NAME='.

From-SVN: r4977
1993-07-23 19:19:04 +00:00
Jim Wilson f5a1436b01 (simple_if): Save stmt_count, and print empty body warning here.
(simple_if): Save stmt_count, and print empty body
warning here.
(if_prefix): Don't save stmt_count here.
(stmt): Don't print empty body warning here.

From-SVN: r4880
1993-07-07 15:59:22 -07:00
Richard Stallman 982a975ec6 (primary): In statement expression case,
if compstmt returns something other than a BLOCK,
return it unchanged.

From-SVN: r4838
1993-07-04 06:56:42 +00:00
Paul Eggert 2ac3624bab (label): Use `convert_and_check' when checking for
overflow in case labels.

From-SVN: r4824
1993-07-02 01:20:01 +00:00
Richard Stallman 4d06f1a218 (all_iter_stmt_simple): Add missing `else'.
From-SVN: r4736
1993-06-26 00:14:16 +00:00
Richard Stallman 074daeb15d For Objc, expect just 20 conflicts.
From-SVN: r4365
1993-05-06 17:41:52 +00:00
Jim Wilson 66b2ba11a6 Delete cond.awk reference.
From-SVN: r4310
1993-05-03 16:25:49 -07:00
Richard Stallman 475e85347d (unary_expr): Delete the alternate REALPART and IMAGPART rules with explicit parens.
(unary_expr): Delete the alternate REALPART and IMAGPART
rules with explicit parens.  Make the simple REALPART and IMAGPART
rules contain cast_expr.

From-SVN: r4179
1993-04-18 03:37:03 +00:00
Richard Stallman c47783c0fc Improve error message for sym undeclared at top level.
From-SVN: r4154
1993-04-14 17:47:31 +00:00
Tom Wood e31c7eec77 *** empty log message ***
From-SVN: r4068
1993-04-09 23:12:37 +00:00
Richard Stallman 6544cdba17 (expr_no_commas, from ASSIGN op):
Store ERROR_MARK as the original code.

From-SVN: r4019
1993-04-05 06:36:22 +00:00
Richard Stallman 12d073e7c8 (REALPART, IMAGPART): New token types.
(unary_expr): Handle REALPART, IMAGPART.

From-SVN: r3780
1993-03-18 21:32:24 +00:00
Michael Meissner b29e212cdd Add missing comma.
From-SVN: r3626
1993-03-04 15:32:55 +00:00
Richard Stallman b490c40dbc (stmt): Allow all_iter_stmt.
(expr -> statement expression): Push and pop iterator stack.
(stmt -> expr): Use iterator_expand.
(all_iter_stmt): New rule.

From-SVN: r3580
1993-03-02 02:10:22 +00:00
Richard Stallman ea3cfc819a (ivar_decls): Give a pedwarn (instead of a warning) for excess semicolons.
From-SVN: r3545
1993-02-26 23:55:35 +00:00
Richard Stallman ca67f8689b (program): After extdefs, pop any unpopped binding lvls.
From-SVN: r3486
1993-02-18 23:44:20 +00:00
Richard Stallman 5303129fc9 (unary_expr): Warn about overflows in parser-built unary expressions.
From-SVN: r3403
1993-02-02 04:39:14 +00:00
Jim Wilson 867b0d7a02 (language_string): Define here for C and Obj-C.
From-SVN: r3329
1993-01-25 11:49:15 -08:00
Richard Stallman e19a77e63b (unary_expr => ANDAND identifier): Handle lookup_label returning 0.
From-SVN: r3325
1993-01-25 06:37:20 +00:00
Richard Stallman df24d0da45 Use new name objc-act.h.
From-SVN: r3316
1993-01-24 00:41:50 +00:00
Richard Stallman e8f1efb243 (component_declarator): Allow attribute after nameless field.
From-SVN: r3100
1993-01-05 09:10:17 +00:00
Jim Wilson b00e5f0d0f (label): Use expr_no_commas instead of expr for case labels.
From-SVN: r3059
1993-01-02 12:15:58 -08:00
Richard Stallman d54d8150fe (stmt, FOR case): Do call position_after_white_space
after recording the current lineno for the increment.

From-SVN: r3051
1993-01-02 04:27:50 +00:00
Richard Stallman ee759b212b (component_decl_list): Do pedwarn for missing semicolon after last field decl.
From-SVN: r2353
1992-10-07 19:42:30 +00:00
Richard Stallman a50cc0dd8e Expect 56 conflicts for objc.
From-SVN: r2299
1992-10-01 17:38:39 +00:00
Richard Stallman e4e13a012e Add mode spec for Emacs.
From-SVN: r2295
1992-10-01 09:05:18 +00:00
Richard Stallman 028299c6bf Initial revision
From-SVN: r2293
1992-10-01 09:01:10 +00:00