Skip to content

Commit bd8f03b

Browse files
committed
Remove unused incoming and outgoing vars. Comment on why they aren't needed.
1 parent 5fa2289 commit bd8f03b

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

clang/lib/CIR/CodeGen/CIRGenStmt.cpp

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -79,14 +79,15 @@ mlir::LogicalResult CIRGenFunction::emitStmt(const Stmt *s,
7979
#define EXPR(Type, Base) case Stmt::Type##Class:
8080
#include "clang/AST/StmtNodes.inc"
8181
{
82-
// Remember the block we came in on.
83-
[[maybe_unused]] mlir::Block *incoming = builder.getInsertionBlock();
84-
assert(incoming && "expression emission must have an insertion point");
82+
assert(builder.getInsertionBlock() &&
83+
"expression emission must have an insertion point");
8584

8685
emitIgnoredExpr(cast<Expr>(s));
8786

88-
[[maybe_unused]] mlir::Block *outgoing = builder.getInsertionBlock();
89-
assert(outgoing && "expression emission cleared block!");
87+
// Classic codegen has a check here to see if the emitter created a new
88+
// block that isn't used (comparing the incoming and outgoing insertion
89+
// points) and deletes the outgoing block if it's not used. In CIR, we
90+
// will handle that during the cir.canonicalize pass.
9091
return mlir::success();
9192
}
9293
case Stmt::IfStmtClass:

0 commit comments

Comments
 (0)