[PATCH] D11956: WebAssembly: implement WebAssemblyTargetLowering::getTargetNodeName

JF Bastien via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 11 13:13:51 PDT 2015


jfb created this revision.
jfb added subscribers: sunfish, llvm-commits.
Herald added subscribers: jfb, aemerson.

Implementation is the same as in AArch64.

http://reviews.llvm.org/D11956

Files:
  lib/Target/WebAssembly/WebAssemblyISelLowering.cpp
  lib/Target/WebAssembly/WebAssemblyISelLowering.h

Index: lib/Target/WebAssembly/WebAssemblyISelLowering.h
===================================================================
--- lib/Target/WebAssembly/WebAssemblyISelLowering.h
+++ lib/Target/WebAssembly/WebAssemblyISelLowering.h
@@ -22,7 +22,7 @@
 
 namespace WebAssemblyISD {
 
-enum {
+enum NodeType : unsigned {
   FIRST_NUMBER = ISD::BUILTIN_OP_END,
   RETURN,
   ARGUMENT,
@@ -47,6 +47,8 @@
 
   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<ISD::OutputArg> &Outs,
Index: lib/Target/WebAssembly/WebAssemblyISelLowering.cpp
===================================================================
--- lib/Target/WebAssembly/WebAssemblyISelLowering.cpp
+++ lib/Target/WebAssembly/WebAssemblyISelLowering.cpp
@@ -120,6 +120,16 @@
   return VT.getSimpleVT();
 }
 
+const char *
+WebAssemblyTargetLowering::getTargetNodeName(unsigned Opcode) const {
+  switch (static_cast<WebAssemblyISD::NodeType>(Opcode)) {
+  case WebAssemblyISD::FIRST_NUMBER: break;
+  case WebAssemblyISD::RETURN: return "WebAssemblyISD::RETURN";
+  case WebAssemblyISD::ARGUMENT: return "WebAssemblyISD::ARGUMENT";
+  }
+  return nullptr;
+}
+
 //===----------------------------------------------------------------------===//
 // WebAssembly Lowering private implementation.
 //===----------------------------------------------------------------------===//


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D11956.31853.patch
Type: text/x-patch
Size: 1574 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150811/bd3c5fcf/attachment.bin>


More information about the llvm-commits mailing list