diff options
| author | Chris Lattner <sabre@nondot.org> | 2009-04-07 05:03:34 +0000 |
|---|---|---|
| committer | Chris Lattner <sabre@nondot.org> | 2009-04-07 05:03:34 +0000 |
| commit | 321741af5f6bb2baa1999a8230c6311955fccaa5 (patch) | |
| tree | defd34c67cd3d98d9bc99653cccd6c086743f322 /llvm/lib/Transforms | |
| parent | 8928d74e19ab444134eadaae3d3fd9697bb42a7a (diff) | |
| download | bcm5719-llvm-321741af5f6bb2baa1999a8230c6311955fccaa5.tar.gz bcm5719-llvm-321741af5f6bb2baa1999a8230c6311955fccaa5.zip | |
fix rdar://6762290, a crash compiling cxx filt with clang.
llvm-svn: 68500
Diffstat (limited to 'llvm/lib/Transforms')
| -rw-r--r-- | llvm/lib/Transforms/Scalar/InstructionCombining.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/llvm/lib/Transforms/Scalar/InstructionCombining.cpp b/llvm/lib/Transforms/Scalar/InstructionCombining.cpp index adab875f953..4c39485b935 100644 --- a/llvm/lib/Transforms/Scalar/InstructionCombining.cpp +++ b/llvm/lib/Transforms/Scalar/InstructionCombining.cpp @@ -5223,10 +5223,11 @@ static Value *EmitGEPOffset(User *GEP, Instruction &I, InstCombiner &IC) { // Convert to correct type. if (Op->getType() != IntPtrTy) { if (Constant *OpC = dyn_cast<Constant>(Op)) - Op = ConstantExpr::getSExt(OpC, IntPtrTy); + Op = ConstantExpr::getIntegerCast(OpC, IntPtrTy, true); else - Op = IC.InsertNewInstBefore(new SExtInst(Op, IntPtrTy, - Op->getName()+".c"), I); + Op = IC.InsertNewInstBefore(CastInst::CreateIntegerCast(Op, IntPtrTy, + true, + Op->getName()+".c"), I); } if (Size != 1) { Constant *Scale = ConstantInt::get(IntPtrTy, Size); |

