# GSoC 2024: Improve Clang Doc

DevFeed: [GSoC 2024: Improve Clang Doc](<https://devfeed.tech/articles/gsoc-2024-improve-clang-doc-43112.md>)

Original publisher: [Read original article](<https://blog.llvm.org/posts/2024-12-04-improve-clang-doc/>)

Author: Peter Chou

Published: 2024-12-23T00:00:00Z

Content type: article

Language: en

Sources: [LLVM Project](<https://devfeed.tech/sources/the-llvm-project-blog.md>)

Topics: [Documentation](<https://devfeed.tech/topics/documentation.md>), [LibTooling](<https://devfeed.tech/topics/libtooling.md>), [software-development](<https://devfeed.tech/topics/software-development.md>), [Tool](<https://devfeed.tech/topics/tool.md>), [Software Testing](<https://devfeed.tech/topics/software-testing.md>), [LLVM](<https://devfeed.tech/topics/llvm.md>), [C++](<https://devfeed.tech/topics/c-plus-plus.md>)

Tags: [c-plus-plus](<https://devfeed.tech/tags/c-plus-plus.md>), [clang](<https://devfeed.tech/tags/clang.md>), [clang-doc](<https://devfeed.tech/tags/clang-doc.md>), [gsoc](<https://devfeed.tech/tags/gsoc.md>), [libtooling](<https://devfeed.tech/tags/libtooling.md>), [llvm](<https://devfeed.tech/tags/llvm.md>), [make](<https://devfeed.tech/tags/make.md>), [markdown](<https://devfeed.tech/tags/markdown.md>), [testing](<https://devfeed.tech/tags/testing.md>)

## AI overview

A Google Summer of Code 2024 project improved Clang-Doc, an LLVM libTooling-based documentation generator. The work addressed usability issues in generated HTML, added support for more C++ constructs, expanded end-to-end tests, and improved performance after identifying excessive runtime, memory use, and crashes on large codebases.

## Source excerpt

Hi, my name is Peter, and this year I was involved in Google Summer of Code 2024. I worked on improving the Clang-Doc documenation generator Mentors: Petr Hosek and Paul Kirth Project Background Clang-Doc is a documentation generator developed on top of libtooling, as analternative to Doxygen. Development started in 2018 and continued through 2019,however, it has since stalled. Currently, the tool can generate HTML, YAML, and markdown but the generated output has usability issues. This GSOC project aimed to address the pain points regarding the output of the HTML, by adding support for various C++ constructs and reworking the CSS of the HTML output to be more user-friendly. Work Done The original scope of the project was to improve the output of Clang-Doc's generation. However during testing the tool was significantly slower than expected which made developing features for the tool impossible.Documentation generation for the LLVM codebase was taking upwards of 10 hours on my local machine. Additionally, the tool utilized a lot of memory and was prone to crashing with an out-of-memory error. Similar tools such as Doxygen and Hdoc ran in comparatively less time for the same codebase. This pointed to a significant bottleneck within Clang-Doc's code path when generating large-scale software projects. Due to this the project scope quickly changed to improving the runtime of Clang-Doc so that it could run much faster. It was only during the latter half of the project did the scope changed back to improving Clang-Doc's generation. Added More Test Cases to Clang-Doc test suite Clang-Doc previously had tests which did not test the full scope of the the HTML or Markdown output. I added more end-to-end tests to make sure that in the process of optimizing documentation generation we were not degrading the quality or functionality of the tool. In summary, I added four comprehensive tests that covered all features that we were not testing such as testing the generation for Enums,