From e558fd8de4e20482a320448e65ee5003d30c908c Mon Sep 17 00:00:00 2001 From: Sven Verdoolaege Date: Thu, 15 Feb 2018 12:05:54 +0100 Subject: [PATCH] isl_aff_get_domain_space: extract out isl_aff_peek_domain_space This function will be used in places where the domain space is only needed temporarily, without exposing too much of the internal representation. Signed-off-by: Sven Verdoolaege --- isl_aff.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/isl_aff.c b/isl_aff.c index b0a2aa36..8970ccbf 100644 --- a/isl_aff.c +++ b/isl_aff.c @@ -346,9 +346,16 @@ int isl_aff_find_dim_by_name(__isl_keep isl_aff *aff, enum isl_dim_type type, return isl_local_space_find_dim_by_name(aff->ls, type, name); } +/* Return the domain space of "aff". + */ +static __isl_keep isl_space *isl_aff_peek_domain_space(__isl_keep isl_aff *aff) +{ + return aff ? isl_local_space_peek_space(aff->ls) : NULL; +} + __isl_give isl_space *isl_aff_get_domain_space(__isl_keep isl_aff *aff) { - return aff ? isl_local_space_get_space(aff->ls) : NULL; + return isl_space_copy(isl_aff_peek_domain_space(aff)); } __isl_give isl_space *isl_aff_get_space(__isl_keep isl_aff *aff) -- 2.11.4.GIT