llvm::detachDeadBlocks

Replace every block in BBs with a single unreachable instruction.

Synopsis

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

void
detachDeadBlocks(
    ArrayRef<BasicBlock*> BBs,
    SmallVectorImpl<DominatorTree::UpdateType>* Updates,
    bool KeepOneInputPHIs = false);

Description

If Updates is specified, collect all necessary DT updates into this vector. If KeepOneInputPHIs is true, one-input Phis in successors of blocks being deleted will be preserved.

Parameters

NameDescription
BBsBlocks whose contents are replaced with unreachable.
UpdatesOptional vector that receives dominator-tree updates.
KeepOneInputPHIsWhether to preserve one-input PHIs in successors.