diff options
author | Matt Beaumont-Gay <matthewbg@google.com> | 2011-02-01 22:12:50 +0000 |
---|---|---|
committer | Matt Beaumont-Gay <matthewbg@google.com> | 2011-02-01 22:12:50 +0000 |
commit | 9a14a362d0388da3b7a9b866d23f09f6fe080a29 (patch) | |
tree | 0b895391892a5ee5a993d410ef2cf083a335a976 /lib/CodeGen | |
parent | a3138424cfbf92f995ef7c08537098307d279df3 (diff) | |
download | external_llvm-9a14a362d0388da3b7a9b866d23f09f6fe080a29.zip external_llvm-9a14a362d0388da3b7a9b866d23f09f6fe080a29.tar.gz external_llvm-9a14a362d0388da3b7a9b866d23f09f6fe080a29.tar.bz2 |
Take Bill Wendling's suggestion for structuring a couple of asserts.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@124688 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen')
-rw-r--r-- | lib/CodeGen/SelectionDAG/SelectionDAG.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/CodeGen/SelectionDAG/SelectionDAG.cpp b/lib/CodeGen/SelectionDAG/SelectionDAG.cpp index d14cae3..f3994b7 100644 --- a/lib/CodeGen/SelectionDAG/SelectionDAG.cpp +++ b/lib/CodeGen/SelectionDAG/SelectionDAG.cpp @@ -2874,9 +2874,9 @@ SDValue SelectionDAG::getNode(unsigned Opcode, DebugLoc DL, EVT VT, 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 @@ SDValue SelectionDAG::getNode(unsigned Opcode, DebugLoc DL, EVT VT, "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!"); } |