We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b881c34 commit 94d683aCopy full SHA for 94d683a
clang/lib/CIR/CodeGen/CIRGenFunction.cpp
@@ -244,6 +244,10 @@ void CIRGenFunction::LexicalScope::cleanup() {
244
245
// Cleanup are done right before codegen resumes a scope. This is where
246
// 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.
251
llvm::SmallVector<mlir::Block *> retBlocks;
252
for (mlir::Block *retBlock : localScope->getRetBlocks()) {
253
mlir::OpBuilder::InsertionGuard guard(builder);
0 commit comments