[PATCH] D50640: Fix for bug 38508 - Don't do PCH processing when only generating preprocessor output
Mike Rice via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Thu Aug 16 14:49:51 PDT 2018
mikerice added a comment.
In https://reviews.llvm.org/D50640#1201216, @thakis wrote:
> How does the gcc driver codepath handle this?
Interestingly I'd say. So the gcc PCH model uses -include pch.h to use a PCH. In the driver, -include pch.h is handled by locating a matching pch file (say pch.h.gch) and if found adds -include_pch pch.h.gch instead of -include pch.h. This occurs even when only preprocessing (-E). When preprocessing the compiler then handles the -include_pch option by opening pch.h.gch, finding the original file that created it (pch.h) and doing what -include pch.h does. Seems like it would be better handled by the driver but maybe there is a reason for it.
When we only allowed PCH with a single /FI the model was the same as gcc and it worked similarly. Since the through header/MS model allows creation of a PCH from any tokens not just a single #include, we can't handle it this way anymore.
https://reviews.llvm.org/D50640
More information about the cfe-commits
mailing list