add emitter support for integer constants and simple physreg references.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96663 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/utils/TableGen/DAGISelMatcher.h b/utils/TableGen/DAGISelMatcher.h
index 7b6fbdb..0d58256 100644
--- a/utils/TableGen/DAGISelMatcher.h
+++ b/utils/TableGen/DAGISelMatcher.h
@@ -386,7 +386,7 @@
   EmitIntegerMatcherNode(int64_t val, MVT::SimpleValueType vt)
   : MatcherNode(EmitInteger), Val(val), VT(vt) {}
   
-  int64_t getVal() const { return Val; }
+  int64_t getValue() const { return Val; }
   MVT::SimpleValueType getVT() const { return VT; }
   
   static inline bool classof(const MatcherNode *N) {
diff --git a/utils/TableGen/DAGISelMatcherEmitter.cpp b/utils/TableGen/DAGISelMatcherEmitter.cpp
index 92b2a55..4b16db3 100644
--- a/utils/TableGen/DAGISelMatcherEmitter.cpp
+++ b/utils/TableGen/DAGISelMatcherEmitter.cpp
@@ -213,10 +213,21 @@
        << cast<CheckChainCompatibleMatcherNode>(N)->getPreviousOp() << ",\n";
     return 2;
       
-  case MatcherNode::EmitInteger:
+  case MatcherNode::EmitInteger: {
+    int64_t Val = cast<EmitIntegerMatcherNode>(N)->getValue();
+    OS << "OPC_EmitInteger" << ClassifyInt(Val) << ", "
+       << getEnumName(cast<EmitIntegerMatcherNode>(N)->getVT()) << ", ";
+    return EmitInt(Val, OS)+2;
+  }
+      
   case MatcherNode::EmitRegister:
-      // FIXME: Implement.
-    return 0;
+    OS << "OPC_EmitRegister, "
+       << getEnumName(cast<EmitRegisterMatcherNode>(N)->getVT()) << ", ";
+    if (Record *R = cast<EmitRegisterMatcherNode>(N)->getReg())
+      OS << getQualifiedName(R) << ",\n";
+    else
+      OS << "0 /*zero_reg*/,\n";
+    return 3;
   }
   assert(0 && "Unreachable");
   return 0;