Nick Lewycky | c3890d2 | 2015-07-29 22:32:47 +0000 | [diff] [blame] | 1 | // WebAssemblyMachineFunctionInfo.h-WebAssembly machine function info-*- C++ -*- |
Dan Gohman | 10e730a | 2015-06-29 23:51:55 +0000 | [diff] [blame] | 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 declares WebAssembly-specific per-machine-function |
| 12 | /// information. |
| 13 | /// |
| 14 | //===----------------------------------------------------------------------===// |
| 15 | |
| 16 | #ifndef LLVM_LIB_TARGET_WEBASSEMBLY_WEBASSEMBLYMACHINEFUNCTIONINFO_H |
| 17 | #define LLVM_LIB_TARGET_WEBASSEMBLY_WEBASSEMBLYMACHINEFUNCTIONINFO_H |
| 18 | |
| 19 | #include "WebAssemblyRegisterInfo.h" |
| 20 | #include "llvm/CodeGen/MachineFunction.h" |
| 21 | #include "llvm/CodeGen/MachineRegisterInfo.h" |
| 22 | |
| 23 | namespace llvm { |
| 24 | |
| 25 | /// This class is derived from MachineFunctionInfo and contains private |
| 26 | /// WebAssembly-specific information for each MachineFunction. |
| 27 | class WebAssemblyFunctionInfo final : public MachineFunctionInfo { |
| 28 | MachineFunction &MF; |
| 29 | |
Dan Gohman | e51c058 | 2015-10-06 00:27:55 +0000 | [diff] [blame^] | 30 | unsigned NumArguments; |
| 31 | |
Dan Gohman | 10e730a | 2015-06-29 23:51:55 +0000 | [diff] [blame] | 32 | public: |
Dan Gohman | e51c058 | 2015-10-06 00:27:55 +0000 | [diff] [blame^] | 33 | explicit WebAssemblyFunctionInfo(MachineFunction &MF) |
| 34 | : MF(MF), NumArguments(0) {} |
Dan Gohman | 10e730a | 2015-06-29 23:51:55 +0000 | [diff] [blame] | 35 | ~WebAssemblyFunctionInfo() override; |
Dan Gohman | e51c058 | 2015-10-06 00:27:55 +0000 | [diff] [blame^] | 36 | |
| 37 | void setNumArguments(unsigned N) { NumArguments = N; } |
| 38 | unsigned getNumArguments() const { return NumArguments; } |
Dan Gohman | 10e730a | 2015-06-29 23:51:55 +0000 | [diff] [blame] | 39 | }; |
| 40 | |
| 41 | } // end namespace llvm |
| 42 | |
| 43 | #endif |