[Flang] Add a link from the docs html page to the FIR html page

The Fortran Language Reference is currently generated via tablegen,
however isn't present on flang.llvm.org/docs/

This patch adds FIRLangRef.md to the flang/docs directoy,
and adds a link to the generated HTML file in sidebar
under the 'Documentation' heading.

Reviewed By: kiranchandramohan

Differential Revision: https://reviews.llvm.org/D128650
This commit is contained in:
Dylan Fleming 2022-07-11 17:34:26 +00:00
parent 9bb18a983f
commit b9f8a1ea84
2 changed files with 19 additions and 1 deletions

View File

@ -95,7 +95,24 @@ if (LLVM_ENABLE_SPHINX)
include(AddSphinxTarget)
if (SPHINX_FOUND)
if (${SPHINX_OUTPUT_HTML})
add_sphinx_target(html flang)
add_sphinx_target(html flang SOURCE_DIR "${CMAKE_CURRENT_BINARY_DIR}/Source")
add_dependencies(docs-flang-html copy-flang-src-docs)
# Copy the flang/docs directory and the generated FIRLangRef.md file to a place in the binary directory.
# Having all the files in a single directory makes it possible for Sphinx to process them together.
# Add a dependency to the flang-doc target to ensure that the FIRLangRef.md file is generated before the copying happens.
add_custom_target(copy-flang-src-docs
COMMAND "${CMAKE_COMMAND}" -E copy_directory
"${CMAKE_CURRENT_SOURCE_DIR}"
"${CMAKE_CURRENT_BINARY_DIR}/Source"
COMMAND "${CMAKE_COMMAND}" -E copy
"${CMAKE_CURRENT_BINARY_DIR}/Dialect/FIRLangRef.md"
"${CMAKE_CURRENT_BINARY_DIR}/Source/FIRLangRef.md"
DEPENDS flang-doc)
endif()
if (${SPHINX_OUTPUT_MAN})
add_sphinx_target(man flang)

View File

@ -5,6 +5,7 @@
<ul class="want-points">
<li><a href="https://github.com/llvm/llvm-project/blob/main/flang/README.md#getting-started">Getting Started</a></li>
<li><a class="reference internal" href="FIRLangRef.html">Fortran IR Language Reference</a></li>
</ul>
<h3>Getting Involved</h3>