From patchwork Tue Jun 28 19:23:24 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gab Charette X-Patchwork-Id: 102449 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 0B898B6F54 for ; Wed, 29 Jun 2011 05:23:45 +1000 (EST) Received: (qmail 19750 invoked by alias); 28 Jun 2011 19:23:43 -0000 Received: (qmail 19740 invoked by uid 22791); 28 Jun 2011 19:23:42 -0000 X-SWARE-Spam-Status: No, hits=-1.4 required=5.0 tests=AWL, BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, SPF_HELO_PASS, 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; Tue, 28 Jun 2011 19:23:28 +0000 Received: from wpaz21.hot.corp.google.com (wpaz21.hot.corp.google.com [172.24.198.85]) by smtp-out.google.com with ESMTP id p5SJNQ9q021039; Tue, 28 Jun 2011 12:23:27 -0700 Received: from gchare.mtv.corp.google.com (gchare.mtv.corp.google.com [172.18.111.122]) by wpaz21.hot.corp.google.com with ESMTP id p5SJNP0W005228; Tue, 28 Jun 2011 12:23:25 -0700 Received: by gchare.mtv.corp.google.com (Postfix, from userid 138564) id DFF861C36CB; Tue, 28 Jun 2011 12:23:24 -0700 (PDT) To: reply@codereview.appspotmail.com, crowl@google.com, dnovillo@google.com, gcc-patches@gcc.gnu.org Subject: [pph] Add cp_global_trees to cache in preload (issue4635077) Message-Id: <20110628192324.DFF861C36CB@gchare.mtv.corp.google.com> Date: Tue, 28 Jun 2011 12:23:24 -0700 (PDT) From: gchare@google.com (Gabriel Charette) 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 Add the cp_global_trees to the cache during the preload. Those are preconstructed trees which we only need the pointers to (i.e. they should be identical in both the .cc and .h) One exception to this is the keyed_classes tree which is generated during parsing. We will need to merge the keyed_classes tree eventually when working with multiple pph's. 2011-06-28 Gabriel Charette * pph-streamer.c (pph_preload_common_nodes): Add cp_global_trees[] to cache. * g++.dg/pph/x1typerefs.cc: Remove xfail. --- This patch is available for review at http://codereview.appspot.com/4635077 diff --git a/gcc/cp/pph-streamer.c b/gcc/cp/pph-streamer.c index e919baf..c62864a 100644 --- a/gcc/cp/pph-streamer.c +++ b/gcc/cp/pph-streamer.c @@ -79,6 +79,17 @@ pph_preload_common_nodes (struct lto_streamer_cache_d *cache) if (c_global_trees[i]) lto_streamer_cache_append (cache, c_global_trees[i]); + /* cp_global_trees[] can have NULL entries in it. Skip them. */ + for (i = 0; i < CPTI_MAX; i++) + { + /* Also skip trees which are generated while parsing. */ + if (i == CPTI_KEYED_CLASSES) + continue; + + if (cp_global_trees[i]) + lto_streamer_cache_append (cache, cp_global_trees[i]); + } + lto_streamer_cache_append (cache, global_namespace); } diff --git a/gcc/testsuite/g++.dg/pph/x1typerefs.cc b/gcc/testsuite/g++.dg/pph/x1typerefs.cc index ba7580f..6aa0e96 100644 --- a/gcc/testsuite/g++.dg/pph/x1typerefs.cc +++ b/gcc/testsuite/g++.dg/pph/x1typerefs.cc @@ -1,6 +1,3 @@ -// { dg-xfail-if "BOGUS" { "*-*-*" } { "-fpph-map=pph.map" } } -// { dg-bogus "c1typerefs.h:11:18: error: cannot convert 'const std::type_info.' to 'const std::type_info.' in initialization" "" { xfail *-*-* } 0 } - #include "x1typerefs.h" int derived::method() {