25 #define DEBUG_TYPE "wasm-eh-restore-stack-pointer" 34 return "WebAssembly Restore Stack Pointer for Exception Handling";
48 "Restore Stack Pointer for Exception Handling",
true,
false)
51 return new WebAssemblyEHRestoreStackPointer();
54 bool WebAssemblyEHRestoreStackPointer::runOnMachineFunction(
56 LLVM_DEBUG(
dbgs() <<
"********** EH Restore Stack Pointer **********\n" 57 "********** Function: " 62 if (!FrameLowering->needsPrologForEH(MF))
66 for (
auto &MBB : MF) {
80 auto InsertPos = MBB.begin();
83 FrameLowering->writeSPToGlobal(WebAssembly::SP32, MF, MBB, InsertPos,
84 MBB.begin()->getDebugLoc());
This class represents lattice values for constants.
This file contains the entry points for global functions defined in the LLVM WebAssembly back-end...
MachineFunctionPass - This class adapts the FunctionPass interface to allow convenient creation of pa...
FunctionPass * createWebAssemblyEHRestoreStackPointer()
StringRef getName() const
getName - Return the name of the corresponding LLVM function.
This file contains the declaration of the WebAssembly-specific utility functions. ...
const TargetSubtargetInfo & getSubtarget() const
getSubtarget - Return the subtarget for which this machine code is being compiled.
void getAnalysisUsage(AnalysisUsage &AU) const override
getAnalysisUsage - Subclasses that override getAnalysisUsage must call this.
This file provides WebAssembly-specific target descriptions.
Represent the analysis usage information of a pass.
FunctionPass class - This class is used to implement most global optimizations.
This file declares the WebAssembly-specific subclass of TargetSubtarget.
void setPreservesCFG()
This function should be called by the pass, iff they do not:
raw_ostream & dbgs()
dbgs() - This returns a reference to a raw_ostream for debugging messages.
virtual const TargetFrameLowering * getFrameLowering() const
bool isCatch(const MachineInstr &MI)
StringRef - Represent a constant reference to a string, i.e.
INITIALIZE_PASS(WebAssemblyEHRestoreStackPointer, DEBUG_TYPE, "Restore Stack Pointer for Exception Handling", true, false) FunctionPass *llvm