SDTCisVT<0, isVoid> is not valid, reject it.

llvm-svn: 99744
This commit is contained in:
Chris Lattner 2010-03-28 06:04:39 +00:00
parent cba70c8162
commit ffdac7b76a
1 changed files with 3 additions and 0 deletions

View File

@ -524,6 +524,9 @@ SDTypeConstraint::SDTypeConstraint(Record *R) {
if (R->isSubClassOf("SDTCisVT")) { if (R->isSubClassOf("SDTCisVT")) {
ConstraintType = SDTCisVT; ConstraintType = SDTCisVT;
x.SDTCisVT_Info.VT = getValueType(R->getValueAsDef("VT")); x.SDTCisVT_Info.VT = getValueType(R->getValueAsDef("VT"));
if (x.SDTCisVT_Info.VT == MVT::isVoid)
throw TGError(R->getLoc(), "Cannot use 'Void' as type to SDTCisVT");
} else if (R->isSubClassOf("SDTCisPtrTy")) { } else if (R->isSubClassOf("SDTCisPtrTy")) {
ConstraintType = SDTCisPtrTy; ConstraintType = SDTCisPtrTy;
} else if (R->isSubClassOf("SDTCisInt")) { } else if (R->isSubClassOf("SDTCisInt")) {