Skip to content

[NFC][analyzer] Update docs of CodeChecker --ctu-ast-mode #144901

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

NagyDonat
Copy link
Contributor

The documentation of the cross translation unit analysis mentioned a certain flag of CodeChecker (an external open source tool that can be used to drive the static analysis), but the information about it was obsolete: apparently the name of the flag, the names of the possible values, and the default value were all changed.

Currently CodeChecker analyze --help displays this flag as

--ctu-ast-mode {load-from-pch,parse-on-demand}
  Choose the way ASTs are loaded during CTU analysis. Only available if
  CTU mode is enabled. Mode 'load-from-pch' generates PCH format
  serialized ASTs during the 'collect' phase. Mode 'parse-on-demand'
  only generates the invocations needed to parse the ASTs. Mode 'load-
  from-pch' can use significant disk-space for the serialized ASTs,
  while mode 'parse-on-demand' can incur some runtime CPU overhead in
  the second phase of the analysis. (default: parse-on-demand)

and I tried to follow this in the commands that I adjusted.

Note that this documentation file probably contains other obsolete details as well, but I didn't try to find or fix them.

The documentation of the cross translation unit analysis mentioned a
certain flag of `CodeChecker` (an external open source tool that can be
used to drive the static analysis), but the information about it was
obsolete: apparently the name of the flag, the names of the possible
values, and the default value were all changed.

Currently `CodeChecker analyze --help` displays this flag as
```
--ctu-ast-mode {load-from-pch,parse-on-demand}
  Choose the way ASTs are loaded during CTU analysis. Only available if
  CTU mode is enabled. Mode 'load-from-pch' generates PCH format
  serialized ASTs during the 'collect' phase. Mode 'parse-on-demand'
  only generates the invocations needed to parse the ASTs. Mode 'load-
  from-pch' can use significant disk-space for the serialized ASTs,
  while mode 'parse-on-demand' can incur some runtime CPU overhead in
  the second phase of the analysis. (default: parse-on-demand)
```
and I tried to follow this in the commands that I adjusted.

Note that this documentation file probably contains other obsolete
details as well, but I didn't try to find or fix them.
@NagyDonat NagyDonat requested review from dkrupp and Szelethus June 19, 2025 14:36
@llvmbot llvmbot added clang Clang issues not falling into any other category clang:static analyzer labels Jun 19, 2025
@llvmbot
Copy link
Member

llvmbot commented Jun 19, 2025

@llvm/pr-subscribers-clang-static-analyzer-1

@llvm/pr-subscribers-clang

Author: Donát Nagy (NagyDonat)

Changes

The documentation of the cross translation unit analysis mentioned a certain flag of CodeChecker (an external open source tool that can be used to drive the static analysis), but the information about it was obsolete: apparently the name of the flag, the names of the possible values, and the default value were all changed.

Currently CodeChecker analyze --help displays this flag as

--ctu-ast-mode {load-from-pch,parse-on-demand}
  Choose the way ASTs are loaded during CTU analysis. Only available if
  CTU mode is enabled. Mode 'load-from-pch' generates PCH format
  serialized ASTs during the 'collect' phase. Mode 'parse-on-demand'
  only generates the invocations needed to parse the ASTs. Mode 'load-
  from-pch' can use significant disk-space for the serialized ASTs,
  while mode 'parse-on-demand' can incur some runtime CPU overhead in
  the second phase of the analysis. (default: parse-on-demand)

and I tried to follow this in the commands that I adjusted.

Note that this documentation file probably contains other obsolete details as well, but I didn't try to find or fix them.


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

1 Files Affected:

  • (modified) clang/docs/analyzer/user-docs/CrossTranslationUnit.rst (+2-2)
diff --git a/clang/docs/analyzer/user-docs/CrossTranslationUnit.rst b/clang/docs/analyzer/user-docs/CrossTranslationUnit.rst
index 700dac0a87064..a04b9f8c24e46 100644
--- a/clang/docs/analyzer/user-docs/CrossTranslationUnit.rst
+++ b/clang/docs/analyzer/user-docs/CrossTranslationUnit.rst
@@ -132,7 +132,7 @@ Once we have set up the `PATH` environment variable and we activated the python
 
 .. code-block:: bash
 
-  $ CodeChecker analyze --ctu compile_commands.json -o reports
+  $ CodeChecker analyze --ctu --ctu-ast-mode load-from-pch compile_commands.json -o reports
   $ ls -F
   compile_commands.json  foo.cpp  foo.cpp.ast  main.cpp  reports/
   $ tree reports
@@ -318,7 +318,7 @@ Once we have set up the `PATH` environment variable and we activated the python
 
 .. code-block:: bash
 
-  $ CodeChecker analyze --ctu --ctu-ast-loading-mode on-demand compile_commands.json -o reports
+  $ CodeChecker analyze --ctu compile_commands.json -o reports
   $ ls -F
   compile_commands.json  foo.cpp main.cpp  reports/
   $ tree reports

@NagyDonat
Copy link
Contributor Author

I'm also pinging @bruntib (a developer of CodeChecker) for a review (perhaps an informal one?).

@NagyDonat NagyDonat requested a review from steakhal June 19, 2025 14:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
clang:static analyzer clang Clang issues not falling into any other category
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants