This is an archive of the discontinued LLVM Phabricator instance.

[TableGen] Update xxx-tblgen command document
ClosedPublic

Authored by Paul-C-Anagnostopoulos on Oct 26 2020, 1:05 PM.

Details

Summary

This revision updates the xxx-tblgen command document that describes the tblgen commands. It now includes the options for all three xxx-tblgen commands.

I also took the opportunity to add some cross-references between documents.

And I eliminated Deficiencies.rst, since it contained no more information that Index.rst.

I will auto-LGTM this in 48 hours.

Diff Detail

Event Timeline

Paul-C-Anagnostopoulos requested review of this revision.Oct 26 2020, 1:05 PM

I'll push this revision now.

This revision is now accepted and ready to land.Oct 28 2020, 6:05 AM
This revision was landed with ongoing or failed builds.Oct 28 2020, 6:08 AM
This revision was automatically updated to reflect the committed changes.

This generates a man page for xxx-tblgen, though arguably no such tool exists.

Couldn't we make this build a man page for llvm-tblgen and then create symlinks from clang-tblgen and mlir-tblgen? Probably not easy, at least I can't find anything right now about how to do this with Sphinx.

But perhaps we could at least go back to the original title tblgen, which matches the file name and doesn't require a user to infer that xxx is a placeholder?

How about the title "tblgen Family - Target Description to C++ Code" and then I list the three command names in the Synopsis?

How about the title "tblgen Family - Target Description to C++ Code" and then I list the three command names in the Synopsis?

Yes, this sounds good. A synopsis can indeed list different ways to invoke a command, or different commands.

Is there some way we can put the clang-tblgen and mlir-tblgen documentation into their respective projects. Seems like making someone update documentation in the llvm base project when they update tblgen in the clang/mlir project is a recipe for forgetting to do it.

The problem is all the common options. You know if we repeat those in three places they will quickly become inconsistent.

What if I add two short documents that simply refer to the primary one? Then at least a clang or mlir developer will find those documents in the appropriate docs/commandguide directory and know to update the primary document.

Should I call them clang-tblgen.rst and mlir-tblgen.rst?

The problem is all the common options. You know if we repeat those in three places they will quickly become inconsistent.

Agreed, we don't want to duplicate them.

What if I add two short documents that simply refer to the primary one? Then at least a clang or mlir developer will find those documents in the appropriate docs/commandguide directory and know to update the primary document.

Or even three? One for each variant ({llvm,clang,mlir}-tblgen), and one for the common options (let's say tblgen).

Should I call them clang-tblgen.rst and mlir-tblgen.rst?

Yes, having the same name as the commands should make them easy to find. On Linux at least this is installed as man page and it's a rule that man pages should be named like the command.

I wasn't thinking of taking out the common ones and then having four documents. Let's just have three. The main document has everything. The other two are just stubs that refer to the main document.

The are 4 tblgens. lldb has one too.

Which apparently isn't mentioned anywhere. I will add documentation for it to the main file and also include a stub that references the main file.

llvm/docs/CommandGuide/tblgen.rst