+/* Print the affine expression "aff" in C format to "p".
+ * The dimension names are taken from "space"
+ * "set" represents the domain of the affine expression.
+ */
+static __isl_give isl_printer *print_aff_on_domain_c(__isl_take isl_printer *p,
+ __isl_keep isl_space *space, __isl_keep isl_aff *aff,
+ __isl_keep isl_set *set)
+{
+ isl_set *u;
+ isl_ast_build *build;
+ isl_ast_expr *expr;
+
+ u = isl_set_universe(isl_space_copy(space));
+ build = isl_ast_build_from_context(u);
+ build = isl_ast_build_restrict(build, isl_set_copy(set));
+ expr = isl_ast_expr_from_aff(isl_aff_copy(aff), build);
+ p = isl_printer_print_ast_expr(p, expr);
+ isl_ast_expr_free(expr);
+ isl_ast_build_free(build);
+
+ return p;
+}
+