Preserve the owning module information from DWARF in the synthesized AST
authorAdrian Prantl <aprantl@apple.com>
Wed, 4 Mar 2020 17:30:12 +0000 (09:30 -0800)
committerAdrian Prantl <aprantl@apple.com>
Thu, 9 Apr 2020 18:09:44 +0000 (11:09 -0700)
commit143d507c9ff90db93e547f0e1131e92db06e2675
tree55f1e2bf7b95941045ac736181631816a9cf827d
parent680082a408dd2df7410d77696100eac8ce9d5530
Preserve the owning module information from DWARF in the synthesized AST

Types that came from a Clang module are nested in DW_TAG_module tags
in DWARF. This patch recreates the Clang module hierarchy in LLDB and
1;95;0csets the owning module information accordingly. My primary motivation
is to facilitate looking up per-module APINotes for individual
declarations, but this likely also has other applications.

This reapplies the previously reverted commit, but without support for
ClassTemplateSpecializations, which I'm going to look into separately.

rdar://problem/59634380

Differential Revision: https://reviews.llvm.org/D75488
25 files changed:
lldb/include/lldb/Symbol/CompilerType.h
lldb/include/lldb/Symbol/TypeSystem.h
lldb/source/Plugins/ExpressionParser/Clang/ClangASTImporter.cpp
lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionDeclMap.cpp
lldb/source/Plugins/ExpressionParser/Clang/ClangExternalASTSourceCallbacks.cpp
lldb/source/Plugins/ExpressionParser/Clang/ClangExternalASTSourceCallbacks.h
lldb/source/Plugins/Language/ObjC/NSDictionary.cpp
lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCTypeEncodingParser.cpp
lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp
lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.h
lldb/source/Plugins/SymbolFile/NativePDB/PdbAstBuilder.cpp
lldb/source/Plugins/SymbolFile/PDB/PDBASTParser.cpp
lldb/source/Plugins/SystemRuntime/MacOSX/SystemRuntimeMacOSX.cpp
lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp
lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.h
lldb/source/Symbol/CompilerType.cpp
lldb/source/Symbol/Type.cpp
lldb/source/Symbol/TypeSystem.cpp
lldb/test/Shell/SymbolFile/DWARF/Inputs/ModuleOwnership/A.h [new file with mode: 0644]
lldb/test/Shell/SymbolFile/DWARF/Inputs/ModuleOwnership/B.h [new file with mode: 0644]
lldb/test/Shell/SymbolFile/DWARF/Inputs/ModuleOwnership/module.modulemap [new file with mode: 0644]
lldb/test/Shell/SymbolFile/DWARF/lit.local.cfg
lldb/test/Shell/SymbolFile/DWARF/module-ownership.mm [new file with mode: 0644]
lldb/unittests/Symbol/TestTypeSystemClang.cpp
lldb/unittests/TestingSupport/Symbol/ClangTestUtils.h