[PATCH] D139559: [lld/mac] Abort link immediately on invalid -undefined argument

Nico Weber via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Dec 8 05:30:31 PST 2022


thakis added inline comments.


================
Comment at: lld/MachO/Driver.cpp:1611-1612
   config->undefinedSymbolTreatment = getUndefinedSymbolTreatment(args);
+  if (errorCount())
+    return false;
 
----------------
int3 wrote:
> how about changing the `error()` call in `getUndefinedSymbolTreatment` to `fatal()` instead? That way the motivation for the early exit is clearer + we won't accidentally apply this early exit to other error messages in the future
That's a good idea, thanks. Done.

It does have the effect that `-undefined bogus` with `-fatal_warnings` no longer aborts early, while it did previously. That's probably fine.


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

https://reviews.llvm.org/D139559



More information about the llvm-commits mailing list