From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17892 invoked by alias); 23 Mar 2011 14:47:50 -0000 Received: (qmail 17647 invoked by uid 22791); 23 Mar 2011 14:47:44 -0000 X-SWARE-Spam-Status: No, hits=-2.1 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from fencepost.gnu.org (HELO fencepost.gnu.org) (140.186.70.10) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 23 Mar 2011 14:47:37 +0000 Received: from eggs.gnu.org ([140.186.70.92]:47261) by fencepost.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1Q2PLT-0000EC-GS for gcc@gnu.org; Wed, 23 Mar 2011 10:47:35 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Q2PLS-0003Gu-CP for gcc@gnu.org; Wed, 23 Mar 2011 10:47:35 -0400 Received: from smtp-out.google.com ([216.239.44.51]:45315) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Q2PLS-0003GV-4t for gcc@gnu.org; Wed, 23 Mar 2011 10:47:34 -0400 Received: from hpaq12.eem.corp.google.com (hpaq12.eem.corp.google.com [172.25.149.12]) by smtp-out.google.com with ESMTP id p2NElVcU021728 for ; Wed, 23 Mar 2011 07:47:31 -0700 Received: from qwk3 (qwk3.prod.google.com [10.241.195.131]) by hpaq12.eem.corp.google.com with ESMTP id p2NElLEl027496 (version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=NOT) for ; Wed, 23 Mar 2011 07:47:30 -0700 Received: by qwk3 with SMTP id 3so5978075qwk.19 for ; Wed, 23 Mar 2011 07:47:30 -0700 (PDT) MIME-Version: 1.0 Received: by 10.52.88.225 with SMTP id bj1mr7085672vdb.61.1300891650104; Wed, 23 Mar 2011 07:47:30 -0700 (PDT) Received: by 10.220.16.129 with HTTP; Wed, 23 Mar 2011 07:47:30 -0700 (PDT) Date: Wed, 23 Mar 2011 14:47:00 -0000 Message-ID: Subject: [pph] Adapting LTO streaming for front end AST saving From: Diego Novillo To: gcc@gnu.org Cc: Richard Guenther , Jan Hubicka , Lawrence Crowl Content-Type: text/plain; charset=UTF-8 X-System-Of-Record: true X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 216.239.44.51 X-IsSubscribed: yes Mailing-List: contact gcc-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-owner@gcc.gnu.org X-SW-Source: 2011-03/txt/msg00354.txt.bz2 Over at the PPH branch we are starting to re-use the LTO streaming routines to save front end trees. Clearly, there are things that need to be extended and/or replaced since LTO streaming assumes that we are in GIMPLE. However, there is a large intersection that I think can be commoned out. - ASTs do not need to concern themselves with language differences. They are generated and consumed by cc1plus, so saving language-dependent information is fine. - LTO streaming has several checks and assumptions that prevent non-gimple trees (e.g., DECL_SAVED_TREE must be NULL). I'm looking for opinions on what would be the best approach to factor out the common code. So far, I have created a layer of routines and data structures that the front end calls to manipulate PPH files. These are wrappers on top of LTO streaming that deal with all the sections, buffers and streams used by LTO. I was thinking of using langhooks to do things like checks (like the check for DECL_SAVED_TREE in lto_output_ts_decl_non_common_tree_pointers or the asserts in lto_get_common_nodes). I'm expecting that there will be other things, like handling more tree nodes in the tree streaming routines. But everything else seems to be already sufficiently flexible for our needs. Thoughts? Thanks. Diego.