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, 2 Apr 2020 00:46:02 +0000 (17:46 -0700)
commit4354dfbdf5c8510a7ddff10ae67a28e16cf7cc79
tree59e49d814a141688bd6404ee6ab1d3adfb8f5880
parentf4754ea0ed7ddc35042bacbc47d661bfe660f132
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
sets 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.

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