26#define DEBUG_TYPE "wasm-clean-code-after-trap"
35 return "WebAssembly Clean Code After Trap";
42char WebAssemblyCleanCodeAfterTrap::ID = 0;
44 "WebAssembly Clean Code After Trap",
false,
false)
47 return new WebAssemblyCleanCodeAfterTrap();
50bool WebAssemblyCleanCodeAfterTrap::runOnMachineFunction(
MachineFunction &MF) {
52 dbgs() <<
"********** CleanCodeAfterTrap **********\n"
53 <<
"********** Function: " << MF.
getName() <<
'\n';
59 bool HasTerminator =
false;
67 if (!RemoveMI.empty()) {
76 MI->eraseFromParent();
#define INITIALIZE_PASS(passName, arg, name, cfg, analysis)
This file defines the SmallVector class.
This file contains the declaration of the WebAssembly-specific utility functions.
This file contains the entry points for global functions defined in the LLVM WebAssembly back-end.
FunctionPass class - This class is used to implement most global optimizations.
MachineFunctionPass - This class adapts the FunctionPass interface to allow convenient creation of pa...
virtual bool runOnMachineFunction(MachineFunction &MF)=0
runOnMachineFunction - This method must be overloaded to perform the desired machine code transformat...
StringRef getName() const
getName - Return the name of the corresponding LLVM function.
Representation of each machine instruction.
virtual void print(raw_ostream &OS, const Module *M) const
print - Print out the internal state of the pass.
virtual StringRef getPassName() const
getPassName - Return a nice clean name for a pass.
void push_back(const T &Elt)
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small.
StringRef - Represent a constant reference to a string, i.e.
unsigned ID
LLVM IR allows to use arbitrary numbers as calling convention identifiers.
This is an optimization pass for GlobalISel generic memory operations.
raw_ostream & dbgs()
dbgs() - This returns a reference to a raw_ostream for debugging messages.
FunctionPass * createWebAssemblyCleanCodeAfterTrap()