[PATCH] D80582: [lld-macho] Specify the complete set of command-line options for ld64

Shoaib Meenai via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 9 18:15:53 PDT 2020


smeenai added a comment.
Herald added a subscriber: aaron.ballman.

In D80582#2068604 <https://reviews.llvm.org/D80582#2068604>, @thakis wrote:

> Taking a step back: Maybe it makes sense to only add flags that people ask for? For example, I'm guessing nobody needs Xcode 3 and earlier flags any more. That's also the strategy that the elf and coff ports went for, and I feel it's worked fairly well there.


@gkm can chime in here as well, but my understanding was that we were only planning to add the actual support for flags once there was a use case. There's some nice things we get from having the entirety of ld64's interface expressed in our tablegen though:

- It gives a crude sense of our completeness, in terms of how many ld64 options we support.
- We can emit nicer diagnostics that distinguish between options we don't support yet, options that are deprecated and we're therefore unlikely to ever support, and options that are just completely invalid.
- It sets up the scaffolding to easily add support for more options later (since they'll already be in the tablegen).

There's some downsides though:

- Our `--help` output might become overwhelming, especially when most of it is currently unsupported options. We could hide unsupported options from the help output, or else group the help output in a way that makes the supported/unsupported status clear.
- For some options, we're likely never going to support them (e.g. the Xcode 3 and earlier flags, like you said). There's also some options that we're realistically not planning to support any time soon (although contributions are most welcome, of course). The only purpose the TableGen entries for those are serving is to get nicer diagnostics.
- Options.td gets a bit cluttered, though we can e.g. organize it along supported/unsupported categories to make it easier to read.

Does that make sense to you?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D80582





More information about the llvm-commits mailing list