[PATCH] D48413: [llvm-strip] Add initial support for static libraries
Alexander Shaposhnikov via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Jun 27 16:46:03 PDT 2018
alexshap added inline comments.
================
Comment at: tools/llvm-objcopy/llvm-objcopy.cpp:456
+ Error Err = Error::success();
+ for (auto &Child : Ar->children(Err)) {
+ Expected<std::unique_ptr<Binary>> ChildOrErr = Child.getAsBinary();
----------------
jhenderson wrote:
> jhenderson wrote:
> > Probably need to avoid using auto here, as the type isn't obvious to me.
> >
> > Ditto at the uses of auto further down.
> What happens if Err is non-success value? Does Ar->children return an empty list?
yes, I've looked at the implementation of child_begin, in fact, what potentially populates the Error is the ctor of the class Child (constructed inside child_begin), but after that there is a check if Error is set or not, if it's non-empty then child_end() is returned, so the range will be empty in that case.
Repository:
rL LLVM
https://reviews.llvm.org/D48413
More information about the llvm-commits
mailing list