Skip to content

Commit

Permalink
[ir] Add nodiscard to get_loop_guard/get_if_guard (#2377)
Browse files Browse the repository at this point in the history
* [ir] Add nodiscard to get_loop_guard/get_if_guard

* [skip ci] enforce code format

* code format...

* [skip ci] enforce code format

* Revert "enforce code format"

This reverts commit 21a932b

Co-authored-by: Taichi Gardener <taichigardener@gmail.com>
  • Loading branch information
xumingkuan and taichi-gardener committed May 29, 2021
1 parent 6f4c25c commit 51e510b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions taichi/ir/ir_builder.h
Expand Up @@ -90,10 +90,10 @@ class IRBuilder {
};

template <typename XStmt>
LoopGuard get_loop_guard(XStmt *loop) {
[[nodiscard]] LoopGuard get_loop_guard(XStmt *loop) {
return LoopGuard(*this, loop);
}
IfGuard get_if_guard(IfStmt *if_stmt, bool true_branch) {
[[nodiscard]] IfGuard get_if_guard(IfStmt *if_stmt, bool true_branch) {
return IfGuard(*this, if_stmt, true_branch);
}

Expand Down Expand Up @@ -192,7 +192,7 @@ class IRBuilder {

// Print values and strings. Arguments can be Stmt* or std::string.
template <typename... Args>
PrintStmt *create_print(Args &&... args) {
PrintStmt *create_print(Args &&...args) {
return insert(Stmt::make_typed<PrintStmt>(std::forward<Args>(args)...));
}

Expand Down

0 comments on commit 51e510b

Please sign in to comment.