Skip to content

Commit 94d683a

Browse files
committed
add comment
1 parent b881c34 commit 94d683a

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

clang/lib/CIR/CodeGen/CIRGenFunction.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -244,6 +244,10 @@ void CIRGenFunction::LexicalScope::cleanup() {
244244

245245
// Cleanup are done right before codegen resumes a scope. This is where
246246
// objects are destroyed. Process all return blocks.
247+
// TODO(cir): Handle returning from a switch statement through a cleanup
248+
// block. We can't simply jump to the cleanup block, because the cleanup block
249+
// is not part of the case region. Either reemit all cleanups in the return
250+
// block or wait for MLIR structured control flow to support early exits.
247251
llvm::SmallVector<mlir::Block *> retBlocks;
248252
for (mlir::Block *retBlock : localScope->getRetBlocks()) {
249253
mlir::OpBuilder::InsertionGuard guard(builder);

0 commit comments

Comments
 (0)