Commit 22531e51 by Jason Merrill Committed by Jason Merrill

class.c (pushclass): Only use the mi_matrix stuff #ifdef MI_MATRIX.

	* class.c (pushclass): Only use the mi_matrix stuff #ifdef MI_MATRIX.
	* search.c: Likewise.
	* lex.c (do_pending_defargs): Only call
	maybe_{begin,end}_member_template_processing for FUNCTION_DECLs.
	* parse.y (initdcl0_innards): Move maybeasm back into initdcl0 et al.

From-SVN: r18637
parent 91885faa
Mon Mar 16 12:10:39 1998 Jason Merrill <jason@yorick.cygnus.com>
* class.c (pushclass): Only use the mi_matrix stuff #ifdef MI_MATRIX.
* search.c: Likewise.
* lex.c (do_pending_defargs): Only call
maybe_{begin,end}_member_template_processing for FUNCTION_DECLs.
* parse.y (initdcl0_innards): Move maybeasm back into initdcl0 et al.
Mon Mar 16 10:47:22 1998 Mark Mitchell <mmitchell@usa.net>
* parse.y: Deal with CONSTRUCTORS in new_initializers.
......
......@@ -4785,9 +4785,13 @@ pushclass (type, modify)
if (type != previous_class_type || current_class_depth > 1)
{
#ifdef MI_MATRIX
build_mi_matrix (type);
push_class_decls (type);
free_mi_matrix ();
#else
push_class_decls (type);
#endif
}
else
{
......
......@@ -1886,7 +1886,8 @@ do_pending_defargs ()
{
push_nested_class (TREE_PURPOSE (defarg_fns), 1);
pushlevel (0);
maybe_begin_member_template_processing (defarg_fn);
if (TREE_CODE (defarg_fn) == FUNCTION_DECL)
maybe_begin_member_template_processing (defarg_fn);
if (TREE_CODE (defarg_fn) == FUNCTION_DECL)
{
......@@ -1914,7 +1915,8 @@ do_pending_defargs ()
return;
}
maybe_end_member_template_processing (defarg_fn);
if (TREE_CODE (defarg_fn) == FUNCTION_DECL)
maybe_end_member_template_processing (defarg_fn);
poplevel (0, 0, 0);
pop_nested_class (1);
}
......
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -2051,37 +2051,39 @@ initdcl:
cp_finish_decl ($<ttype>$, NULL_TREE, $2, 1, 0); }
;
/* This rule assumes a certain configuration of the parser
stack. In particular, $0, the element directly before the
beginning of this rule on the stack, must be a declarator,
or notype_declarator. And, $-1 must be some declmods, or
declspecs. */
/* This rule assumes a certain configuration of the parser stack.
In particular, $0, the element directly before the beginning of
this rule on the stack, must be a maybeasm. $-1 must be a
declarator or notype_declarator. And $-2 must be some declmods
or declspecs. We can't move the maybeasm into this rule because
we need that reduce so we prefer fn.def1 when appropriate. */
initdcl0_innards:
maybeasm maybe_attribute '='
{ $<itype>3 = parse_decl ($<ttype>0, $<ttype>-1,
$2, 1, &$<ttype>$); }
maybe_attribute '='
{ $<itype>2 = parse_decl ($<ttype>-1, $<ttype>-2,
$1, 1, &$<ttype>$); }
/* Note how the declaration of the variable is in effect
while its init is parsed! */
init
{ cp_finish_decl ($<ttype>4, $5, $1, 1, LOOKUP_ONLYCONVERTING);
$$ = $<itype>3; }
| maybeasm maybe_attribute
{ cp_finish_decl ($<ttype>3, $4, $<ttype>0, 1,
LOOKUP_ONLYCONVERTING);
$$ = $<itype>2; }
| maybe_attribute
{ tree d;
$$ = parse_decl ($<ttype>0, $<ttype>-1, $2, 0, &d);
cp_finish_decl (d, NULL_TREE, $1, 1, 0); }
$$ = parse_decl ($<ttype>-1, $<ttype>-2, $1, 0, &d);
cp_finish_decl (d, NULL_TREE, $<ttype>0, 1, 0); }
;
initdcl0:
declarator initdcl0_innards
{ $$ = $2; }
declarator maybeasm initdcl0_innards
{ $$ = $3; }
notype_initdcl0:
notype_declarator initdcl0_innards
{ $$ = $2; }
notype_declarator maybeasm initdcl0_innards
{ $$ = $3; }
;
nomods_initdcl0:
notype_declarator
notype_declarator maybeasm
{ /* Set things up as initdcl0_innards expects. */
$<ttype>$ = $1;
$1 = NULL_TREE; }
......
......@@ -2417,6 +2417,7 @@ next_baselink (baselink)
/* DEPTH-FIRST SEARCH ROUTINES. */
#ifdef MI_MATRIX
/* Assign unique numbers to _CLASSTYPE members of the lattice
specified by TYPE. The root nodes are marked first; the nodes
are marked depth-fisrt, left-right. */
......@@ -2441,6 +2442,7 @@ static int mi_size;
((mi_matrix+mi_size*(CLASSTYPE_CID (C1)-1))[CLASSTYPE_CID (C2)-1])
#define BINFO_DERIVES_FROM_STAR(C) \
(mi_matrix+(BINFO_CID (C)-1))
#endif
/* This routine converts a pointer to be a pointer of an immediate
base class. The normal convert_pointer_to routine would diagnose
......@@ -2531,11 +2533,13 @@ dfs_walk (binfo, fn, qfn)
fn (binfo);
}
#ifdef MI_MATRIX
/* Predicate functions which serve for dfs_walk. */
static int numberedp (binfo) tree binfo;
{ return BINFO_CID (binfo); }
static int unnumberedp (binfo) tree binfo;
{ return BINFO_CID (binfo) == 0; }
#endif
static int markedp (binfo) tree binfo;
{ return BINFO_MARKED (binfo); }
......@@ -2578,6 +2582,7 @@ static int dfs_debug_unmarkedp (binfo) tree binfo;
test anything (vis a vis marking) if they are paired with
a predicate function (above). */
#ifdef MI_MATRIX
/* Assign each type within the lattice a number which is unique
in the lattice. The first number assigned is 1. */
......@@ -2594,6 +2599,7 @@ dfs_unnumber (binfo)
{
BINFO_CID (binfo) = 0;
}
#endif
#if 0
static void
......@@ -3131,6 +3137,7 @@ get_vbase_types (type)
return vbase_types;
}
#ifdef MI_MATRIX
static void
dfs_record_inheritance (binfo)
tree binfo;
......@@ -3217,6 +3224,7 @@ free_mi_matrix ()
cid = 0;
#endif
}
#endif
/* If we want debug info for a type TYPE, make sure all its base types
are also marked as being potentially interesting. This avoids
......@@ -3300,12 +3308,17 @@ envelope_add_decl (type, decl, values)
else
dont_add = 1;
}
/* If we don't check CLASSTYPE_CID on CONTEXT right now, we'll end
up subtracting from the address of MI_MATRIX, putting us off
in la la land. */
else if (context
&& CLASSTYPE_CID (context)
&& TYPE_DERIVES_FROM (context, type))
else if (type == current_class_type
#ifdef MI_MATRIX
/* If we don't check CLASSTYPE_CID on CONTEXT right now,
we'll end up subtracting from the address of MI_MATRIX,
putting us off in la la land. */
|| (CLASSTYPE_CID (type)
&& TYPE_DERIVES_FROM (context, type))
#else
|| DERIVED_FROM_P (context, type)
#endif
)
{
/* Don't add in *values to list */
*values = NULL_TREE;
......@@ -3323,12 +3336,17 @@ envelope_add_decl (type, decl, values)
? DECL_CLASS_CONTEXT (value)
: DECL_CONTEXT (value);
/* If we don't check CLASSTYPE_CID on CONTEXT right now, we'll end
up subtracting from the address of MI_MATRIX, putting us off
in la la land. */
if (context
&& CLASSTYPE_CID (context)
&& TYPE_DERIVES_FROM (context, type))
if (type == current_class_type
#ifdef MI_MATRIX
/* If we don't check CLASSTYPE_CID on CONTEXT right now,
we'll end up subtracting from the address of MI_MATRIX,
putting us off in la la land. */
|| (CLASSTYPE_CID (type)
&& TYPE_DERIVES_FROM (context, type))
#else
|| DERIVED_FROM_P (context, type)
#endif
)
{
/* remove *tmp from list */
*tmp = TREE_CHAIN (*tmp);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment