[all-commits] [llvm/llvm-project] 00c812: [LLDB] Fix handling of bit-fields when there is a ...

Shafik Yaghmour via All-commits all-commits at lists.llvm.org
Fri Mar 27 11:28:21 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 00c8120acbac3430c3594c5b6ca3527ef9c1afca
      https://github.com/llvm/llvm-project/commit/00c8120acbac3430c3594c5b6ca3527ef9c1afca
  Author: shafik <syaghmour at apple.com>
  Date:   2020-03-27 (Fri, 27 Mar 2020)

  Changed paths:
    M lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp
    M lldb/test/API/lang/cpp/bitfields/TestCppBitfields.py
    M lldb/test/API/lang/cpp/bitfields/main.cpp

  Log Message:
  -----------
  [LLDB] Fix handling of bit-fields when there is a base class when parsing DWARF

When parsing DWARF and laying out bit-fields we currently don't take into account whether we have a base class or not.
Currently if the first field is a bit-field but the bit offset is due a field we inherit from a base class we currently
treat it as an unnamed bit-field and therefore add an extra field.

This fix will not check if we have a base class and assume that this offset is due to members we are inheriting from the base.
We are currently seeing asserts during codegen when debugging clang::DiagnosticOptions.

This assumption will fail in the case where the first field in the derived class in an unnamed bit-field. Fixing the first field
being an unnamed bit-field looks like it will require a larger change since we will need a way to track or discover the last field offset of the bases(s).

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




More information about the All-commits mailing list