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 | 62ce3b31a782a6c8fbb816c75365abfacc820bb6 (patch) | |
tree | 08d68369c816ae8d0532e64fbb26b7a89925a603 /lib/Transforms | |
parent | ae7dd8004eb286039ee1eb1a35ddb1ff4eafe460 (diff) |
fix rdar://6762290, a crash compiling cxx filt with clang.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68500 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms')
-rw-r--r-- | lib/Transforms/Scalar/InstructionCombining.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/Transforms/Scalar/InstructionCombining.cpp b/lib/Transforms/Scalar/InstructionCombining.cpp index adab875f95..4c39485b93 100644 --- a/lib/Transforms/Scalar/InstructionCombining.cpp +++ b/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); |