[Lldb-commits] [PATCH] D64844: [Target] Remove Target::GetScratchClangASTContext

Jim Ingham via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Wed Jul 17 10:23:13 PDT 2019

jingham requested changes to this revision.
jingham added a comment.
This revision now requires changes to proceed.

This seems partly wrong to me.  The point is that the Target holds keeps scratch AST contexts for all the languages it supports.  They are the central repository for the accumulation of effects of expressions evaluated while that target is alive.  For instance, all the user defined types and variables go there. The Target also manages its lifecycle.   So all the Scratch AST Contexts are properly owned by the target.  For instance, in the swift case if there's a module that we can't import, we have to fall back to making an AST Context for each module we can successfully import and dispatching expressions to the appropriate one of those.

This move doesn't keep all the clients from knowing they are getting their hands on a ClangASTContext, so it doesn't seem like it achieves much hiding.  All it does is conceal the ownership of the scratch AST context for C-family languages.



More information about the lldb-commits mailing list