hanchenye-llvm-project/lldb
Pavel Labath ad17e289f0 DWARF: Don't create lldb CompileUnits for DWARF type units
Summary:
Type units don't represent actual compilations and a lot of the
operations that we do with lldb compile units (getting their line
tables, variables, etc.) don't make sense for them. There is also a lot
more of them (sometimes over 100x), so making them more lightweight pays
off.

The main change in this patch is that we stop creating lldb CompileUnits
for DWARF type units. The trickiest part here is that the SymbolFile
interface requires that we assign consecutive sequence IDs to the
compile units we create. As DWARF type and compile units can come in any
order (in v5), this means we can no longer use 1-1 mapping between DWARF
and lldb compile units. Instead I build a translation table between the
two indices. To avoid pessimizing the case where there are no type
units, I build the translation table only in case we have at least one
type unit.

Additionaly, I also tried to strenghted type safete by replacing
DWARFUnit with DWARFCompileUnit where applicable. Though that was not
stricly necessary, I found it a good way to ensure that the
transformations I am doing here make sense. In the places where I was
changing the function signatures, and where it was obvious that the
objects being handled were not null, I also replaced pointers with
references.

There shouldn't be any major functional change with this patch. The only
change I observed is that now the types in the type units will not be
parsed when one calls Module::ParseAllDebugSymbols, unless they are
referenced from other compile units. This makes sense, given how
ParseAllDebugSymbols is implemented (it iterates over all compile
units), and it only matters for one hand-writted test where I did not
bother to reference the types from the compile units (which I now do).

Reviewers: clayborg, JDevlieghere, aprantl

Subscribers: jdoerfert, lldb-commits

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

llvm-svn: 363250
2019-06-13 11:22:47 +00:00
..
cmake NFC: Fix typo in a cmake message 2019-06-07 21:14:01 +00:00
docs [Docs] Modernize references to macOS 2019-05-30 16:46:22 +00:00
examples [lldb] Ignore null frames in lldb.macosx crashlog 2019-06-12 14:46:37 +00:00
include/lldb [Reproducers] Include lldb version in the reproducer root 2019-06-13 04:35:22 +00:00
lit DWARF: Don't create lldb CompileUnits for DWARF type units 2019-06-13 11:22:47 +00:00
lldb.xcodeproj Update AuxVector.cpp 2019-06-11 21:20:34 +00:00
lldb.xcworkspace Remove accidentally commited file in xcshareddata 2019-02-05 23:35:01 +00:00
packages/Python/lldbsuite Skip failing test on older versions of clang. 2019-06-12 21:30:00 +00:00
resources [CMake] Revised LLDB.framework builds 2019-01-04 12:46:50 +00:00
scripts Make SBDebugger.RunCommandInterpreter callable from Python. 2019-05-15 00:08:55 +00:00
source DWARF: Don't create lldb CompileUnits for DWARF type units 2019-06-13 11:22:47 +00:00
test [CMake] Folder structure for generated Xcode project to cover more targets 2019-05-28 09:29:05 +00:00
third_party/Python/module [lldb/thirdparty] Remove unneeded files, asked by Jonas. 2019-03-12 20:41:36 +00:00
tools [CMake] Two extra FOLDER properties for debugserver 2019-06-12 14:46:30 +00:00
unittests [Reproducers] Simplify providers with nested Info struct (NFC) 2019-06-12 22:17:38 +00:00
utils [CMake] Add special case for processing LLDB_DOTEST_ARGS 2019-06-07 14:32:51 +00:00
.arcconfig
.clang-format
.gitignore Add .noindex to the gitignore 2019-04-05 17:57:42 +00:00
CMakeLists.txt [CMake] LLDB.framework tools handling 2019-05-29 11:26:06 +00:00
CODE_OWNERS.txt Fix/unify the spelling of Objective-C. 2018-06-13 16:21:24 +00:00
INSTALL.txt Fix build URL in new LLDB website 2019-05-01 09:55:00 +00:00
LICENSE.TXT Fix typos throughout the license files that somehow I and my reviewers 2019-01-21 09:52:34 +00:00
use_lldb_suite_root.py