[PATCH] D70378: [LLD][COFF] Cover usage of LLD as a library

Alexandre Ganea via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 24 07:58:18 PDT 2020


aganea added inline comments.


================
Comment at: lld/tools/lld/lld.cpp:167
+// Similar to lldMain except that exceptions are caught.
+SafeReturn safeLldMain(int argc, const char **argv) {
+  int r = 0;
----------------
blackhole12 wrote:
> aganea wrote:
> > @blackhole12 Since this goal of this patch is in part to fix an issue you've raised, is this API in line with what you're expecting? (when using LLD as a library)
> I'm not sure why you are asking about this part in particular. When using LLD as a library, I call the appropriate `::link()` function directly so I can pass in additional arguments like the error stream or standard out stream. I cannot use `lldMain` or `safeLldMain` for my use case.
That answers my question. How do you handle crashes or signals in that case? If you think `safeLldMain` can be useful to you, I could also add two extra arguments to redirect the std streams.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D70378



More information about the llvm-commits mailing list