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())) {
53 II->getOperandBundlesAsDefs(OpBundles);
61 II->replaceAllUsesWith(NewCall);
67 II->getUnwindDest()->removePredecessor(&BB);
70 BB.getInstList().erase(II);
static bool runImpl(Function &F, TargetLibraryInfo &TLI, DominatorTree &DT)
This is the entry point for all transforms.
static PassRegistry * getPassRegistry()
getPassRegistry - Access the global registry object, which is automatically initialized at applicatio...
Compute iterated dominance frontiers using a linear time algorithm.
INITIALIZE_PASS(LowerInvokeLegacyPass, "lowerinvoke", "Lower invoke and unwind, for unwindless code generators", false, false) static bool runImpl(Function &F)
This class represents a function call, abstracting a target machine's calling convention.
STATISTIC(NumFunctions, "Total number of functions")
static CallInst * Create(Value *Func, ArrayRef< Value *> Args, ArrayRef< OperandBundleDef > Bundles=None, const Twine &NameStr="", Instruction *InsertBefore=nullptr)
FunctionPass * createLowerInvokePass()
void initializeLowerInvokeLegacyPassPass(PassRegistry &)
void setAttributes(AttributeList A)
Set the parameter attributes for this call.
void takeName(Value *V)
Transfer the name from V to this value.
static PreservedAnalyses none()
Convenience factory function for the empty preserved set.
static bool runOnFunction(Function &F, bool PostInlining)
A set of analyses that are preserved following a run of a transformation pass.
void setDebugLoc(DebugLoc Loc)
Set the debug location information for this instruction.
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.
void setCallingConv(CallingConv::ID CC)
PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM)
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.