From: JF Bastien Date: Tue, 11 Aug 2015 20:13:18 +0000 (+0000) Subject: WebAssembly: implement WebAssemblyTargetLowering::getTargetNodeName X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=fedd321354027338083aa51ad3df8bea09783c4e;p=oota-llvm.git 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 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244655 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Target/WebAssembly/WebAssemblyISelLowering.cpp b/lib/Target/WebAssembly/WebAssemblyISelLowering.cpp index ee155fdbb22..f73500dddc0 100644 --- a/lib/Target/WebAssembly/WebAssemblyISelLowering.cpp +++ b/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/lib/Target/WebAssembly/WebAssemblyISelLowering.h b/lib/Target/WebAssembly/WebAssemblyISelLowering.h index 12b4fe62864..9af4e455ad2 100644 --- a/lib/Target/WebAssembly/WebAssemblyISelLowering.h +++ b/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,