[PATCH] D113534: [lld-macho] Avoid warning on -install-name if -dylib is not provided

Nico Weber via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 16 17:29:01 PST 2021


thakis added a comment.

In D113534#3135231 <https://reviews.llvm.org/D113534#3135231>, @thevinster wrote:

>> but I'd probably also add a --warn-dylib-install-name to override the no form
>
> Just so I understand here, you're suggesting to rename the current config to `--warn-dylib-install-name`?

No, I mean also adding a `--warn-dylib-install-name`

> It doesn't make sense to have a `--warn-no` and a `--warn` because by default, the warning isn't enabled.

Many many flags have both positive and negative forms, in many tools, despite one of them being the default. This is useful because:

a) If you have some hairball build where something passes the non-default flag explicitly for all targets but you want to undo it locally for some target, you can pass the other variant further on
b) It makes it easy to show the default in --help output (just put " (default)" at the end of the help text that has the default. `bin/lld-link '/?'` has many examples of this.

> The reason why I had the name `--warn-no-dylib-install-name` is to make it clear to readers that `install-name` can't used with other flags other than `-dylib` (hence the no...). I do think the name can be a bit confusing with the `--warn-no` structure, but the name, `--warn-dylib-install-name`, reads it as if the code should warn if `install-name` is used with `-dylib`. Perhaps, `--warn-install-name-no-dylib`?




Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D113534



More information about the llvm-commits mailing list