[all-commits] [llvm/llvm-project] ef2399: [lldb] Remove FieldDecl stealing hack by rerouting...

Raphael Isemann via All-commits all-commits at lists.llvm.org
Fri Jan 10 10:18:39 PST 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: ef239972614cc3c67006f9c298fcfa841818dc77
      https://github.com/llvm/llvm-project/commit/ef239972614cc3c67006f9c298fcfa841818dc77
  Author: Raphael Isemann <teemperor at gmail.com>
  Date:   2020-01-10 (Fri, 10 Jan 2020)

  Changed paths:
    M lldb/source/Plugins/ExpressionParser/Clang/ClangASTSource.cpp
    M lldb/source/Symbol/ClangASTImporter.cpp

  Log Message:
  -----------
  [lldb] Remove FieldDecl stealing hack by rerouting indirect imports to the original AST

Summary:
This is a port of D67803 that was about preventing indirect importing to our scratch context when evaluating expressions.

D67803 already has a pretty long explanation of how this works, but the idea is that instead
of importing declarations indirectly over the expression AST (i.e., Debug info AST -> Expression AST -> scratch AST)
we instead directly import the declaration from the debug info AST to the scratch AST.

The difference from D67803 is that here we have to do this in the ASTImporterDelegate (which is our ASTImporter
subclass we use in LLDB). It has the same information as the ExternalASTMerger in D67803 as it can access the
ClangASTImporter (which also keeps track of where Decls originally came from).

With this patch we can also delete the FieldDecl stealing hack in the ClangASTSource (this was only necessary as the
indirect imports caused the creation of duplicate Record declarations but we needed the fields in the Record decl
we originally found in the scratch ASTContext).

This also fixes the current gmodules failures where we fail to find std::vector fields after an indirect import
over the expression AST (where it seems even our FieldDecl stealing hack can't save us from).

Reviewers: shafik, aprantl

Reviewed By: shafik

Subscribers: JDevlieghere, lldb-commits, mib, labath, friss

Tags: #lldb

Differential Revision: https://reviews.llvm.org/D72507




More information about the All-commits mailing list