Polly is trying to move towards using isl::ast_expr/ isl-noexceptions.h (which implements RAII) where possible instead of manually managing memory. checkIslAstExprInt manually frees Expr, so it has been removed to be more idiomatic and consistent.
Details
Diff Detail
Event Timeline
Could you update the second parameter of checkIslAstExprInt as well? Yes, it's cheating in that it passes isl functions as callbacks which you will not be able to do anymore, but it also prohibits us to use proper use of RAII.
This time you actually need NFC to the title.
polly/lib/CodeGen/IslNodeBuilder.cpp | ||
---|---|---|
151–152 | Use Expr.isa<isl::ast_expr_int>() | |
151–154 | ||
153–154 | Expr.val() |
Would be better to make this a function inside the ast_expr class? I could also overload the == operator for either ist::val or ist::ast_expr or both (not sure if this is a good idea though).
polly/lib/CodeGen/IslNodeBuilder.cpp | ||
---|---|---|
187 | It looks like I should change this to be !Expr.isa<isl::ast_expr_int>() as well, right? If so, should I make a different review or do you want each patch to be tightly scoped and not contain a hodgepodge of changes? |
No. The ast_expr class is automatically generated and your changes will be lost when re-generating.
I could also overload the == operator for either ist::val or ist::ast_expr or both
While is possible to overload operator== independently of isl::ast_expr/isl::val, this would be something that the C++ wrapper would typically do. We have Polly-specific overloads for operator<<, but you would need to make a case that this would be useful elsewhere to make such a global change.
polly/lib/CodeGen/IslNodeBuilder.cpp | ||
---|---|---|
149–150 | Please update the comment. | |
152–154 | Its becoming simple enough that you could just inline the function. Using isl::val::is_zero/isl::val::is_one would be slightly more efficient. |
LGTM.
Could you update the summary to something that makes sense in a commit message? Yes, you understand correctly.
Would you like me to land this patch for you?
polly/lib/CodeGen/IslNodeBuilder.cpp | ||
---|---|---|
187 | I assume this was a comment to an earlier revision and you meant UB.isa<... as it is in the current iteration. Looks god as-is. |
Please update the comment.