This is the mail archive of the
mailing list for the GCC project.
Re: [PATCH 0/2] Port symtab/cgraph/varpool nodes to use C++ inheritance
- From: Martin Jambor <mjambor at suse dot cz>
- To: Jan Hubicka <hubicka at ucw dot cz>
- Cc: David Malcolm <dmalcolm at redhat dot com>, gcc-patches at gcc dot gnu dot org
- Date: Wed, 21 Aug 2013 11:22:50 +0200
- Subject: Re: [PATCH 0/2] Port symtab/cgraph/varpool nodes to use C++ inheritance
- References: <1376614672-8927-1-git-send-email-dmalcolm at redhat dot com> <20130820210104 dot GC16244 at atrey dot karlin dot mff dot cuni dot cz>
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).