Re: [lldb-dev] [cfe-dev] stable layout bug for imported record decls.

2018-08-15 Thread Gábor Márton via lldb-dev
Just sending again the trace, because gmail broke the lines pretty badly. (1) === "To" ASTContext A, "From" ASTContext X, MINIMAL import through ExternalASTSource inteface clang::ASTImporter::Import (this=0x13b3c50, FromT=...) at ../../git/llvm/tools/clang/lib/AST/ASTImporter.cpp:6983 lldb_privat

Re: [lldb-dev] [cfe-dev] stable layout bug for imported record decls.

2018-08-15 Thread Gábor Márton via lldb-dev
Lang, I've done some more research on this and here is what I've found so far. LLDB uses the ExternalASTSource interface and it provides its own implementation for it (lldb_private::ClangASTSource). ClangASTSource is being used in at least 3 modes (all of these uses the ASTImporter): (1) to do a

Re: [lldb-dev] [cfe-dev] stable layout bug for imported record decls.

2018-08-14 Thread Lang Hames via lldb-dev
Hi Gábor, Richard, Hi Richard, maybe my understanding is not correct, but I believe the > situation is somewhat twisted and reversed... Is this relationship recursive? (Should it be?) I.e. When ClangASTSource uses ASTImporter to minimally import a Decl, should that Decl have another ExternalASTS

Re: [lldb-dev] [cfe-dev] stable layout bug for imported record decls.

2018-08-14 Thread Gábor Márton via lldb-dev
> It might be interesting to consider how this is addressed by the > ExternalASTSource interface. There, we have separate "import the lexical > contents of this AST node (including populating the lexical declarations list > with all members, in the right order)", "import the lookup results for t

Re: [lldb-dev] [cfe-dev] stable layout bug for imported record decls.

2018-08-13 Thread Richard Smith via lldb-dev
On Mon, 13 Aug 2018 at 17:08, Lang Hames via cfe-dev wrote: > Hi Richard, > > Perhaps a better approach would be to make the "minimal" mode for the >> ASTImporter provide an ExternalASTSource to lazily complete the AST as >> needed (thereby avoiding violating the invariant, because you would >> p

Re: [lldb-dev] [cfe-dev] stable layout bug for imported record decls.

2018-08-13 Thread Lang Hames via lldb-dev
Hi Richard, Perhaps a better approach would be to make the "minimal" mode for the > ASTImporter provide an ExternalASTSource to lazily complete the AST as > needed (thereby avoiding violating the invariant, because you would > populate the lexical declarations list whenever anyone actually asks fo

Re: [lldb-dev] [cfe-dev] stable layout bug for imported record decls.

2018-08-13 Thread Richard Smith via lldb-dev
On Thu, 9 Aug 2018 at 10:47, Lang Hames via cfe-dev wrote: > Hi clang-dev, lldb-dev, > > It looks like my clang commit r305850, which modified ASTImporter to > import method override tables from an external context, introduced a new > bug which manifests as incorrect vtable layouts for LLDB expre