Eliminate unneccesary extraneous iterators
authorChris Lattner <sabre@nondot.org>
Tue, 9 Apr 2002 19:46:27 +0000 (19:46 +0000)
committerChris Lattner <sabre@nondot.org>
Tue, 9 Apr 2002 19:46:27 +0000 (19:46 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2215 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/SparcV9/SparcV9RegInfo.cpp

index b5eef094d683986cfa1b50083ecd2f21aeb729bc..027e14f5d5a0ff776626726d5527718c683f812e 100644 (file)
@@ -342,13 +342,10 @@ void UltraSparcRegInfo::suggestRegs4MethodArgs(const Function *Meth,
                                                  // get the argument list
   const Function::ArgumentListType& ArgList = Meth->getArgumentList();
                                                  // get an iterator to arg list
-  Function::ArgumentListType::const_iterator ArgIt = ArgList.begin(); 
-
   // for each argument
-  for( unsigned argNo=0; ArgIt != ArgList.end() ; ++ArgIt, ++argNo) {    
-
+  for( unsigned argNo=0; argNo != ArgList.size(); ++argNo) {    
     // get the LR of arg
-    LiveRange *const LR = LRI.getLiveRangeForValue((const Value *) *ArgIt); 
+    LiveRange *LR = LRI.getLiveRangeForValue((const Value *)ArgList[argNo]); 
     assert( LR && "No live range found for method arg");
 
     unsigned RegType = getRegType( LR );
@@ -391,15 +388,12 @@ void UltraSparcRegInfo::colorMethodArgs(const Function *Meth,
                                                  // get the argument list
   const Function::ArgumentListType& ArgList = Meth->getArgumentList();
                                                  // get an iterator to arg list
-  Function::ArgumentListType::const_iterator ArgIt = ArgList.begin(); 
   MachineInstr *AdMI;
 
-
   // for each argument
-  for( unsigned argNo=0; ArgIt != ArgList.end() ; ++ArgIt, ++argNo) {    
-
+  for( unsigned argNo=0; argNo != ArgList.size(); ++argNo) {    
     // get the LR of arg
-    LiveRange *LR = LRI.getLiveRangeForValue(*ArgIt); 
+    LiveRange *LR = LRI.getLiveRangeForValue((Value*)ArgList[argNo]); 
     assert( LR && "No live range found for method arg");