From: Chris Lattner Date: Sat, 8 Apr 2006 04:07:52 +0000 (+0000) Subject: Use the isValidOperands helper instead of duplicating checking code X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=1cbe05b20845f5085953e293797fbbd1afbf5471;p=oota-llvm.git Use the isValidOperands helper instead of duplicating checking code git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27524 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/VMCore/Verifier.cpp b/lib/VMCore/Verifier.cpp index b7396695c41..70c6a4c8e9a 100644 --- a/lib/VMCore/Verifier.cpp +++ b/lib/VMCore/Verifier.cpp @@ -540,26 +540,17 @@ void Verifier::visitShiftInst(ShiftInst &SI) { } void Verifier::visitExtractElementInst(ExtractElementInst &EI) { - Assert1(isa(EI.getOperand(0)->getType()), - "First operand to extractelement must be packed type!", &EI); - Assert1(EI.getOperand(1)->getType() == Type::UIntTy, - "Second operand to extractelement must be uint type!", &EI); - Assert1(EI.getType() == - cast(EI.getOperand(0)->getType())->getElementType(), - "Extractelement return type must match " - "first operand element type!", &EI); + Assert1(ExtractElementInst::isValidOperands(EI.getOperand(0), + EI.getOperand(1)), + "Invalid extractelement operands!", &EI); visitInstruction(EI); } void Verifier::visitInsertElementInst(InsertElementInst &IE) { - Assert1(isa(IE.getOperand(0)->getType()), - "First operand to insertelement must be packed type!", &IE); - Assert1(IE.getOperand(1)->getType() == - cast(IE.getOperand(0)->getType())->getElementType(), - "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); + Assert1(InsertElementInst::isValidOperands(IE.getOperand(0), + IE.getOperand(1), + IE.getOperand(2)), + "Invalid insertelement operands!", &IE); visitInstruction(IE); }