From patchwork Wed Jul 15 16:32:27 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew MacLeod X-Patchwork-Id: 495900 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 BA7E01402A9 for ; Thu, 16 Jul 2015 02:32:44 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b=Wjd2Qtj7; 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=SkYJqCI3WJ1Zzq5Z3IPmQqTbRgNzzVPo/ZAdwOhFvdcluO LNxcS4WGBqkFf6C+PfY0+gtkarCIeoZMF2sezP3sYXnWmZBBR1+joG/zYNBOi1zt llEiKzxPveRVGcB9zXTukazUo7ZQM+hcTKNvgdDmV3BmQsmcbOaADL57NcPN0= 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=6ym1a8448zBbyZEheCBBSEyOBhw=; b=Wjd2Qtj7jEQEMAc4bPJH N5D9POdsKhjZVUnpcZoytfAYEk9iqfiXwPw+i9k1R1h0B8PMqimj3UE1CHmK4FdJ j1fBEnFLAJBxukqjkEEX5+zItKpUl6u1qtQG16AKJhkAkGsd8PyBF/bduW149BLw HMMDtrs2TX++zFhbfc1P/Sg= Received: (qmail 10347 invoked by alias); 15 Jul 2015 16:32:32 -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 10337 invoked by uid 89); 15 Jul 2015 16:32:31 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.1 required=5.0 tests=AWL, BAYES_50, 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; Wed, 15 Jul 2015 16:32:30 +0000 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) by mx1.redhat.com (Postfix) with ESMTPS id 989174C0A7 for ; Wed, 15 Jul 2015 16:32:28 +0000 (UTC) Received: from [10.10.51.16] (unused [10.10.51.16] (may be forged)) by int-mx13.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t6FGWRUf024311 for ; Wed, 15 Jul 2015 12:32:28 -0400 Message-ID: <55A68B1B.7000201@redhat.com> Date: Wed, 15 Jul 2015 12:32:27 -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] options.h and comments on a couple of tm.h #include's X-IsSubscribed: yes I think this is the last patch before I start include reductions and cleanups. options.h is generated with the following snippet: /* Anything that includes tm.h, does not necessarily need this. */" #if !defined(GCC_TM_H) #include "input.h" /* for location_t */ <...> // bunch of prototypes which use location_t <...> #endif This is primarily so that the generator files can compile which don't include input.h, and thus have no location_t defined. options.h is usually included by tm.h, but some front end files include just option.h, and the inclusion of input.h is so that they don't have to I guess. input.h is now included by coretypes.h, so any of these files that care about the prototypes already have input.h. It seems to make more sense to simply check if input.h has been included instead of a weird contortion on tm.h, which is really unrelated in many ways. (I'm simply checking if UNKNOWN_LOCATION is defined) In fact, the current approach introduces a latent ordering issue in a number of front end files... they include options.h because they dont need tm.h, but then include tm.h indirectly through target.h.. if the include order is changed such that target.h was included *before* options.h (or instead of), some files fail to compile because they no longer see these prototypes. this just cleans that crud up. The other 4 files in the patch include tm.h on a line with a multi-line comment following it. The comment is suppose to reflect what macros the include is for, but at least some of these are out of date.. no one updates them. The information they convey is easily determined in an up to date way by simply removing the include from the list and compiling the .o. Plus many other front end files dont bother with this, so its inconsistent. And my real motivation is because it plays havoc with my automatic include maniupulations :-) So i propose just removing the comments. I didnt bother trying to merge options.h and tm.h in various files, mostly because for the include reduction, Im going to flatten option.h out of tm.h and tm.h/hard-reg-set.h out of target.h. I wont bother submitting that to mainline since its going to affect all the same files I'll be checking in later. When the reduction is done, I'll look at who actually needed options.h, tm.h, target.h and maybe they'll probably get mashed back to the way they are now(or maybe they wont... :-) it'll depend on the usage patterns. In any case, i dont need to pollute trunk until I know for sure. This bootstraps on x86_64-unknown-linux-gnu with no new regressions. ok for trunk? Andrew * opth-gen.awk: Check for UNKNOWN_LOCATION rather than GCC_TM_H, don't include input.h. * opts.c: Remove multiline #include comment. * java/expr.c: Remove multiline #include comment. * fortran/trans-types.c: Remove multiline #include comment. * c-family/c-opts.c: Remove multiline #include comment. Index: opth-gen.awk =================================================================== *** opth-gen.awk (revision 225789) --- opth-gen.awk (working copy) *************** print ""; *** 308,316 **** print "/* Hash optimization from a structure. */"; print "extern hashval_t cl_optimization_hash (const struct cl_optimization *);"; print ""; ! print "/* Anything that includes tm.h, does not necessarily need this. */" ! print "#if !defined(GCC_TM_H)" ! print "#include \"input.h\" /* for location_t */" print "bool " print "common_handle_option_auto (struct gcc_options *opts, " print " struct gcc_options *opts_set, " --- 308,315 ---- print "/* Hash optimization from a structure. */"; print "extern hashval_t cl_optimization_hash (const struct cl_optimization *);"; print ""; ! print "/* Generator files may not have access to location_t, and don't need these. */" ! print "#if defined(UNKNOWN_LOCATION)" print "bool " print "common_handle_option_auto (struct gcc_options *opts, " print " struct gcc_options *opts_set, " Index: java/expr.c =================================================================== *** java/expr.c (revision 225789) --- java/expr.c (working copy) *************** The Free Software Foundation is independ *** 26,37 **** #include "config.h" #include "system.h" #include "coretypes.h" ! #include "tm.h" /* For INT_TYPE_SIZE, ! TARGET_VTABLE_USES_DESCRIPTORS, ! BITS_PER_UNIT, ! MODIFY_JNI_METHOD_CALL and ! PARM_BOUNDARY. */ ! #include "alias.h" #include "tree.h" #include "fold-const.h" --- 26,32 ---- #include "config.h" #include "system.h" #include "coretypes.h" ! #include "tm.h" #include "alias.h" #include "tree.h" #include "fold-const.h" Index: fortran/trans-types.c =================================================================== *** fortran/trans-types.c (revision 225789) --- fortran/trans-types.c (working copy) *************** along with GCC; see the file COPYING3. *** 24,38 **** #include "config.h" #include "system.h" #include "coretypes.h" ! #include "tm.h" /* For INTMAX_TYPE, INT8_TYPE, INT16_TYPE, INT32_TYPE, ! INT64_TYPE, INT_LEAST8_TYPE, INT_LEAST16_TYPE, ! INT_LEAST32_TYPE, INT_LEAST64_TYPE, INT_FAST8_TYPE, ! INT_FAST16_TYPE, INT_FAST32_TYPE, INT_FAST64_TYPE, ! BOOL_TYPE_SIZE, BITS_PER_UNIT, POINTER_SIZE, ! INT_TYPE_SIZE, CHAR_TYPE_SIZE, SHORT_TYPE_SIZE, ! LONG_TYPE_SIZE, LONG_LONG_TYPE_SIZE, ! FLOAT_TYPE_SIZE, DOUBLE_TYPE_SIZE and ! LONG_DOUBLE_TYPE_SIZE. */ #include "alias.h" #include "tree.h" #include "fold-const.h" --- 24,30 ---- #include "config.h" #include "system.h" #include "coretypes.h" ! #include "tm.h" #include "alias.h" #include "tree.h" #include "fold-const.h" Index: c-family/c-opts.c =================================================================== *** c-family/c-opts.c (revision 225789) --- c-family/c-opts.c (working copy) *************** along with GCC; see the file COPYING3. *** 21,27 **** #include "config.h" #include "system.h" #include "coretypes.h" ! #include "options.h" #include "alias.h" #include "tree.h" #include "c-common.h" --- 21,27 ---- #include "config.h" #include "system.h" #include "coretypes.h" ! #include "tm.h" #include "alias.h" #include "tree.h" #include "c-common.h" *************** along with GCC; see the file COPYING3. *** 39,49 **** #include "plugin.h" /* For PLUGIN_INCLUDE_FILE event. */ #include "mkdeps.h" #include "c-target.h" - #include "tm.h" /* For BYTES_BIG_ENDIAN, - DOLLARS_IN_IDENTIFIERS, - STDC_0_IN_SYSTEM_HEADERS, - TARGET_FLT_EVAL_METHOD_NON_DEFAULT and - TARGET_OPTF. */ #include "tm_p.h" /* For C_COMMON_OVERRIDE_OPTIONS. */ #include "dumpfile.h" --- 39,44 ---- Index: opts.c =================================================================== *** opts.c (revision 225789) --- opts.c (working copy) *************** along with GCC; see the file COPYING3. *** 23,32 **** #include "intl.h" #include "coretypes.h" #include "opts.h" ! #include "options.h" ! #include "tm.h" /* For STACK_CHECK_BUILTIN, ! STACK_CHECK_STATIC_BUILTIN, DEFAULT_GDB_EXTENSIONS, ! DWARF2_DEBUGGING_INFO and DBX_DEBUGGING_INFO. */ #include "flags.h" #include "params.h" #include "diagnostic.h" --- 23,29 ---- #include "intl.h" #include "coretypes.h" #include "opts.h" ! #include "tm.h" #include "flags.h" #include "params.h" #include "diagnostic.h"