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

Erik McClure via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 24 08:45:38 PDT 2020


blackhole12 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;
----------------
aganea wrote:
> 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.
Currently, I don't handle anything. If LLD crashes, my compiler crashes. A safe invocation, however, would certainly be handy, as it would allow the compiler to emit an error message instead of crashing. 


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