[llvm-commits] [hlvm] r38311 - /hlvm/trunk/hlvm/Pass/Validate.cpp
Reid Spencer
reid at x10sys.com
Sat Jul 7 17:02:14 PDT 2007
Author: reid
Date: Sat Jul 7 19:02:14 2007
New Revision: 38311
URL: http://llvm.org/viewvc/llvm-project?rev=38311&view=rev
Log:
Reduce code size for SelectOp checks.
Eliminate redundant checks on SwitchOp.
Modified:
hlvm/trunk/hlvm/Pass/Validate.cpp
Modified: hlvm/trunk/hlvm/Pass/Validate.cpp
URL: http://llvm.org/viewvc/llvm-project/hlvm/trunk/hlvm/Pass/Validate.cpp?rev=38311&r1=38310&r2=38311&view=diff
==============================================================================
--- hlvm/trunk/hlvm/Pass/Validate.cpp (original)
+++ hlvm/trunk/hlvm/Pass/Validate.cpp Sat Jul 7 19:02:14 2007
@@ -672,14 +672,11 @@
ValidateImpl::validate(SelectOp* n)
{
if (checkOperator(n,SelectOpID,3)) {
- Operator* Op1 = n->getOperand(0);
- Operator* Op2 = n->getOperand(1);
- Operator* Op3 = n->getOperand(2);
- checkBooleanExpression(Op1);
- checkResult(Op2);
- checkResult(Op3);
- if (Op2->getType() != Op3->getType())
- error(n,"Second and third operands for SelectOp must have same type");
+ checkBooleanExpression(n->getOperand(0));
+ if (checkResult(n->getOperand(1)))
+ if (checkResult(n->getOperand(2)))
+ if (n->getOperand(1)->getType() != n->getOperand(2)->getType())
+ error(n,"Second and third operands for SelectOp must have same type");
}
}
@@ -725,8 +722,6 @@
{
if (checkOperator(n,SwitchOpID,2,false))
{
- checkIntegralExpression(n->getOperand(0));
- checkResult(n->getOperand(1));
if (n->getNumOperands() % 2 != 0)
error(n,"SwitchOp requires even number of operands");
else {
More information about the llvm-commits
mailing list