Skip to content

SIL: Add an option to print all the cond_fail message strings encountered during IRGenPrepare #80167

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

Merged

Conversation

aschwaighofer
Copy link
Contributor

Run the swift-frontend in a mode that will generate LLVM IR adding the option -print-cond-fail-messages will dump all cond_fail message strings encountered in the SIL.

% swift-frontend -Xllvm -print-cond-fail-messages -emit-ir/-c ...
cond_fail message encountered: Can't take a prefix of negative length from a collection
cond_fail message encountered: Range out of bounds
cond_fail message encountered: Array index is out of range

…ered during IRGenPrepare

Run the swift-frontend in a mode that will generate LLVM IR adding the
option `-print-cond-fail-messages` will dump all cond_fail message strings
encountered in the SIL.

```
% swift-frontend -Xllvm -print-cond-fail-messages -emit-ir/-c ...
cond_fail message encountered: Can't take a prefix of negative length from a collection
cond_fail message encountered: Range out of bounds
cond_fail message encountered: Array index is out of range
```
@aschwaighofer
Copy link
Contributor Author

@swift-ci test

@aschwaighofer
Copy link
Contributor Author

@swift-ci test macOS

Copy link
Contributor

@eeckstein eeckstein left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@aschwaighofer
Copy link
Contributor Author

@swift-ci test macOS

@aschwaighofer aschwaighofer enabled auto-merge March 21, 2025 15:34
@aschwaighofer aschwaighofer merged commit 7da2333 into swiftlang:main Mar 21, 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