<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/58501>58501</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            Different options for codechecker about CTU documented by clang and codechecker
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            new issue
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          dilyanpalauzov
      </td>
    </tr>
</table>

<pre>
    I compare the documentation for clang static analyzer and codechecker 6.20 about Cross-TU.
```console
$ CodeChecker analyze --help

  --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)

```
Look at https://clang.llvm.org/docs/analyzer/user-docs/CrossTranslationUnit.html . In the “PCH-based analysis → Automated CTU Analysis with CodeChecker” section the suggested command is:

> CodeChecker analyze --ctu compile_commands.json -o reports

In the “On-demand analysis → Automated CTU Analysis with CodeChecker”  section the suggested command is:

> CodeChecker analyze --ctu --ctu-ast-loading-mode on-demand compile_commands.json -o reports

That said,
* the documentation of clang suggests the default value is `load-from-pch`.  The documentation of codechecker says the default value is `parse-on-demand`;
* The argument ` --ctu-ast-loading-mode` / `--ctu-ast-mode` is spelled differently on both projects
* The value `parse-on-demand` / `on-demand` is also spelled differently.

I do not see relavant changes in codechecker between v6.20 and the upcoming next release.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJytVl2P2jgU_TXh5SpRCCQMD3lgQqtW6qqVlnmunORC3HHsyHZgmV-_104YPpahWqkIidjOPT7361xKVR_zr1CptmMawTY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