mark some functions as (possibly) unused
authorSven Verdoolaege <skimo@kotnet.org>
Wed, 25 May 2011 11:43:37 +0000 (13:43 +0200)
committerSven Verdoolaege <skimo@kotnet.org>
Wed, 25 May 2011 12:09:01 +0000 (14:09 +0200)
Signed-off-by: Sven Verdoolaege <skimo@kotnet.org>
configure.ac
isl_config_post.h [new file with mode: 0644]
isl_fold.c
isl_polynomial.c
isl_tab.c
isl_tab_pip.c
isl_union_templ.c
m4/ax_c___attribute__.m4 [new file with mode: 0644]

index d648968..2b6c557 100644 (file)
@@ -10,6 +10,7 @@ AC_PROG_CC
 
 AX_CC_MAXOPT
 AX_GCC_WARN_UNUSED_RESULT
+AX_C___ATTRIBUTE__
 
 AC_PROG_LIBTOOL
 
@@ -90,6 +91,7 @@ AX_CREATE_PKGCONFIG_INFO
 AX_DETECT_GIT_HEAD
 echo '#define GIT_HEAD_ID "'$GIT_HEAD_ID'"' > gitversion.h
 
+AH_BOTTOM([#include <isl_config_post.h>])
 AC_CONFIG_HEADERS(isl_config.h)
 AC_CONFIG_HEADERS(include/isl/config.h)
 AC_CONFIG_FILES(Makefile)
diff --git a/isl_config_post.h b/isl_config_post.h
new file mode 100644 (file)
index 0000000..86a094d
--- /dev/null
@@ -0,0 +1,3 @@
+#ifndef HAVE___ATTRIBUTE__
+#define __attribute__(x)
+#endif
index 308f1b3..45fd3a7 100644 (file)
@@ -16,6 +16,7 @@
 #include <isl/lp.h>
 #include <isl/seq.h>
 #include <isl_mat_private.h>
+#include <isl_config.h>
 
 enum isl_fold isl_fold_type_negate(enum isl_fold type)
 {
index 2092d8b..52dd7ae 100644 (file)
@@ -23,6 +23,7 @@
 #include <isl_range.h>
 #include <isl_local_space_private.h>
 #include <isl_aff_private.h>
+#include <isl_config.h>
 
 static unsigned pos(__isl_keep isl_dim *dim, enum isl_dim_type type)
 {
index 227f054..5151ab6 100644 (file)
--- a/isl_tab.c
+++ b/isl_tab.c
@@ -12,6 +12,7 @@
 #include "isl_map_private.h"
 #include "isl_tab.h"
 #include <isl/seq.h>
+#include <isl_config.h>
 
 /*
  * The implementation of tableaus in this file was inspired by Section 8
@@ -1187,6 +1188,11 @@ static int to_row(struct isl_tab *tab, struct isl_tab_var *var, int sign)
        return isl_tab_pivot(tab, r, var->index);
 }
 
+/* Check whether all variables that are marked as non-negative
+ * also have a non-negative sample value.  This function is not
+ * called from the current code but is useful during debugging.
+ */
+static void check_table(struct isl_tab *tab) __attribute__ ((unused));
 static void check_table(struct isl_tab *tab)
 {
        int i;
index 00efda4..5bf39ef 100644 (file)
@@ -16,6 +16,7 @@
 #include "isl_tab.h"
 #include "isl_sample.h"
 #include <isl_mat_private.h>
+#include <isl_config.h>
 
 /*
  * The implementation of parametric integer linear programming in this file
@@ -1116,6 +1117,7 @@ static int first_neg(struct isl_tab *tab)
  * is satisfied.  This function is not called from the current code
  * but is useful during debugging.
  */
+static void check_lexpos(struct isl_tab *tab) __attribute__ ((unused));
 static void check_lexpos(struct isl_tab *tab)
 {
        unsigned off = 2 + tab->M;
index e92e207..c06069d 100644 (file)
@@ -362,6 +362,12 @@ S(UNION,match_bin_data) {
        UNION *res;
 };
 
+/* This function is currently only used from isl_polynomial.c
+ * and not from isl_fold.c.
+ */
+static __isl_give UNION *match_bin_op(__isl_take UNION *u1,
+       __isl_take UNION *u2,
+       int (*fn)(void **, void *)) __attribute__ ((unused));
 static __isl_give UNION *match_bin_op(__isl_take UNION *u1,
        __isl_take UNION *u2, int (*fn)(void **, void *))
 {
diff --git a/m4/ax_c___attribute__.m4 b/m4/ax_c___attribute__.m4
new file mode 100644 (file)
index 0000000..cf3d62b
--- /dev/null
@@ -0,0 +1,66 @@
+# ===========================================================================
+#    http://www.gnu.org/software/autoconf-archive/ax_c___attribute__.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+#   AX_C___ATTRIBUTE__
+#
+# DESCRIPTION
+#
+#   Provides a test for the compiler support of __attribute__ extensions.
+#   Defines HAVE___ATTRIBUTE__ if it is found.
+#
+# LICENSE
+#
+#   Copyright (c) 2008 Stepan Kasal <skasal@redhat.com>
+#   Copyright (c) 2008 Christian Haggstrom
+#   Copyright (c) 2008 Ryan McCabe <ryan@numb.org>
+#
+#   This program is free software; you can redistribute it and/or modify it
+#   under the terms of the GNU General Public License as published by the
+#   Free Software Foundation; either version 2 of the License, or (at your
+#   option) any later version.
+#
+#   This program is distributed in the hope that it will be useful, but
+#   WITHOUT ANY WARRANTY; without even the implied warranty of
+#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
+#   Public License for more details.
+#
+#   You should have received a copy of the GNU General Public License along
+#   with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+#   As a special exception, the respective Autoconf Macro's copyright owner
+#   gives unlimited permission to copy, distribute and modify the configure
+#   scripts that are the output of Autoconf when processing the Macro. You
+#   need not follow the terms of the GNU General Public License when using
+#   or distributing such scripts, even though portions of the text of the
+#   Macro appear in them. The GNU General Public License (GPL) does govern
+#   all other use of the material that constitutes the Autoconf Macro.
+#
+#   This special exception to the GPL applies to versions of the Autoconf
+#   Macro released by the Autoconf Archive. When you make and distribute a
+#   modified version of the Autoconf Macro, you may extend this special
+#   exception to the GPL to apply to your modified version as well.
+
+#serial 8
+
+AC_DEFUN([AX_C___ATTRIBUTE__], [
+  AC_CACHE_CHECK([for __attribute__], [ax_cv___attribute__],
+    [AC_COMPILE_IFELSE(
+      [AC_LANG_PROGRAM(
+       [[#include <stdlib.h>
+         static void foo(void) __attribute__ ((unused));
+         static void
+         foo(void) {
+             exit(1);
+         }
+        ]], [])],
+      [ax_cv___attribute__=yes],
+      [ax_cv___attribute__=no]
+    )
+  ])
+  if test "$ax_cv___attribute__" = "yes"; then
+    AC_DEFINE([HAVE___ATTRIBUTE__], 1, [define if your compiler has __attribute__])
+  fi
+])