diff options
author | Mark Mitchell <mmitchel@gcc.gnu.org> | 2000-06-30 18:20:42 +0000 |
---|---|---|
committer | Mark Mitchell <mmitchel@gcc.gnu.org> | 2000-06-30 18:20:42 +0000 |
commit | f09f1de5cf126e1f5f41fd5043121e162103460d (patch) | |
tree | 5783c365ca75835ffeb02421644de31663125abe | |
parent | add284e6eaeae270757d98d3d682cb764eeb5fa7 (diff) | |
download | gcc-f09f1de5cf126e1f5f41fd5043121e162103460d.zip gcc-f09f1de5cf126e1f5f41fd5043121e162103460d.tar.gz gcc-f09f1de5cf126e1f5f41fd5043121e162103460d.tar.bz2 |
Makefile.in (c-common.o): Don't depend on c-tree.h or c-lex.h.
* Makefile.in (c-common.o): Don't depend on c-tree.h or c-lex.h.
* c-common.c (ridpointers): Declare.
* c-common.h (enum rid): Declare.
(NORID): Likewise.
(ridpointers): Likewise.
* c-lex.c (ridpointers): Don't declare.
(init_lex): Initialize ridpointers.
* c-lex.h (enum rid): Don't declare.
(NORID): Likewise.
(RID_FIRST_MODIFIER): Likewise.
(ridpointers): Likewise.
* cp-tree.h (ridpointers): Don't declare.
* decl.c (record_builtin_type): Use CP_RID_MAX instead of RID_MAX.
(record_builtin_java_type): Likewise.
(init_decl_processing): Likewise.
* lex.c: Move inclusion of lex.h.
(ridpointers): Don't define.
(init_parse): Initialize ripdointers. Use CP_RID_MAX instead of
RID_MAX.
* lex.h (enum rid): Rename to ...
(enum cp_rid): ... this.
(ridpointers): Don't declare.
* parse.y: Move inclusion of lex.h.
* parse.c: Regenerated.
* spew.c: Move inclusion of lex.h.
* cp-tree.h (struct language_function): Remove temp_name_counter.
(temp_name_counter): Remove.
(get_temp_name): Change prototype.
(get_guard): New function.
(get_guard_cond): Likewise.
(set_guard): Likewise.
* cvt.c (build_up_reference): Adjust call to get_temp_name.
* decl.c (expand_static_init): Use get_guard and friends to
implement guard variables.
* decl2.c (get_temp_name): Assume that the variables created are
always static.
(get_sentry): Rename to ...
(get_guard): ... this. Implement new ABI guard variables.
(get_guard_bits): New function.
(get_guard_cond): Likewise.
(set_guard): Likewise.
(start_static_initialization_or_destruction): Use them.
(do_static_initialization): Replace sentry with guard throughout.
(do_static_destruction): Likewise.
* init.c (create_temporary_var): Add comment.
From-SVN: r34815
-rw-r--r-- | gcc/ChangeLog | 14 | ||||
-rw-r--r-- | gcc/Makefile.in | 2 | ||||
-rw-r--r-- | gcc/c-common.c | 4 | ||||
-rw-r--r-- | gcc/c-common.h | 51 | ||||
-rw-r--r-- | gcc/c-lex.c | 6 | ||||
-rw-r--r-- | gcc/c-lex.h | 51 | ||||
-rw-r--r-- | gcc/cp/ChangeLog | 43 | ||||
-rw-r--r-- | gcc/cp/cp-tree.h | 2 | ||||
-rw-r--r-- | gcc/cp/decl.c | 40 | ||||
-rw-r--r-- | gcc/cp/lex.c | 11 | ||||
-rw-r--r-- | gcc/cp/lex.h | 55 | ||||
-rw-r--r-- | gcc/cp/parse.c | 2 | ||||
-rw-r--r-- | gcc/cp/parse.y | 2 | ||||
-rw-r--r-- | gcc/cp/spew.c | 2 |
14 files changed, 138 insertions, 147 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 033b7d2..35be3b2 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,17 @@ +2000-06-30 Mark Mitchell <mark@codesourcery.com> + + * Makefile.in (c-common.o): Don't depend on c-tree.h or c-lex.h. + * c-common.c (ridpointers): Declare. + * c-common.h (enum rid): Declare. + (NORID): Likewise. + (ridpointers): Likewise. + * c-lex.c (ridpointers): Don't declare. + (init_lex): Initialize ridpointers. + * c-lex.h (enum rid): Don't declare. + (NORID): Likewise. + (RID_FIRST_MODIFIER): Likewise. + (ridpointers): Likewise. + 2000-06-30 J. David Anglin <dave@hiauly1.hia.nrc.ca> * pa/som.h (ASM_WEAKEN_LABEL): Export weak data symbols so that they diff --git a/gcc/Makefile.in b/gcc/Makefile.in index 44d1868..74b40f3 100644 --- a/gcc/Makefile.in +++ b/gcc/Makefile.in @@ -1154,7 +1154,7 @@ s-under: $(GCC_PASSES) # A file used by all variants of C. -c-common.o : c-common.c $(CONFIG_H) system.h $(TREE_H) c-tree.h c-lex.h \ +c-common.o : c-common.c $(CONFIG_H) system.h $(TREE_H) \ c-common.h flags.h toplev.h output.h c-pragma.h $(RTL_H) $(GGC_H) \ $(EXPR_H) diff --git a/gcc/c-common.c b/gcc/c-common.c index dafa33e..b6cf58e 100644 --- a/gcc/c-common.c +++ b/gcc/c-common.c @@ -134,6 +134,10 @@ enum cpp_token cpp_token; tree c_global_trees[CTI_MAX]; +/* The elements of `ridpointers' are identifier nodes for the reserved + type names and storage classes. It is indexed by a RID_... value. */ +tree *ridpointers; + tree (*make_fname_decl) PARAMS ((tree, const char *, int)); /* Nonzero means the expression being parsed will never be evaluated. diff --git a/gcc/c-common.h b/gcc/c-common.h index 9db6c8b..9fd9bdd 100644 --- a/gcc/c-common.h +++ b/gcc/c-common.h @@ -19,6 +19,57 @@ along with GNU CC; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ +/* Reserved identifiers. */ + +enum rid +{ + RID_UNUSED, + RID_INT, + RID_CHAR, + RID_FLOAT, + RID_DOUBLE, + RID_VOID, + RID_UNUSED1, + + /* The first seven are in the order of most frequently used, + as emiprically determined. */ + RID_FIRST_MODIFIER, + RID_EXTERN = RID_FIRST_MODIFIER, + RID_CONST, + RID_LONG, + RID_TYPEDEF, + RID_UNSIGNED, + RID_SHORT, + RID_INLINE, + RID_AUTO, + RID_STATIC, + RID_REGISTER, + RID_SIGNED, + RID_RESTRICT, + RID_VOLATILE, + RID_BOUNDED, + RID_UNBOUNDED, + RID_NOALIAS, + RID_ITERATOR, + RID_COMPLEX, + + RID_IN, + RID_OUT, + RID_INOUT, + RID_BYCOPY, + RID_BYREF, + RID_ONEWAY, + RID_ID, + + RID_MAX +}; + +#define NORID RID_UNUSED + +/* The elements of `ridpointers' are identifier nodes for the reserved + type names and storage classes. It is indexed by a RID_... value. */ +extern tree *ridpointers; + /* Standard named or nameless data types of the C compiler. */ enum c_tree_index diff --git a/gcc/c-lex.c b/gcc/c-lex.c index 8b917ff..f720a3f 100644 --- a/gcc/c-lex.c +++ b/gcc/c-lex.c @@ -62,11 +62,6 @@ FILE *finput; extern void yyprint PARAMS ((FILE *, int, YYSTYPE)); -/* The elements of `ridpointers' are identifier nodes - for the reserved type names and storage classes. - It is indexed by a RID_... value. */ -tree ridpointers[(int) RID_MAX]; - /* Cause the `yydebug' variable to be defined. */ #define YYDEBUG 1 @@ -284,6 +279,7 @@ init_lex () maxtoken = 40; token_buffer = (char *) xmalloc (maxtoken + 2); + ridpointers = (tree *) xcalloc ((int) RID_MAX, sizeof (tree)); ridpointers[(int) RID_INT] = get_identifier ("int"); ridpointers[(int) RID_CHAR] = get_identifier ("char"); ridpointers[(int) RID_VOID] = get_identifier ("void"); diff --git a/gcc/c-lex.h b/gcc/c-lex.h index 532027e..224aa03 100644 --- a/gcc/c-lex.h +++ b/gcc/c-lex.h @@ -18,57 +18,6 @@ along with GNU CC; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ - - -enum rid -{ - RID_UNUSED, - RID_INT, - RID_CHAR, - RID_FLOAT, - RID_DOUBLE, - RID_VOID, - RID_UNUSED1, - - RID_UNSIGNED, - RID_SHORT, - RID_LONG, - RID_AUTO, - RID_STATIC, - RID_EXTERN, - RID_REGISTER, - RID_TYPEDEF, - RID_SIGNED, - RID_CONST, - RID_RESTRICT, - RID_VOLATILE, - RID_BOUNDED, - RID_UNBOUNDED, - RID_INLINE, - RID_NOALIAS, - RID_ITERATOR, - RID_COMPLEX, - - RID_IN, - RID_OUT, - RID_INOUT, - RID_BYCOPY, - RID_BYREF, - RID_ONEWAY, - RID_ID, - - RID_MAX -}; - -#define NORID RID_UNUSED - -#define RID_FIRST_MODIFIER RID_UNSIGNED - -/* The elements of `ridpointers' are identifier nodes - for the reserved type names and storage classes. - It is indexed by a RID_... value. */ -extern tree ridpointers[(int) RID_MAX]; - extern char *token_buffer; /* Pointer to token buffer. */ extern tree make_pointer_declarator PARAMS ((tree, tree)); diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 6d75cde..8bdad5e 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,19 +1,20 @@ -2000-06-28 Alex Samuel <samuel@codesourcery.com> - - * mangle.c (find_substitution): Use same_type_p. - (write_encoding): Don't check for substitutions. - -2000-06-30 Nathan Sidwell <nathan@codesourcery.com> - - * parse.y (expr_no_comma_rangle): New non-terminal. - (template_parm): Use it for default parameter case. - (template_arg): Use it. - (expr_no_commas): Remove commented out undefined extensions. - * Makefile.in (CONFLICTS): Adjust to 33 s/r & 48 r/r. - * parse.h, parse.c: Rebuilt. - 2000-06-30 Mark Mitchell <mark@codesourcery.com> + * cp-tree.h (ridpointers): Don't declare. + * decl.c (record_builtin_type): Use CP_RID_MAX instead of RID_MAX. + (record_builtin_java_type): Likewise. + (init_decl_processing): Likewise. + * lex.c: Move inclusion of lex.h. + (ridpointers): Don't define. + (init_parse): Initialize ripdointers. Use CP_RID_MAX instead of + RID_MAX. + * lex.h (enum rid): Rename to ... + (enum cp_rid): ... this. + (ridpointers): Don't declare. + * parse.y: Move inclusion of lex.h. + * parse.c: Regenerated. + * spew.c: Move inclusion of lex.h. + * cp-tree.h (struct language_function): Remove temp_name_counter. (temp_name_counter): Remove. (get_temp_name): Change prototype. @@ -35,6 +36,20 @@ (do_static_destruction): Likewise. * init.c (create_temporary_var): Add comment. +2000-06-28 Alex Samuel <samuel@codesourcery.com> + + * mangle.c (find_substitution): Use same_type_p. + (write_encoding): Don't check for substitutions. + +2000-06-30 Nathan Sidwell <nathan@codesourcery.com> + + * parse.y (expr_no_comma_rangle): New non-terminal. + (template_parm): Use it for default parameter case. + (template_arg): Use it. + (expr_no_commas): Remove commented out undefined extensions. + * Makefile.in (CONFLICTS): Adjust to 33 s/r & 48 r/r. + * parse.h, parse.c: Rebuilt. + 2000-06-29 Mark Mitchell <mark@codesourcery.com> * cp-tree.h (flag_const_strings): Remove. diff --git a/gcc/cp/cp-tree.h b/gcc/cp/cp-tree.h index fb37a3d..0bcb24a 100644 --- a/gcc/cp/cp-tree.h +++ b/gcc/cp/cp-tree.h @@ -1034,8 +1034,6 @@ struct language_function extern tree current_function_return_value; extern tree global_namespace; -extern tree ridpointers[]; - #define ansi_opname(CODE) \ (operator_name_info[(int) (CODE)].identifier) #define ansi_assopname(CODE) \ diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c index ae933ab..3e952ed 100644 --- a/gcc/cp/decl.c +++ b/gcc/cp/decl.c @@ -6123,7 +6123,7 @@ signal_catch (sig) } /* Push the declarations of builtin types into the namespace. - RID_INDEX, if < RID_MAX is the index of the builtin type + RID_INDEX, if < CP_RID_MAX is the index of the builtin type in the array RID_POINTERS. NAME is the name used when looking up the builtin type. TYPE is the _TYPE node for the builtin type. */ @@ -6136,7 +6136,7 @@ record_builtin_type (rid_index, name, type) tree rname = NULL_TREE, tname = NULL_TREE; tree tdecl = NULL_TREE; - if ((int) rid_index < (int) RID_MAX) + if ((int) rid_index < (int) CP_RID_MAX) rname = ridpointers[(int) rid_index]; if (name) tname = get_identifier (name); @@ -6147,7 +6147,7 @@ record_builtin_type (rid_index, name, type) { tdecl = pushdecl (build_decl (TYPE_DECL, tname, type)); set_identifier_type_value (tname, NULL_TREE); - if ((int) rid_index < (int) RID_MAX) + if ((int) rid_index < (int) CP_RID_MAX) /* Built-in types live in the global namespace. */ SET_IDENTIFIER_GLOBAL_VALUE (tname, tdecl); } @@ -6190,7 +6190,7 @@ record_builtin_java_type (name, size) TYPE_PRECISION (type) = - size; layout_type (type); } - record_builtin_type (RID_MAX, name, type); + record_builtin_type (CP_RID_MAX, name, type); decl = TYPE_NAME (type); /* Suppress generate debug symbol entries for these types, @@ -6372,23 +6372,27 @@ init_decl_processing () record_builtin_type (RID_SIGNED, NULL_PTR, integer_type_node); record_builtin_type (RID_LONG, "long int", long_integer_type_node); record_builtin_type (RID_UNSIGNED, "unsigned int", unsigned_type_node); - record_builtin_type (RID_MAX, "long unsigned int", long_unsigned_type_node); - record_builtin_type (RID_MAX, "unsigned long", long_unsigned_type_node); - record_builtin_type (RID_MAX, "long long int", long_long_integer_type_node); - record_builtin_type (RID_MAX, "long long unsigned int", + record_builtin_type (CP_RID_MAX, "long unsigned int", + long_unsigned_type_node); + record_builtin_type (CP_RID_MAX, "unsigned long", long_unsigned_type_node); + record_builtin_type (CP_RID_MAX, "long long int", + long_long_integer_type_node); + record_builtin_type (CP_RID_MAX, "long long unsigned int", long_long_unsigned_type_node); - record_builtin_type (RID_MAX, "long long unsigned", + record_builtin_type (CP_RID_MAX, "long long unsigned", long_long_unsigned_type_node); record_builtin_type (RID_SHORT, "short int", short_integer_type_node); - record_builtin_type (RID_MAX, "short unsigned int", short_unsigned_type_node); - record_builtin_type (RID_MAX, "unsigned short", short_unsigned_type_node); + record_builtin_type (CP_RID_MAX, "short unsigned int", + short_unsigned_type_node); + record_builtin_type (CP_RID_MAX, "unsigned short", + short_unsigned_type_node); ptrdiff_type_node = TREE_TYPE (IDENTIFIER_GLOBAL_VALUE (get_identifier (PTRDIFF_TYPE))); /* Define both `signed char' and `unsigned char'. */ - record_builtin_type (RID_MAX, "signed char", signed_char_type_node); - record_builtin_type (RID_MAX, "unsigned char", unsigned_char_type_node); + record_builtin_type (CP_RID_MAX, "signed char", signed_char_type_node); + record_builtin_type (CP_RID_MAX, "unsigned char", unsigned_char_type_node); /* `unsigned long' is the standard type for sizeof. Note that stddef.h uses `unsigned long', @@ -6451,7 +6455,7 @@ init_decl_processing () signed_size_zero_node = build_int_2 (0, 0); record_builtin_type (RID_FLOAT, NULL_PTR, float_type_node); record_builtin_type (RID_DOUBLE, NULL_PTR, double_type_node); - record_builtin_type (RID_MAX, "long double", long_double_type_node); + record_builtin_type (CP_RID_MAX, "long double", long_double_type_node); pushdecl (build_decl (TYPE_DECL, get_identifier ("complex int"), complex_integer_type_node)); @@ -6478,7 +6482,7 @@ init_decl_processing () TYPE_QUAL_CONST)); empty_except_spec = build_tree_list (NULL_TREE, NULL_TREE); #if 0 - record_builtin_type (RID_MAX, NULL_PTR, string_type_node); + record_builtin_type (CP_RID_MAX, NULL_PTR, string_type_node); #endif /* Make a type to be the domain of a few array types @@ -6595,16 +6599,16 @@ init_decl_processing () vtable_entry_type = build_qualified_type (vtable_entry_type, TYPE_QUAL_CONST); } - record_builtin_type (RID_MAX, VTBL_PTR_TYPE, vtable_entry_type); + record_builtin_type (CP_RID_MAX, VTBL_PTR_TYPE, vtable_entry_type); vtbl_type_node = build_cplus_array_type (vtable_entry_type, NULL_TREE); layout_type (vtbl_type_node); vtbl_type_node = build_qualified_type (vtbl_type_node, TYPE_QUAL_CONST); - record_builtin_type (RID_MAX, NULL_PTR, vtbl_type_node); + record_builtin_type (CP_RID_MAX, NULL_PTR, vtbl_type_node); vtbl_ptr_type_node = build_pointer_type (vtable_entry_type); layout_type (vtbl_ptr_type_node); - record_builtin_type (RID_MAX, NULL_PTR, vtbl_ptr_type_node); + record_builtin_type (CP_RID_MAX, NULL_PTR, vtbl_ptr_type_node); std_node = build_decl (NAMESPACE_DECL, flag_honor_std diff --git a/gcc/cp/lex.c b/gcc/cp/lex.c index fee13f4..1bf7953 100644 --- a/gcc/cp/lex.c +++ b/gcc/cp/lex.c @@ -30,8 +30,8 @@ Boston, MA 02111-1307, USA. */ #include "system.h" #include "input.h" #include "tree.h" -#include "lex.h" #include "cp-tree.h" +#include "lex.h" #include "parse.h" #include "flags.h" #include "obstack.h" @@ -162,11 +162,6 @@ YYLTYPE yylloc; /* location data for the lookahead */ used in a context which makes it a reference to a variable. */ tree lastiddecl; -/* The elements of `ridpointers' are identifier nodes - for the reserved type names and storage classes. - It is indexed by a RID_... value. */ -tree ridpointers[(int) RID_MAX]; - /* We may keep statistics about how long which files took to compile. */ static int header_time, body_time; static tree filename_times; @@ -610,6 +605,8 @@ init_parse (filename) maxtoken = 40; token_buffer = (char *) xmalloc (maxtoken + 2); + my_friendly_assert ((int) CP_RID_MAX < 64, 20000630); + ridpointers = (tree *) xcalloc ((int) CP_RID_MAX, sizeof (tree)); ridpointers[(int) RID_INT] = get_identifier ("int"); ridpointers[(int) RID_BOOL] = get_identifier ("bool"); ridpointers[(int) RID_CHAR] = get_identifier ("char"); @@ -708,7 +705,7 @@ init_parse (filename) interface_unknown = 1; ggc_add_string_root (&internal_filename, 1); - ggc_add_tree_root (ridpointers, RID_MAX); + ggc_add_tree_root (ridpointers, CP_RID_MAX); ggc_add_tree_root (&defarg_fns, 1); ggc_add_tree_root (&defarg_parm, 1); ggc_add_tree_root (&this_filename_time, 1); diff --git a/gcc/cp/lex.h b/gcc/cp/lex.h index 456fdee..7d00129 100644 --- a/gcc/cp/lex.h +++ b/gcc/cp/lex.h @@ -21,18 +21,17 @@ can know your rights and responsibilities. It should be in a file named COPYING. Among other things, the copyright notice and this notice must be preserved on all copies. */ - - -enum rid +enum cp_rid { - RID_UNUSED, - RID_INT, + RID_FRIEND = RID_MAX, + RID_VIRTUAL, + RID_EXPLICIT, + RID_EXPORT, + RID_MUTABLE, + RID_LAST_MODIFIER = RID_MUTABLE, + RID_BOOL, - RID_CHAR, RID_WCHAR, - RID_FLOAT, - RID_DOUBLE, - RID_VOID, /* C++ extension */ RID_CLASS, @@ -41,37 +40,6 @@ enum rid RID_ENUM, RID_LONGLONG, - /* This is where grokdeclarator starts its search when setting the specbits. - The first seven are in the order of most frequently used, as found - building libg++. */ - RID_FIRST_MODIFIER, - - RID_EXTERN = RID_FIRST_MODIFIER, - RID_CONST, - RID_LONG, - RID_TYPEDEF, - RID_UNSIGNED, - RID_SHORT, - RID_INLINE, - - RID_STATIC, - - RID_REGISTER, - RID_VOLATILE, - RID_FRIEND, - RID_VIRTUAL, - RID_EXPLICIT, - RID_EXPORT, - RID_SIGNED, - RID_AUTO, - RID_MUTABLE, - RID_COMPLEX, - RID_RESTRICT, - - RID_LAST_MODIFIER = RID_RESTRICT, - /* This is where grokdeclarator ends its search when setting the - specbits. */ - RID_PUBLIC, RID_PRIVATE, RID_PROTECTED, @@ -80,7 +48,7 @@ enum rid RID_NULL, /* Before adding enough to get up to 64, the RIDBIT_* macros will have to be changed a little. */ - RID_MAX + CP_RID_MAX }; /* The type that can represent all values of RIDBIT. */ @@ -106,11 +74,6 @@ typedef struct { unsigned long idata[2]; } } while (0) #define RIDBIT_ANY_SET(V) ((V).idata[0] || (V).idata[1]) -/* The elements of `ridpointers' are identifier nodes - for the reserved type names and storage classes. - It is indexed by a RID_... value. */ -extern tree ridpointers[(int) RID_MAX]; - /* the declaration found for the last IDENTIFIER token read in. yylex must look this up to detect typedefs, which get token type TYPENAME, so it is left around in case the identifier is not a typedef but is diff --git a/gcc/cp/parse.c b/gcc/cp/parse.c index bbde2f9..59606e4 100644 --- a/gcc/cp/parse.c +++ b/gcc/cp/parse.c @@ -102,8 +102,8 @@ #include "tree.h" #include "input.h" #include "flags.h" -#include "lex.h" #include "cp-tree.h" +#include "lex.h" #include "output.h" #include "except.h" #include "toplev.h" diff --git a/gcc/cp/parse.y b/gcc/cp/parse.y index c0d51b5..9b0fab0 100644 --- a/gcc/cp/parse.y +++ b/gcc/cp/parse.y @@ -38,8 +38,8 @@ Boston, MA 02111-1307, USA. */ #include "tree.h" #include "input.h" #include "flags.h" -#include "lex.h" #include "cp-tree.h" +#include "lex.h" #include "output.h" #include "except.h" #include "toplev.h" diff --git a/gcc/cp/spew.c b/gcc/cp/spew.c index fc17bea..f152642 100644 --- a/gcc/cp/spew.c +++ b/gcc/cp/spew.c @@ -28,8 +28,8 @@ Boston, MA 02111-1307, USA. */ #include "system.h" #include "input.h" #include "tree.h" -#include "lex.h" #include "cp-tree.h" +#include "lex.h" #include "parse.h" #include "flags.h" #include "obstack.h" |