1 // WebAssemblyMachineFunctionInfo.h-WebAssembly machine function info-*- C++ -*-
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
11 /// \brief This file declares WebAssembly-specific per-machine-function
14 //===----------------------------------------------------------------------===//
16 #ifndef LLVM_LIB_TARGET_WEBASSEMBLY_WEBASSEMBLYMACHINEFUNCTIONINFO_H
17 #define LLVM_LIB_TARGET_WEBASSEMBLY_WEBASSEMBLYMACHINEFUNCTIONINFO_H
19 #include "WebAssemblyRegisterInfo.h"
20 #include "llvm/CodeGen/MachineFunction.h"
21 #include "llvm/CodeGen/MachineRegisterInfo.h"
25 /// This class is derived from MachineFunctionInfo and contains private
26 /// WebAssembly-specific information for each MachineFunction.
27 class WebAssemblyFunctionInfo final : public MachineFunctionInfo {
30 std::vector<MVT> Params;
31 std::vector<MVT> Results;
34 explicit WebAssemblyFunctionInfo(MachineFunction &MF)
36 ~WebAssemblyFunctionInfo() override;
38 void addParam(MVT VT) { Params.push_back(VT); }
39 const std::vector<MVT> &getParams() const { return Params; }
41 void addResult(MVT VT) { Results.push_back(VT); }
42 const std::vector<MVT> &getResults() const { return Results; }
45 } // end namespace llvm