blob: bac0dfafcf31b015a166fe35668132bfcb4fe182 [file] [log] [blame]
Nick Lewyckyc3890d22015-07-29 22:32:47 +00001// WebAssemblyMachineFunctionInfo.h-WebAssembly machine function info-*- C++ -*-
Dan Gohman10e730a2015-06-29 23:51:55 +00002//
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
23namespace llvm {
24
25/// This class is derived from MachineFunctionInfo and contains private
26/// WebAssembly-specific information for each MachineFunction.
27class WebAssemblyFunctionInfo final : public MachineFunctionInfo {
28 MachineFunction &MF;
29
Dan Gohman754cd112015-11-11 01:33:02 +000030 std::vector<MVT> Params;
31 std::vector<MVT> Results;
Dan Gohmane51c0582015-10-06 00:27:55 +000032
Dan Gohman10e730a2015-06-29 23:51:55 +000033public:
Dan Gohmane51c0582015-10-06 00:27:55 +000034 explicit WebAssemblyFunctionInfo(MachineFunction &MF)
Dan Gohman754cd112015-11-11 01:33:02 +000035 : MF(MF) {}
Dan Gohman10e730a2015-06-29 23:51:55 +000036 ~WebAssemblyFunctionInfo() override;
Dan Gohmane51c0582015-10-06 00:27:55 +000037
Dan Gohman754cd112015-11-11 01:33:02 +000038 void addParam(MVT VT) { Params.push_back(VT); }
39 const std::vector<MVT> &getParams() const { return Params; }
40
41 void addResult(MVT VT) { Results.push_back(VT); }
42 const std::vector<MVT> &getResults() const { return Results; }
Dan Gohman10e730a2015-06-29 23:51:55 +000043};
44
45} // end namespace llvm
46
47#endif