diff options
author | Pavel Labath <pavel@labath.sk> | 2020-07-07 15:28:24 +0200 |
---|---|---|
committer | Pavel Labath <pavel@labath.sk> | 2020-07-27 12:58:22 +0200 |
commit | 1956cf1042d3c406d9e9cefe47d3b43adf2bdbe1 (patch) | |
tree | 1548e47874f4769256e31223342337609e595cc0 /llvm/lib/Bitcode/Reader/BitcodeAnalyzer.cpp | |
parent | 6701c0bf730157775736c1314758e89bfdccb14a (diff) | |
download | llvm-1956cf1042d3c406d9e9cefe47d3b43adf2bdbe1.zip llvm-1956cf1042d3c406d9e9cefe47d3b43adf2bdbe1.tar.gz llvm-1956cf1042d3c406d9e9cefe47d3b43adf2bdbe1.tar.bz2 |
[lldb/DWARF] Don't treat class declarations with children as definitions
Summary:
This effectively reverts r188124, which added code to handle
(DW_AT_)declarations of structures with some kinds of children as
definitions. The commit message claims this is a workaround for some
kind of debug info produced by gcc. However, it does not go into
specifics, so it's hard to reproduce or verify that this is indeed still a
problem.
Having this code is definitely a problem though, because it mistakenly
declares incomplete dwarf declarations to be complete. Both clang (with
-flimit-debug-info) and gcc (by default) generate DW_AT_declarations of
structs with children. This happens when full debug info for a class is
not emitted in a given compile unit (e.g. because of vtable homing), but
the class has inline methods which are used in the given compile unit.
In that case, the compilers emit a DW_AT_declaration of a class, but
add a DW_TAG_subprogram child to it to describe the inlined instance of
the method.
Even though the class tag has some children, it definitely does not
contain enough information to construct a full class definition (most
notably, it lacks any members). Keeping the class as incomplete allows
us to search for a real definition in other modules, helping the
-flimit-debug-info flow. And in case the definition is not found we can
display a error message saying that, instead of just showing an empty
struct.
Reviewers: clayborg, aprantl, JDevlieghere, shafik
Subscribers: lldb-commits
Tags: #lldb
Differential Revision: https://reviews.llvm.org/D83302
Diffstat (limited to 'llvm/lib/Bitcode/Reader/BitcodeAnalyzer.cpp')
0 files changed, 0 insertions, 0 deletions