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
This commit is contained in:
Mark Mitchell 2000-06-30 18:20:42 +00:00
parent add284e6ea
commit f09f1de5cf
14 changed files with 138 additions and 147 deletions

View file

@ -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

View file

@ -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)

View file

@ -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.

View file

@ -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

View file

@ -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");

View file

@ -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));

View file

@ -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.

View file

@ -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) \

View file

@ -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

View file

@ -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);

View file

@ -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

View file

@ -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"

View file

@ -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"

View file

@ -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"