Repository navigation
fix: document only a file's own declarations, parsed with all its preprocessor options - #1
Merged
Merged
Conversation
`clanguru docs` documented every function definition and class of the translation unit, including those of the headers it includes. For a GoogleTest file this lists libstdc++'s `__gthread_*` functions from gthr-default.h and gtest's `RUN_ALL_TESTS`, with those headers' line numbers, under the title of the test file. Wherever libclang finds the system headers, test_doc_structure_for_gtest_files failed on main for the same reason. The parser keeps every declaration, because the mock generator needs the headers' ones; the documentation now takes only those located in the source file.
Only -I and -D were taken from the compilation database. A directory passed as -isystem (CMake does so for SYSTEM includes, and for the generated configuration headers of some build systems) was dropped, as were -iquote, -idirafter, -include, -imacros and -U. libclang then parsed the file without those headers, and every `#ifdef` on a macro they define took the wrong branch: the documentation showed the code of a configuration the file is not built in.
ubmarco
marked this pull request as ready for review
October 1, 2026 14:10
ubmarco
added a commit
to useblocks/SPLed
that referenced
this pull request
Oct 1, 2026
…branches spl-core ce62088 is the merge of useblocks/spl-core#5 into the fork's develop, which mirrors avengineers' develop; clanguru 50a25d7 the merge of useblocks/clanguru#1 into the fork's main. Both contain the commits pinned before (5b98203, 07b8843), which were reachable only from feature branches and pull-request refs. Answers finding 1 of the review of #4.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The same two fixes as the upstream PR cuinixam#9, on the useblocks fork, which SPLed pins until upstream releases them.
fix(docs)—clanguru docsdocuments only the declarations of the source file itself, not those of the headers it includes (libstdc++'s__gthread_*functions in every GoogleTest listing).fix(compilation)— every preprocessor option of the compile command is kept (-isystem,-iquote,-idirafter,-include,-imacros,-Ubesides-I/-D), so#ifdefbranches follow the build's configuration headers.Tests for both;
pypeline runpasses (139 passed, 4 skipped). Details and the SPLed case are in cuinixam#9.