From 8ababb70fa8211e15d5269d241d94643c525e2e8 Mon Sep 17 00:00:00 2001 From: Sven Verdoolaege Date: Tue, 16 Oct 2018 10:47:03 +0200 Subject: [PATCH] add exported isl_multi_*_set_at as alternative name for isl_multi_*_set_* Do this for consistency with isl_multi_*_get_at. Signed-off-by: Sven Verdoolaege --- doc/user.pod | 19 +++++++++++++++++++ include/isl/multi.h | 4 ++++ isl_multi_templ.c | 12 +++++++++++- 3 files changed, 34 insertions(+), 1 deletion(-) diff --git a/doc/user.pod b/doc/user.pod index a34ad916..1e62a3a4 100644 --- a/doc/user.pod +++ b/doc/user.pod @@ -3110,27 +3110,46 @@ Similarly for the other pairs of functions. The base expression can be replaced using the following functions. #include + __isl_give isl_multi_id *isl_multi_id_set_at( + __isl_take isl_multi_id *mi, int pos, + __isl_take isl_id *id); __isl_give isl_multi_id *isl_multi_id_set_id( __isl_take isl_multi_id *mi, int pos, __isl_take isl_id *id); #include + __isl_give isl_multi_val *isl_multi_val_set_at( + __isl_take isl_multi_val *mv, int pos, + __isl_take isl_val *val); __isl_give isl_multi_val *isl_multi_val_set_val( __isl_take isl_multi_val *mv, int pos, __isl_take isl_val *val); #include + __isl_give isl_multi_aff *isl_multi_aff_set_at( + __isl_take isl_multi_aff *ma, int pos, + __isl_take isl_aff *aff); __isl_give isl_multi_aff *isl_multi_aff_set_aff( __isl_take isl_multi_aff *multi, int pos, __isl_take isl_aff *aff); + __isl_give isl_multi_pw_aff *isl_multi_pw_aff_set_at( + __isl_take isl_multi_pw_aff *mpa, int pos, + __isl_take isl_pw_aff *pa); __isl_give isl_multi_pw_aff *isl_multi_pw_aff_set_pw_aff( __isl_take isl_multi_pw_aff *mpa, int pos, __isl_take isl_pw_aff *pa); __isl_give isl_multi_union_pw_aff * + isl_multi_union_pw_aff_set_at( + __isl_take isl_multi_union_pw_aff *mupa, int pos, + __isl_take isl_union_pw_aff *upa); + __isl_give isl_multi_union_pw_aff * isl_multi_union_pw_aff_set_union_pw_aff( __isl_take isl_multi_union_pw_aff *mupa, int pos, __isl_take isl_union_pw_aff *upa); +C is an alternative name for C. +Similarly for the other pairs of functions. + As a convenience, a sequence of base expressions that have their domains in a given space can be extracted from a sequence of union expressions using the following function. diff --git a/include/isl/multi.h b/include/isl/multi.h index a61e65e5..5f262d3e 100644 --- a/include/isl/multi.h +++ b/include/isl/multi.h @@ -38,6 +38,10 @@ __isl_give isl_##BASE *isl_multi_##BASE##_get_at( \ __isl_keep isl_multi_##BASE *multi, int pos); \ __isl_give isl_##BASE *isl_multi_##BASE##_get_##BASE( \ __isl_keep isl_multi_##BASE *multi, int pos); \ +__isl_export \ +__isl_give isl_multi_##BASE *isl_multi_##BASE##_set_at( \ + __isl_take isl_multi_##BASE *multi, int pos, \ + __isl_take isl_##BASE *el); \ __isl_give isl_multi_##BASE *isl_multi_##BASE##_set_##BASE( \ __isl_take isl_multi_##BASE *multi, int pos, \ __isl_take isl_##BASE *el); \ diff --git a/isl_multi_templ.c b/isl_multi_templ.c index 0694ba45..13c9f861 100644 --- a/isl_multi_templ.c +++ b/isl_multi_templ.c @@ -215,7 +215,9 @@ static __isl_give MULTI(BASE) *FN(MULTI(BASE),restore_check_space)( return FN(MULTI(BASE),restore)(multi, pos, el); } -__isl_give MULTI(BASE) *FN(FN(MULTI(BASE),set),BASE)( +/* Replace the base expression at position "pos" in "multi" with "el". + */ +__isl_give MULTI(BASE) *FN(MULTI(BASE),set_at)( __isl_take MULTI(BASE) *multi, int pos, __isl_take EL *el) { isl_space *multi_space = NULL; @@ -248,6 +250,14 @@ error: return NULL; } +/* This is an alternative name for the function above. + */ +__isl_give MULTI(BASE) *FN(FN(MULTI(BASE),set),BASE)( + __isl_take MULTI(BASE) *multi, int pos, __isl_take EL *el) +{ + return FN(MULTI(BASE),set_at)(multi, pos, el); +} + /* Reset the space of "multi". This function is called from isl_pw_templ.c * and doesn't know if the space of an element object is represented * directly or through its domain. It therefore passes along both, -- 2.11.4.GIT