Hi,

On Tue, Aug 20, 2013 at 11:01:04PM +0200, Jan Hubicka wrote:

[...]

> >     Currently to access the base symtab fields of a cgraph or varpool
> >     node, the code has e.g.
> > 
> >        node->symbol.decl
> > 
> >     whereas with C++ inheritance, the "symbol" field is no more, and we
> >     directly use the base-class field:
> > 
> >        node->decl
> 
> Indeed, this is very nice.  We also use
> (symtab_node)node whenver we need to go from cgraph/varpool node back
> to basetype.  These should go, too.
> Finally I introduced cgraph(node)/varpool(node) functions that converts
> symtab node to cgraph/varpool node and ICEs when failed.
> 
> We probably should use our new template conversions.  We have is_a
> predicate and dyn_cast convertor that returns NULL on failure.  Do
> we have variant that ICEs when conversion is not possible?
> > 

as_a ...it ICEs when gcc is configured with checking (and happily does
invalid conversion otherwise).

Martin

Reply via email to