From 426526884032ec2621361a90ff28810bd01e4bbf Mon Sep 17 00:00:00 2001 From: Sven Verdoolaege Date: Fri, 24 Jun 2011 12:18:15 +0200 Subject: [PATCH] add isl_aff_add_constant_si Signed-off-by: Sven Verdoolaege --- doc/user.pod | 2 ++ include/isl/aff.h | 1 + isl_aff.c | 12 ++++++++++++ 3 files changed, 15 insertions(+) diff --git a/doc/user.pod b/doc/user.pod index 0ceb503..d80e920 100644 --- a/doc/user.pod +++ b/doc/user.pod @@ -2225,6 +2225,8 @@ It can be modified using __isl_give isl_aff *isl_aff_add_constant( __isl_take isl_aff *aff, isl_int v); + __isl_give isl_aff *isl_aff_add_constant_si( + __isl_take isl_aff *aff, int v); __isl_give isl_aff *isl_aff_add_coefficient_si( __isl_take isl_aff *aff, enum isl_dim_type type, int pos, int v); diff --git a/include/isl/aff.h b/include/isl/aff.h index b01ff29..75f7421 100644 --- a/include/isl/aff.h +++ b/include/isl/aff.h @@ -38,6 +38,7 @@ __isl_give isl_aff *isl_aff_set_coefficient_si(__isl_take isl_aff *aff, enum isl_dim_type type, int pos, int v); __isl_give isl_aff *isl_aff_set_denominator(__isl_take isl_aff *aff, isl_int v); __isl_give isl_aff *isl_aff_add_constant(__isl_take isl_aff *aff, isl_int v); +__isl_give isl_aff *isl_aff_add_constant_si(__isl_take isl_aff *aff, int v); __isl_give isl_aff *isl_aff_add_coefficient_si(__isl_take isl_aff *aff, enum isl_dim_type type, int pos, int v); diff --git a/isl_aff.c b/isl_aff.c index 75b1c20..0b18668 100644 --- a/isl_aff.c +++ b/isl_aff.c @@ -223,6 +223,18 @@ __isl_give isl_aff *isl_aff_add_constant(__isl_take isl_aff *aff, isl_int v) return aff; } +__isl_give isl_aff *isl_aff_add_constant_si(__isl_take isl_aff *aff, int v) +{ + isl_int t; + + isl_int_init(t); + isl_int_set_si(t, v); + aff = isl_aff_add_constant(aff, t); + isl_int_clear(t); + + return aff; +} + __isl_give isl_aff *isl_aff_set_constant_si(__isl_take isl_aff *aff, int v) { aff = isl_aff_cow(aff); -- 2.7.4