From patchwork Thu Jun 25 13:27:46 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew MacLeod X-Patchwork-Id: 488456 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]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id A9DA31402DE for ; Thu, 25 Jun 2015 23:28:02 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b=fXwXcGCl; dkim-atps=neutral DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :message-id:date:from:mime-version:to:subject:content-type; q= dns; s=default; b=B5bqmJZzmOlwSZPbFyReJfKQ+U8U2xsRP5DcMyMEVh0ZSL yG8oThZDmq2UaUo2wdInZvgio55txxQ7wnesH2C3dsxvJTDViRPDodLfZzKlB+VZ HpkKO/kIw9KjMzWy7QvWmOg/ufoXwlLhVQW0uX4ne0+F5OWzMckWJPfDII0Jg= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :message-id:date:from:mime-version:to:subject:content-type; s= default; bh=GQq6m0aVKJt9ica5r9xIAaOMcVA=; b=fXwXcGClqS87PBYOw46b 3R1gdSOUzp3Z1HjBMvGUBf6uW8bUWrvXWB9PVQe6juhTlv4WMbvRQ6Ds9RSVkcTG HPmmmq+Wc3nfuEW0vyqwwR407o6Xzn5Ta1HQxtY/fkrL3t5l5iYwf3t1rbtlLJhE homb0TWmnwYZ6Z4gL+QoQSo= Received: (qmail 118483 invoked by alias); 25 Jun 2015 13:27:52 -0000 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 Received: (qmail 118384 invoked by uid 89); 25 Jun 2015 13:27:51 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.5 required=5.0 tests=AWL, BAYES_00, KAM_ASCII_DIVIDERS, KAM_LAZY_DOMAIN_SECURITY, RP_MATCHES_RCVD, SPF_HELO_PASS autolearn=no version=3.3.2 X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Thu, 25 Jun 2015 13:27:49 +0000 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (Postfix) with ESMTPS id 0E70EC2E48 for ; Thu, 25 Jun 2015 13:27:48 +0000 (UTC) Received: from [10.10.51.143] (unused [10.10.51.143] (may be forged)) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t5PDRlrY014598 for ; Thu, 25 Jun 2015 09:27:47 -0400 Message-ID: <558C01D2.3070909@redhat.com> Date: Thu, 25 Jun 2015 09:27:46 -0400 From: Andrew MacLeod User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 MIME-Version: 1.0 To: gcc-patches Subject: [patch 4/4] Remove options.h/tm.h and function.h as dependencies and include compile time prerequisites in cgraph.h X-IsSubscribed: yes This patch removes a couple more dependencies cgraph.h has. The function address_can_be_compared_p makes reference to flag_merge_constants which comes from options.h via tm.h. By moving it to cgraph.c instead of inlining it in the header file, options.h and thus tm.h is no longer needed. ipa_opt_pass is given a forward declaration in function.h, but it really consumed by cgraph.h By moving that forward declaration to cgraph, it no longer requires function.h to be in the include path. It actually defined in tree-pass.h, the the *right* thing would be to require tree-pass.h, but that seems unnecessary. Another option would be to do the forward declaration in coretypes.h.. maybe that would be better? The final thing I did was include ipa-ref.h and plugin-api.h from cgraph.h. There are hard requirements for compiling cgraph.h, and are needed almost no where else, This is the first consolidation step. Its the right place to include them as indicated by the second part of the patch which removes these 2 includes from all the source files in the compiler, allowing them to just come from cgraph.h Bootstraps on x86_64-unknown-linux-gnu with no new regressions. Also builds stage 1 on all the targets in config-list.mk. OK for trunk? Andrew * function.h (ipa_opt_pass, ipa_opt_pass_d): Move forward declarations. * cgraph.h: Include ipa-ref.h and plugin-api.h. (ipa_opt_pass, ipa_opt_pass_d)): Relocate forward declarations here. (symtab_node::address_can_be_compared_p): Move function. * cgraph.c (symtab_node::address_can_be_compared_p): Relocate function definition here. Index: function.h =================================================================== *** function.h (revision 224602) --- function.h (working copy) *************** struct gimple_df; *** 156,165 **** struct call_site_record_d; struct dw_fde_node; - class ipa_opt_pass_d; - typedef ipa_opt_pass_d *ipa_opt_pass; - - struct GTY(()) varasm_status { /* If we're using a per-function constant pool, this is it. */ struct rtx_constant_pool *pool; --- 156,161 ---- Index: cgraph.h =================================================================== *** cgraph.h (revision 224602) --- cgraph.h (working copy) *************** along with GCC; see the file COPYING3. *** 21,26 **** --- 21,31 ---- #ifndef GCC_CGRAPH_H #define GCC_CGRAPH_H + #include "ipa-ref.h" + #include "plugin-api.h" + + class ipa_opt_pass_d; + typedef ipa_opt_pass_d *ipa_opt_pass; /* Symbol table consists of functions and variables. TODO: add labels and CONST_DECLs. */ *************** varpool_node::call_for_symbol_and_aliase *** 3046,3074 **** return false; } - /* Return true if NODE's address can be compared. */ - - inline bool - symtab_node::address_can_be_compared_p () - { - /* Address of virtual tables and functions is never compared. */ - if (DECL_VIRTUAL_P (decl)) - return false; - /* Address of C++ cdtors is never compared. */ - if (is_a (this) - && (DECL_CXX_CONSTRUCTOR_P (decl) - || DECL_CXX_DESTRUCTOR_P (decl))) - return false; - /* Constant pool symbols addresses are never compared. - flag_merge_constants permits us to assume the same on readonly vars. */ - if (is_a (this) - && (DECL_IN_CONSTANT_POOL (decl) - || (flag_merge_constants >= 2 - && TREE_READONLY (decl) && !TREE_THIS_VOLATILE (decl)))) - return false; - return true; - } - /* Return true if refernece may be used in address compare. */ inline bool --- 3051,3056 ---- Index: cgraph.c =================================================================== *** cgraph.c (revision 224602) --- cgraph.c (working copy) *************** along with GCC; see the file COPYING3. *** 44,53 **** #include "dominance.h" #include "cfg.h" #include "basic-block.h" - #include "plugin-api.h" #include "hard-reg-set.h" #include "function.h" - #include "ipa-ref.h" #include "cgraph.h" #include "intl.h" #include "tree-ssa-alias.h" --- 44,51 ---- *************** function_version_hasher::equal (cgraph_f *** 159,164 **** --- 157,185 ---- static GTY(()) struct cgraph_function_version_info * version_info_node = NULL; + /* Return true if NODE's address can be compared. */ + + bool + symtab_node::address_can_be_compared_p () + { + /* Address of virtual tables and functions is never compared. */ + if (DECL_VIRTUAL_P (decl)) + return false; + /* Address of C++ cdtors is never compared. */ + if (is_a (this) + && (DECL_CXX_CONSTRUCTOR_P (decl) + || DECL_CXX_DESTRUCTOR_P (decl))) + return false; + /* Constant pool symbols addresses are never compared. + flag_merge_constants permits us to assume the same on readonly vars. */ + if (is_a (this) + && (DECL_IN_CONSTANT_POOL (decl) + || (flag_merge_constants >= 2 + && TREE_READONLY (decl) && !TREE_THIS_VOLATILE (decl)))) + return false; + return true; + } + /* Get the cgraph_function_version_info node corresponding to node. */ cgraph_function_version_info * cgraph_node::function_version (void)