Skip to content

Commit

Permalink
[CIR][CIRGen][Exception] Workaround internal testcase break
Browse files Browse the repository at this point in the history
Recent work on exceptions broke an internal testcase, free the path
back while I work on a holistic solution.
  • Loading branch information
bcardosolopes authored and lanza committed Sep 7, 2023
1 parent 127b2cd commit a13781b
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions clang/lib/CIR/CodeGen/CIRGenException.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -271,8 +271,6 @@ mlir::LogicalResult CIRGenFunction::buildCXXTryStmt(const CXXTryStmt &S) {
});

enterCXXTryStmt(S, catchOp);
llvm_unreachable("NYI");

if (buildStmt(S.getTryBlock(), /*useCurrentScope=*/true).failed())
return mlir::failure();
exitCXXTryStmt(S);
Expand Down Expand Up @@ -385,12 +383,20 @@ mlir::Block *CIRGenFunction::buildLandingPad() {
case EHScope::Catch:
case EHScope::Cleanup:
case EHScope::Filter:
llvm_unreachable("NYI");
if (auto *lpad = innermostEHScope.getCachedLandingPad())
return lpad;
}

llvm_unreachable("NYI");
{
// Save the current CIR generation state.
mlir::OpBuilder::InsertionGuard guard(builder);
assert(!UnimplementedFeature::generateDebugInfo() && "NYI");
// FIXME(cir): handle CIR relevant landing pad bits, there's no good
// way to assert here right now and leaving one in break important
// testcases. Work to fill this in is coming soon.
}

return nullptr;
}

mlir::Block *CIRGenFunction::getInvokeDestImpl() {
Expand Down Expand Up @@ -433,7 +439,8 @@ mlir::Block *CIRGenFunction::getInvokeDestImpl() {
LP = buildLandingPad();
}

assert(LP);
// FIXME(cir): this breaks important testcases, fix is coming soon.
// assert(LP);

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

0 comments on commit a13781b

Please sign in to comment.