From 5645e8a82d3b4e0174bf0894d66a5de9486d4095 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Mon, 12 Jan 2004 19:04:55 +0000 Subject: Make ConstantExpr::get work for shifts as well llvm-svn: 10790 --- llvm/lib/VMCore/Constants.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'llvm/lib/VMCore') 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) && -- cgit v1.2.3