Skip to content

[clang] Automatically generate builtin documentation from a .td File. #139039

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
StevenYangCC opened this issue May 8, 2025 · 10 comments
Open
Labels
clang Clang issues not falling into any other category documentation

Comments

@StevenYangCC
Copy link

StevenYangCC commented May 8, 2025

Currently, the builtin documentation is hand written into .rst. It would be better if that documentation could live on the builtin in the .td file, similar to how already works for things like attributes and warnings.

@llvmbot llvmbot added the clang Clang issues not falling into any other category label May 8, 2025
@AaronBallman
Copy link
Collaborator

I'm not certain what this issue is asking for. Which documentation should come from a .def file? (We already table generate much of our documentation, such as attributes, command line options, and diagnostic flags.)

@jhuber6
Copy link
Contributor

jhuber6 commented May 8, 2025

I'm not certain what this issue is asking for. Which documentation should come from a .def file? (We already table generate much of our documentation, such as attributes, command line options, and diagnostic flags.)

They also opened #139036 and #139037 which makes me think this is just LLM generated spam.

@StevenYangCC
Copy link
Author

StevenYangCC commented May 9, 2025

It would be very useful to automatically generate documentation for the builtin interface based on the .def description.

@jhuber6
Copy link
Contributor

jhuber6 commented May 9, 2025

It would be very useful to automatically generate documentation for the builtin interface based on the .def description.

We already do that in Tablegen. The real suggestion would be to port over all of our remaining .def files toy Tablegen.

@StevenYangCC
Copy link
Author

It would also be useful if the .def files could all be ported to Tablegen.

@StevenYangCC
Copy link
Author

StevenYangCC commented May 9, 2025

@AaronBallman The readability of the current builtin interface described in a .def file is terrible.

@jhuber6
Copy link
Contributor

jhuber6 commented May 9, 2025

@AaronBallman The readability of the current builtin interface described in a .def file is terrible.

Feel free to make a PR that ports your favorite .def file to Tablegen. Like #122873 for example.

@StevenYangCC
Copy link
Author

@jhuber6 I'd like to throw this out here for discussion first.

@StevenYangCC
Copy link
Author

@AaronBallman The readability of the current builtin interface described in a .def file is terrible.

Feel free to make a PR that ports your favorite .def file to Tablegen. Like #122873 for example.

But there are no comments here to fully describe the function and parameters, either.

@AaronBallman AaronBallman changed the title [clang] Automatically Generate Interface User Documentation Based on a .def File. [clang] Automatically generate builtin documentation from a .td File. May 9, 2025
@AaronBallman
Copy link
Collaborator

Thanks for the clarification! I've made some edits to the issue so it's easier for others to understand without having to read all the comments.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
clang Clang issues not falling into any other category documentation
Projects
None yet
Development

No branches or pull requests

5 participants