From patchwork Wed Mar 23 22:18:41 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Diego Novillo X-Patchwork-Id: 88124 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 54A02B6F1E for ; Thu, 24 Mar 2011 09:18:52 +1100 (EST) Received: (qmail 27870 invoked by alias); 23 Mar 2011 22:18:50 -0000 Received: (qmail 27860 invoked by uid 22791); 23 Mar 2011 22:18:49 -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, 23 Mar 2011 22:18:45 +0000 Received: from wpaz33.hot.corp.google.com (wpaz33.hot.corp.google.com [172.24.198.97]) by smtp-out.google.com with ESMTP id p2NMIhmK004566; Wed, 23 Mar 2011 15:18:43 -0700 Received: from topo.tor.corp.google.com (topo.tor.corp.google.com [172.29.41.2]) by wpaz33.hot.corp.google.com with ESMTP id p2NMIfFD020296; Wed, 23 Mar 2011 15:18:41 -0700 Received: by topo.tor.corp.google.com (Postfix, from userid 54752) id 38C75ED0E; Wed, 23 Mar 2011 18:18:41 -0400 (EDT) To: gcc-patches@gcc.gnu.org, reply@codereview.appspotmail.com, crowl@google.com Subject: [pph] AST streaming (4/4) (issue4303049) Message-Id: <20110323221841.38C75ED0E@topo.tor.corp.google.com> Date: Wed, 23 Mar 2011 18:18:41 -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 Ugly LTO hacks. To be nuked. See http://gcc.gnu.org/ml/gcc-patches/2011-03/msg01556.html for details. Diego. * lto-streamer-in.c (lto_input_ts_decl_non_common_tree_pointers): Always read DECL_SAVED_TREE. * lto-streamer-out.c (lto_output_ts_decl_common_tree_pointers): Igonore varpool nodes. (lto_output_ts_decl_non_common_tree_pointers): Output NULL DECL_SAVED_TREE. --- This patch is available for review at http://codereview.appspot.com/4303049 diff --git a/gcc/lto-streamer-in.c b/gcc/lto-streamer-in.c index b86008b..d2f0075 100644 --- a/gcc/lto-streamer-in.c +++ b/gcc/lto-streamer-in.c @@ -2025,6 +2028,10 @@ lto_input_ts_decl_non_common_tree_pointers (struct lto_input_block *ib, { if (TREE_CODE (expr) == FUNCTION_DECL) { + /* FIXME pph - Hookize. */ +#if 1 + DECL_SAVED_TREE (expr) = lto_input_tree (ib, data_in); +#endif DECL_ARGUMENTS (expr) = lto_input_tree (ib, data_in); DECL_RESULT (expr) = lto_input_tree (ib, data_in); } diff --git a/gcc/lto-streamer-out.c b/gcc/lto-streamer-out.c index a66e1fb..d3d8294 100644 --- a/gcc/lto-streamer-out.c +++ b/gcc/lto-streamer-out.c @@ -854,6 +848,8 @@ lto_output_ts_decl_common_tree_pointers (struct output_block *ob, tree expr, && TREE_CODE (expr) != TRANSLATION_UNIT_DECL) { tree initial = DECL_INITIAL (expr); + /* FIXME pph - Hookize. */ +#if 0 if (TREE_CODE (expr) == VAR_DECL && (TREE_STATIC (expr) || DECL_EXTERNAL (expr)) && initial) @@ -866,6 +862,7 @@ lto_output_ts_decl_common_tree_pointers (struct output_block *ob, tree expr, vnode)) initial = NULL; } +#endif lto_output_tree_or_ref (ob, initial, ref_p); } @@ -898,11 +895,16 @@ lto_output_ts_decl_non_common_tree_pointers (struct output_block *ob, { if (TREE_CODE (expr) == FUNCTION_DECL) { +#if 0 /* DECL_SAVED_TREE holds the GENERIC representation for DECL. At this point, it should not exist. Either because it was converted to gimple or because DECL didn't have a GENERIC representation in this TU. */ gcc_assert (DECL_SAVED_TREE (expr) == NULL_TREE); +#else + /* FIXME pph - Hookize and handle FE ASTs. */ + lto_output_tree_or_ref (ob, NULL, ref_p); +#endif lto_output_tree_or_ref (ob, DECL_ARGUMENTS (expr), ref_p); lto_output_tree_or_ref (ob, DECL_RESULT (expr), ref_p); }