From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 30235 invoked by alias); 6 Apr 2011 23:25:55 -0000 Received: (qmail 30223 invoked by uid 22791); 6 Apr 2011 23:25:53 -0000 X-SWARE-Spam-Status: No, hits=-3.6 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from cantor2.suse.de (HELO mx2.suse.de) (195.135.220.15) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 06 Apr 2011 23:25:48 +0000 Received: from relay1.suse.de (charybdis-ext.suse.de [195.135.221.2]) by mx2.suse.de (Postfix) with ESMTP id AEC248730A for ; Thu, 7 Apr 2011 01:25:47 +0200 (CEST) Resent-From: Martin Jambor Resent-Date: Thu, 7 Apr 2011 01:25:47 +0200 Resent-Message-ID: <20110406232547.GA27755@virgil.arch.suse.de> Resent-To: GCC Patches Message-Id: <20110406232220.922143392@virgil.suse.cz> User-Agent: quilt/0.48-16.4 Date: Wed, 06 Apr 2011 23:25:00 -0000 From: Martin Jambor To: GCC Patches Cc: Jan Hubicka Subject: [PATCH 0/7] Change of call graph interface - cgraph_node function removal X-IsSubscribed: yes Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org X-SW-Source: 2011-04/txt/msg00518.txt.bz2 Hi, I'm sending this email describing the set of patches also to the gcc mailing list because quite a few people do not follow the gcc-patches mailing list (where I am sending the individual patches). The patch set changes the interface of call graph and tries to avoid lazy call graph node creation wherever easily possible. Most importantly, it removes the cgraph_node function. The vast majority of call graph users should call cgraph_get_node instead. This function does not create a node when it already does not exist but returns NULL instead. Users should check for this if that can happen and might consider using gcc_checking_assert if it cannot but would result in a failure at some later point (unlike in the previous version of the patches, there is no cgraph_do_get_node doing this for you). In the very few cases where cgraph_get_node is not sufficient for you because you need to create a node, two new functions for that purpose are introduced. cgraph_create_node creates a call graph node for a declaration and aborts if it already exists. cgraph_get_create_node tries to find an existing node for a declaration and creates it if it does not already exist. Over the long term we would like to convert some more calls to cgraph_get_create_node to other accessors (ideally it should be used only in cgraphbuild.c) so please refrain from adding them unless you absolutely have to. I have successfully bootstrapped and tested the patches piecemeal on x86_64-linux with "all,ada" languages (and enabled checking), I have bootstrapped and tested the whole set with the same languages on i686, I have verified that c and c++ testsuite passes on ia64 and a similar test is in progress on sparc64. Are the patches OK for trunk? Thanks, Martin