aboutsummaryrefslogtreecommitdiff
path: root/lib/VMCore/Instructions.cpp
diff options
context:
space:
mode:
authorNate Begeman <natebegeman@mac.com>2008-07-29 15:49:41 +0000
committerNate Begeman <natebegeman@mac.com>2008-07-29 15:49:41 +0000
commit5bc1ea0736a5785ed596d58beeff2ab23909e33d (patch)
tree873c527b697e72ea9a3cc6b65f14717777db584a /lib/VMCore/Instructions.cpp
parent75cf9cc527c6ef3097dcefab173e93716a5a3e4a (diff)
Add vector shifts to the IR, patch by Eli Friedman.
CodeGen & Clang work coming next. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54161 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/VMCore/Instructions.cpp')
-rw-r--r--lib/VMCore/Instructions.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/VMCore/Instructions.cpp b/lib/VMCore/Instructions.cpp
index bedf74cd9c..5edd39319b 100644
--- a/lib/VMCore/Instructions.cpp
+++ b/lib/VMCore/Instructions.cpp
@@ -874,6 +874,7 @@ void LoadInst::setAlignment(unsigned Align) {
//===----------------------------------------------------------------------===//
void StoreInst::AssertOK() {
+ assert(getOperand(0) && getOperand(1) && "Both operands must be non-null!");
assert(isa<PointerType>(getOperand(1)->getType()) &&
"Ptr must have pointer type!");
assert(getOperand(0)->getType() ==
@@ -1535,8 +1536,10 @@ void BinaryOperator::init(BinaryOps iType) {
case AShr:
assert(getType() == LHS->getType() &&
"Shift operation should return same type as operands!");
- assert(getType()->isInteger() &&
- "Shift operation requires integer operands");
+ assert((getType()->isInteger() ||
+ (isa<VectorType>(getType()) &&
+ cast<VectorType>(getType())->getElementType()->isInteger())) &&
+ "Tried to create a shift operation on a non-integral type!");
break;
case And: case Or:
case Xor: