From 2c384ad87fc1963dbb9b2092dba08f99ddf32136 Mon Sep 17 00:00:00 2001 From: Szabolcs Nagy Date: Fri, 22 Apr 2016 11:00:42 +0000 Subject: [PATCH] [PATCH 2/2] (header usage fix) include c++ headers in system.h 2016-04-22 Szabolcs Nagy * system.h (list, map, set, vector): Include conditionally. * auto-profile.c (INCLUDE_MAP, INCLUDE_SET): Define. * graphite-isl-ast-to-gimple.c (INCLUDE_MAP): Define. * ipa-icf.c (INCLUDE_LIST): Define. * config/aarch64/cortex-a57-fma-steering.c (INCLUDE_LIST): Define. * config/sh/sh.c (INCLUDE_VECTOR): Define. * config/sh/sh_treg_combine.cc (INCLUDE_ALGORITHM): Define. (INCLUDE_LIST, INCLUDE_VECTOR): Define. * cp/logic.cc (INCLUDE_LIST): Define. * fortran/trans-common.c (INCLUDE_MAP): Define. From-SVN: r235362 --- gcc/ChangeLog | 13 +++++++++++++ gcc/auto-profile.c | 6 ++---- gcc/config/aarch64/cortex-a57-fma-steering.c | 3 +-- gcc/config/sh/sh.c | 2 +- gcc/config/sh/sh_treg_combine.cc | 7 +++---- gcc/cp/logic.cc | 3 +-- gcc/fortran/trans-common.c | 4 +--- gcc/graphite-isl-ast-to-gimple.c | 2 +- gcc/ipa-icf.c | 2 +- gcc/system.h | 12 ++++++++++++ 10 files changed, 36 insertions(+), 18 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 5fb73ce59a8..ff68ee80b48 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,16 @@ +2016-04-22 Szabolcs Nagy + + * system.h (list, map, set, vector): Include conditionally. + * auto-profile.c (INCLUDE_MAP, INCLUDE_SET): Define. + * graphite-isl-ast-to-gimple.c (INCLUDE_MAP): Define. + * ipa-icf.c (INCLUDE_LIST): Define. + * config/aarch64/cortex-a57-fma-steering.c (INCLUDE_LIST): Define. + * config/sh/sh.c (INCLUDE_VECTOR): Define. + * config/sh/sh_treg_combine.cc (INCLUDE_ALGORITHM): Define. + (INCLUDE_LIST, INCLUDE_VECTOR): Define. + * cp/logic.cc (INCLUDE_LIST): Define. + * fortran/trans-common.c (INCLUDE_MAP): Define. + 2016-04-22 Szabolcs Nagy * auto-profile.c: Remove include. diff --git a/gcc/auto-profile.c b/gcc/auto-profile.c index 0c726bd4d63..cd82ab4932d 100644 --- a/gcc/auto-profile.c +++ b/gcc/auto-profile.c @@ -19,6 +19,8 @@ along with GCC; see the file COPYING3. If not see . */ #include "config.h" +#define INCLUDE_MAP +#define INCLUDE_SET #include "system.h" #include "coretypes.h" #include "backend.h" @@ -31,10 +33,6 @@ along with GCC; see the file COPYING3. If not see #include "cgraph.h" #include "gcov-io.h" #include "diagnostic-core.h" - -#include -#include - #include "profile.h" #include "langhooks.h" #include "cfgloop.h" diff --git a/gcc/config/aarch64/cortex-a57-fma-steering.c b/gcc/config/aarch64/cortex-a57-fma-steering.c index 21159fe2ca6..1bf804b4873 100644 --- a/gcc/config/aarch64/cortex-a57-fma-steering.c +++ b/gcc/config/aarch64/cortex-a57-fma-steering.c @@ -19,6 +19,7 @@ . */ #include "config.h" +#define INCLUDE_LIST #include "system.h" #include "coretypes.h" #include "backend.h" @@ -37,8 +38,6 @@ #include "cortex-a57-fma-steering.h" #include "aarch64-protos.h" -#include - /* For better performance, the destination of FMADD/FMSUB instructions should have the same parity as their accumulator register if the accumulator contains the result of a previous FMUL or FMADD/FMSUB instruction if diff --git a/gcc/config/sh/sh.c b/gcc/config/sh/sh.c index 8c8fe3c6715..b18e59b1418 100644 --- a/gcc/config/sh/sh.c +++ b/gcc/config/sh/sh.c @@ -20,9 +20,9 @@ along with GCC; see the file COPYING3. If not see . */ #include -#include #include "config.h" +#define INCLUDE_VECTOR #include "system.h" #include "coretypes.h" #include "backend.h" diff --git a/gcc/config/sh/sh_treg_combine.cc b/gcc/config/sh/sh_treg_combine.cc index bc1ee0e234e..4d40715db79 100644 --- a/gcc/config/sh/sh_treg_combine.cc +++ b/gcc/config/sh/sh_treg_combine.cc @@ -19,6 +19,9 @@ along with GCC; see the file COPYING3. If not see . */ #include "config.h" +#define INCLUDE_ALGORITHM +#define INCLUDE_LIST +#define INCLUDE_VECTOR #include "system.h" #include "coretypes.h" #include "backend.h" @@ -32,10 +35,6 @@ along with GCC; see the file COPYING3. If not see #include "tree-pass.h" #include "expr.h" -#include -#include -#include - /* This pass tries to optimize for example this: mov.l @(4,r4),r1 diff --git a/gcc/cp/logic.cc b/gcc/cp/logic.cc index e4967bbfa29..c12c381d85c 100644 --- a/gcc/cp/logic.cc +++ b/gcc/cp/logic.cc @@ -19,6 +19,7 @@ along with GCC; see the file COPYING3. If not see . */ #include "config.h" +#define INCLUDE_LIST #include "system.h" #include "coretypes.h" #include "tm.h" @@ -45,8 +46,6 @@ along with GCC; see the file COPYING3. If not see #include "toplev.h" #include "type-utils.h" -#include - namespace { // Helper algorithms diff --git a/gcc/fortran/trans-common.c b/gcc/fortran/trans-common.c index 44787aebfde..4fdccc90747 100644 --- a/gcc/fortran/trans-common.c +++ b/gcc/fortran/trans-common.c @@ -93,6 +93,7 @@ along with GCC; see the file COPYING3. If not see block for each merged equivalence list. */ #include "config.h" +#define INCLUDE_MAP #include "system.h" #include "coretypes.h" #include "tm.h" @@ -100,9 +101,6 @@ along with GCC; see the file COPYING3. If not see #include "gfortran.h" #include "trans.h" #include "stringpool.h" - -#include - #include "fold-const.h" #include "stor-layout.h" #include "varasm.h" diff --git a/gcc/graphite-isl-ast-to-gimple.c b/gcc/graphite-isl-ast-to-gimple.c index 88609c08de9..049a4c5ed3f 100644 --- a/gcc/graphite-isl-ast-to-gimple.c +++ b/gcc/graphite-isl-ast-to-gimple.c @@ -24,6 +24,7 @@ along with GCC; see the file COPYING3. If not see #ifdef HAVE_isl +#define INCLUDE_MAP #include "system.h" #include "coretypes.h" #include "backend.h" @@ -54,7 +55,6 @@ along with GCC; see the file COPYING3. If not see #include "cfganal.h" #include "value-prof.h" #include "graphite.h" -#include /* We always try to use signed 128 bit types, but fall back to smaller types in case a platform does not provide types of these sizes. In the future we diff --git a/gcc/ipa-icf.c b/gcc/ipa-icf.c index aa6589c16e1..dda5cacc993 100644 --- a/gcc/ipa-icf.c +++ b/gcc/ipa-icf.c @@ -52,6 +52,7 @@ along with GCC; see the file COPYING3. If not see */ #include "config.h" +#define INCLUDE_LIST #include "system.h" #include "coretypes.h" #include "backend.h" @@ -66,7 +67,6 @@ along with GCC; see the file COPYING3. If not see #include "coverage.h" #include "gimple-pretty-print.h" #include "data-streamer.h" -#include #include "fold-const.h" #include "calls.h" #include "varasm.h" diff --git a/gcc/system.h b/gcc/system.h index cb545410a15..984f302fbc9 100644 --- a/gcc/system.h +++ b/gcc/system.h @@ -220,6 +220,18 @@ extern int errno; #if defined (INCLUDE_ALGORITHM) || !defined (HAVE_SWAP_IN_UTILITY) # include #endif +#ifdef INCLUDE_LIST +# include +#endif +#ifdef INCLUDE_MAP +# include +#endif +#ifdef INCLUDE_SET +# include +#endif +#ifdef INCLUDE_VECTOR +# include +#endif # include # include # include -- 2.30.2