This is an archive of the discontinued LLVM Phabricator instance.

[Docs][llvm-link] Add documentation an CLI options
ClosedPublic

Authored by aidengrossman on Jul 20 2023, 5:43 PM.

Details

Summary

Currently the documentation on the command line options for llvm-link is quite sparse. This patch adds in the options that the tool understands that aren't currently present in the documentation.

Diff Detail

Event Timeline

aidengrossman created this revision.Jul 20 2023, 5:43 PM
Herald added a project: Restricted Project. · View Herald TranscriptJul 20 2023, 5:43 PM
aidengrossman requested review of this revision.Jul 20 2023, 5:43 PM
Herald added a project: Restricted Project. · View Herald TranscriptJul 20 2023, 5:43 PM

Was trying to reference the online documentation to look at some flags but didn't see the options that I was looking for and had to go digging through the source code to find it, so I decided to write up a patch. I've added all the missing options which might not be completely ideal as there are quite a few that have been implemented mainly to be used for llvm-lit tests rather than for public consumption, but I felt like there wasn't a large reason not to include them. Definitely interested in hearing other opinions though.

Ping on this patch when reviewers have a chance. Thanks!

tejohnson accepted this revision.Jul 31 2023, 11:09 AM

lgtm with a clarification suggested below.

llvm/docs/CommandGuide/llvm-link.rst
86

maybe: "Specify the path to a file containing the module summary index with the results of an earlier ThinLTO link. Required with -import." (i.e. make it clearer that llvm-link is not itself doing the ThinLTO link, but this file should have the results of one done earlier).

This revision is now accepted and ready to land.Jul 31 2023, 11:09 AM
MaskRay added inline comments.Jul 31 2023, 12:20 PM
llvm/docs/CommandGuide/llvm-link.rst
60

For user-facing utilities (llvm-link is probably not yet), we advertise double-dash long options.

aidengrossman added inline comments.Aug 2 2023, 11:24 AM
llvm/docs/CommandGuide/llvm-link.rst
60

Just to be clear, you're saying that we should keep the single-dash long options here? Or do you want me to change the documentation to use double-dash long options?

MaskRay added inline comments.Aug 2 2023, 12:15 PM
llvm/docs/CommandGuide/llvm-link.rst
60

Yes, consider documenting just double-dash long options.

aidengrossman marked 2 inline comments as done.

Address reviewer feedback.

  • Update message for --summary-index
  • Use double dash long messages

@MaskRay If you don't mind taking a look at this and making sure my most recent changes matches what you expect.

There are also quite a few other tools (maybe even most) that are still using single-dash options in their documentation. I'll probably open up some patches to fix that so the documentation is more consistent in a little bit.

aidengrossman marked an inline comment as done.Aug 4 2023, 5:30 PM
MaskRay accepted this revision.Aug 4 2023, 7:47 PM
This revision was automatically updated to reflect the committed changes.