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 9e2e84606d
commit 46815e1da6

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