25#define DEBUG_TYPE "lower-invoke"
40char LowerInvokeLegacyPass::ID = 0;
42 "Lower invoke and unwind, for unwindless code generators",
49 CallInst *NewCall = createCallMatchingInvoke(II);
50 NewCall->takeName(II);
51 NewCall->insertBefore(II->getIterator());
52 II->replaceAllUsesWith(NewCall);
55 UncondBrInst::Create(II->getNormalDest(), II->getIterator());
58 II->getUnwindDest()->removePredecessor(&BB);
61 II->eraseFromParent();
69bool LowerInvokeLegacyPass::runOnFunction(
Function &
F) {
77 return new LowerInvokeLegacyPass();
static bool runImpl(MachineFunction &MF)
static bool runOnFunction(Function &F, bool PostInlining)
uint64_t IntrinsicInst * II
#define INITIALIZE_PASS(passName, arg, name, cfg, analysis)
This file defines the 'Statistic' class, which is designed to be an easy way to expose various metric...
#define STATISTIC(VARNAME, DESC)
LLVM Basic Block Representation.
FunctionPass class - This class is used to implement most global optimizations.
LLVM_ABI PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM)
static LLVM_ABI 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 an optimization pass for GlobalISel generic memory operations.
LLVM_ABI void initializeLowerInvokeLegacyPassPass(PassRegistry &)
decltype(auto) dyn_cast(const From &Val)
dyn_cast<X> - Return the argument parameter cast to the specified type.
LLVM_ABI FunctionPass * createLowerInvokePass()
AnalysisManager< Function > FunctionAnalysisManager
Convenience typedef for the Function analysis manager.
LLVM_ABI char & LowerInvokePassID