Commit bfec1a84 by Mark Mitchell Committed by Mark Mitchell

search.c (convert_pointer_to_single_level): Reimplement without using get_binfo.

	* search.c (convert_pointer_to_single_level): Reimplement without
	using get_binfo.

From-SVN: r27394
parent 505e0385
1999-06-07 Mark Mitchell <mark@codesourcery.com>
* search.c (convert_pointer_to_single_level): Reimplement without
using get_binfo.
1999-06-06 Mark Mitchell <mark@codesourcery.com>
* method.c (is_back_referenceable_type): Back-reference bools when
not squangling.
1999-06-07 Dave Brolley <brolley@cygnus.com> 1999-06-07 Dave Brolley <brolley@cygnus.com>
* lex.c (real_yylex): Replace unused bytes from bad multibyte char. * lex.c (real_yylex): Replace unused bytes from bad multibyte char.
......
...@@ -2057,17 +2057,29 @@ static tree ...@@ -2057,17 +2057,29 @@ static tree
convert_pointer_to_single_level (to_type, expr) convert_pointer_to_single_level (to_type, expr)
tree to_type, expr; tree to_type, expr;
{ {
tree derived;
tree binfo_of_derived; tree binfo_of_derived;
tree last; int i;
binfo_of_derived = TYPE_BINFO (TREE_TYPE (TREE_TYPE (expr))); derived = TREE_TYPE (TREE_TYPE (expr));
last = get_binfo (to_type, TREE_TYPE (TREE_TYPE (expr)), 0); binfo_of_derived = TYPE_BINFO (derived);
my_friendly_assert (BINFO_INHERITANCE_CHAIN (last) == binfo_of_derived,
980827);
my_friendly_assert (BINFO_INHERITANCE_CHAIN (binfo_of_derived) == NULL_TREE, my_friendly_assert (BINFO_INHERITANCE_CHAIN (binfo_of_derived) == NULL_TREE,
980827); 980827);
return build_vbase_path (PLUS_EXPR, build_pointer_type (to_type), expr, for (i = CLASSTYPE_N_BASECLASSES (derived) - 1; i >= 0; --i)
last, 1); {
tree binfo = BINFO_BASETYPE (binfo_of_derived, i);
my_friendly_assert (BINFO_INHERITANCE_CHAIN (binfo) == binfo_of_derived,
980827);
if (same_type_p (BINFO_TYPE (binfo), to_type))
return build_vbase_path (PLUS_EXPR,
build_pointer_type (to_type),
expr, binfo, 1);
}
my_friendly_abort (19990607);
/* NOTREACHED */
return NULL_TREE;
} }
tree markedp (binfo, data) tree markedp (binfo, data)
......
// Build don't link:
// Special g++ Options: -w
// Origin: Derived from code by Andris Pavenis <andris@stargate.astr.lu.lv>
class vector {};
class V
{
};
class A : public vector
{
};
class B : public A, virtual V, public vector
{
B() {}
};
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