[PATCH] D69585: PerformPendingInstatiations() already in the PCH

Reid Kleckner via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Jan 13 15:08:03 PST 2020


rnk added a comment.

I'm interested in making clang do this, but I think this needs significantly more work until this is ready to land. It needs in-tree tests. I assumed we'd want to hook it up to `clang-cl /Yc` and `/Yu`.



================
Comment at: clang/include/clang/Basic/LangOptions.def:163
 BENIGN_LANGOPT(CacheGeneratedPCH, 1, 0, "cache generated PCH files in memory")
+BENIGN_LANGOPT(PCHInstantiateTemplates, 1, 0, "performing pending template instantiations already while building a pch")
 COMPATIBLE_LANGOPT(ModulesDeclUse    , 1, 0, "require declaration of module uses")
----------------
I think both sides of a PCH user and creator will need to agree on this, so this isn't a "benign" langopt, is it? This is a regular one, and we should diagnose mismatches between the PCH creation and use.


================
Comment at: clang/lib/Sema/Sema.cpp:985-986
+
+    // FIXME: Instantiating implicit templates already in the PCH breaks some
+    // OpenMP-specific code paths, see https://reviews.llvm.org/D69585 .
+    if(LangOpts.PCHInstantiateTemplates && !LangOpts.OpenMP) {
----------------
This really deserves to be debugged before we land it.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D69585/new/

https://reviews.llvm.org/D69585





More information about the cfe-commits mailing list