aboutsummaryrefslogtreecommitdiff
path: root/lldb.xcworkspace
diff options
context:
space:
mode:
authorSean Callanan <scallanan@apple.com>2011-12-20 23:55:47 +0000
committerSean Callanan <scallanan@apple.com>2011-12-20 23:55:47 +0000
commita75feaf0b7c7f1b4339d4355a94e1088be00e6b0 (patch)
tree00e1cb3b826a118a88868df512d63720ed22864e /lldb.xcworkspace
parent693f4001ad3b28afdd9abfe7c66f8eb5c3c85e35 (diff)
downloadlldb-a75feaf0b7c7f1b4339d4355a94e1088be00e6b0.tar.gz
Fixed a bug in the ASTImporter that affects
types that have been imported multiple times. The discussion below uses this diagram: ASTContext A B C Decl Da Db Dc ASTImporter \-Iab-/\-Iac-/ \-----Iac----/ When a Decl D is imported from ASTContext A to ASTContext B, the ASTImporter Iab records the pair <Da, Db> in a DenseMap. That way, if Iab ever encounters Da again (for example, as the DeclContext for another Decl), it can use the imported version. This is not an optimization, it is critical: if I import the field "st_dev" as part of importing "struct stat," the field must have DeclContext equal to the parent structure or we end up with multiple different Decls containing different parts of "struct stat." "struct stat" is imported once and recorded in the DenseMap; then the ASTImporter finds that same version when looking for the DeclContext of "st_dev." The bug arises when Db is imported into another ASTContext C and ASTContext B goes away. This often occurs when LLDB produces result variables for expressions. Ibc is aware of the transport of Db to Dc, but a brand new ASTImporter, Iac, is responsible for completing Dc from its source upon request. That ASTImporter has no mappings, so it will produce a clone of Dc when attempting to import its children. That means that type completion operations on Dc will fail. The solution is to create Iac as soon as Ibc imports D from B to C, and inform Iac of the mapping between Da and Dc. This allows type completion to happen correctly. git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@147016 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lldb.xcworkspace')
0 files changed, 0 insertions, 0 deletions