[llvm] r241727 - Use a raw_svector_ostream and simplify a loop. NFC.

Rafael Espindola rafael.espindola at gmail.com
Wed Jul 8 14:07:18 PDT 2015


Author: rafael
Date: Wed Jul  8 16:07:18 2015
New Revision: 241727

URL: http://llvm.org/viewvc/llvm-project?rev=241727&view=rev
Log:
Use a raw_svector_ostream and simplify a loop. NFC.

Modified:
    llvm/trunk/lib/Object/ArchiveWriter.cpp

Modified: llvm/trunk/lib/Object/ArchiveWriter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Object/ArchiveWriter.cpp?rev=241727&r1=241726&r2=241727&view=diff
==============================================================================
--- llvm/trunk/lib/Object/ArchiveWriter.cpp (original)
+++ llvm/trunk/lib/Object/ArchiveWriter.cpp Wed Jul  8 16:07:18 2015
@@ -183,14 +183,11 @@ writeSymbolTable(raw_fd_ostream &Out, ob
     return 0;
 
   unsigned StartOffset = 0;
-  unsigned MemberNum = 0;
-  std::string NameBuf;
-  raw_string_ostream NameOS(NameBuf);
+  SmallString<128> NameBuf;
+  raw_svector_ostream NameOS(NameBuf);
   unsigned NumSyms = 0;
   LLVMContext Context;
-  for (ArrayRef<NewArchiveIterator>::iterator I = Members.begin(),
-                                              E = Members.end();
-       I != E; ++I, ++MemberNum) {
+  for (unsigned MemberNum = 0, N = Members.size(); MemberNum < N; ++MemberNum) {
     MemoryBufferRef MemberBuffer = Buffers[MemberNum];
     ErrorOr<std::unique_ptr<object::SymbolicFile>> ObjOrErr =
         object::SymbolicFile::createSymbolicFile(





More information about the llvm-commits mailing list