[lld] r252167 - Avoid implicit Archive::child_iterator construction.

Rafael Espindola via llvm-commits llvm-commits at lists.llvm.org
Thu Nov 5 06:40:28 PST 2015


Author: rafael
Date: Thu Nov  5 08:40:28 2015
New Revision: 252167

URL: http://llvm.org/viewvc/llvm-project?rev=252167&view=rev
Log:
Avoid implicit Archive::child_iterator construction.

Modified:
    lld/trunk/ELF/InputFiles.cpp

Modified: lld/trunk/ELF/InputFiles.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/InputFiles.cpp?rev=252167&r1=252166&r2=252167&view=diff
==============================================================================
--- lld/trunk/ELF/InputFiles.cpp (original)
+++ lld/trunk/ELF/InputFiles.cpp Thu Nov  5 08:40:28 2015
@@ -291,14 +291,14 @@ void ArchiveFile::parse() {
 
 // Returns a buffer pointing to a member file containing a given symbol.
 MemoryBufferRef ArchiveFile::getMember(const Archive::Symbol *Sym) {
-  ErrorOr<Archive::child_iterator> ItOrErr = Sym->getMember();
-  error(ItOrErr, "Could not get the member for symbol " + Sym->getName());
-  Archive::child_iterator It = *ItOrErr;
+  ErrorOr<Archive::Child> COrErr = Sym->getMember();
+  error(COrErr, "Could not get the member for symbol " + Sym->getName());
+  const Archive::Child &C = *COrErr;
 
-  if (!Seen.insert(It->getChildOffset()).second)
+  if (!Seen.insert(C.getChildOffset()).second)
     return MemoryBufferRef();
 
-  ErrorOr<MemoryBufferRef> Ret = It->getMemoryBufferRef();
+  ErrorOr<MemoryBufferRef> Ret = C.getMemoryBufferRef();
   error(Ret, "Could not get the buffer for the member defining symbol " +
                  Sym->getName());
   return *Ret;




More information about the llvm-commits mailing list