diff options
Diffstat (limited to 'llvm/lib/Target/WebAssembly/WebAssemblyMachineFunctionInfo.h')
| -rw-r--r-- | llvm/lib/Target/WebAssembly/WebAssemblyMachineFunctionInfo.h | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/llvm/lib/Target/WebAssembly/WebAssemblyMachineFunctionInfo.h b/llvm/lib/Target/WebAssembly/WebAssemblyMachineFunctionInfo.h index 3962e8db946..6844656b75e 100644 --- a/llvm/lib/Target/WebAssembly/WebAssemblyMachineFunctionInfo.h +++ b/llvm/lib/Target/WebAssembly/WebAssemblyMachineFunctionInfo.h @@ -17,11 +17,16 @@ #include "MCTargetDesc/WebAssemblyMCTargetDesc.h" #include "llvm/BinaryFormat/Wasm.h" +#include "llvm/CodeGen/MIRYamlMapping.h" #include "llvm/CodeGen/MachineRegisterInfo.h" #include "llvm/MC/MCSymbolWasm.h" namespace llvm { +namespace yaml { +struct WebAssemblyFunctionInfo; +} + /// This class is derived from MachineFunctionInfo and contains private /// WebAssembly-specific information for each MachineFunction. class WebAssemblyFunctionInfo final : public MachineFunctionInfo { @@ -54,6 +59,7 @@ class WebAssemblyFunctionInfo final : public MachineFunctionInfo { public: explicit WebAssemblyFunctionInfo(MachineFunction &MF) : MF(MF) {} ~WebAssemblyFunctionInfo() override; + void initializeBaseYamlFields(const yaml::WebAssemblyFunctionInfo &YamlMFI); void addParam(MVT VT) { Params.push_back(VT); } const std::vector<MVT> &getParams() const { return Params; } @@ -135,6 +141,22 @@ std::unique_ptr<wasm::WasmSignature> signatureFromMVTs(const SmallVectorImpl<MVT> &Results, const SmallVectorImpl<MVT> &Params); +namespace yaml { + +struct WebAssemblyFunctionInfo final : public yaml::MachineFunctionInfo { + WebAssemblyFunctionInfo() = default; + WebAssemblyFunctionInfo(const llvm::WebAssemblyFunctionInfo &MFI); + + void mappingImpl(yaml::IO &YamlIO) override; + ~WebAssemblyFunctionInfo() = default; +}; + +template <> struct MappingTraits<WebAssemblyFunctionInfo> { + static void mapping(IO &YamlIO, WebAssemblyFunctionInfo &MFI) {} +}; + +} // end namespace yaml + } // end namespace llvm #endif |

