diff options
author | Chris Lattner <sabre@nondot.org> | 2004-01-12 19:04:55 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2004-01-12 19:04:55 +0000 |
commit | 3edd3979e1fd5f08203a0d4e0e89adc80db337a9 (patch) | |
tree | daf70c8f6c6700bff6070dbd4d8e938e96876dd2 /lib/VMCore | |
parent | 81ebc300891a81c305258aed980567514dff952d (diff) | |
download | external_llvm-3edd3979e1fd5f08203a0d4e0e89adc80db337a9.zip external_llvm-3edd3979e1fd5f08203a0d4e0e89adc80db337a9.tar.gz external_llvm-3edd3979e1fd5f08203a0d4e0e89adc80db337a9.tar.bz2 |
Make ConstantExpr::get work for shifts as well
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10790 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/VMCore')
-rw-r--r-- | lib/VMCore/Constants.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/VMCore/Constants.cpp b/lib/VMCore/Constants.cpp index 2a9af77..e796bad 100644 --- a/lib/VMCore/Constants.cpp +++ b/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) && |