Skip to content
This repository was archived by the owner on Apr 28, 2023. It is now read-only.

Commit b8eb8cc

Browse files
author
Sven Verdoolaege
committed
is_identifier_or_nonnegative_integer: use isl_ast_expr as subclasses
This was missing from 3f12a71 (Bump isl for exporting isl_ast_expr as subclasses, Fri Mar 30 11:12:58 2018 +0200).
1 parent 41279c8 commit b8eb8cc

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

tc/core/polyhedral/cuda/codegen.cc

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -528,11 +528,10 @@ isl::multi_aff makeMultiAffAccess(
528528

529529
namespace {
530530
bool is_identifier_or_nonnegative_integer(isl::ast_expr expr) {
531-
if (isl_ast_expr_get_type(expr.get()) == isl_ast_expr_id)
532-
return true;
533-
if (isl_ast_expr_get_type(expr.get()) != isl_ast_expr_int)
534-
return false;
535-
return isl::manage(isl_ast_expr_get_val(expr.get())).is_nonneg();
531+
if (auto intExpr = expr.as<isl::ast_expr_int>()) {
532+
return intExpr.get_val().is_nonneg();
533+
}
534+
return !expr.as<isl::ast_expr_id>().is_null();
536535
}
537536
} // namespace
538537

0 commit comments

Comments
 (0)