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
commit 839fdd693d2fe8d12f04ab5bde20e8595b3031f2 Author: David Malcolm <dmalc...@redhat.com> Date: Fri Jun 26 05:22:32 2015 -0400 fix typed-splay-tree.h insert diff --git a/gcc/typed-splay-tree.h b/gcc/typed-splay-tree.h index 1ec4894..7849862 100644 --- a/gcc/typed-splay-tree.h +++ b/gcc/typed-splay-tree.h @@ -42,7 +42,7 @@ class typed_splay_tree value_type lookup (key_type k); value_type predecessor (key_type k); value_type successor (key_type k); - value_type insert (key_type k, value_type v); + void insert (key_type k, value_type v); private: static value_type node_to_value (splay_tree_node node);