[all-commits] [llvm/llvm-project] 9e9b11: [lldb] Support new libc++ __compressed_pair layout...

Michael Buch via All-commits all-commits at lists.llvm.org
Mon Sep 16 02:12:12 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 9e9b1178ca435f690381ffe8241e4bf1bb7e60fb
      https://github.com/llvm/llvm-project/commit/9e9b1178ca435f690381ffe8241e4bf1bb7e60fb
  Author: Michael Buch <michaelbuch12 at gmail.com>
  Date:   2024-09-16 (Mon, 16 Sep 2024)

  Changed paths:
    M lldb/examples/synthetic/libcxx.py
    M lldb/source/Plugins/Language/CPlusPlus/LibCxx.cpp
    M lldb/source/Plugins/Language/CPlusPlus/LibCxx.h
    M lldb/source/Plugins/Language/CPlusPlus/LibCxxList.cpp
    M lldb/source/Plugins/Language/CPlusPlus/LibCxxMap.cpp
    M lldb/source/Plugins/Language/CPlusPlus/LibCxxUnorderedMap.cpp
    M lldb/source/Plugins/Language/CPlusPlus/LibCxxVector.cpp
    M lldb/test/API/functionalities/data-formatter/data-formatter-stl/generic/list/TestDataFormatterGenericList.py

  Log Message:
  -----------
  [lldb] Support new libc++ __compressed_pair layout (#96538)

This patch is in preparation for the `__compressed_pair` refactor in
https://github.com/llvm/llvm-project/pull/76756.

This is mostly reviewable now. With the new layout we no longer need to
unwrap the `__compressed_pair`. Instead, we just need to look for child
members. E.g., to get to the underlying pointer of `std::unique_ptr` we
no longer do,
```
GetFirstValueOfCXXCompressedPair(GetChildMemberWithName("__ptr_"))

```
but instead do
```
GetChildMemberWithName("__ptr_")
```

We need to be slightly careful because previously the
`__compressed_pair` had a member called `__value_`, whereas now
`__value_` might be a member of the class that used to hold the
`__compressed_pair`. So before unwrapping the pair, we added checks for
`isOldCompressedLayout` (not sure yet whether folding this check into
`GetFirstValueOfCXXCompressedPair` is better).



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list