polyhedron_detect_equalities.c
nodist_pkginclude_HEADERS = \
- include/isl_libs.h \
+ include/isl_config.h \
include/isl_stdint.h
pkginclude_HEADERS = \
include/isl_blk.h \
static void delete_lp(struct tab_lp *lp);
static int add_lp_row(struct tab_lp *lp, isl_int *row, int dim);
static void get_alpha(struct tab_lp* lp, int row, mpq_t *alpha);
-static int del_lp_row(struct tab_lp *lp);
+static int del_lp_row(struct tab_lp *lp) WARN_UNUSED;
static int cut_lp_to_hyperplane(struct tab_lp *lp, isl_int *row);
#define GBR_LP struct tab_lp
AC_PROG_CC
AX_CC_MAXOPT
+AX_GCC_WARN_UNUSED_RESULT
AC_PROG_LIBTOOL
AX_CREATE_PKGCONFIG_INFO
AC_CONFIG_HEADERS(config.h)
-AC_CONFIG_HEADERS(include/isl_libs.h)
+AC_CONFIG_HEADERS(include/isl_config.h)
AC_CONFIG_FILES(Makefile)
AC_CONFIG_FILES(doc/Makefile)
if test $with_piplib = bundled; then
+#undef GCC_WARN_UNUSED_RESULT
+
#undef ISL_POLYLIB
#undef ISL_PIPLIB
#include <isl_int.h>
#include <isl_blk.h>
#include <isl_hash.h>
-#include <isl_libs.h>
+#include <isl_config.h>
#define __isl_give
#define __isl_take
#define __isl_keep
+#ifdef GCC_WARN_UNUSED_RESULT
+#define WARN_UNUSED GCC_WARN_UNUSED_RESULT
+#else
+#define WARN_UNUSED
+#endif
+
#if defined(__cplusplus)
extern "C" {
#endif
}
static int push_union(struct isl_tab *tab,
+ enum isl_tab_undo_type type, union isl_tab_undo_val u) WARN_UNUSED;
+static int push_union(struct isl_tab *tab,
enum isl_tab_undo_type type, union isl_tab_undo_val u)
{
struct isl_tab_undo *undo;
* If sgn = 0, then the variable is unbounded in both directions,
* and we pivot with any row we can find.
*/
+static int to_row(struct isl_tab *tab, struct isl_tab_var *var, int sign) WARN_UNUSED;
static int to_row(struct isl_tab *tab, struct isl_tab_var *var, int sign)
{
int r;
* then also be written as the negative sum of non-negative variables
* and must therefore also be zero.
*/
+static int close_row(struct isl_tab *tab, struct isl_tab_var *var) WARN_UNUSED;
static int close_row(struct isl_tab *tab, struct isl_tab_var *var)
{
int j;
/* Pivot a non-negative variable down until it reaches the value zero
* and then pivot the variable into a column position.
*/
+static int to_col(struct isl_tab *tab, struct isl_tab_var *var) WARN_UNUSED;
static int to_col(struct isl_tab *tab, struct isl_tab_var *var)
{
int i;
/* Undo the operation performed by isl_tab_relax.
*/
+static int unrelax(struct isl_tab *tab, struct isl_tab_var *var) WARN_UNUSED;
static int unrelax(struct isl_tab *tab, struct isl_tab_var *var)
{
unsigned off = 2 + tab->M;
return 0;
}
+static int perform_undo_var(struct isl_tab *tab, struct isl_tab_undo *undo) WARN_UNUSED;
static int perform_undo_var(struct isl_tab *tab, struct isl_tab_undo *undo)
{
struct isl_tab_var *var = var_from_index(tab, undo->u.var_index);
}
}
+static int perform_undo(struct isl_tab *tab, struct isl_tab_undo *undo) WARN_UNUSED;
static int perform_undo(struct isl_tab *tab, struct isl_tab_undo *undo)
{
switch (undo->type) {
struct isl_tab *tab);
struct isl_basic_set *isl_basic_set_update_from_tab(struct isl_basic_set *bset,
struct isl_tab *tab);
-struct isl_tab *isl_tab_detect_implicit_equalities(struct isl_tab *tab);
-struct isl_tab *isl_tab_detect_redundant(struct isl_tab *tab);
+struct isl_tab *isl_tab_detect_implicit_equalities(struct isl_tab *tab) WARN_UNUSED;
+struct isl_tab *isl_tab_detect_redundant(struct isl_tab *tab) WARN_UNUSED;
#define ISL_TAB_SAVE_DUAL (1 << 0)
enum isl_lp_result isl_tab_min(struct isl_tab *tab,
isl_int *f, isl_int denom, isl_int *opt, isl_int *opt_denom,
- unsigned flags);
+ unsigned flags) WARN_UNUSED;
-struct isl_tab *isl_tab_extend(struct isl_tab *tab, unsigned n_new);
-struct isl_tab *isl_tab_add_ineq(struct isl_tab *tab, isl_int *ineq);
-struct isl_tab *isl_tab_add_eq(struct isl_tab *tab, isl_int *eq);
-struct isl_tab *isl_tab_add_valid_eq(struct isl_tab *tab, isl_int *eq);
+struct isl_tab *isl_tab_extend(struct isl_tab *tab, unsigned n_new) WARN_UNUSED;
+struct isl_tab *isl_tab_add_ineq(struct isl_tab *tab, isl_int *ineq) WARN_UNUSED;
+struct isl_tab *isl_tab_add_eq(struct isl_tab *tab, isl_int *eq) WARN_UNUSED;
+struct isl_tab *isl_tab_add_valid_eq(struct isl_tab *tab, isl_int *eq) WARN_UNUSED;
int isl_tab_is_equality(struct isl_tab *tab, int con);
int isl_tab_is_redundant(struct isl_tab *tab, int con);
enum isl_ineq_type isl_tab_ineq_type(struct isl_tab *tab, isl_int *ineq);
struct isl_tab_undo *isl_tab_snap(struct isl_tab *tab);
-int isl_tab_rollback(struct isl_tab *tab, struct isl_tab_undo *snap);
+int isl_tab_rollback(struct isl_tab *tab, struct isl_tab_undo *snap) WARN_UNUSED;
-struct isl_tab *isl_tab_relax(struct isl_tab *tab, int con);
-struct isl_tab *isl_tab_select_facet(struct isl_tab *tab, int con);
+struct isl_tab *isl_tab_relax(struct isl_tab *tab, int con) WARN_UNUSED;
+struct isl_tab *isl_tab_select_facet(struct isl_tab *tab, int con) WARN_UNUSED;
void isl_tab_dump(struct isl_tab *tab, FILE *out, int indent);
/* private */
struct isl_tab_var *isl_tab_var_from_row(struct isl_tab *tab, int i);
-int isl_tab_mark_redundant(struct isl_tab *tab, int row);
+int isl_tab_mark_redundant(struct isl_tab *tab, int row) WARN_UNUSED;
struct isl_tab *isl_tab_mark_empty(struct isl_tab *tab);
struct isl_tab *isl_tab_dup(struct isl_tab *tab);
struct isl_tab *isl_tab_product(struct isl_tab *tab1, struct isl_tab *tab2);
-int isl_tab_extend_cons(struct isl_tab *tab, unsigned n_new);
-int isl_tab_allocate_con(struct isl_tab *tab);
-int isl_tab_extend_vars(struct isl_tab *tab, unsigned n_new);
-int isl_tab_allocate_var(struct isl_tab *tab);
-int isl_tab_pivot(struct isl_tab *tab, int row, int col);
-int isl_tab_add_row(struct isl_tab *tab, isl_int *line);
+int isl_tab_extend_cons(struct isl_tab *tab, unsigned n_new) WARN_UNUSED;
+int isl_tab_allocate_con(struct isl_tab *tab) WARN_UNUSED;
+int isl_tab_extend_vars(struct isl_tab *tab, unsigned n_new) WARN_UNUSED;
+int isl_tab_allocate_var(struct isl_tab *tab) WARN_UNUSED;
+int isl_tab_pivot(struct isl_tab *tab, int row, int col) WARN_UNUSED;
+int isl_tab_add_row(struct isl_tab *tab, isl_int *line) WARN_UNUSED;
int isl_tab_row_is_redundant(struct isl_tab *tab, int row);
int isl_tab_min_at_most_neg_one(struct isl_tab *tab, struct isl_tab_var *var);
-int isl_tab_kill_col(struct isl_tab *tab, int col);
+int isl_tab_kill_col(struct isl_tab *tab, int col) WARN_UNUSED;
-int isl_tab_push(struct isl_tab *tab, enum isl_tab_undo_type type);
+int isl_tab_push(struct isl_tab *tab, enum isl_tab_undo_type type) WARN_UNUSED;
int isl_tab_push_var(struct isl_tab *tab,
- enum isl_tab_undo_type type, struct isl_tab_var *var);
-int isl_tab_push_basis(struct isl_tab *tab);
+ enum isl_tab_undo_type type, struct isl_tab_var *var) WARN_UNUSED;
+int isl_tab_push_basis(struct isl_tab *tab) WARN_UNUSED;
-struct isl_tab *isl_tab_init_samples(struct isl_tab *tab);
+struct isl_tab *isl_tab_init_samples(struct isl_tab *tab) WARN_UNUSED;
struct isl_tab *isl_tab_add_sample(struct isl_tab *tab,
- __isl_take isl_vec *sample);
+ __isl_take isl_vec *sample) WARN_UNUSED;
struct isl_tab *isl_tab_drop_sample(struct isl_tab *tab, int s);
-int isl_tab_save_samples(struct isl_tab *tab);
+int isl_tab_save_samples(struct isl_tab *tab) WARN_UNUSED;
struct isl_tab *isl_tab_detect_equalities(struct isl_tab *tab,
- struct isl_tab *tab_cone);
+ struct isl_tab *tab_cone) WARN_UNUSED;
#endif
* smallest increment in the sample point. If there is no such column
* then the tableau is infeasible.
*/
-static struct isl_tab *restore_lexmin(struct isl_tab *tab);
+static struct isl_tab *restore_lexmin(struct isl_tab *tab) WARN_UNUSED;
static struct isl_tab *restore_lexmin(struct isl_tab *tab)
{
int row, col;
* In the end we try to use one of the two constraints to eliminate
* a column.
*/
+static struct isl_tab *add_lexmin_eq(struct isl_tab *tab, isl_int *eq) WARN_UNUSED;
static struct isl_tab *add_lexmin_eq(struct isl_tab *tab, isl_int *eq)
{
int r1, r2;
--- /dev/null
+# ===========================================================================
+# http://www.nongnu.org/autoconf-archive/ax_gcc_warn_unused_result.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AX_GCC_WARN_UNUSED_RESULT
+#
+# DESCRIPTION
+#
+# The macro will compile a test program to see whether the compiler does
+# understand the per-function postfix pragma.
+#
+# LICENSE
+#
+# Copyright (c) 2008 Guido U. Draheim <guidod@gmx.de>
+#
+# 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.
+
+AC_DEFUN([AX_GCC_WARN_UNUSED_RESULT],[dnl
+AC_CACHE_CHECK(
+ [whether the compiler supports function __attribute__((__warn_unused_result__))],
+ ax_cv_gcc_warn_unused_result,[
+ AC_TRY_COMPILE([__attribute__((__warn_unused_result__))
+ int f(int i) { return i; }],
+ [],
+ ax_cv_gcc_warn_unused_result=yes, ax_cv_gcc_warn_unused_result=no)])
+ if test "$ax_cv_gcc_warn_unused_result" = yes; then
+ AC_DEFINE([GCC_WARN_UNUSED_RESULT],[__attribute__((__warn_unused_result__))],
+ [most gcc compilers know a function __attribute__((__warn_unused_result__))])
+ fi
+])