mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-24 19:52:54 +01:00
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
This commit is contained in:
parent
6610545b7e
commit
aaec1f6faa
@ -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 =
|
||||
|
@ -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.
|
||||
|
Loading…
Reference in New Issue
Block a user