llvm::changeToInvokeAndSplitBasicBlock

Convert a call into an invoke and split its basic block.

Synopsis

Declared in <llvm/Transforms/Utils/Local.h>

BasicBlock*
changeToInvokeAndSplitBasicBlock(
    CallInst* CI,
    BasicBlock* UnwindEdge,
    DomTreeUpdater* DTU = nullptr);

Description

Convert the CallInst to InvokeInst with the specified unwind edge basic block. This also splits the basic block where CI is located, because InvokeInst is a terminator instruction. Returns the newly split basic block.

Return Value

Newly split basic block following the invoke.

Parameters

NameDescription
CICall to convert into an invoke.
UnwindEdgeUnwind successor for the new invoke.
DTUOptional dominator-tree updater for CFG changes.