Stop using getValues().
authorAlkis Evlogimenos <alkis@evlogimenos.com>
Wed, 4 Aug 2004 08:02:59 +0000 (08:02 +0000)
committerAlkis Evlogimenos <alkis@evlogimenos.com>
Wed, 4 Aug 2004 08:02:59 +0000 (08:02 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15482 91177308-0d34-0410-b5e6-96231b3b80d8

lib/VMCore/Constants.cpp

index 6800bdf68f5f6bba5306061007a7ceaee839c6cb..f679f2350819a51ed6088dbdeedf685a9b613c37 100644 (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);
   }