[PATCH] D46652: [clang-cl, PCH] Implement support for MS-style PCH through headers

Kim Gräsman via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed May 16 13:22:59 PDT 2018


kimgr added a comment.

I've done some terrible things with MSVC PCHs over the years, so I'll pile on some more questions:

- Can you test what happens when you do `clang-cl.exe /Yc stdafx.h /Tp stdafx.h`, i.e. compile the header directly as C++ code and generate .pch from it?  The normal MSVC modus operandi is to have stdafx.h included in all source files (with /Yu) and stdafx.cpp to generate it (with /Yc). That stdafx.cpp file serves no purpose, so I've played this trick to generate PCH from the header directly. If it works, it might also be useful for your tests.
- I think the current skip-warning is over-specific -- what if I put an inline function before my PCH include? A global variable? A #pragma? Or am I misunderstanding what skipping does? It seems to me that any non-comment tokens before the PCH #include should raise a warning.
- I find the "through header" terminology is a little hard to interpret, but I did find it on MSDN, so maybe it's well established.

I'll try to look more at this patch in context later.


https://reviews.llvm.org/D46652





More information about the cfe-commits mailing list