Stop using getValues().

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15482 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Alkis Evlogimenos 2004-08-04 08:02:59 +00:00
parent a834fe24d5
commit 9e4c681354

View File

@ -439,9 +439,9 @@ void ConstantArray::replaceUsesOfWithOnConstant(Value *From, Value *To,
assert(isa<Constant>(To) && "Cannot make Constant refer to non-constant!");
std::vector<Constant*> Values;
Values.reserve(getValues().size()); // Build replacement array...
for (unsigned i = 0, e = getValues().size(); i != e; ++i) {
Constant *Val = cast<Constant>(getValues()[i]);
Values.reserve(getNumOperands()); // Build replacement array...
for (unsigned i = 0, e = getNumOperands(); i != e; ++i) {
Constant *Val = getOperand(i);
if (Val == From) Val = cast<Constant>(To);
Values.push_back(Val);
}
@ -464,9 +464,9 @@ void ConstantStruct::replaceUsesOfWithOnConstant(Value *From, Value *To,
assert(isa<Constant>(To) && "Cannot make Constant refer to non-constant!");
std::vector<Constant*> Values;
Values.reserve(getValues().size());
for (unsigned i = 0, e = getValues().size(); i != e; ++i) {
Constant *Val = cast<Constant>(getValues()[i]);
Values.reserve(getNumOperands()); // Build replacement array...
for (unsigned i = 0, e = getNumOperands(); i != e; ++i) {
Constant *Val = getOperand(i);
if (Val == From) Val = cast<Constant>(To);
Values.push_back(Val);
}