25#define DEBUG_TYPE "lower-invoke"
40char LowerInvokeLegacyPass::ID = 0;
42 "Lower invoke and unwind, for unwindless code generators",
48 if (
InvokeInst *
II = dyn_cast<InvokeInst>(BB.getTerminator())) {
51 II->getOperandBundlesAsDefs(OpBundles);
55 CallArgs, OpBundles,
"",
II->getIterator());
60 II->replaceAllUsesWith(NewCall);
66 II->getUnwindDest()->removePredecessor(&BB);
69 II->eraseFromParent();
77bool LowerInvokeLegacyPass::runOnFunction(
Function &
F) {
static bool runImpl(Function &F, const TargetLowering &TLI)
uint64_t IntrinsicInst * II
#define INITIALIZE_PASS(passName, arg, name, cfg, analysis)
This file defines the SmallVector class.
This file defines the 'Statistic' class, which is designed to be an easy way to expose various metric...
#define STATISTIC(VARNAME, DESC)
A container for analyses that lazily runs them and caches their results.
LLVM Basic Block Representation.
static BranchInst * Create(BasicBlock *IfTrue, InsertPosition InsertBefore=nullptr)
void setCallingConv(CallingConv::ID CC)
void setAttributes(AttributeList A)
Set the attributes for this call.
This class represents a function call, abstracting a target machine's calling convention.
static CallInst * Create(FunctionType *Ty, Value *F, const Twine &NameStr="", InsertPosition InsertBefore=nullptr)
FunctionPass class - This class is used to implement most global optimizations.
virtual bool runOnFunction(Function &F)=0
runOnFunction - Virtual method overriden by subclasses to do the per-function processing of the pass.
void setDebugLoc(DebugLoc Loc)
Set the debug location information for this instruction.
PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM)
static PassRegistry * getPassRegistry()
getPassRegistry - Access the global registry object, which is automatically initialized at applicatio...
A set of analyses that are preserved following a run of a transformation pass.
static PreservedAnalyses none()
Convenience factory function for the empty preserved set.
static PreservedAnalyses all()
Construct a special preserved set that preserves all passes.
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small.
void takeName(Value *V)
Transfer the name from V to this value.
unsigned ID
LLVM IR allows to use arbitrary numbers as calling convention identifiers.
This is an optimization pass for GlobalISel generic memory operations.
void initializeLowerInvokeLegacyPassPass(PassRegistry &)
FunctionPass * createLowerInvokePass()