Skip to content

Conversation

@adrian-prantl
Copy link
Contributor

Reflection metadata lookup failures are notoriously difficult to debug because there is no error handling in TypeLowering outside of compile-time #ifdef'd fprintf(stderr) calls. The nicest thing to do would be to adopt llvm::Expected<> but TypeLowering is also included in the standard library, which only has access to a tiny subset of the LLVM Support library. This patch adds a place to store a pointer to the first encountered error, which can then be converted to an llvm::Error at the API level.

(cherry picked from commit 868c991)

Explanation: Better error handling for reflection in LLDB.

Scope: LLDB

Original PR: #82244

Risk: Low. NFC

Reviewers: @tbkka

Reflection metadata lookup failures are notoriously difficult to debug
because there is no error handling in TypeLowering outside of
compile-time #ifdef'd fprintf(stderr) calls. The nicest thing to do
would be to adopt llvm::Expected<> but TypeLowering is also included
in the standard library, which only has access to a tiny subset of the
LLVM Support library. This patch adds a place to store a pointer to
the first encountered error, which can then be converted to an
llvm::Error at the API level.

(cherry picked from commit 868c991)
@adrian-prantl
Copy link
Contributor Author

test with swiftlang/llvm-project#10868
@swift-ci test

@adrian-prantl
Copy link
Contributor Author

@swift-ci test macOS

(cherry picked from commit 45198dc)
@adrian-prantl
Copy link
Contributor Author

@swift-ci test

@adrian-prantl
Copy link
Contributor Author

test with swiftlang/llvm-project#10868
@swift-ci test

@adrian-prantl adrian-prantl merged commit 637a043 into swiftlang:release/6.2 Jun 30, 2025
5 checks passed
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