27 #define DEBUG_TYPE "lowerinvoke"
29 STATISTIC(NumInvokes,
"Number of invokes replaced");
44 "Lower invoke and unwind, for unwindless code generators",
50 if (
InvokeInst *II = dyn_cast<InvokeInst>(BB.getTerminator())) {
55 NewCall->takeName(II);
56 NewCall->setCallingConv(II->getCallingConv());
57 NewCall->setAttributes(II->getAttributes());
58 NewCall->setDebugLoc(II->getDebugLoc());
59 II->replaceAllUsesWith(NewCall);
65 II->getUnwindDest()->removePredecessor(&BB);
68 BB.getInstList().erase(II);
76 bool LowerInvokeLegacyPass::runOnFunction(
Function &
F) {
static PassRegistry * getPassRegistry()
getPassRegistry - Access the global registry object, which is automatically initialized at applicatio...
STATISTIC(NumFunctions,"Total number of functions")
This class represents a function call, abstracting a target machine's calling convention.
FunctionPass * createLowerInvokePass()
void initializeLowerInvokeLegacyPassPass(PassRegistry &)
static PreservedAnalyses none()
Convenience factory function for the empty preserved set.
A set of analyses that are preserved following a run of a transformation pass.
LLVM Basic Block Representation.
FunctionPass class - This class is used to implement most global optimizations.
static PreservedAnalyses all()
Construct a special preserved set that preserves all passes.
PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM)
static CallInst * Create(Value *Func, ArrayRef< Value * > Args, ArrayRef< OperandBundleDef > Bundles=None, const Twine &NameStr="", Instruction *InsertBefore=nullptr)
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small...
Module.h This file contains the declarations for the Module class.
static BranchInst * Create(BasicBlock *IfTrue, Instruction *InsertBefore=nullptr)
A container for analyses that lazily runs them and caches their results.
INITIALIZE_PASS(LowerInvokeLegacyPass,"lowerinvoke","Lower invoke and unwind, for unwindless code generators", false, false) static bool runImpl(Function &F)