[llvm-commits] [llvm] r76195 - /llvm/trunk/lib/CodeGen/ELFWriter.cpp

Bruno Cardoso Lopes bruno.cardoso at gmail.com
Fri Jul 17 11:02:39 PDT 2009


Author: bruno
Date: Fri Jul 17 13:02:30 2009
New Revision: 76195

URL: http://llvm.org/viewvc/llvm-project?rev=76195&view=rev
Log:
revert one of the loops to use indicies over iterators because there are vector insertions inside the loop

Modified:
    llvm/trunk/lib/CodeGen/ELFWriter.cpp

Modified: llvm/trunk/lib/CodeGen/ELFWriter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/ELFWriter.cpp?rev=76195&r1=76194&r2=76195&view=diff

==============================================================================
--- llvm/trunk/lib/CodeGen/ELFWriter.cpp (original)
+++ llvm/trunk/lib/CodeGen/ELFWriter.cpp Fri Jul 17 13:02:30 2009
@@ -456,8 +456,8 @@
 void ELFWriter::EmitRelocations() {
 
   // Create Relocation sections for each section which needs it.
-  for (ELFSectionIter I=SectionList.begin(), E=SectionList.end(); I != E; ++I) {
-    ELFSection &S = *(*I);
+  for (unsigned i=0, e=SectionList.size(); i != e; ++i) {
+    ELFSection &S = *SectionList[i];
 
     // This section does not have relocations
     if (!S.hasRelocations()) continue;
@@ -578,8 +578,7 @@
   // Set the zero'th symbol to a null byte, as required.
   StrTab.emitByte(0);
 
-  // Walk on the symbol list and write symbol names into the
-  // string table.
+  // Walk on the symbol list and write symbol names into the string table.
   unsigned Index = 1;
   for (ELFSymIter I=SymbolList.begin(), E=SymbolList.end(); I != E; ++I) {
     ELFSym &Sym = *(*I);





More information about the llvm-commits mailing list