[llvm-commits] [llvm] r124688 - /llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
Matt Beaumont-Gay
matthewbg at google.com
Tue Feb 1 14:12:51 PST 2011
Author: matthewbg
Date: Tue Feb 1 16:12:50 2011
New Revision: 124688
URL: http://llvm.org/viewvc/llvm-project?rev=124688&view=rev
Log:
Take Bill Wendling's suggestion for structuring a couple of asserts.
Modified:
llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
Modified: llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp?rev=124688&r1=124687&r2=124688&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp (original)
+++ llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp Tue Feb 1 16:12:50 2011
@@ -2874,9 +2874,9 @@
assert(VT.getSimpleVT() <= N1.getValueType().getSimpleVT() &&
"Extract subvector must be from larger vector to smaller vector!");
- if (ConstantSDNode *CSD = dyn_cast<ConstantSDNode>(Index.getNode())) {
- (void)CSD;
- assert((VT.getVectorNumElements() + CSD->getZExtValue()
+ if (isa<ConstantSDNode>(Index.getNode())) {
+ assert((VT.getVectorNumElements() +
+ cast<ConstantSDNode>(Index.getNode())->getZExtValue()
<= N1.getValueType().getVectorNumElements())
&& "Extract subvector overflow!");
}
@@ -3093,9 +3093,9 @@
"Dest and insert subvector source types must match!");
assert(N2.getValueType().getSimpleVT() <= N1.getValueType().getSimpleVT() &&
"Insert subvector must be from smaller vector to larger vector!");
- if (ConstantSDNode *CSD = dyn_cast<ConstantSDNode>(Index.getNode())) {
- (void)CSD;
- assert((N2.getValueType().getVectorNumElements() + CSD->getZExtValue()
+ if (isa<ConstantSDNode>(Index.getNode())) {
+ assert((N2.getValueType().getVectorNumElements() +
+ cast<ConstantSDNode>(Index.getNode())->getZExtValue()
<= VT.getVectorNumElements())
&& "Insert subvector overflow!");
}
More information about the llvm-commits
mailing list