[llvm] r251876 - This never returns end(), simplify to use Child instead of iterator. NFC.
Rafael Espindola via llvm-commits
llvm-commits at lists.llvm.org
Mon Nov 2 17:20:45 PST 2015
Author: rafael
Date: Mon Nov 2 19:20:44 2015
New Revision: 251876
URL: http://llvm.org/viewvc/llvm-project?rev=251876&view=rev
Log:
This never returns end(), simplify to use Child instead of iterator. NFC.
Modified:
llvm/trunk/include/llvm/Object/Archive.h
llvm/trunk/lib/Object/Archive.cpp
Modified: llvm/trunk/include/llvm/Object/Archive.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Object/Archive.h?rev=251876&r1=251875&r2=251876&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Object/Archive.h (original)
+++ llvm/trunk/include/llvm/Object/Archive.h Mon Nov 2 19:20:44 2015
@@ -142,7 +142,7 @@ public:
, SymbolIndex(symi)
, StringIndex(stri) {}
StringRef getName() const;
- ErrorOr<child_iterator> getMember() const;
+ ErrorOr<Child> getMember() const;
Symbol getNext() const;
};
Modified: llvm/trunk/lib/Object/Archive.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Object/Archive.cpp?rev=251876&r1=251875&r2=251876&view=diff
==============================================================================
--- llvm/trunk/lib/Object/Archive.cpp (original)
+++ llvm/trunk/lib/Object/Archive.cpp Mon Nov 2 19:20:44 2015
@@ -402,7 +402,7 @@ StringRef Archive::Symbol::getName() con
return Parent->getSymbolTable().begin() + StringIndex;
}
-ErrorOr<Archive::child_iterator> Archive::Symbol::getMember() const {
+ErrorOr<Archive::Child> Archive::Symbol::getMember() const {
const char *Buf = Parent->getSymbolTable().begin();
const char *Offsets = Buf;
if (Parent->kind() == K_MIPS64)
@@ -447,8 +447,7 @@ ErrorOr<Archive::child_iterator> Archive
}
const char *Loc = Parent->getData().begin() + Offset;
- child_iterator Iter(Child(Parent, Loc));
- return Iter;
+ return Child(Parent, Loc);
}
Archive::Symbol Archive::Symbol::getNext() const {
More information about the llvm-commits
mailing list