Add a new SDTCisPtrTy constraint, which indicates that an operand must have
authorChris Lattner <sabre@nondot.org>
Fri, 9 Dec 2005 22:57:42 +0000 (22:57 +0000)
committerChris Lattner <sabre@nondot.org>
Fri, 9 Dec 2005 22:57:42 +0000 (22:57 +0000)
the same type as the pointer type for a target.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24649 91177308-0d34-0410-b5e6-96231b3b80d8

utils/TableGen/DAGISelEmitter.cpp
utils/TableGen/DAGISelEmitter.h

index f663c551334134c2f2b7f8cc9a9c0377488a98dc..285c10f0f5db43f19cdfbe2f04e9cdafd236adbb 100644 (file)
@@ -58,6 +58,8 @@ SDTypeConstraint::SDTypeConstraint(Record *R) {
   if (R->isSubClassOf("SDTCisVT")) {
     ConstraintType = SDTCisVT;
     x.SDTCisVT_Info.VT = getValueType(R->getValueAsDef("VT"));
+  } else if (R->isSubClassOf("SDTCisPtrTy")) {
+    ConstraintType = SDTCisPtrTy;
   } else if (R->isSubClassOf("SDTCisInt")) {
     ConstraintType = SDTCisInt;
   } else if (R->isSubClassOf("SDTCisFP")) {
@@ -120,6 +122,10 @@ bool SDTypeConstraint::ApplyTypeConstraint(TreePatternNode *N,
   case SDTCisVT:
     // Operand must be a particular type.
     return NodeToApply->UpdateNodeType(x.SDTCisVT_Info.VT, TP);
+  case SDTCisPtrTy: {
+    // Operand must be same as target pointer type.
+    return NodeToApply->UpdateNodeType(CGT.getPointerType(), TP);
+  }
   case SDTCisInt: {
     // If there is only one integer type supported, this must be it.
     std::vector<MVT::ValueType> IntVTs =
index 5c3bbcb93d160d45bee07e4127f74f4b0b59b9a0..7a050c53e1251ce06e74ec94629c7b83b65e9d35 100644 (file)
@@ -45,8 +45,8 @@ namespace llvm {
     
     unsigned OperandNo;   // The operand # this constraint applies to.
     enum { 
-      SDTCisVT, SDTCisInt, SDTCisFP, SDTCisSameAs, SDTCisVTSmallerThanOp,
-      SDTCisOpSmallerThanOp
+      SDTCisVT, SDTCisPtrTy, SDTCisInt, SDTCisFP, SDTCisSameAs, 
+      SDTCisVTSmallerThanOp, SDTCisOpSmallerThanOp
     } ConstraintType;
     
     union {   // The discriminated union.