• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // WebAssemblyRegisterInfo.h - WebAssembly Register Information Impl -*- 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 file contains the WebAssembly implementation of the
12 /// WebAssemblyRegisterInfo class.
13 ///
14 //===----------------------------------------------------------------------===//
15 
16 #ifndef LLVM_LIB_TARGET_WEBASSEMBLY_WEBASSEMBLYREGISTERINFO_H
17 #define LLVM_LIB_TARGET_WEBASSEMBLY_WEBASSEMBLYREGISTERINFO_H
18 
19 #define GET_REGINFO_HEADER
20 #include "WebAssemblyGenRegisterInfo.inc"
21 
22 namespace llvm {
23 
24 class MachineFunction;
25 class RegScavenger;
26 class TargetRegisterClass;
27 class Triple;
28 
29 class WebAssemblyRegisterInfo final : public WebAssemblyGenRegisterInfo {
30   const Triple &TT;
31 
32 public:
33   explicit WebAssemblyRegisterInfo(const Triple &TT);
34 
35   // Code Generation virtual methods.
36   const MCPhysReg *getCalleeSavedRegs(const MachineFunction *MF) const override;
37   BitVector getReservedRegs(const MachineFunction &MF) const override;
38   void eliminateFrameIndex(MachineBasicBlock::iterator MI, int SPAdj,
39                            unsigned FIOperandNum,
40                            RegScavenger *RS = nullptr) const override;
41 
42   // Debug information queries.
43   unsigned getFrameRegister(const MachineFunction &MF) const override;
44 
45   const TargetRegisterClass *
46   getPointerRegClass(const MachineFunction &MF,
47                      unsigned Kind = 0) const override;
48 };
49 
50 } // end namespace llvm
51 
52 #endif
53