I made the ClangASTImporter owned by the target
rather than individually on behalf of each
ASTContext.  This allows the ASTImporter to know
about all containers of types, which will let it
be smarter about forwarding information about
type origins.  That means that the following
sequence of steps will be possible (after a few
more changes):

- Import a type from a Module's ASTContext into
  an expression parser ASTContext, tracking its
  origin information -- this works now.

- Because the result of the expression uses that
  type, import it from the expression parser
  ASTContext into the Target's scratch AST
  context, forwarding the origin information --
  this needs to be added.

- For a later expression that uses the result,
  import the type from the Target's scratch AST
  context, still forwarding origin information
  -- this also needs to be added.

- Use the intact origin information to complete
  the type as needed -- this works now if the
  origin information is present.

To this end, I made the following changes:

- ASTImporter top-level copy functions now
  require both a source and a destination AST
  context parameter.

- The ASTImporter now knows how to purge
  records related to an ASTContext that is
  going away.

- The Target now owns and creates the ASTImporter
  whenever the main executable changes or (in the
  absence of a main executable) on demand.


git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@144802 91177308-0d34-0410-b5e6-96231b3b80d8
7 files changed