[clang] [docs] Pass -c when generating a PCH file (PR #226850)

via cfe-commits cfe-commits at lists.llvm.org
Sun Sep 27 17:10:49 PDT 2026


llvmorg-github-actions[bot] wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-clang

Author: Fangrui Song (MaskRay)

<details>
<summary>Changes</summary>

Without options like -fsyntax-only/-E/-S/-c, the driver runs in link
mode, and a header-only command line produces a PCH only incidentally: a
linker option such as -lm or -Wl,..., including one from a config file,
adds a link job. Use -c in the PCH examples.

Also fix two broken examples: -ignore-pch is a driver option (cc1
rejects -Xclang -ignore-pch), and the relocatable PCH example is
missing -o. In LibASTImporter.md, generate the C++ AST files with
-emit-ast instead of treating .cpp files as headers.

LLM-aided

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


2 Files Affected:

- (modified) clang/docs/LibASTImporter.md (+2-2) 
- (modified) clang/docs/UsersManual.md (+10-10) 


``````````diff
The server is unavailable at this time. Please wait a few minutes before you try again.
``````````

</details>


https://github.com/llvm/llvm-project/pull/226850


More information about the cfe-commits mailing list