1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-24 03:33:20 +01:00

Use the isValidOperands helper instead of duplicating checking code

llvm-svn: 27524
This commit is contained in:
Chris Lattner 2006-04-08 04:07:52 +00:00
parent 6610c8ac0c
commit 73fc98fdeb

View File

@ -540,26 +540,17 @@ void Verifier::visitShiftInst(ShiftInst &SI) {
} }
void Verifier::visitExtractElementInst(ExtractElementInst &EI) { void Verifier::visitExtractElementInst(ExtractElementInst &EI) {
Assert1(isa<PackedType>(EI.getOperand(0)->getType()), Assert1(ExtractElementInst::isValidOperands(EI.getOperand(0),
"First operand to extractelement must be packed type!", &EI); EI.getOperand(1)),
Assert1(EI.getOperand(1)->getType() == Type::UIntTy, "Invalid extractelement operands!", &EI);
"Second operand to extractelement must be uint type!", &EI);
Assert1(EI.getType() ==
cast<PackedType>(EI.getOperand(0)->getType())->getElementType(),
"Extractelement return type must match "
"first operand element type!", &EI);
visitInstruction(EI); visitInstruction(EI);
} }
void Verifier::visitInsertElementInst(InsertElementInst &IE) { void Verifier::visitInsertElementInst(InsertElementInst &IE) {
Assert1(isa<PackedType>(IE.getOperand(0)->getType()), Assert1(InsertElementInst::isValidOperands(IE.getOperand(0),
"First operand to insertelement must be packed type!", &IE); IE.getOperand(1),
Assert1(IE.getOperand(1)->getType() == IE.getOperand(2)),
cast<PackedType>(IE.getOperand(0)->getType())->getElementType(), "Invalid insertelement operands!", &IE);
"Second operand to insertelement must match "
"first operand element type!", &IE);
Assert1(IE.getOperand(2)->getType() == Type::UIntTy,
"Third operand to insertelement must be uint type!", &IE);
visitInstruction(IE); visitInstruction(IE);
} }