class CFGBuilder

Declaration

class CFGBuilder { /* full declaration omitted */ };

Description

CFGBuilder builds IR with specific CFG, based on the supplied list of arcs. It's able to apply the provided updates and automatically modify the IR.

Internally it makes every basic block end with either SwitchInst or with UnreachableInst. When all arc to a BB are deleted, the BB remains in the function and doesn't get deleted.

Declared at: llvm/unittests/IR/CFGBuilder.h:53

Method Overview

  • public CFGBuilder(llvm::Function * F, const std::vector<Arc> & InitialArcs, std::vector<Update> Updates)
  • public Optional<llvm::CFGBuilder::Update> applyUpdate()
  • public void dump(llvm::raw_ostream & OS = dbgs()) const
  • public Optional<llvm::CFGBuilder::Update> getNextUpdate() const
  • public llvm::BasicBlock * getOrAddBlock(llvm::StringRef BlockName)

Methods

CFGBuilder(llvm::Function* F,
           const std::vector<Arc>& InitialArcs,
           std::vector<Update> Updates)

Declared at: llvm/unittests/IR/CFGBuilder.h:71

Parameters

llvm::Function* F
const std::vector<Arc>& InitialArcs
std::vector<Update> Updates

Optional<llvm::CFGBuilder::Update> applyUpdate()

Declared at: llvm/unittests/IR/CFGBuilder.h:76

void dump(llvm::raw_ostream& OS = dbgs()) const

Declared at: llvm/unittests/IR/CFGBuilder.h:77

Parameters

llvm::raw_ostream& OS = dbgs()

Optional<llvm::CFGBuilder::Update> getNextUpdate()
    const

Declared at: llvm/unittests/IR/CFGBuilder.h:75

llvm::BasicBlock* getOrAddBlock(
    llvm::StringRef BlockName)

Declared at: llvm/unittests/IR/CFGBuilder.h:74

Parameters

llvm::StringRef BlockName