[clang] Reland: "[Frontend][PCH]-Add support for ignoring PCH options (-ignore-pch). (#142409)" (PR #143614)

Ying Yi via cfe-commits cfe-commits at lists.llvm.org
Tue Jun 10 15:53:37 PDT 2025


MaggieYingYi wrote:

> LGTM.
> 
Thanks @mizvekov.

> So what changed since the last commit is that preprocessing-only mode doesn't imply the semantics of this flag anymore.
> 

Yes, only ignore PCH option when `-ignore-pch` is used in the command line. The preprocessing-only mode (-E) doesn't ignore PCH options.

When I implemented `-ignore-pch`, I followed Visual Studio `/Y-` implementation: `-include-pch` is ignored when command is used to generate the preprocessed file (`-E`). After exploring the test failure of crash-vfs-include-pch.m, I think we should NOT ignore PCH option (`-include-pch`) when generating the pre-processed file. For example, the user might want to check the different preprocessed files between using normal header and precompiled header. 

Thanks @dyung for helping me check the build and test on MacOS. check-all passed on mac.

> I think It's good practice to mention what changed since the original landing.
>
Thanks, I will add it in commit message.



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


More information about the cfe-commits mailing list