Skip to content

Conversation

aschwaighofer
Copy link
Contributor

The standard library uses _precondition calls which have a message argument.

Allow disabling the generated cond_fail by these message arguments.

For example:

 _precondition(source >= (0 as T), "Negative value is not representable")

results in a cond_fail "Negative value is not representable".

This commit allows for specifying a file that contains these messages on each line.

/path/to/disable_cond_fails:

Negative value is not representable
Array index is out of range

The optimizer will remove these cond_fails if the swift frontend is invoked with -Xllvm -cond-fail-config-file=/path/to/disable_cond_fails.

The standard library uses `_precondition` calls which have a message argument.

Allow disabling the generated cond_fail by these message arguments.

For example:

 _precondition(source >= (0 as T), "Negative value is not representable")

Results in a `cond_fail "Negative value is not representable"`.

This commit allows for specifying a file that contains these messages on
each line.

/path/to/disable_cond_fails:
```
Negative value is not representable
Array index is out of range
```

The optimizer will remove these cond_fails if the swift frontend is invoked with
`-Xllvm -cond-fail-config-file=/path/to/disable_cond_fails`.
@aschwaighofer
Copy link
Contributor Author

@swift-ci test

@aschwaighofer aschwaighofer merged commit 2f30161 into swiftlang:main Mar 19, 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