LLVM  3.7.0
WebAssemblyFrameLowering.cpp
Go to the documentation of this file.
1 //===-- WebAssemblyFrameLowering.cpp - WebAssembly Frame Lowering ----------==//
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 file contains the WebAssembly implementation of
12 /// TargetFrameLowering class.
13 ///
14 /// On WebAssembly, there aren't a lot of things to do here. There are no
15 /// callee-saved registers to save, and no spill slots.
16 ///
17 /// The stack grows downward.
18 ///
19 //===----------------------------------------------------------------------===//
20 
23 #include "WebAssemblyInstrInfo.h"
25 #include "WebAssemblySubtarget.h"
32 #include "llvm/Support/Debug.h"
33 using namespace llvm;
34 
35 #define DEBUG_TYPE "wasm-frame-info"
36 
37 // TODO: Implement a red zone?
38 
39 /// Return true if the specified function should have a dedicated frame pointer
40 /// register.
42  llvm_unreachable("TODO: implement hasFP");
43 }
44 
45 /// Under normal circumstances, when a frame pointer is not required, we reserve
46 /// argument space for call sites in the function immediately on entry to the
47 /// current function. This eliminates the need for add/sub sp brackets around
48 /// call sites. Returns true if the call frame is included as part of the stack
49 /// frame.
51  const MachineFunction &MF) const {
52  return !MF.getFrameInfo()->hasVarSizedObjects();
53 }
54 
58  llvm_unreachable("TODO: implement eliminateCallFramePseudoInstr");
59 }
60 
62  MachineBasicBlock &MBB) const {
63  llvm_unreachable("TODO: implement emitPrologue");
64 }
65 
67  MachineBasicBlock &MBB) const {
68  llvm_unreachable("TODO: implement emitEpilogue");
69 }
70 
72  MachineFunction &MF, RegScavenger *RS) const {
73  llvm_unreachable("TODO: implement processFunctionBeforeCalleeSavedScan");
74 }
void emitPrologue(MachineFunction &MF, MachineBasicBlock &MBB) const override
These methods insert prolog and epilog code into the function.
bool hasFP(const MachineFunction &MF) const override
Return true if the specified function should have a dedicated frame pointer register.
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
Definition: ErrorHandling.h:98
This file declares the WebAssembly-specific subclass of TargetMachine.
void emitEpilogue(MachineFunction &MF, MachineBasicBlock &MBB) const override
bundle_iterator< MachineInstr, instr_iterator > iterator
void processFunctionBeforeCalleeSavedScan(MachineFunction &MF, RegScavenger *RS) const override
This file provides WebAssembly-specific target descriptions.
This file declares the WebAssembly-specific subclass of TargetSubtarget.
This file contains the WebAssembly implementation of the TargetInstrInfo class.
void eliminateCallFramePseudoInstr(MachineFunction &MF, MachineBasicBlock &MBB, MachineBasicBlock::iterator I) const override
eliminateCallFramePseudoInstr - This method is called during prolog/epilog code insertion to eliminat...
MachineFrameInfo * getFrameInfo()
getFrameInfo - Return the frame info object for the current function.
This class implements WebAssembly-specific bits of TargetFrameLowering class.
#define I(x, y, z)
Definition: MD5.cpp:54
bool hasReservedCallFrame(const MachineFunction &MF) const override
Under normal circumstances, when a frame pointer is not required, we reserve argument space for call ...
This file declares WebAssembly-specific per-machine-function information.
bool hasVarSizedObjects() const
This method may be called any time after instruction selection is complete to determine if the stack ...