From patchwork Fri Oct 14 12:09:45 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Diego Novillo X-Patchwork-Id: 119775 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 47E57B6F97 for ; Fri, 14 Oct 2011 23:10:19 +1100 (EST) Received: (qmail 31440 invoked by alias); 14 Oct 2011 12:10:08 -0000 Received: (qmail 31297 invoked by uid 22791); 14 Oct 2011 12:10:05 -0000 X-SWARE-Spam-Status: No, hits=-2.4 required=5.0 tests=AWL, BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, RP_MATCHES_RCVD, SPF_HELO_PASS X-Spam-Check-By: sourceware.org Received: from smtp-out.google.com (HELO smtp-out.google.com) (216.239.44.51) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 14 Oct 2011 12:09:48 +0000 Received: from wpaz9.hot.corp.google.com (wpaz9.hot.corp.google.com [172.24.198.73]) by smtp-out.google.com with ESMTP id p9EC9l0t030015; Fri, 14 Oct 2011 05:09:47 -0700 Received: from topo.tor.corp.google.com (topo.tor.corp.google.com [172.29.41.2]) by wpaz9.hot.corp.google.com with ESMTP id p9EC9kid024678; Fri, 14 Oct 2011 05:09:46 -0700 Received: by topo.tor.corp.google.com (Postfix, from userid 54752) id D12281DA1D3; Fri, 14 Oct 2011 08:09:45 -0400 (EDT) To: reply@codereview.appspotmail.com, crowl@google.com, gcc-patches@gcc.gnu.org Subject: [pph] Misc cleanups (2/3) (issue5263044) Message-Id: <20111014120945.D12281DA1D3@topo.tor.corp.google.com> Date: Fri, 14 Oct 2011 08:09:45 -0400 (EDT) From: dnovillo@google.com (Diego Novillo) 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 * pph-streamer-in.c (pph_in_tree_1): Rename from pph_in_any_tree. Update all users. Do not call pph_trace_tree unless flag_pph_tracer is set. diff --git a/gcc/cp/pph-streamer-in.c b/gcc/cp/pph-streamer-in.c index f8d6393..5cdf4d5 100644 --- a/gcc/cp/pph-streamer-in.c +++ b/gcc/cp/pph-streamer-in.c @@ -512,25 +512,24 @@ pph_in_start_record (pph_stream *stream, unsigned *include_ix_p, /* The core tree reader is defined much later. */ +static tree pph_in_tree_1 (pph_stream *stream, tree *chain); -static tree pph_in_any_tree (pph_stream *stream, tree *chain); - -/* Load an AST from STREAM. Return the corresponding tree. */ +/* Load a non-mergeable AST from STREAM. Return the corresponding tree. */ tree pph_in_tree (pph_stream *stream) { - tree t = pph_in_any_tree (stream, NULL); - return t; + return pph_in_tree_1 (stream, NULL); } /* Load an AST into CHAIN from STREAM. */ + static void pph_in_mergeable_tree (pph_stream *stream, tree *chain) { - pph_in_any_tree (stream, chain); + pph_in_tree_1 (stream, chain); } @@ -1922,11 +1921,11 @@ pph_in_tree_header (pph_stream *stream, enum LTO_tags tag) } -/* Read a tree from the STREAM. If CHAIN is not null, the tree may be +/* Read a tree from the STREAM. If CHAIN is not NULL, the tree may be unified with an existing tree in that chain. */ static tree -pph_in_any_tree (pph_stream *stream, tree *chain) +pph_in_tree_1 (pph_stream *stream, tree *chain) { struct lto_input_block *ib = stream->encoder.r.ib; struct data_in *data_in = stream->encoder.r.data_in; @@ -1965,7 +1964,7 @@ pph_in_any_tree (pph_stream *stream, tree *chain) return streamer_read_integer_cst (ib, data_in); } - /* Materialize a new node from IB. This will also read all the + /* Materialize a new node from STREAM. This will also read all the language-independent bitfields for the new tree. */ expr = read = pph_in_tree_header (stream, tag); gcc_assert (read != NULL); @@ -1992,11 +1991,11 @@ pph_in_any_tree (pph_stream *stream, tree *chain) /* Add the new tree to the cache and read its body. The tree is added to the cache before we read its body to handle circular references and references from children nodes. */ - /* FIXME pph: We should not insert when read == expr, but it fails. */ pph_cache_insert_at (&stream->cache, expr, ix, pph_tree_code_to_tag (expr)); pph_in_tree_body (stream, expr); - pph_trace_tree (expr, chain != NULL); + if (flag_pph_tracer) + pph_trace_tree (expr, chain != NULL); /* If needed, sign the recently materialized tree to detect mutations. Note that we only need to compute signatures