[PATCH 1/2] Add gcc/typed-splay-tree.h

David Malcolm dmalcolm@redhat.com
Thu Jan 1 00:00:00 GMT 2015


On Thu, 2015-06-25 at 13:18 -0600, Jeff Law wrote:
> On 06/25/2015 01:13 PM, David Malcolm wrote:
> > I found when implementing switch statements for the jit that it
> > was much easier to work with libiberty's splay-tree.h by first
> > wrapping it in a C++ wrapper to add typesafety.
> >
> > This patch adds such a wrapper, implementing the methods I needed.
> >
> > It's unused in this patch, but is used in the followup patch (which only
> > touches the jit).
> >
> > OK for trunk?
> >
> > gcc/ChangeLog:
> > 	* typed-splay-tree.h: New file.
> OK.

Well, this is embarrassing, it seems the patch I posted to the list
doesn't actually compile.

The underlying splay_tree_insert returns a splay_tree_node, I had the
typed_splay_tree::insert returning a value_type.  I dropped this bogus
return type from the "insert" method in the implementation, in favor of
"void", but I forgot to update the declaration, leading to errors when
attempting to actually compile this (via jit/jit-recording.c in the
followup patch).

The attached one-liner patch drops it from the declaration, and applies
to [PATCH 1/2].  I don't know if I can count this as "obvious"...  It
does compile now, and "make check-jit" looks good.

Suitably mortified
Dave
-------------- next part --------------
A non-text attachment was scrubbed...
Name: fix-typed-splay-tree.h
Type: text/x-chdr
Size: 634 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/jit/attachments/20150101/58188ae0/attachment.bin>


More information about the Jit mailing list