summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2004-01-12 19:04:55 +0000
committerChris Lattner <sabre@nondot.org>2004-01-12 19:04:55 +0000
commit5645e8a82d3b4e0174bf0894d66a5de9486d4095 (patch)
treea656b7aef51f9f3bb3566b22bd9d6e11f87b011a /llvm/lib
parent2853a7ed225f760c3a02c35f4e22fd6038ca2dd1 (diff)
downloadbcm5719-llvm-5645e8a82d3b4e0174bf0894d66a5de9486d4095.tar.gz
bcm5719-llvm-5645e8a82d3b4e0174bf0894d66a5de9486d4095.zip
Make ConstantExpr::get work for shifts as well
llvm-svn: 10790
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/VMCore/Constants.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/llvm/lib/VMCore/Constants.cpp b/llvm/lib/VMCore/Constants.cpp
index 2a9af77ef6a..e796bad8360 100644
--- a/llvm/lib/VMCore/Constants.cpp
+++ b/llvm/lib/VMCore/Constants.cpp
@@ -940,6 +940,8 @@ Constant *ConstantExpr::getCast(Constant *C, const Type *Ty) {
Constant *ConstantExpr::getTy(const Type *ReqTy, unsigned Opcode,
Constant *C1, Constant *C2) {
+ if (Opcode == Instruction::Shl || Opcode == Instruction::Shr)
+ return getShiftTy(ReqTy, Opcode, C1, C2);
// Check the operands for consistency first
assert((Opcode >= Instruction::BinaryOpsBegin &&
Opcode < Instruction::BinaryOpsEnd) &&
OpenPOWER on IntegriCloud