Skip to content

Commit 55c03f8

Browse files
bcardosolopeslanza
authored andcommitted
[CIR][CIRGen][Exception] Workaround internal testcase break
Recent work on exceptions broke an internal testcase, free the path back while I work on a holistic solution.
1 parent b46b3ba commit 55c03f8

File tree

1 file changed

+12
-5
lines changed

1 file changed

+12
-5
lines changed

clang/lib/CIR/CodeGen/CIRGenException.cpp

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -271,8 +271,6 @@ mlir::LogicalResult CIRGenFunction::buildCXXTryStmt(const CXXTryStmt &S) {
271271
});
272272

273273
enterCXXTryStmt(S, catchOp);
274-
llvm_unreachable("NYI");
275-
276274
if (buildStmt(S.getTryBlock(), /*useCurrentScope=*/true).failed())
277275
return mlir::failure();
278276
exitCXXTryStmt(S);
@@ -385,12 +383,20 @@ mlir::Block *CIRGenFunction::buildLandingPad() {
385383
case EHScope::Catch:
386384
case EHScope::Cleanup:
387385
case EHScope::Filter:
388-
llvm_unreachable("NYI");
389386
if (auto *lpad = innermostEHScope.getCachedLandingPad())
390387
return lpad;
391388
}
392389

393-
llvm_unreachable("NYI");
390+
{
391+
// Save the current CIR generation state.
392+
mlir::OpBuilder::InsertionGuard guard(builder);
393+
assert(!UnimplementedFeature::generateDebugInfo() && "NYI");
394+
// FIXME(cir): handle CIR relevant landing pad bits, there's no good
395+
// way to assert here right now and leaving one in break important
396+
// testcases. Work to fill this in is coming soon.
397+
}
398+
399+
return nullptr;
394400
}
395401

396402
mlir::Block *CIRGenFunction::getInvokeDestImpl() {
@@ -433,7 +439,8 @@ mlir::Block *CIRGenFunction::getInvokeDestImpl() {
433439
LP = buildLandingPad();
434440
}
435441

436-
assert(LP);
442+
// FIXME(cir): this breaks important testcases, fix is coming soon.
443+
// assert(LP);
437444

438445
// Cache the landing pad on the innermost scope. If this is a
439446
// non-EH scope, cache the landing pad on the enclosing scope, too.

0 commit comments

Comments
 (0)