blob: 5f4708fe77edc08fe83bc2aa05e17c8fd7c4659a [file] [log] [blame]
Dan Gohman10e730a2015-06-29 23:51:55 +00001// WebAssemblyFrameLowering.h - TargetFrameLowering for WebAssembly -*- C++ -*-/
2//
3// The LLVM Compiler Infrastructure
4//
5// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
7//
8//===----------------------------------------------------------------------===//
9///
10/// \file
11/// \brief This class implements WebAssembly-specific bits of
12/// TargetFrameLowering class.
13///
14//===----------------------------------------------------------------------===//
15
16#ifndef LLVM_LIB_TARGET_WEBASSEMBLY_WEBASSEMBLYFRAMELOWERING_H
17#define LLVM_LIB_TARGET_WEBASSEMBLY_WEBASSEMBLYFRAMELOWERING_H
18
19#include "llvm/Target/TargetFrameLowering.h"
20
21namespace llvm {
22
23class WebAssemblyFrameLowering final : public TargetFrameLowering {
24public:
25 WebAssemblyFrameLowering()
26 : TargetFrameLowering(StackGrowsDown, /*StackAlignment=*/16,
27 /*LocalAreaOffset=*/0,
28 /*TransientStackAlignment=*/16,
29 /*StackRealignable=*/true) {}
30
31 void
32 eliminateCallFramePseudoInstr(MachineFunction &MF, MachineBasicBlock &MBB,
33 MachineBasicBlock::iterator I) const override;
34
35 /// These methods insert prolog and epilog code into the function.
36 void emitPrologue(MachineFunction &MF, MachineBasicBlock &MBB) const override;
37 void emitEpilogue(MachineFunction &MF, MachineBasicBlock &MBB) const override;
38
39 bool hasFP(const MachineFunction &MF) const override;
40 bool hasReservedCallFrame(const MachineFunction &MF) const override;
Dan Gohman10e730a2015-06-29 23:51:55 +000041};
42
43} // end namespace llvm
44
45#endif