python3kgae marked an inline comment as done. python3kgae added inline comments.
================ Comment at: clang/include/clang/Sema/HLSLExternalSemaSource.h:58 +/// them before we initialize the ExternalSemaSource base class. +struct ChainedHLSLExternalSemaSourceMembers { + ChainedHLSLExternalSemaSourceMembers(ExternalSemaSource *ExtSema) ---------------- beanz wrote: > python3kgae wrote: > > beanz wrote: > > > IIUC, this code just exists to make sure that the `ASTReader` > > > deserializes before the external sema source starts adding things. Is > > > that correct? > > > > > > If so, you don't need to do this, instead you can just add this code to > > > `InitializeSema()` to force the `ASTReader` to de-serialize the decls: > > > > > > ``` > > > // If the translation unit has external storage force external decls to > > > load. > > > if (AST.getTranslationUnitDecl()->hasExternalLexicalStorage()) > > > (void)AST.getTranslationUnitDecl()->decls_begin(); > > > ``` > > Still need this to make sure HLSLSema and ExternalSema are initialized > > before MultiplexExternalSemaSource. > In FrontendAction, where you are creating the Chained source, you can instead > create a Multiplex source, and put the PCH external source in as the first > source and the HLSL one second. The PCH will get initialized first, the HLSL > one can force the PCH one to populate the decls. Asked how to resolve the issue in https://discourse.llvm.org/t/is-it-possible-for-multiplexexternalsemasource-to-own-the-sources/64990 Hope someone can explain why multiplexexternalsemasource doesn't own the Sources. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D132421/new/ https://reviews.llvm.org/D132421 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits