make ConstantExpr::replaceUsesOfWithOnConstant preserve the inbounds

flag.  Noticed by Jin Gu Kang!

llvm-svn: 125366
This commit is contained in:
Chris Lattner 2011-02-11 05:37:21 +00:00
parent 94c8d2941f
commit 603af18826
1 changed files with 2 additions and 1 deletions

View File

@ -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;