From 480c840896a3f9487877e67e54fe6c814c34fac3 Mon Sep 17 00:00:00 2001 From: JF Bastien Date: Tue, 11 Aug 2015 20:13:18 +0000 Subject: [PATCH] WebAssembly: implement WebAssemblyTargetLowering::getTargetNodeName Summary: Implementation is the same as in AArch64. Subscribers: aemerson, jfb, llvm-commits, sunfish Differential Revision: http://reviews.llvm.org/D11956 llvm-svn: 244655 --- llvm/lib/Target/WebAssembly/WebAssemblyISelLowering.cpp | 10 ++++++++++ llvm/lib/Target/WebAssembly/WebAssemblyISelLowering.h | 4 +++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/llvm/lib/Target/WebAssembly/WebAssemblyISelLowering.cpp b/llvm/lib/Target/WebAssembly/WebAssemblyISelLowering.cpp index ee155fd..f73500d 100644 --- a/llvm/lib/Target/WebAssembly/WebAssemblyISelLowering.cpp +++ b/llvm/lib/Target/WebAssembly/WebAssemblyISelLowering.cpp @@ -120,6 +120,16 @@ MVT WebAssemblyTargetLowering::getScalarShiftAmountTy(const DataLayout &DL, return VT.getSimpleVT(); } +const char * +WebAssemblyTargetLowering::getTargetNodeName(unsigned Opcode) const { + switch (static_cast(Opcode)) { + case WebAssemblyISD::FIRST_NUMBER: break; + case WebAssemblyISD::RETURN: return "WebAssemblyISD::RETURN"; + case WebAssemblyISD::ARGUMENT: return "WebAssemblyISD::ARGUMENT"; + } + return nullptr; +} + //===----------------------------------------------------------------------===// // WebAssembly Lowering private implementation. //===----------------------------------------------------------------------===// diff --git a/llvm/lib/Target/WebAssembly/WebAssemblyISelLowering.h b/llvm/lib/Target/WebAssembly/WebAssemblyISelLowering.h index 12b4fe6..9af4e45 100644 --- a/llvm/lib/Target/WebAssembly/WebAssemblyISelLowering.h +++ b/llvm/lib/Target/WebAssembly/WebAssemblyISelLowering.h @@ -22,7 +22,7 @@ namespace llvm { namespace WebAssemblyISD { -enum { +enum NodeType : unsigned { FIRST_NUMBER = ISD::BUILTIN_OP_END, RETURN, ARGUMENT, @@ -47,6 +47,8 @@ private: MVT getScalarShiftAmountTy(const DataLayout &DL, EVT) const override; + const char *getTargetNodeName(unsigned Opcode) const override; + bool CanLowerReturn(CallingConv::ID CallConv, MachineFunction &MF, bool isVarArg, const SmallVectorImpl &Outs, -- 2.7.4