diff options
| author | 2019-06-23 21:36:31 +0000 | |
|---|---|---|
| committer | 2019-06-23 21:36:31 +0000 | |
| commit | 23f101f37937a1bd4a29726cab2f76e0fb038b35 (patch) | |
| tree | f7da7d6b32c2e07114da399150bfa88d72187012 /gnu/llvm/lib/Target/WebAssembly/WebAssemblyFrameLowering.h | |
| parent | sort previous; ok deraadt (diff) | |
| download | wireguard-openbsd-23f101f37937a1bd4a29726cab2f76e0fb038b35.tar.xz wireguard-openbsd-23f101f37937a1bd4a29726cab2f76e0fb038b35.zip | |
Import LLVM 8.0.0 release including clang, lld and lldb.
Diffstat (limited to 'gnu/llvm/lib/Target/WebAssembly/WebAssemblyFrameLowering.h')
| -rw-r--r-- | gnu/llvm/lib/Target/WebAssembly/WebAssemblyFrameLowering.h | 29 |
1 files changed, 19 insertions, 10 deletions
diff --git a/gnu/llvm/lib/Target/WebAssembly/WebAssemblyFrameLowering.h b/gnu/llvm/lib/Target/WebAssembly/WebAssemblyFrameLowering.h index fe23e418a3f..c6fa8261b03 100644 --- a/gnu/llvm/lib/Target/WebAssembly/WebAssemblyFrameLowering.h +++ b/gnu/llvm/lib/Target/WebAssembly/WebAssemblyFrameLowering.h @@ -22,9 +22,10 @@ namespace llvm { class MachineFrameInfo; class WebAssemblyFrameLowering final : public TargetFrameLowering { - public: +public: /// Size of the red zone for the user stack (leaf functions can use this much - /// space below the stack pointer without writing it back to memory). + /// space below the stack pointer without writing it back to __stack_pointer + /// global). // TODO: (ABI) Revisit and decide how large it should be. static const size_t RedZoneSize = 128; @@ -34,9 +35,9 @@ class WebAssemblyFrameLowering final : public TargetFrameLowering { /*TransientStackAlignment=*/16, /*StackRealignable=*/true) {} - MachineBasicBlock::iterator eliminateCallFramePseudoInstr( - MachineFunction &MF, MachineBasicBlock &MBB, - MachineBasicBlock::iterator I) const override; + MachineBasicBlock::iterator + eliminateCallFramePseudoInstr(MachineFunction &MF, MachineBasicBlock &MBB, + MachineBasicBlock::iterator I) const override; /// These methods insert prolog and epilog code into the function. void emitPrologue(MachineFunction &MF, MachineBasicBlock &MBB) const override; @@ -45,13 +46,21 @@ class WebAssemblyFrameLowering final : public TargetFrameLowering { bool hasFP(const MachineFunction &MF) const override; bool hasReservedCallFrame(const MachineFunction &MF) const override; - private: + bool needsPrologForEH(const MachineFunction &MF) const; + + /// Write SP back to __stack_pointer global. + void writeSPToGlobal(unsigned SrcReg, MachineFunction &MF, + MachineBasicBlock &MBB, + MachineBasicBlock::iterator &InsertStore, + const DebugLoc &DL) const; + +private: bool hasBP(const MachineFunction &MF) const; - bool needsSP(const MachineFunction &MF, const MachineFrameInfo &MFI) const; - bool needsSPWriteback(const MachineFunction &MF, - const MachineFrameInfo &MFI) const; + bool needsSPForLocalFrame(const MachineFunction &MF) const; + bool needsSP(const MachineFunction &MF) const; + bool needsSPWriteback(const MachineFunction &MF) const; }; -} // end namespace llvm +} // end namespace llvm #endif |
