Skip to content

🍒 [lldb] upgrade GetIndexOfChildWithName to use llvm::Expected and ExtractIndexFromString to use std::optional #10642

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

Open
wants to merge 2 commits into
base: swift/release/6.2
Choose a base branch
from

Conversation

charles-zablit
Copy link

@charles-zablit charles-zablit commented May 8, 2025

…m#136693)

This patch replaces the use of `UINT32_MAX` as the error return value of
`GetIndexOfChildWithName` with `llvm::Expected`.

1. Replace `CalculateNumChildrenIgnoringErrors` with
`CalculateNumChildren`. See [this
comment](llvm#136693 (comment)).
2. Update `lldb_private::formatters::ExtractIndexFromString` to use
`llvm::Expected`. See [this
comment](llvm#136693 (comment)).
3. Create a new class which carries both user and internal errors. See
[this
comment](llvm#136693 (comment)).
@charles-zablit charles-zablit requested a review from a team as a code owner May 8, 2025 11:49
@charles-zablit
Copy link
Author

Warning about a merge conflict:

This line was not present in the swiftlang repo:
https://github.com/llvm/llvm-project/blob/c290f48a45df5dc66c9cdc3f3b340cb0e3fc3937/lldb/source/Plugins/Language/CPlusPlus/GenericOptional.cpp#L40-L41

I removed it from the merge conflict, but that might be a mistake.

@adrian-prantl
Copy link

@swift-ci test

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.

2 participants