Commit Graph

93 Commits

Author SHA1 Message Date
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