summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordje <dje@138bc75d-0d04-0410-961f-82ee72b054a4>2015-11-23 14:23:59 +0000
committerdje <dje@138bc75d-0d04-0410-961f-82ee72b054a4>2015-11-23 14:23:59 +0000
commitd8a2c81e6df0a7e4bef324eea5b40ba39fe1e42f (patch)
tree8b552b61a1b1ac6b4ce298f12409fda5177e3c16
parentf865b5d0c963010b0f8d83bf339c77bacc30f7fc (diff)
downloadgcc-d8a2c81e6df0a7e4bef324eea5b40ba39fe1e42f.tar.gz
Correct graphite*.c ISL header file inclusion order.
* system.h: Don't poison calloc and strdup if USES_ISL is defined. * graphite-dependences.c: Define USES_ISL. Include ISL header files after GCC header files and before graphite header files. * graphite-dependences.c: Same. * graphite-isl-ast-to-gimple.c: Same. * graphite-optimize-isl.c: Same. * graphite-poly.c: Same. * graphite-scop-detection.c: Same. * graphite-sese-to-poly.c: Same. * graphite.c: Same. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@230759 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/graphite-dependences.c19
-rw-r--r--gcc/graphite-isl-ast-to-gimple.c41
-rw-r--r--gcc/graphite-optimize-isl.c31
-rw-r--r--gcc/graphite-poly.c31
-rw-r--r--gcc/graphite-scop-detection.c19
-rw-r--r--gcc/graphite-sese-to-poly.c41
-rw-r--r--gcc/graphite.c23
-rw-r--r--gcc/system.h3
8 files changed, 107 insertions, 101 deletions
diff --git a/gcc/graphite-dependences.c b/gcc/graphite-dependences.c
index aef29acfb3a..3f4e5ea8fe6 100644
--- a/gcc/graphite-dependences.c
+++ b/gcc/graphite-dependences.c
@@ -19,18 +19,11 @@ You should have received a copy of the GNU General Public License
along with GCC; see the file COPYING3. If not see
<http://www.gnu.org/licenses/>. */
+#define USES_ISL
+
#include "config.h"
#ifdef HAVE_isl
-/* Workaround for GMP 5.1.3 bug, see PR56019. */
-#include <stddef.h>
-
-#include <isl/constraint.h>
-#include <isl/set.h>
-#include <isl/map.h>
-#include <isl/union_map.h>
-#include <isl/flow.h>
-#include <isl/constraint.h>
#include "system.h"
#include "coretypes.h"
@@ -44,6 +37,14 @@ along with GCC; see the file COPYING3. If not see
#include "tree-pass.h"
#include "cfgloop.h"
#include "tree-data-ref.h"
+
+#include <isl/constraint.h>
+#include <isl/set.h>
+#include <isl/map.h>
+#include <isl/union_map.h>
+#include <isl/flow.h>
+#include <isl/constraint.h>
+
#include "graphite-poly.h"
diff --git a/gcc/graphite-isl-ast-to-gimple.c b/gcc/graphite-isl-ast-to-gimple.c
index 557c44cf10b..b13aa128a1e 100644
--- a/gcc/graphite-isl-ast-to-gimple.c
+++ b/gcc/graphite-isl-ast-to-gimple.c
@@ -18,27 +18,11 @@ You should have received a copy of the GNU General Public License
along with GCC; see the file COPYING3. If not see
<http://www.gnu.org/licenses/>. */
+#define USES_ISL
+
#include "config.h"
#ifdef HAVE_isl
-/* Workaround for GMP 5.1.3 bug, see PR56019. */
-#include <stddef.h>
-
-#include <isl/constraint.h>
-#include <isl/set.h>
-#include <isl/union_set.h>
-#include <isl/map.h>
-#include <isl/union_map.h>
-#include <isl/ast_build.h>
-
-/* Since ISL-0.13, the extern is in val_gmp.h. */
-#if !defined(HAVE_ISL_SCHED_CONSTRAINTS_COMPUTE_SCHEDULE) && defined(__cplusplus)
-extern "C" {
-#endif
-#include <isl/val_gmp.h>
-#if !defined(HAVE_ISL_SCHED_CONSTRAINTS_COMPUTE_SCHEDULE) && defined(__cplusplus)
-}
-#endif
#include "system.h"
#include "coretypes.h"
@@ -59,19 +43,36 @@ extern "C" {
#include "tree-pass.h"
#include "cfgloop.h"
#include "tree-data-ref.h"
-#include "graphite-poly.h"
#include "tree-ssa-loop-manip.h"
#include "tree-scalar-evolution.h"
#include "gimple-ssa.h"
#include "tree-phinodes.h"
#include "tree-into-ssa.h"
#include "ssa-iterators.h"
-#include "graphite-isl-ast-to-gimple.h"
#include "tree-cfg.h"
#include "gimple-pretty-print.h"
#include "cfganal.h"
#include "value-prof.h"
+#include <isl/constraint.h>
+#include <isl/set.h>
+#include <isl/union_set.h>
+#include <isl/map.h>
+#include <isl/union_map.h>
+#include <isl/ast_build.h>
+
+/* Since ISL-0.13, the extern is in val_gmp.h. */
+#if !defined(HAVE_ISL_SCHED_CONSTRAINTS_COMPUTE_SCHEDULE) && defined(__cplusplus)
+extern "C" {
+#endif
+#include <isl/val_gmp.h>
+#if !defined(HAVE_ISL_SCHED_CONSTRAINTS_COMPUTE_SCHEDULE) && defined(__cplusplus)
+}
+#endif
+
+#include "graphite-poly.h"
+#include "graphite-isl-ast-to-gimple.h"
+
#include <map>
/* We always try to use signed 128 bit types, but fall back to smaller types
diff --git a/gcc/graphite-optimize-isl.c b/gcc/graphite-optimize-isl.c
index c09264bf093..6ae224fd53a 100644
--- a/gcc/graphite-optimize-isl.c
+++ b/gcc/graphite-optimize-isl.c
@@ -18,11 +18,25 @@ You should have received a copy of the GNU General Public License
along with GCC; see the file COPYING3. If not see
<http://www.gnu.org/licenses/>. */
+#define USES_ISL
+
#include "config.h"
#ifdef HAVE_isl
-/* Workaround for GMP 5.1.3 bug, see PR56019. */
-#include <stddef.h>
+
+#include "system.h"
+#include "coretypes.h"
+#include "backend.h"
+#include "cfghooks.h"
+#include "tree.h"
+#include "gimple.h"
+#include "fold-const.h"
+#include "gimple-iterator.h"
+#include "tree-ssa-loop.h"
+#include "cfgloop.h"
+#include "tree-data-ref.h"
+#include "params.h"
+#include "dumpfile.h"
#include <isl/constraint.h>
#include <isl/set.h>
@@ -38,20 +52,7 @@ along with GCC; see the file COPYING3. If not see
#include <isl/schedule_node.h>
#endif
-#include "system.h"
-#include "coretypes.h"
-#include "backend.h"
-#include "cfghooks.h"
-#include "tree.h"
-#include "gimple.h"
-#include "fold-const.h"
-#include "gimple-iterator.h"
-#include "tree-ssa-loop.h"
-#include "cfgloop.h"
-#include "tree-data-ref.h"
#include "graphite-poly.h"
-#include "params.h"
-#include "dumpfile.h"
#ifdef HAVE_ISL_OPTIONS_SET_SCHEDULE_SERIALIZE_SCCS
diff --git a/gcc/graphite-poly.c b/gcc/graphite-poly.c
index 809670ab330..9137cc43b34 100644
--- a/gcc/graphite-poly.c
+++ b/gcc/graphite-poly.c
@@ -19,11 +19,25 @@ You should have received a copy of the GNU General Public License
along with GCC; see the file COPYING3. If not see
<http://www.gnu.org/licenses/>. */
+#define USES_ISL
+
#include "config.h"
#ifdef HAVE_isl
-/* Workaround for GMP 5.1.3 bug, see PR56019. */
-#include <stddef.h>
+
+#include "system.h"
+#include "coretypes.h"
+#include "backend.h"
+#include "tree.h"
+#include "gimple.h"
+#include "cfghooks.h"
+#include "gimple-pretty-print.h"
+#include "diagnostic-core.h"
+#include "fold-const.h"
+#include "gimple-iterator.h"
+#include "tree-ssa-loop.h"
+#include "cfgloop.h"
+#include "tree-data-ref.h"
#include <isl/constraint.h>
#include <isl/set.h>
@@ -43,19 +57,6 @@ extern "C" {
}
#endif
-#include "system.h"
-#include "coretypes.h"
-#include "backend.h"
-#include "tree.h"
-#include "gimple.h"
-#include "cfghooks.h"
-#include "gimple-pretty-print.h"
-#include "diagnostic-core.h"
-#include "fold-const.h"
-#include "gimple-iterator.h"
-#include "tree-ssa-loop.h"
-#include "cfgloop.h"
-#include "tree-data-ref.h"
#include "graphite-poly.h"
#define OPENSCOP_MAX_STRING 256
diff --git a/gcc/graphite-scop-detection.c b/gcc/graphite-scop-detection.c
index 84fe945e74a..60bb0499f08 100644
--- a/gcc/graphite-scop-detection.c
+++ b/gcc/graphite-scop-detection.c
@@ -19,16 +19,11 @@ You should have received a copy of the GNU General Public License
along with GCC; see the file COPYING3. If not see
<http://www.gnu.org/licenses/>. */
+#define USES_ISL
+
#include "config.h"
#ifdef HAVE_isl
-/* Workaround for GMP 5.1.3 bug, see PR56019. */
-#include <stddef.h>
-
-#include <isl/constraint.h>
-#include <isl/set.h>
-#include <isl/map.h>
-#include <isl/union_map.h>
#include "system.h"
#include "coretypes.h"
@@ -51,11 +46,17 @@ along with GCC; see the file COPYING3. If not see
#include "tree-data-ref.h"
#include "tree-scalar-evolution.h"
#include "tree-pass.h"
-#include "graphite-poly.h"
#include "tree-ssa-propagate.h"
-#include "graphite-scop-detection.h"
#include "gimple-pretty-print.h"
+#include <isl/constraint.h>
+#include <isl/set.h>
+#include <isl/map.h>
+#include <isl/union_map.h>
+
+#include "graphite-poly.h"
+#include "graphite-scop-detection.h"
+
class debug_printer
{
private:
diff --git a/gcc/graphite-sese-to-poly.c b/gcc/graphite-sese-to-poly.c
index 83acc4ac6ca..34aa4763c41 100644
--- a/gcc/graphite-sese-to-poly.c
+++ b/gcc/graphite-sese-to-poly.c
@@ -18,28 +18,11 @@ You should have received a copy of the GNU General Public License
along with GCC; see the file COPYING3. If not see
<http://www.gnu.org/licenses/>. */
+#define USES_ISL
+
#include "config.h"
#ifdef HAVE_isl
-/* Workaround for GMP 5.1.3 bug, see PR56019. */
-#include <stddef.h>
-
-#include <isl/constraint.h>
-#include <isl/set.h>
-#include <isl/map.h>
-#include <isl/union_map.h>
-#include <isl/constraint.h>
-#include <isl/aff.h>
-#include <isl/val.h>
-
-/* Since ISL-0.13, the extern is in val_gmp.h. */
-#if !defined(HAVE_ISL_SCHED_CONSTRAINTS_COMPUTE_SCHEDULE) && defined(__cplusplus)
-extern "C" {
-#endif
-#include <isl/val_gmp.h>
-#if !defined(HAVE_ISL_SCHED_CONSTRAINTS_COMPUTE_SCHEDULE) && defined(__cplusplus)
-}
-#endif
#include "system.h"
#include "coretypes.h"
@@ -63,8 +46,26 @@ extern "C" {
#include "tree-data-ref.h"
#include "tree-scalar-evolution.h"
#include "domwalk.h"
-#include "graphite-poly.h"
#include "tree-ssa-propagate.h"
+
+#include <isl/constraint.h>
+#include <isl/set.h>
+#include <isl/map.h>
+#include <isl/union_map.h>
+#include <isl/constraint.h>
+#include <isl/aff.h>
+#include <isl/val.h>
+
+/* Since ISL-0.13, the extern is in val_gmp.h. */
+#if !defined(HAVE_ISL_SCHED_CONSTRAINTS_COMPUTE_SCHEDULE) && defined(__cplusplus)
+extern "C" {
+#endif
+#include <isl/val_gmp.h>
+#if !defined(HAVE_ISL_SCHED_CONSTRAINTS_COMPUTE_SCHEDULE) && defined(__cplusplus)
+}
+#endif
+
+#include "graphite-poly.h"
#include "graphite-sese-to-poly.h"
/* Assigns to RES the value of the INTEGER_CST T. */
diff --git a/gcc/graphite.c b/gcc/graphite.c
index 5316bc4fa7d..c2efdc95925 100644
--- a/gcc/graphite.c
+++ b/gcc/graphite.c
@@ -27,19 +27,9 @@ along with GCC; see the file COPYING3. If not see
The wiki page http://gcc.gnu.org/wiki/Graphite contains pointers to
the related work. */
-#include "config.h"
-
-#ifdef HAVE_isl
-/* Workaround for GMP 5.1.3 bug, see PR56019. */
-#include <stddef.h>
-
-#include <isl/constraint.h>
-#include <isl/set.h>
-#include <isl/map.h>
-#include <isl/options.h>
-#include <isl/union_map.h>
-#endif
+#define USES_ISL
+#include "config.h"
#include "system.h"
#include "coretypes.h"
#include "backend.h"
@@ -59,10 +49,17 @@ along with GCC; see the file COPYING3. If not see
#include "tree-ssa-loop.h"
#include "tree-data-ref.h"
#include "tree-scalar-evolution.h"
-#include "graphite-poly.h"
#include "dbgcnt.h"
#include "tree-parloops.h"
#include "tree-cfgcleanup.h"
+
+#include <isl/constraint.h>
+#include <isl/set.h>
+#include <isl/map.h>
+#include <isl/options.h>
+#include <isl/union_map.h>
+
+#include "graphite-poly.h"
#include "graphite-scop-detection.h"
#include "graphite-isl-ast-to-gimple.h"
#include "graphite-sese-to-poly.h"
diff --git a/gcc/system.h b/gcc/system.h
index ed3de9f1c7f..498596f7fef 100644
--- a/gcc/system.h
+++ b/gcc/system.h
@@ -798,9 +798,12 @@ extern void fancy_abort (const char *, int, const char *) ATTRIBUTE_NORETURN;
compiling gcc, so that the autoconf declaration tests for malloc
etc don't spuriously fail. */
#ifdef IN_GCC
+
+#ifndef USES_ISL
#undef calloc
#undef strdup
#pragma GCC poison calloc strdup
+#endif
#if !defined(FLEX_SCANNER) && !defined(YYBISON)
#undef malloc