From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 101397 invoked by alias); 29 Jun 2015 17:44:44 -0000 Mailing-List: contact jit-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Post: List-Help: List-Subscribe: Sender: jit-owner@gcc.gnu.org Received: (qmail 101273 invoked by uid 89); 29 Jun 2015 17:44:43 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Checked: by ClamAV 0.98.7 on sourceware.org X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.2 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD,SPF_HELO_PASS,SPF_PASS autolearn=ham version=3.3.2 X-Spam-Status: No, score=-2.2 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD,SPF_HELO_PASS,SPF_PASS autolearn=ham version=3.3.2 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on sourceware.org X-Spam-Level: X-Spam-User: qpsmtpd, 2 recipients X-HELO: mx1.redhat.com Message-ID: <1435599418.13727.144.camel@surprise> Subject: Re: [PATCH 1/2] Add gcc/typed-splay-tree.h From: David Malcolm To: Jeff Law Cc: gcc-patches@gcc.gnu.org, jit@gcc.gnu.org Date: Thu, 01 Jan 2015 00:00:00 -0000 In-Reply-To: <558C53EA.2040706@redhat.com> References: <558A846C.70003@starynkevitch.net> <1435259621-45194-1-git-send-email-dmalcolm@redhat.com> <558C53EA.2040706@redhat.com> Content-Type: multipart/mixed; boundary="=-FSY2zVp4xgZdhXRs/oMn" Mime-Version: 1.0 X-Scanned-By: MIMEDefang 2.68 on 10.5.11.23 X-SW-Source: 2015-q2/txt/msg00128.txt.bz2 --=-FSY2zVp4xgZdhXRs/oMn Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit Content-length: 1235 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 --=-FSY2zVp4xgZdhXRs/oMn Content-Disposition: attachment; filename="fix-typed-splay-tree.h" Content-Type: text/x-chdr; name="fix-typed-splay-tree.h"; charset="UTF-8" Content-Transfer-Encoding: 7bit Content-length: 634 commit 839fdd693d2fe8d12f04ab5bde20e8595b3031f2 Author: David Malcolm 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); --=-FSY2zVp4xgZdhXRs/oMn--