diff options
author | Chris Lattner <sabre@nondot.org> | 2011-02-11 05:37:21 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2011-02-11 05:37:21 +0000 |
commit | 603af18826d563451a640021d243286b9d66fb9c (patch) | |
tree | 5ddfa9d6603d5b65b230c62ec9fa97b4fa49aebc /llvm/lib/VMCore/Constants.cpp | |
parent | 94c8d2941f6d2b08ab965fb46a5b113ab7657a53 (diff) | |
download | bcm5719-llvm-603af18826d563451a640021d243286b9d66fb9c.tar.gz bcm5719-llvm-603af18826d563451a640021d243286b9d66fb9c.zip |
make ConstantExpr::replaceUsesOfWithOnConstant preserve the inbounds
flag. Noticed by Jin Gu Kang!
llvm-svn: 125366
Diffstat (limited to 'llvm/lib/VMCore/Constants.cpp')
-rw-r--r-- | llvm/lib/VMCore/Constants.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/llvm/lib/VMCore/Constants.cpp b/llvm/lib/VMCore/Constants.cpp index 3a5a8b06635..42c60769f5e 100644 --- a/llvm/lib/VMCore/Constants.cpp +++ b/llvm/lib/VMCore/Constants.cpp @@ -2054,7 +2054,8 @@ void ConstantExpr::replaceUsesOfWithOnConstant(Value *From, Value *ToV, Indices.push_back(Val); } Replacement = ConstantExpr::getGetElementPtr(Pointer, - &Indices[0], Indices.size()); + &Indices[0], Indices.size(), + cast<GEPOperator>(this)->isInBounds()); } else if (getOpcode() == Instruction::ExtractValue) { Constant *Agg = getOperand(0); if (Agg == From) Agg = To; |