Doxygen for TableGen files

Would it be helpful to be able to use Doxygen on TableGen .td files?

Would it be helpful to be able to use Doxygen on TableGen .td files?

Maybe?

I've been thinking in the past that it would perhaps be nice to
document intrinsics in the .td files. Certainly for target-specific
intrinsics this is the case. If we could move descriptions of
intrinsics from LangRef.rst to Doxygen generated from .td files, that
would be slightly nicer than what we have today.

Though perhaps a first question to ask is to what extent people use
Doxygen on the C++ part of LLVM today :slight_smile:

Cheers,
Nicolai

We can ponder these issues more when I return from the beach the week after next. I will start a "How Can We Improve TableGen" thread to solicit ideas. I have noticed a few C++ files with little to no Doxygenation.

And thank you so much for committing my changes today!

Nicolai Hähnle via llvm-dev <llvm-dev@lists.llvm.org> writes:

Though perhaps a first question to ask is to what extent people use
Doxygen on the C++ part of LLVM today :slight_smile:

I personally only use it on very rare occasion, mostly because it's kind
of unwieldy (difficult to navigate, search, etc.). I have hopes that
maybe clang-doc will get to a better place but of course that wouldn't
work on .td files.

I'm much more likely to just look through comments in code because I'm
already in my editor and it's easy to pull up a file I need. Before
working on a new documentation tool for .td files I'd prefer we just
comment them better.

                    -David

I second David’s statements.

IMHO, sophisticated tools like Doxygen provides just a platform to document but as developers we have to document. We should follow a strict practice of documentation for each part of the code we write. Until this happens, no tool will ever help (unless its AI based which can automagically generate comments!)
If we follow such practice even code comments would be useful.