WebAssembly: implement WebAssemblyTargetLowering::getTargetNodeName
authorJF Bastien <jfb@google.com>
Tue, 11 Aug 2015 20:13:18 +0000 (20:13 +0000)
committerJF Bastien <jfb@google.com>
Tue, 11 Aug 2015 20:13:18 +0000 (20:13 +0000)
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

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

index ee155fdbb2260282fa882a2f60e327fde3ac9ca2..f73500dddc00e19334af22112e5dfd3b22b151ad 100644 (file)
@@ -120,6 +120,16 @@ MVT WebAssemblyTargetLowering::getScalarShiftAmountTy(const DataLayout &DL,
   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.
 //===----------------------------------------------------------------------===//
index 12b4fe62864b1654dfdd8a1bfe73c5169f246904..9af4e455ad267e20cd69fd464e73d98be37e1006 100644 (file)
@@ -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<ISD::OutputArg> &Outs,