[PATCH] D87987: [llvm-objcopy][NFC] allow to redefine error handling.

Alexey Lapshin via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 21 04:01:20 PDT 2020


avl added a comment.

> Do we actually have any non-fatal errors in llvm-objcopy etc currently?

yes. there are some. f.e. CopyConfig.cpp::parseObjcopyOptions  uses ErrorCallback to decide whether the error would be fatal or non-fatal.
I can leave this callback for places where it is already used and convert interfaces into Expected and Error usage in other places.

> If not, I think a better approach would be to simply bubble up the errors via Expected and Error usage, and handle the failures in the client code directly.

Ok. Currently the error is reported inplace and the program just dies(exit(1)). To change this behavior it would be necessary to update many interfaces(f.e. writeSectionData()->SectionBase::accept()->SectionVisitor::visitor()). 
Will do that.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D87987/new/

https://reviews.llvm.org/D87987



More information about the llvm-commits mailing list