mirror of
https://gcc.gnu.org/git/gcc.git
synced 2024-12-02 16:23:56 +08:00
Index: gcc/ChangeLog
2002-09-12 Geoffrey Keating <geoffk@apple.com> * ggc-common.c (ggc_mark_rtx_children_1): Update for changed name mangling. The following changes are merged from pch-branch: * doc/gty.texi (GTY Options): Document %a. * gengtype.c (do_scalar_typedef): New function. (process_gc_options): Handle `length' option. (set_gc_used_type): A pointer to an array of structures doesn't qualify as a pointer to a structure. (output_escaped_param): Add `%a' escape. (write_gc_structure_fields): Allow 'desc' on array of unions. (main): Define `uint8', `jword' and `JCF_u2' as scalars; use do_scalar_typedef. * gengtype.c (enum rtx_code): Make global. (rtx_format): Make global. (rtx_next): New. (gen_rtx_next): New. (write_rtx_next): New. (adjust_field_rtx_def): Skip fields marked by chain_next. (open_base_files): Delete redundant prototype. (write_enum_defn): New. (output_mangled_typename): Correct abort call. (write_gc_marker_routine_for_structure): Handle chain_next and chain_prev options. (finish_root_table): Don't output redundant \n. (main): Call gen_rtx_next, write_rtx_next, write_enum_defn. * c-tree.h (union lang_tree_node): Add chain_next option. * gengtype.h (NUM_PARAM): New definition. (struct type): For TYPE_PARAM_STRUCT, allow multiple parameters. * gengtype.c (find_param_structure): New. (adjust_field_type): Handle param<n>_is option. (process_gc_options): Detect use_params option. Update callers. (set_gc_used_type): Add 'param' parameter, update callers. Handle 'use_params' option. (open_base_files): Add splay-tree.h to list of files included. (output_mangled_typename): New. (write_gc_structure_fields): Update 'param' parameter to support multiple parameters. Change name mangling. Allow parameterized fields to have an apparent scalar type. Handle param<n>_is options, use_param option. (write_gc_marker_routine_for_structure): Update for change to name mangling. Better guess the output file for parameterized types. (write_gc_types): Update for change to name mangling. (write_gc_root): Update for change to name mangling. Handle (ignore) param<n>_is options. * doc/gty.texi (GTY Options): Add description of param<n>_is options, use_params option. * ggc.h (ggc_mark_rtx): Update for changed name mangling. * gengtype-lex.l: Produce token for param<n>_is. * gengtype-yacc.y: Parse param<n>_is. * gengtype.c (adjust_field_tree_exp): Don't name a variable 'rindex'. * rtl.c: Update comment describing rtx_format. * rtl.h (union rtunion): Separate definition and typedef. (struct rtx_def): Use gengtype to mark. * Makefile.in (gengtype.o): Also depend on rtl.def. * ggc.h (ggc_mark_rtx_children): Delete prototype. (ggc_mark_rtx): Change to alias of gengtype-generated routine. * ggc-common.c (ggc_mark_rtx_children): Delete. (ggc_mark_rtx_children_1): Delete. (gt_ggc_m_rtx_def): Delete. * gengtype.c (adjust_field_rtx_def): New. (adjust_field_type): Call adjust_field_rtx_def. (write_gc_structure_fields): Add 'default' case to switch if none is specified; remove unused code. * tree.h (struct tree_exp): Update for change to meaning of special. * gengtype.c (adjust_field_tree_exp): New function. (adjust_field_type): Handle `tree_exp' special here. (write_gc_structure_fields): Don't handle `tree_exp' special here. Handle new `dot' option. * gengtype.h: Make `info' a pointer-to-const. * gengtype-yacc.y (yacc_ids): Use xasprintf. * gengtype.c (write_gc_structure_fields): Remove implementation of `always' option, add `default' option. * doc/gty.texi (GTY Options): Remove documentation of `always', add `default'. Index: gcc/cp/ChangeLog 2002-09-12 Geoffrey Keating <geoffk@apple.com> * cp-tree.h (union lang_tree_node): Add chain_next option. Index: gcc/f/ChangeLog 2002-09-12 Geoffrey Keating <geoffk@apple.com> * com.c (union lang_tree_node): Add chain_next option. Index: gcc/java/ChangeLog 2002-09-12 Geoffrey Keating <geoffk@apple.com> * java-tree.h (union lang_tree_node): Add chain_next option. From-SVN: r57206
This commit is contained in:
parent
a7f6d760f3
commit
36a5eadd1a
@ -1,3 +1,90 @@
|
||||
2002-09-16 Geoffrey Keating <geoffk@apple.com>
|
||||
|
||||
* ggc-common.c (ggc_mark_rtx_children_1): Update for changed name
|
||||
mangling.
|
||||
|
||||
The following changes are merged from pch-branch:
|
||||
|
||||
* doc/gty.texi (GTY Options): Document %a.
|
||||
* gengtype.c (do_scalar_typedef): New function.
|
||||
(process_gc_options): Handle `length' option.
|
||||
(set_gc_used_type): A pointer to an array of structures doesn't
|
||||
qualify as a pointer to a structure.
|
||||
(output_escaped_param): Add `%a' escape.
|
||||
(write_gc_structure_fields): Allow 'desc' on array of unions.
|
||||
(main): Define `uint8', `jword' and `JCF_u2' as scalars; use
|
||||
do_scalar_typedef.
|
||||
|
||||
* gengtype.c (enum rtx_code): Make global.
|
||||
(rtx_format): Make global.
|
||||
(rtx_next): New.
|
||||
(gen_rtx_next): New.
|
||||
(write_rtx_next): New.
|
||||
(adjust_field_rtx_def): Skip fields marked by chain_next.
|
||||
(open_base_files): Delete redundant prototype.
|
||||
(write_enum_defn): New.
|
||||
(output_mangled_typename): Correct abort call.
|
||||
(write_gc_marker_routine_for_structure): Handle chain_next and
|
||||
chain_prev options.
|
||||
(finish_root_table): Don't output redundant \n.
|
||||
(main): Call gen_rtx_next, write_rtx_next, write_enum_defn.
|
||||
* c-tree.h (union lang_tree_node): Add chain_next option.
|
||||
|
||||
* gengtype.h (NUM_PARAM): New definition.
|
||||
(struct type): For TYPE_PARAM_STRUCT, allow multiple parameters.
|
||||
* gengtype.c (find_param_structure): New.
|
||||
(adjust_field_type): Handle param<n>_is option.
|
||||
(process_gc_options): Detect use_params option. Update callers.
|
||||
(set_gc_used_type): Add 'param' parameter, update callers. Handle
|
||||
'use_params' option.
|
||||
(open_base_files): Add splay-tree.h to list of files included.
|
||||
(output_mangled_typename): New.
|
||||
(write_gc_structure_fields): Update 'param' parameter to support
|
||||
multiple parameters. Change name mangling. Allow parameterized
|
||||
fields to have an apparent scalar type. Handle param<n>_is options,
|
||||
use_param option.
|
||||
(write_gc_marker_routine_for_structure): Update for change to name
|
||||
mangling. Better guess the output file for parameterized types.
|
||||
(write_gc_types): Update for change to name mangling.
|
||||
(write_gc_root): Update for change to name mangling. Handle (ignore)
|
||||
param<n>_is options.
|
||||
* doc/gty.texi (GTY Options): Add description of param<n>_is
|
||||
options, use_params option.
|
||||
* ggc.h (ggc_mark_rtx): Update for changed name mangling.
|
||||
* gengtype-lex.l: Produce token for param<n>_is.
|
||||
* gengtype-yacc.y: Parse param<n>_is.
|
||||
|
||||
* gengtype.c (adjust_field_tree_exp): Don't name a variable 'rindex'.
|
||||
|
||||
* rtl.c: Update comment describing rtx_format.
|
||||
* rtl.h (union rtunion): Separate definition and typedef.
|
||||
(struct rtx_def): Use gengtype to mark.
|
||||
* Makefile.in (gengtype.o): Also depend on rtl.def.
|
||||
* ggc.h (ggc_mark_rtx_children): Delete prototype.
|
||||
(ggc_mark_rtx): Change to alias of gengtype-generated routine.
|
||||
* ggc-common.c (ggc_mark_rtx_children): Delete.
|
||||
(ggc_mark_rtx_children_1): Delete.
|
||||
(gt_ggc_m_rtx_def): Delete.
|
||||
* gengtype.c (adjust_field_rtx_def): New.
|
||||
(adjust_field_type): Call adjust_field_rtx_def.
|
||||
(write_gc_structure_fields): Add 'default' case to switch if none
|
||||
is specified; remove unused code.
|
||||
|
||||
* tree.h (struct tree_exp): Update for change to meaning
|
||||
of special.
|
||||
* gengtype.c (adjust_field_tree_exp): New function.
|
||||
(adjust_field_type): Handle `tree_exp' special here.
|
||||
(write_gc_structure_fields): Don't handle `tree_exp' special here.
|
||||
Handle new `dot' option.
|
||||
|
||||
* gengtype.h: Make `info' a pointer-to-const.
|
||||
* gengtype-yacc.y (yacc_ids): Use xasprintf.
|
||||
|
||||
* gengtype.c (write_gc_structure_fields): Remove implementation
|
||||
of `always' option, add `default' option.
|
||||
* doc/gty.texi (GTY Options): Remove documentation of `always',
|
||||
add `default'.
|
||||
|
||||
2002-09-16 Hans-Peter Nilsson <hp@bitrange.com>
|
||||
|
||||
* output.h: Remove #ifdef RTX_CODE and #ifdef TREE_CODE.
|
||||
|
@ -2053,7 +2053,8 @@ gengtype$(build_exeext) : gengtype.o gengtype-lex.o gengtype-yacc.o \
|
||||
$(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o $@ \
|
||||
gengtype.o gengtype-lex.o gengtype-yacc.o $(HOST_LIBS)
|
||||
|
||||
gengtype.o : gengtype.c gengtype.h $(HCONFIG_H) $(SYSTEM_H) real.h gtyp-gen.h
|
||||
gengtype.o : gengtype.c gengtype.h $(HCONFIG_H) $(SYSTEM_H) real.h rtl.def \
|
||||
gtyp-gen.h
|
||||
$(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) \
|
||||
$(srcdir)/gengtype.c $(OUTPUT_OPTION)
|
||||
|
||||
|
@ -48,7 +48,8 @@ struct lang_identifier GTY(())
|
||||
/* The resulting tree type. */
|
||||
|
||||
union lang_tree_node
|
||||
GTY((desc ("TREE_CODE (&%h.generic) == IDENTIFIER_NODE")))
|
||||
GTY((desc ("TREE_CODE (&%h.generic) == IDENTIFIER_NODE"),
|
||||
chain_next ("(union lang_tree_node *)TREE_CHAIN (&%h.generic)")))
|
||||
{
|
||||
union tree_node GTY ((tag ("0"),
|
||||
desc ("tree_node_structure (&%h)")))
|
||||
|
@ -1,3 +1,7 @@
|
||||
2002-09-16 Geoffrey Keating <geoffk@apple.com>
|
||||
|
||||
* cp-tree.h (union lang_tree_node): Add chain_next option.
|
||||
|
||||
2002-09-16 Nathan Sidwell <nathan@codesourcery.com>
|
||||
|
||||
* parse.y (parse_finish_call_expr): Check lookup_member result.
|
||||
|
@ -505,7 +505,8 @@ enum cp_tree_node_structure_enum {
|
||||
};
|
||||
|
||||
/* The resulting tree type. */
|
||||
union lang_tree_node GTY((desc ("cp_tree_node_structure (&%h)")))
|
||||
union lang_tree_node GTY((desc ("cp_tree_node_structure (&%h)"),
|
||||
chain_next ("(union lang_tree_node *)TREE_CHAIN (&%h.generic)")))
|
||||
{
|
||||
struct tree_common GTY ((tag ("TS_CP_COMMON"))) common;
|
||||
union tree_node GTY ((tag ("TS_CP_GENERIC"),
|
||||
|
@ -72,6 +72,10 @@ immediately contains the current structure.
|
||||
@item %0
|
||||
This expands to an expression that evaluates to the outermost structure
|
||||
that contains the current structure.
|
||||
@item %a
|
||||
This expands to the string of the form @code{[i1][i2]...} that indexes
|
||||
the array item currently being marked. For instance, if the field
|
||||
being marked is @code{foo}, then @code{%1.foo%a} is the same as @code{%h}.
|
||||
@end table
|
||||
|
||||
The available options are:
|
||||
@ -121,10 +125,10 @@ field really isn't ever used.
|
||||
|
||||
@findex desc
|
||||
@findex tag
|
||||
@findex always
|
||||
@findex default
|
||||
@item desc
|
||||
@itemx tag
|
||||
@itemx always
|
||||
@itemx default
|
||||
|
||||
The type machinery needs to be told which field of a @code{union} is
|
||||
currently active. This is done by giving each field a constant @code{tag}
|
||||
@ -146,7 +150,9 @@ it discriminates. Use @code{%1} to mean the structure containing it.
|
||||
(There are no escapes available to the @code{tag} option, since it's
|
||||
supposed to be a constant.)
|
||||
|
||||
You can use @code{always} to mean that this field is always used.
|
||||
Each @code{tag} should be different. If no @code{tag} is matched,
|
||||
the field marked with @code{default} is used if there is one, otherwise
|
||||
no field in the union will be marked.
|
||||
|
||||
@findex param_is
|
||||
@findex use_param
|
||||
@ -154,15 +160,39 @@ You can use @code{always} to mean that this field is always used.
|
||||
@itemx use_param
|
||||
|
||||
Sometimes it's convenient to define some data structure to work on
|
||||
generic pointers (that is, @code{PTR}), and then use it with specific types.
|
||||
@code{param_is} specifies the real type pointed to, and @code{use_param}
|
||||
says where in the generic data structure that type should be put.
|
||||
generic pointers (that is, @code{PTR}) and then use it with a specific
|
||||
type. @code{param_is} specifies the real type pointed to, and
|
||||
@code{use_param} says where in the generic data structure that type
|
||||
should be put.
|
||||
|
||||
For instance, to have a @code{htab_t} that points to trees, one should write
|
||||
@verbatim
|
||||
htab_t GTY ((param_is (union tree_node))) ict;
|
||||
@end verbatim
|
||||
|
||||
@findex param@var{n}_is
|
||||
@findex use_param@var{n}
|
||||
@item param@var{n}_is
|
||||
@itemx use_param@var{n}
|
||||
|
||||
In more complicated cases, the data structure might need to work on
|
||||
several different types, which might not necessarily all be pointers.
|
||||
For this, @code{param1_is} through @code{param9_is} may be used to
|
||||
specify the real type of a field identified by @code{use_param1} through
|
||||
@code{use_param9}.
|
||||
|
||||
@findex use_params
|
||||
@item use_params
|
||||
|
||||
When a structure contains another structure that is parameterised,
|
||||
there's no need to do anything special, the inner stucture inherits the
|
||||
parameters of the outer one. When a structure contains a pointer to a
|
||||
parameterised structure, the type machinery won't automatically detect
|
||||
this (it could, it just doesn't yet), so it's necessary to tell it that
|
||||
the pointed-to structure should use the same parameters as the outer
|
||||
structure. This is done by marking the pointer with the
|
||||
@code{use_params} option.
|
||||
|
||||
@findex deletable
|
||||
@item deletable
|
||||
|
||||
|
@ -1,3 +1,7 @@
|
||||
2002-09-16 Geoffrey Keating <geoffk@apple.com>
|
||||
|
||||
* com.c (union lang_tree_node): Add chain_next option.
|
||||
|
||||
2002-09-16 Richard Henderson <rth@redhat.com>
|
||||
|
||||
* target.c (ffetarget_real1): Don't pass FFETARGET_ATOF_
|
||||
|
@ -605,7 +605,8 @@ struct lang_identifier GTY(())
|
||||
|
||||
/* The resulting tree type. */
|
||||
union lang_tree_node
|
||||
GTY((desc ("TREE_CODE (&%h.generic) == IDENTIFIER_NODE")))
|
||||
GTY((desc ("TREE_CODE (&%h.generic) == IDENTIFIER_NODE"),
|
||||
chain_next ("(union lang_tree_node *)TREE_CHAIN (&%h.generic)")))
|
||||
{
|
||||
union tree_node GTY ((tag ("0"),
|
||||
desc ("tree_node_structure (&%h)")))
|
||||
|
@ -203,8 +203,11 @@ ITYPE {IWORD}({WS}{IWORD})*
|
||||
"struct"/[^[:alnum:]_] { return STRUCT; }
|
||||
"enum"/[^[:alnum:]_] { return ENUM; }
|
||||
"ptr_alias"/[^[:alnum:]_] { return ALIAS; }
|
||||
"param_is"/[^[:alnum:]_] { return PARAM_IS; }
|
||||
[0-9]+ { return NUM; }
|
||||
"param"[0-9]*"_is"/[^[:alnum:]_] {
|
||||
yylval.s = xmemdup (yytext, yyleng, yyleng+1);
|
||||
return PARAM_IS;
|
||||
}
|
||||
|
||||
{IWORD}({WS}{IWORD})*/[^[:alnum:]_] |
|
||||
"ENUM_BITFIELD"{WS}?"("{WS}?{ID}{WS}?")" {
|
||||
|
@ -42,7 +42,7 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
|
||||
%token STRUCT "struct"
|
||||
%token ENUM "enum"
|
||||
%token ALIAS "ptr_alias"
|
||||
%token PARAM_IS "param_is"
|
||||
%token <s>PARAM_IS
|
||||
%token NUM
|
||||
%token PERCENTPERCENT "%%"
|
||||
%token <t>SCALAR
|
||||
@ -174,8 +174,7 @@ yacc_ids: /* empty */
|
||||
p->opt = xmalloc (sizeof (*(p->opt)));
|
||||
p->opt->name = "tag";
|
||||
p->opt->next = NULL;
|
||||
p->opt->info = xmalloc (3 + strlen ($2));
|
||||
sprintf (p->opt->info, "'%s'", $2);
|
||||
p->opt->info = xasprintf ("'%s'", $2);
|
||||
$$ = p;
|
||||
}
|
||||
;
|
||||
@ -263,14 +262,14 @@ options: GTY_TOKEN '(' '(' optionseqopt ')' ')'
|
||||
type_option : ALIAS
|
||||
{ $$ = "ptr_alias"; }
|
||||
| PARAM_IS
|
||||
{ $$ = "param_is"; }
|
||||
{ $$ = $1; }
|
||||
;
|
||||
|
||||
option: type_option '(' type ')'
|
||||
{
|
||||
options_p o = xmalloc (sizeof (*o));
|
||||
o->name = $1;
|
||||
o->info = $3;
|
||||
o->info = adjust_field_type ($3, NULL);
|
||||
$$ = o;
|
||||
}
|
||||
| ID '(' STRING ')'
|
||||
|
1117
gcc/gengtype.c
1117
gcc/gengtype.c
File diff suppressed because it is too large
Load Diff
@ -41,7 +41,7 @@ enum typekind {
|
||||
typedef struct options {
|
||||
struct options *next;
|
||||
const char *name;
|
||||
void *info;
|
||||
const void *info;
|
||||
} *options_p;
|
||||
|
||||
typedef struct pair *pair_p;
|
||||
@ -57,6 +57,8 @@ struct pair {
|
||||
options_p opt;
|
||||
};
|
||||
|
||||
#define NUM_PARAM 10
|
||||
|
||||
/* A description of a type. */
|
||||
struct type {
|
||||
enum typekind kind;
|
||||
@ -85,7 +87,7 @@ struct type {
|
||||
} a;
|
||||
struct {
|
||||
type_p stru;
|
||||
type_p param;
|
||||
type_p param[NUM_PARAM];
|
||||
struct fileloc line;
|
||||
} param_struct;
|
||||
} u;
|
||||
|
135
gcc/ggc-common.c
135
gcc/ggc-common.c
@ -34,7 +34,6 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
|
||||
/* Statistics about the allocation. */
|
||||
static ggc_statistics *ggc_stats;
|
||||
|
||||
static void ggc_mark_rtx_children_1 PARAMS ((rtx));
|
||||
static int ggc_htab_delete PARAMS ((void **, void *));
|
||||
|
||||
/* Maintain global roots that are preserved during GC. */
|
||||
@ -132,140 +131,6 @@ ggc_mark_roots ()
|
||||
htab_traverse (*cti->base, ggc_htab_delete, (PTR) cti);
|
||||
}
|
||||
|
||||
/* R had not been previously marked, but has now been marked via
|
||||
ggc_set_mark. Now recurse and process the children. */
|
||||
|
||||
void
|
||||
ggc_mark_rtx_children (r)
|
||||
rtx r;
|
||||
{
|
||||
rtx i, last;
|
||||
|
||||
/* Special case the instruction chain. This is a data structure whose
|
||||
chain length is potentially unbounded, and which contain references
|
||||
within the chain (e.g. label_ref and insn_list). If do nothing here,
|
||||
we risk blowing the stack recursing through a long chain of insns.
|
||||
|
||||
Combat this by marking all of the instructions in the chain before
|
||||
marking the contents of those instructions. */
|
||||
|
||||
switch (GET_CODE (r))
|
||||
{
|
||||
case INSN:
|
||||
case JUMP_INSN:
|
||||
case CALL_INSN:
|
||||
case NOTE:
|
||||
case CODE_LABEL:
|
||||
case BARRIER:
|
||||
for (i = NEXT_INSN (r); ; i = NEXT_INSN (i))
|
||||
if (! ggc_test_and_set_mark (i))
|
||||
break;
|
||||
last = i;
|
||||
|
||||
for (i = NEXT_INSN (r); i != last; i = NEXT_INSN (i))
|
||||
ggc_mark_rtx_children_1 (i);
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
ggc_mark_rtx_children_1 (r);
|
||||
}
|
||||
|
||||
static void
|
||||
ggc_mark_rtx_children_1 (r)
|
||||
rtx r;
|
||||
{
|
||||
const char *fmt;
|
||||
int i;
|
||||
rtx next_rtx;
|
||||
|
||||
do
|
||||
{
|
||||
enum rtx_code code = GET_CODE (r);
|
||||
/* This gets set to a child rtx to eliminate tail recursion. */
|
||||
next_rtx = NULL;
|
||||
|
||||
/* Collect statistics, if appropriate. */
|
||||
if (ggc_stats)
|
||||
{
|
||||
++ggc_stats->num_rtxs[(int) code];
|
||||
ggc_stats->size_rtxs[(int) code] += ggc_get_size (r);
|
||||
}
|
||||
|
||||
/* ??? If (some of) these are really pass-dependent info, do we
|
||||
have any right poking our noses in? */
|
||||
switch (code)
|
||||
{
|
||||
case MEM:
|
||||
gt_ggc_m_mem_attrs (MEM_ATTRS (r));
|
||||
break;
|
||||
case JUMP_INSN:
|
||||
ggc_mark_rtx (JUMP_LABEL (r));
|
||||
break;
|
||||
case CODE_LABEL:
|
||||
ggc_mark_rtx (LABEL_REFS (r));
|
||||
break;
|
||||
case LABEL_REF:
|
||||
ggc_mark_rtx (LABEL_NEXTREF (r));
|
||||
ggc_mark_rtx (CONTAINING_INSN (r));
|
||||
break;
|
||||
case ADDRESSOF:
|
||||
ggc_mark_tree (ADDRESSOF_DECL (r));
|
||||
break;
|
||||
case NOTE:
|
||||
switch (NOTE_LINE_NUMBER (r))
|
||||
{
|
||||
case NOTE_INSN_EXPECTED_VALUE:
|
||||
ggc_mark_rtx (NOTE_EXPECTED_VALUE (r));
|
||||
break;
|
||||
|
||||
case NOTE_INSN_BLOCK_BEG:
|
||||
case NOTE_INSN_BLOCK_END:
|
||||
ggc_mark_tree (NOTE_BLOCK (r));
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
for (fmt = GET_RTX_FORMAT (GET_CODE (r)), i = 0; *fmt ; ++fmt, ++i)
|
||||
{
|
||||
rtx exp;
|
||||
switch (*fmt)
|
||||
{
|
||||
case 'e': case 'u':
|
||||
exp = XEXP (r, i);
|
||||
if (ggc_test_and_set_mark (exp))
|
||||
{
|
||||
if (next_rtx == NULL)
|
||||
next_rtx = exp;
|
||||
else
|
||||
ggc_mark_rtx_children (exp);
|
||||
}
|
||||
break;
|
||||
case 'V': case 'E':
|
||||
gt_ggc_m_rtvec_def (XVEC (r, i));
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
while ((r = next_rtx) != NULL);
|
||||
}
|
||||
|
||||
/* Various adaptor functions. */
|
||||
void
|
||||
gt_ggc_mx_rtx_def (x)
|
||||
void *x;
|
||||
{
|
||||
ggc_mark_rtx((rtx)x);
|
||||
}
|
||||
|
||||
/* Allocate a block of memory, then clear it. */
|
||||
void *
|
||||
ggc_alloc_cleared (size)
|
||||
|
14
gcc/ggc.h
14
gcc/ggc.h
@ -1,5 +1,5 @@
|
||||
/* Garbage collection for the GNU compiler.
|
||||
Copyright (C) 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
|
||||
Copyright (C) 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GCC.
|
||||
|
||||
@ -62,21 +62,13 @@ extern const struct ggc_cache_tab * const gt_ggc_cache_rtab[];
|
||||
|
||||
extern void ggc_mark_roots PARAMS ((void));
|
||||
|
||||
extern void ggc_mark_rtx_children PARAMS ((struct rtx_def *));
|
||||
|
||||
/* If EXPR is not NULL and previously unmarked, mark it and evaluate
|
||||
to true. Otherwise evaluate to false. */
|
||||
#define ggc_test_and_set_mark(EXPR) \
|
||||
((EXPR) != NULL && ((void *) (EXPR)) != (void *) 1 && ! ggc_set_mark (EXPR))
|
||||
|
||||
#define ggc_mark_rtx(EXPR) \
|
||||
do { \
|
||||
rtx const r__ = (EXPR); \
|
||||
if (ggc_test_and_set_mark (r__)) \
|
||||
ggc_mark_rtx_children (r__); \
|
||||
} while (0)
|
||||
|
||||
#define ggc_mark_tree gt_ggc_m_tree_node
|
||||
#define ggc_mark_rtx gt_ggc_m_7rtx_def
|
||||
#define ggc_mark_tree gt_ggc_m_9tree_node
|
||||
|
||||
#define ggc_mark(EXPR) \
|
||||
do { \
|
||||
|
@ -1,3 +1,7 @@
|
||||
2002-09-16 Geoffrey Keating <geoffk@apple.com>
|
||||
|
||||
* java-tree.h (union lang_tree_node): Add chain_next option.
|
||||
|
||||
2002-09-16 Richard Henderson <rth@redhat.com>
|
||||
|
||||
* jcf-parse.c (get_constant): Runtime check for IEEE format;
|
||||
|
@ -693,7 +693,8 @@ struct lang_identifier GTY(())
|
||||
|
||||
/* The resulting tree type. */
|
||||
union lang_tree_node
|
||||
GTY((desc ("TREE_CODE (&%h.generic) == IDENTIFIER_NODE")))
|
||||
GTY((desc ("TREE_CODE (&%h.generic) == IDENTIFIER_NODE"),
|
||||
chain_next ("(union lang_tree_node *)TREE_CHAIN (&%h.generic)")))
|
||||
{
|
||||
union tree_node GTY ((tag ("0"),
|
||||
desc ("tree_node_structure (&%h)")))
|
||||
|
@ -186,6 +186,7 @@ const char * const rtx_format[NUM_RTX_CODE] = {
|
||||
"u" a pointer to another insn
|
||||
prints the uid of the insn.
|
||||
"b" is a pointer to a bitmap header.
|
||||
"B" is a basic block pointer.
|
||||
"t" is a tree pointer. */
|
||||
|
||||
#define DEF_RTL_EXPR(ENUM, NAME, FORMAT, CLASS) FORMAT ,
|
||||
|
30
gcc/rtl.h
30
gcc/rtl.h
@ -62,6 +62,8 @@ extern const char * const rtx_format[NUM_RTX_CODE];
|
||||
|
||||
extern const char rtx_class[NUM_RTX_CODE];
|
||||
#define GET_RTX_CLASS(CODE) (rtx_class[(int) (CODE)])
|
||||
|
||||
extern const unsigned char rtx_next[NUM_RTX_CODE];
|
||||
|
||||
/* The flags and bitfields of an ADDR_DIFF_VEC. BASE is the base label
|
||||
relative to which the offsets are calculated, as explained in rtl.def. */
|
||||
@ -103,7 +105,7 @@ typedef struct mem_attrs GTY(())
|
||||
|
||||
/* Common union for an element of an rtx. */
|
||||
|
||||
typedef union rtunion_def
|
||||
union rtunion_def
|
||||
{
|
||||
HOST_WIDE_INT rtwint;
|
||||
int rtint;
|
||||
@ -118,11 +120,13 @@ typedef union rtunion_def
|
||||
tree rttree;
|
||||
struct basic_block_def *bb;
|
||||
mem_attrs *rtmem;
|
||||
} rtunion;
|
||||
};
|
||||
typedef union rtunion_def rtunion;
|
||||
|
||||
/* RTL expression ("rtx"). */
|
||||
|
||||
struct rtx_def
|
||||
struct rtx_def GTY((chain_next ("RTX_NEXT (&%h)"),
|
||||
chain_prev ("RTX_PREV (&%h)")))
|
||||
{
|
||||
/* The kind of expression this is. */
|
||||
ENUM_BITFIELD(rtx_code) code: 16;
|
||||
@ -198,11 +202,29 @@ struct rtx_def
|
||||
/* The first element of the operands of this rtx.
|
||||
The number of operands and their types are controlled
|
||||
by the `code' field, according to rtl.def. */
|
||||
rtunion fld[1];
|
||||
rtunion GTY ((special ("rtx_def"),
|
||||
desc ("GET_CODE (&%0)"))) fld[1];
|
||||
};
|
||||
|
||||
#define NULL_RTX (rtx) 0
|
||||
|
||||
/* The "next" and "previous" RTX, relative to this one. */
|
||||
|
||||
#define RTX_NEXT(X) (rtx_next[GET_CODE (X)] == 0 ? NULL \
|
||||
: *(rtx *)(((char *)X) + rtx_next[GET_CODE (X)]))
|
||||
|
||||
/* FIXME: the "NEXT_INSN (PREV_INSN (X)) == X" condition shouldn't be needed.
|
||||
*/
|
||||
#define RTX_PREV(X) ((GET_CODE (X) == INSN \
|
||||
|| GET_CODE (X) == CALL_INSN \
|
||||
|| GET_CODE (X) == JUMP_INSN \
|
||||
|| GET_CODE (X) == NOTE \
|
||||
|| GET_CODE (X) == BARRIER \
|
||||
|| GET_CODE (X) == CODE_LABEL) \
|
||||
&& PREV_INSN (X) != NULL \
|
||||
&& NEXT_INSN (PREV_INSN (X)) == X \
|
||||
? PREV_INSN (X) : NULL)
|
||||
|
||||
/* Define macros to access the `code' field of the rtx. */
|
||||
|
||||
#define GET_CODE(RTX) ((enum rtx_code) (RTX)->code)
|
||||
|
@ -889,7 +889,7 @@ struct tree_exp GTY(())
|
||||
struct tree_common common;
|
||||
int complexity;
|
||||
tree GTY ((special ("tree_exp"),
|
||||
length ("TREE_CODE_LENGTH (TREE_CODE ((tree) &%h))")))
|
||||
desc ("TREE_CODE ((tree) &%0)")))
|
||||
operands[1];
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user