summaryrefslogtreecommitdiffstats
path: root/llvm/utils
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2005-12-09 22:57:42 +0000
committerChris Lattner <sabre@nondot.org>2005-12-09 22:57:42 +0000
commit433573f4c67ce526d9988c2642d0cb0ffb46c46e (patch)
treeb3f82a5680ccd45f50b75bed9da96e82d37b5e70 /llvm/utils
parent275a3ed80c0b3ca12ad276a31c92d99cfb9f22bb (diff)
downloadbcm5719-llvm-433573f4c67ce526d9988c2642d0cb0ffb46c46e.tar.gz
bcm5719-llvm-433573f4c67ce526d9988c2642d0cb0ffb46c46e.zip
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
Diffstat (limited to 'llvm/utils')
-rw-r--r--llvm/utils/TableGen/DAGISelEmitter.cpp6
-rw-r--r--llvm/utils/TableGen/DAGISelEmitter.h4
2 files changed, 8 insertions, 2 deletions
diff --git a/llvm/utils/TableGen/DAGISelEmitter.cpp b/llvm/utils/TableGen/DAGISelEmitter.cpp
index f663c551334..285c10f0f5d 100644
--- a/llvm/utils/TableGen/DAGISelEmitter.cpp
+++ b/llvm/utils/TableGen/DAGISelEmitter.cpp
@@ -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 =
diff --git a/llvm/utils/TableGen/DAGISelEmitter.h b/llvm/utils/TableGen/DAGISelEmitter.h
index 5c3bbcb93d1..7a050c53e12 100644
--- a/llvm/utils/TableGen/DAGISelEmitter.h
+++ b/llvm/utils/TableGen/DAGISelEmitter.h
@@ -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.
OpenPOWER on IntegriCloud