From patchwork Mon May 30 20:06:31 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Diego Novillo X-Patchwork-Id: 97948 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) by ozlabs.org (Postfix) with SMTP id E9DCBB6F6F for ; Tue, 31 May 2011 06:07:09 +1000 (EST) Received: (qmail 31811 invoked by alias); 30 May 2011 20:07:05 -0000 Received: (qmail 31798 invoked by uid 22791); 30 May 2011 20:07:03 -0000 X-SWARE-Spam-Status: No, hits=-2.0 required=5.0 tests=AWL, BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, SPF_HELO_PASS, TW_BJ, TW_CL, TW_CP, TW_CX, TW_JC, T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from smtp-out.google.com (HELO smtp-out.google.com) (74.125.121.67) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 30 May 2011 20:06:36 +0000 Received: from hpaq1.eem.corp.google.com (hpaq1.eem.corp.google.com [172.25.149.1]) by smtp-out.google.com with ESMTP id p4UK6ZRO026725 for ; Mon, 30 May 2011 13:06:35 -0700 Received: from topo.tor.corp.google.com (topo.tor.corp.google.com [172.29.41.2]) by hpaq1.eem.corp.google.com with ESMTP id p4UK6WNc018254; Mon, 30 May 2011 13:06:33 -0700 Received: by topo.tor.corp.google.com (Postfix, from userid 54752) id 8DB1B1DA1C9; Mon, 30 May 2011 16:06:31 -0400 (EDT) Date: Mon, 30 May 2011 16:06:31 -0400 From: Diego Novillo To: gcc-patches@gcc.gnu.org, Lawrence Crowl Subject: [pph] Update streaming of cxx_binding and c_language_function Message-ID: <20110530200629.GA27918@google.com> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.20 (2009-06-14) X-System-Of-Record: true X-IsSubscribed: yes Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org This patch updates the streaming of these two structures to reflect changes in trunk. Tested and submitted together with the latest merge. Diego. ALLOC_AND_REGISTER. (pph_stream_read_label_binding): Likewise. (pph_stream_read_class_binding): Likewise. Do not memcpy into cb->base. Assign to it directly. (pph_stream_read_c_language_function): Call pph_stream_read_tree_vec instead of pph_input_tree. * pph-streamer-out.c (pph_stream_write_class_binding): Do not write &cb->base. Write cb->base. (pph_stream_write_c_language_function): Call pph_stream_write_tree_vec instead of pph_output_tree_or_ref. --- gcc/cp/ChangeLog.pph | 14 ++++++++++++++ gcc/cp/pph-streamer-in.c | 21 ++++++--------------- gcc/cp/pph-streamer-out.c | 4 ++-- 3 files changed, 22 insertions(+), 17 deletions(-) diff --git a/gcc/cp/ChangeLog.pph b/gcc/cp/ChangeLog.pph index 0331089..05db431 100644 --- a/gcc/cp/ChangeLog.pph +++ b/gcc/cp/ChangeLog.pph @@ -1,3 +1,17 @@ +2011-05-30 Diego Novillo + + * pph-streamer-in.c (pph_stream_read_cxx_binding_1): Call + ALLOC_AND_REGISTER. + (pph_stream_read_label_binding): Likewise. + (pph_stream_read_class_binding): Likewise. + Do not memcpy into cb->base. Assign to it directly. + (pph_stream_read_c_language_function): Call + pph_stream_read_tree_vec instead of pph_input_tree. + * pph-streamer-out.c (pph_stream_write_class_binding): Do not + write &cb->base. Write cb->base. + (pph_stream_write_c_language_function): Call + pph_stream_write_tree_vec instead of pph_output_tree_or_ref. + 2011-05-27 Lawrence Crowl * cp-objcp-common.c (cp_tree_size): Remove case TREE_BINFO. diff --git a/gcc/cp/pph-streamer-in.c b/gcc/cp/pph-streamer-in.c index d9b9f1d..b6f7da7 100644 --- a/gcc/cp/pph-streamer-in.c +++ b/gcc/cp/pph-streamer-in.c @@ -338,14 +338,12 @@ pph_stream_read_cxx_binding_1 (pph_stream *stream) value = pph_input_tree (stream); type = pph_input_tree (stream); - cb = cxx_binding_make (value, type); + ALLOC_AND_REGISTER (stream, ix, cb, cxx_binding_make (value, type)); cb->scope = pph_stream_read_binding_level (stream); bp = pph_input_bitpack (stream); cb->value_is_inherited = bp_unpack_value (&bp, 1); cb->is_local = bp_unpack_value (&bp, 1); - pph_stream_register_shared_data (stream, cb, ix); - return cb; } @@ -368,9 +366,7 @@ pph_stream_read_cxx_binding (pph_stream *stream) curr = prev; } - /* Read the current binding at the end. Note that we do not need - to call pph_stream_register_shared_data as it is already done - by pph_stream_read_cxx_binding_1. */ + /* Read the current binding at the end. */ cb = pph_stream_read_cxx_binding_1 (stream); if (cb) cb->previous = curr; @@ -394,13 +390,10 @@ pph_stream_read_class_binding (pph_stream *stream) else if (marker == PPH_RECORD_SHARED) return (cp_class_binding *) pph_stream_read_shared_data (stream, ix); - cb = ggc_alloc_cleared_cp_class_binding (); - memcpy (&cb->base, pph_stream_read_cxx_binding (stream), - sizeof (cxx_binding)); + ALLOC_AND_REGISTER (stream, ix, cb, ggc_alloc_cleared_cp_class_binding ()); + cb->base = pph_stream_read_cxx_binding (stream); cb->identifier = pph_input_tree (stream); - pph_stream_register_shared_data (stream, cb, ix); - return cb; } @@ -420,12 +413,10 @@ pph_stream_read_label_binding (pph_stream *stream) else if (marker == PPH_RECORD_SHARED) return (cp_label_binding *) pph_stream_read_shared_data (stream, ix); - lb = ggc_alloc_cleared_cp_label_binding (); + ALLOC_AND_REGISTER (stream, ix, lb, ggc_alloc_cleared_cp_label_binding ()); lb->label = pph_input_tree (stream); lb->prev_value = pph_input_tree (stream); - pph_stream_register_shared_data (stream, lb, ix); - return lb; } @@ -511,7 +502,7 @@ pph_stream_read_c_language_function (pph_stream *stream) ALLOC_AND_REGISTER (stream, ix, clf, ggc_alloc_cleared_c_language_function ()); - clf->x_stmt_tree.x_cur_stmt_list = pph_input_tree (stream); + clf->x_stmt_tree.x_cur_stmt_list = pph_stream_read_tree_vec (stream); clf->x_stmt_tree.stmts_are_full_exprs_p = pph_input_uint (stream); return clf; diff --git a/gcc/cp/pph-streamer-out.c b/gcc/cp/pph-streamer-out.c index a5a8dec..77d5ec0 100644 --- a/gcc/cp/pph-streamer-out.c +++ b/gcc/cp/pph-streamer-out.c @@ -367,7 +367,7 @@ pph_stream_write_class_binding (pph_stream *stream, cp_class_binding *cb, if (!pph_start_record (stream, cb)) return; - pph_stream_write_cxx_binding (stream, &cb->base, ref_p); + pph_stream_write_cxx_binding (stream, cb->base, ref_p); pph_output_tree_or_ref (stream, cb->identifier, ref_p); } @@ -497,7 +497,7 @@ pph_stream_write_c_language_function (pph_stream *stream, if (!pph_start_record (stream, clf)) return; - pph_output_tree_or_ref (stream, clf->x_stmt_tree.x_cur_stmt_list, ref_p); + pph_stream_write_tree_vec (stream, clf->x_stmt_tree.x_cur_stmt_list, ref_p); pph_output_uint (stream, clf->x_stmt_tree.stmts_are_full_exprs_p); }