Skip to content

[lldb] Enable SWIG Doxygen Translation #147617

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
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

JDevlieghere
Copy link
Member

@JDevlieghere JDevlieghere commented Jul 8, 2025

Enable SWIG support for translating Doxygen comments found in interface and header files into a target language's normal documentation language. This feature was introduced in SWIG 4.0 and currently only supports Python (and Java). Hand-written documentation still takes precedence.

SWIG documentation: https://www.swig.org/Doc4.0/Doxygen.html

Enable SWIG support for translating Doxygen comments found in interface
and header files into a target language's normal documentation language.
This feature was introduced in SWIG 4.0 and currently only supports
Python (and Java). Hand-written documentation still takes precedence.
@llvmbot
Copy link
Member

llvmbot commented Jul 8, 2025

@llvm/pr-subscribers-lldb

Author: Jonas Devlieghere (JDevlieghere)

Changes

Enable SWIG support for translating Doxygen comments found in interface and header files into a target language's normal documentation language. This feature was introduced in SWIG 4.0 and currently only supports Python (and Java). Hand-written documentation still takes precedence.


Full diff: https://github.com/llvm/llvm-project/pull/147617.diff

1 Files Affected:

  • (modified) lldb/bindings/python/CMakeLists.txt (+1)
diff --git a/lldb/bindings/python/CMakeLists.txt b/lldb/bindings/python/CMakeLists.txt
index 69306a384e0b1..ef6def3f26872 100644
--- a/lldb/bindings/python/CMakeLists.txt
+++ b/lldb/bindings/python/CMakeLists.txt
@@ -14,6 +14,7 @@ add_custom_command(
   DEPENDS lldb-sbapi-dwarf-enums
   COMMAND ${SWIG_EXECUTABLE}
       ${SWIG_COMMON_FLAGS}
+      -doxygen
       -I${CMAKE_CURRENT_SOURCE_DIR}
       ${SWIG_EXTRA_FLAGS}
       -outdir ${CMAKE_CURRENT_BINARY_DIR}

JDevlieghere added a commit to JDevlieghere/llvm-project that referenced this pull request Jul 9, 2025
Despite our best efforts, improved documentation of the public API
remains a common request amongst its users. We have the Docstrings files
in the bindings directory, but coverage and quality varies greatly by
class.

I've noticed that we a bunch of Doxygen comments throughout LLDB, but
relatively few in the SB API, which might be explained by the
aforementioned Docstrings files. With llvm#147617, we can leverage the
Doxygen documentation to automatically generate Pydoc documentation for
the Python bindings using SWIG.

Going forward, I'd like to invest in the Doxygen documentation for the
public API. This PR is a first step in that direction. The Doxygen
comments will benefit both C++ and Python clients. Additionally, the
compiler (through the -Wdocumentation flag) can help catch quality and
correctness issues.
Copy link
Collaborator

@labath labath left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oooh, sweet.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants