Add a new SDTCisPtrTy constraint, which indicates that an operand must have
the same type as the pointer type for a target.
llvm-svn: 24649
diff --git a/llvm/utils/TableGen/DAGISelEmitter.cpp b/llvm/utils/TableGen/DAGISelEmitter.cpp
index f663c55..285c10f 100644
--- a/llvm/utils/TableGen/DAGISelEmitter.cpp
+++ b/llvm/utils/TableGen/DAGISelEmitter.cpp
@@ -58,6 +58,8 @@
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 @@
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 =