From patchwork Tue Jul 6 14:30:58 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Tobias Burnus X-Patchwork-Id: 58025 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 A521EB6F06 for ; Wed, 7 Jul 2010 00:31:18 +1000 (EST) Received: (qmail 16532 invoked by alias); 6 Jul 2010 14:31:16 -0000 Received: (qmail 16497 invoked by uid 22791); 6 Jul 2010 14:31:13 -0000 X-SWARE-Spam-Status: No, hits=-1.9 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_NONE X-Spam-Check-By: sourceware.org Received: from mx02.qsc.de (HELO mx02.qsc.de) (213.148.130.14) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 06 Jul 2010 14:31:04 +0000 Received: from [192.168.178.22] (port-92-204-41-181.dynamic.qsc.de [92.204.41.181]) by mx02.qsc.de (Postfix) with ESMTP id 3732E1E4B5; Tue, 6 Jul 2010 16:30:59 +0200 (CEST) Message-ID: <4C333E22.6030401@net-b.de> Date: Tue, 06 Jul 2010 16:30:58 +0200 From: Tobias Burnus User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.10) Gecko/20100520 SUSE/3.0.5 Thunderbird/3.0.5 MIME-Version: 1.0 To: =?ISO-8859-1?Q?Manuel_L=F3pez-Ib=E1=F1ez?= , gfortran CC: Gcc Patch List , Steven Bosscher , "Joseph S. Myers" , Ian Lance Taylor Subject: Re: do not include diagnostic-core.h in toplev.h References: In-Reply-To: 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 Manuel López-Ibáñez wrote: > This patch moves diagnostic-core.h out of toplev.h. Since toplev.h is > included everywhere, it would be an enormous work to check every file > to ensure which one is actually needed. Followup patches can > progressively remove either toplev.h or diagnostic-core.h (or > sometimes even both). Therefore, my patch just includes > diagnostic-core.h whenever toplev.h is included, except in a few > places where I removed the unused includes by hand before giving up. > In particular, the C/C++ frontends did not need to include additional > headers because diagnostic-core.h is included by c-common.h, c-tree.h > and cp-tree.h (Not sure whether this is correct but it was like this > before my patch). > > Bootstrapped and regression tested on x86_64-linux-gnu. > fortran/ > * Include diagnostic-core.h in every file that includes toplev.h. The changelog is incomplete. Attached is a patch which selectively includes one file or the other (well, as it turns out: both). The patch was trivial as comments indicated which function are required. I think even without Manuel's patch it is profitable as many files only need "diagnostic-core.h" even though they include "toplev.h". Thus, I intent the commit the attached patch as obvious - unless there are objections. Build and being regtested on x86-64-linux. (The build is with Manuel's patch.) Tobias 2010-07-06 Tobias Burnus * trans-decl.c: Include diagnostic-core.h besides toplev.h. * trans-intrinsic.c: Ditto. * trans-types.c: Ditto. * convert.c: Include diagnostic-core.h instead of toplev.h. * options.c: Ditto. * trans-array.c: Ditto. * trans-const.c: Ditto. * trans-expr.c: Ditto. * trans-io.c: Ditto. * trans-openmp.c: Ditto. * trans.c: Ditto. diff --git a/gcc/fortran/convert.c b/gcc/fortran/convert.c index f69ea23..50e3a6a 100644 --- a/gcc/fortran/convert.c +++ b/gcc/fortran/convert.c @@ -40,7 +40,7 @@ along with GCC; see the file COPYING3. If not see #include "tree.h" #include "flags.h" #include "convert.h" -#include "toplev.h" /* For error. */ +#include "diagnostic-core.h" /* For error. */ #include "gfortran.h" #include "trans.h" diff --git a/gcc/fortran/options.c b/gcc/fortran/options.c index af537a1..d5c6c3c 100644 --- a/gcc/fortran/options.c +++ b/gcc/fortran/options.c @@ -33,7 +33,7 @@ along with GCC; see the file COPYING3. If not see #include "gfortran.h" #include "target.h" #include "cpp.h" -#include "toplev.h" /* For sorry. */ +#include "diagnostic-core.h" /* For sorry. */ #include "tm.h" gfc_option_t gfc_option; diff --git a/gcc/fortran/trans-array.c b/gcc/fortran/trans-array.c index 7eb8e75..bc26835 100644 --- a/gcc/fortran/trans-array.c +++ b/gcc/fortran/trans-array.c @@ -80,7 +80,7 @@ along with GCC; see the file COPYING3. If not see #include "system.h" #include "coretypes.h" #include "tree.h" -#include "toplev.h" /* For internal_error/fatal_error. */ +#include "diagnostic-core.h" /* For internal_error/fatal_error. */ #include "flags.h" #include "gfortran.h" #include "constructor.h" diff --git a/gcc/fortran/trans-const.c b/gcc/fortran/trans-const.c index 6d4f222..8cd4fda 100644 --- a/gcc/fortran/trans-const.c +++ b/gcc/fortran/trans-const.c @@ -26,7 +26,7 @@ along with GCC; see the file COPYING3. If not see #include "coretypes.h" #include "tree.h" #include "realmpfr.h" -#include "toplev.h" /* For fatal_error. */ +#include "diagnostic-core.h" /* For fatal_error. */ #include "double-int.h" #include "gfortran.h" #include "trans.h" diff --git a/gcc/fortran/trans-decl.c b/gcc/fortran/trans-decl.c index 1c7226c..1331148 100644 --- a/gcc/fortran/trans-decl.c +++ b/gcc/fortran/trans-decl.c @@ -29,7 +29,8 @@ along with GCC; see the file COPYING3. If not see #include "tree-dump.h" #include "gimple.h" /* For create_tmp_var_raw. */ #include "ggc.h" -#include "toplev.h" /* For announce_function/internal_error. */ +#include "diagnostic-core.h" /* For internal_error. */ +#include "toplev.h" /* For announce_function. */ #include "output.h" /* For decl_default_tls_model. */ #include "target.h" #include "function.h" diff --git a/gcc/fortran/trans-expr.c b/gcc/fortran/trans-expr.c index 1a7a4a1..ea8b892 100644 --- a/gcc/fortran/trans-expr.c +++ b/gcc/fortran/trans-expr.c @@ -26,7 +26,7 @@ along with GCC; see the file COPYING3. If not see #include "system.h" #include "coretypes.h" #include "tree.h" -#include "toplev.h" /* For fatal_error. */ +#include "diagnostic-core.h" /* For fatal_error. */ #include "langhooks.h" #include "flags.h" #include "gfortran.h" diff --git a/gcc/fortran/trans-intrinsic.c b/gcc/fortran/trans-intrinsic.c index 7f583da..0b737b0 100644 --- a/gcc/fortran/trans-intrinsic.c +++ b/gcc/fortran/trans-intrinsic.c @@ -28,7 +28,8 @@ along with GCC; see the file COPYING3. If not see #include "tm.h" /* For UNITS_PER_WORD. */ #include "tree.h" #include "ggc.h" -#include "toplev.h" /* For rest_of_decl_compilation/internal_error. */ +#include "diagnostic-core.h" /* For internal_error. */ +#include "toplev.h" /* For rest_of_decl_compilation. */ #include "flags.h" #include "gfortran.h" #include "arith.h" diff --git a/gcc/fortran/trans-io.c b/gcc/fortran/trans-io.c index 9926d2f..2624bb2 100644 --- a/gcc/fortran/trans-io.c +++ b/gcc/fortran/trans-io.c @@ -25,7 +25,7 @@ along with GCC; see the file COPYING3. If not see #include "coretypes.h" #include "tree.h" #include "ggc.h" -#include "toplev.h" /* For internal_error. */ +#include "diagnostic-core.h" /* For internal_error. */ #include "gfortran.h" #include "trans.h" #include "trans-stmt.h" diff --git a/gcc/fortran/trans-openmp.c b/gcc/fortran/trans-openmp.c index 7a7d330..4a7f70e 100644 --- a/gcc/fortran/trans-openmp.c +++ b/gcc/fortran/trans-openmp.c @@ -25,7 +25,7 @@ along with GCC; see the file COPYING3. If not see #include "coretypes.h" #include "tree.h" #include "gimple.h" /* For create_tmp_var_raw. */ -#include "toplev.h" /* For internal_error. */ +#include "diagnostic-core.h" /* For internal_error. */ #include "gfortran.h" #include "trans.h" #include "trans-stmt.h" diff --git a/gcc/fortran/trans-types.c b/gcc/fortran/trans-types.c index 6f71da8..cfc6ab6 100644 --- a/gcc/fortran/trans-types.c +++ b/gcc/fortran/trans-types.c @@ -30,7 +30,8 @@ along with GCC; see the file COPYING3. If not see #include "langhooks.h" /* For iso-c-bindings.def. */ #include "target.h" #include "ggc.h" -#include "toplev.h" /* For rest_of_decl_compilation/fatal_error. */ +#include "diagnostic-core.h" /* For fatal_error. */ +#include "toplev.h" /* For rest_of_decl_compilation. */ #include "gfortran.h" #include "trans.h" #include "trans-types.h" diff --git a/gcc/fortran/trans.c b/gcc/fortran/trans.c index 43b69d5..f97e739 100644 --- a/gcc/fortran/trans.c +++ b/gcc/fortran/trans.c @@ -25,7 +25,7 @@ along with GCC; see the file COPYING3. If not see #include "tree.h" #include "gimple.h" /* For create_tmp_var_raw. */ #include "tree-iterator.h" -#include "toplev.h" /* For internal_error. */ +#include "diagnostic-core.h" /* For internal_error. */ #include "defaults.h" #include "flags.h" #include "gfortran.h"