From patchwork Wed Jul 6 04:04:35 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Diego Novillo X-Patchwork-Id: 103409 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 35AD61007D5 for ; Wed, 6 Jul 2011 14:04:58 +1000 (EST) Received: (qmail 9153 invoked by alias); 6 Jul 2011 04:04:55 -0000 Received: (qmail 9144 invoked by uid 22791); 6 Jul 2011 04:04:52 -0000 X-SWARE-Spam-Status: No, hits=-2.1 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) (216.239.44.51) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 06 Jul 2011 04:04:38 +0000 Received: from kpbe20.cbf.corp.google.com (kpbe20.cbf.corp.google.com [172.25.105.84]) by smtp-out.google.com with ESMTP id p6644bsF004891; Tue, 5 Jul 2011 21:04:37 -0700 Received: from topo.tor.corp.google.com (topo.tor.corp.google.com [172.29.41.2]) by kpbe20.cbf.corp.google.com with ESMTP id p6644ZxF009960; Tue, 5 Jul 2011 21:04:36 -0700 Received: by topo.tor.corp.google.com (Postfix, from userid 54752) id 2F44C1DA1D1; Wed, 6 Jul 2011 00:04:35 -0400 (EDT) To: reply@codereview.appspotmail.com, crowl@google.com, gchare@google.com, gcc-patches@gcc.gnu.org Subject: [pph] Do not clobber unemitted_tinfo_decls and keyed_classes (issue4636085) Message-Id: <20110706040435.2F44C1DA1D1@topo.tor.corp.google.com> Date: Wed, 6 Jul 2011 00:04:35 -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 This patch removes a FIXME in pph_read_file_contents. Instead of clobbering unemitted_tinfo_decls and keyed_classes, we should add to the existing ones. No new fixes, but this helps with the next patch. Tested on x86_64. Committed to branch. Diego. * pph-streamer-in.c (pph_read_file_contents): Do not clobber unemitted_tinfo_decls and keyed_classes. Append new elements from STREAM. --- This patch is available for review at http://codereview.appspot.com/4636085 diff --git a/gcc/cp/pph-streamer-in.c b/gcc/cp/pph-streamer-in.c index 0ddcc75..72536a5 100644 --- a/gcc/cp/pph-streamer-in.c +++ b/gcc/cp/pph-streamer-in.c @@ -1314,8 +1314,9 @@ pph_read_file_contents (pph_stream *stream) cpp_ident_use *bad_use; const char *cur_def; cpp_idents_used idents_used; - tree fndecl; + tree fndecl, t, file_keyed_classes; unsigned i; + VEC(tree,gc) *file_unemitted_tinfo_decls; pph_in_identifiers (stream, &idents_used); @@ -1334,10 +1335,12 @@ pph_read_file_contents (pph_stream *stream) if (flag_pph_dump_tree) pph_dump_namespace (pph_logfile, global_namespace); - keyed_classes = pph_in_tree (stream); - /* FIXME pph: This call replaces the tinfo, we should merge instead. - See pph_in_tree_vec. */ - unemitted_tinfo_decls = pph_in_tree_vec (stream); + file_keyed_classes = pph_in_tree (stream); + keyed_classes = chainon (file_keyed_classes, keyed_classes); + + file_unemitted_tinfo_decls = pph_in_tree_vec (stream); + for (i = 0; VEC_iterate (tree, file_unemitted_tinfo_decls, i, t); i++) + VEC_safe_push (tree, gc, unemitted_tinfo_decls, t); /* Expand all the functions with bodies that we read from STREAM. */ for (i = 0; VEC_iterate (tree, stream->fns_to_expand, i, fndecl); i++)