Skip to content

Commit

Permalink
Update CIRGenItaniumCXXABI.cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
bruteforceboy authored Feb 4, 2025
1 parent ad9139a commit 22fdf39
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions clang/lib/CIR/CodeGen/CIRGenItaniumCXXABI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2273,17 +2273,12 @@ void CIRGenItaniumCXXABI::emitRethrow(CIRGenFunction &CGF, bool isNoReturn) {

// The idea here is creating a separate block for the rethrow with an
// `UnreachableOp` as the terminator. So, we branch from the current block
// to the rethrow block (or erase if empty) and create a block for the
// remaining operations.
// to the rethrow block and create a block for the remaining operations.

auto currentBlock = builder.getInsertionBlock();
auto reg = currentBlock->getParent();

bool branch = false;
if (currentBlock->empty())
currentBlock->erase();
else
branch = true;
bool branch = !currentBlock->empty();

auto rethrowBlock = builder.createBlock(reg);
builder.setInsertionPointToStart(rethrowBlock);
Expand Down

0 comments on commit 22fdf39

Please sign in to comment.