Skip to content

[cherry-pick][stable/20230725] [lldb] Add std::chrono and std::valarray libc++ formatters #8190

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversation

Michael137
Copy link

This patch cherry-picks various libc++ formatters for std::chrono and std::valarray. It also cherry-picks some pre-requisite NFC commits to reduce merge conflicts.

@Michael137
Copy link
Author

@swift-ci test

@Michael137 Michael137 force-pushed the lldb/libcxx-formatters-to-20230725 branch 3 times, most recently from 7530adb to 667d213 Compare February 15, 2024 16:54
@Michael137
Copy link
Author

@swift-ci test

@Michael137
Copy link
Author

@swift-ci test Windows

Michael137 and others added 8 commits February 16, 2024 11:50
…roughout formatters (llvm#80133)

This avoids duplicating the logic to get the first
element of a libc++ `__compressed_pair`. This will
be useful in supporting upcoming changes to the layout
of `__compressed_pair`.

Drive-by changes:
* Renamed `m_item` to `size_node` for readability;
  `m_item` suggests it's a member variable, which it
  is not.

(cherry picked from commit 08c0eb1)
…eturn an enum (llvm#80167)

This patch changes the return value of
`SyntheticChildrenFrontend::Update` to a scoped enum that aims to
describe what the return value means.

(cherry picked from commit d7fb94b)
The code is heavily based on the vector data formatter.

(cherry picked from commit 5e9eaf8)
This adds the data formatters for chrono duration typedefs.

Reviewed By: Michael137

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

(cherry picked from commit 0e4264a)
This adds a subset of the C++20 calendar data formatters:
- day,
- month,
- year,
- month_day,
- month_day_last, and
- year_month_day.

A followup patch will add the missing calendar data formatters:
- weekday,
- weekday_indexed,
- weekday_last,
- month_weekday,
- month_weekday_last,
- year_month,
- year_month_day_last
- year_month_weekday, and
- year_month_weekday_last.

(cherry picked from commit b5f2db9)
This is a followup of llvm#76983 and adds the libc++ data formatters for
- weekday,
- weekday_indexed,
- weekday_last,
- month_weekday,
- month_weekday_last,
- year_month,
- year_month_day_last
- year_month_weekday, and
- year_month_weekday_last.

(cherry picked from commit e3fde34)
This formatter
llvm#78609
was originally passing the signed seconds (which can refer to times in
the past) with an unsigned printf formatter, and had tests that expected
to see negative values from the printf which always failed on macOS. I'm
not clear how they ever passed on any platform.

Fix the printf to print seconds as a signed value, and re-enable the
tests.

(cherry picked from commit f219cda)
@Michael137 Michael137 force-pushed the lldb/libcxx-formatters-to-20230725 branch from 667d213 to 963722e Compare February 16, 2024 11:54
@Michael137
Copy link
Author

@swift-ci test

@Michael137
Copy link
Author

@swift-ci test Windows

1 similar comment
@Michael137
Copy link
Author

@swift-ci test Windows

…e() API

This patch adapts the Swift formatters to the new return type
of the `TypeSynthetic::Update` API.

* `return false` -> `ChildCacheState::eRefetch`
* `return true` -> `ChildCacheState::eReuse`
@Michael137 Michael137 force-pushed the lldb/libcxx-formatters-to-20230725 branch from 963722e to 7ad9b8a Compare February 16, 2024 15:19
@Michael137
Copy link
Author

@swift-ci test

@Michael137
Copy link
Author

@swift-ci test Windows

3 similar comments
@Michael137
Copy link
Author

@swift-ci test Windows

@Michael137
Copy link
Author

@swift-ci test Windows

@Michael137
Copy link
Author

@swift-ci test Windows

@Michael137 Michael137 merged commit c4000d8 into swiftlang:stable/20230725 Feb 16, 2024
@Michael137 Michael137 deleted the lldb/libcxx-formatters-to-20230725 branch February 16, 2024 18:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants