This is an archive of the discontinued LLVM Phabricator instance.

[clang][doc] Rescue some deleted bits of the command-line reference.
ClosedPublic

Authored by efriedma on Jun 7 2023, 1:49 PM.

Details

Summary

Back when the command-line reference rst was in-tree, a lot of people missed the "DO NOT EDIT" comment at the top, and then changes were effectively reverted when the file was regenerated. I went through the changes, and rescued the interesting bits of documentation that were destroyed. (Noticed when I was trying to find our documentation for -fno-delete-null-pointer-checks, but it was missing.)

Additional notes:

  • I'm intentionally leaving out D73459 because I'm not sure how to port the changes to -march.
  • Some options have help text in Options.td, but that text doesn't make it into the reference. Incomplete list of such options: -fc++-static-destructors, -frtti-data, -fplt, -fstrict-return, -funique-section-names, -fuse-init-array. I think there's something specifically weird with boolean options, but not completely sure what's happening.

Diff Detail

Event Timeline

efriedma created this revision.Jun 7 2023, 1:49 PM
Herald added a project: Restricted Project. · View Herald TranscriptJun 7 2023, 1:49 PM
Herald added a subscriber: dschuff. · View Herald Transcript
efriedma requested review of this revision.Jun 7 2023, 1:49 PM
Herald added a project: Restricted Project. · View Herald TranscriptJun 7 2023, 1:49 PM
Herald added a subscriber: aheejin. · View Herald Transcript

Another argument for not having generated file in-tree. Thanks for doing this.

This revision is now accepted and ready to land.Jun 7 2023, 10:53 PM

These changes LGTM, thank you!

@MaskRay, @jansvoboda11 -- I think we need to figure out a better strategy for documenting compiler options. We have documentation that lives here in Options.td, but we also have documentation in UsersManual.rst; it would be good for us to have a unified place for option documentation so users don't have to click around so much (and so we don't accidentally wind up with conflicting documentation in two places). My suggestion is that we use Options.td to generate all of the docs, and move what we've got in UsersManual.rst (and elsewhere, if we find it) into here. Additionally, I think we should take any long-form documentation and split it between ClangOptionDocs.td and Options.td similar to how we already do for Attr.td and AttrDocs.td or Diagnostic*Kinds.td and DiagnosticDocs.td (so the documentation is generated from a single source, but we don't have to clutter that file up with longer documentation strings). Finally, I think we should begin to require documentation for all new user-facing driver options as part of the code review process (we can even enforce this by failing a build if a driver option has no associated documentation, similar to how we do it for attributes; we use an Undocumented placeholder for all the existing options without documentation so those can be backfilled over time). WDYT?

aaron.ballman accepted this revision.Jun 8 2023, 4:54 AM