[Flang] Generate documentation for compiler flags
authorDylan Fleming <Dylan.Fleming@arm.com>
Fri, 22 Jul 2022 16:40:50 +0000 (16:40 +0000)
committerDylan Fleming <Dylan.Fleming@arm.com>
Fri, 22 Jul 2022 17:05:04 +0000 (17:05 +0000)
commit846439dd97d45e0e08af14269708511646a9add1
treea57ecac15d86d7a21bf2752ae6df5d380c6f5df5
parent5e2d5071ffd770ad8f15a57bfbf21e691a475629
[Flang] Generate documentation for compiler flags

This patch aims to create a webpage to document
Flang's command line options on https://flang.llvm.org/docs/
in a similar way to Clang's
https://clang.llvm.org/docs/ClangCommandLineReference.html

This is done by using clang_tablegen to generate an .rst
file from Options.td (which is current shared with Clang)
For this to work, ClangOptionDocEmitter.cpp was updated
to allow specific Flang flags to be included,
rather than bulk excluding clang flags.

Note:
Some headings in the generated documentation will incorrectly
contain references to Clang, e.g.
"Flags controlling the behaviour of Clang during compilation"
This is because Options.td (Which is shared between both Clang and Flang)
contains hard-coded DocBrief sections. I couldn't find a non-intrusive way
to make this target-dependant, as such I've left this as is, and it will need revisiting later.

Reviewed By: awarzynski

Differential Revision: https://reviews.llvm.org/D129864
clang/utils/TableGen/ClangOptionDocEmitter.cpp
flang/docs/CMakeLists.txt
flang/docs/index.md
flang/include/flang/FlangOptionsDocs.td [new file with mode: 0644]