Skip to content

[IRGen] Allow configuring a panic function to call instead of trapping #41449

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
merged 3 commits into from
Feb 21, 2022

Conversation

lorentey
Copy link
Member

Add a new frontend option (called -trap-function <name>, similar to Clang’s existing -ftrap-function) that specifies a function to call instead of trapping.

When the option is used, the compiler will emit a call to the specified function every time it would have otherwise emitted a trap instruction. The function must have no parameters and it must never return.

rdar://89125883

@lorentey lorentey requested a review from jckarter February 18, 2022 07:04
Add a new frontend option (called `-trap-function <name>`, similar to Clang’s existing `-ftrap-function`) that specifies a function to call instead of trapping.

When the option is used, the compiler will emit a call to the specified function every time it would have otherwise emitted a trap instruction. The function must have no parameters and it must never return.

rdar://89125883
@lorentey

This comment was marked as outdated.

@lorentey

This comment was marked as outdated.

@lorentey

This comment was marked as outdated.

@lorentey

This comment was marked as outdated.

@lorentey

This comment was marked as outdated.

@lorentey

This comment was marked as outdated.

@lorentey
Copy link
Member Author

@swift-ci test

@lorentey lorentey merged commit e24bb55 into swiftlang:main Feb 21, 2022
@lorentey lorentey deleted the custom-traps branch February 21, 2022 20:46
lorentey added a commit to lorentey/swift that referenced this pull request May 7, 2022
…set a trap function in the stdlib

(The underlying functionality was added in swiftlang#41445 and swiftlang#41449, respectively.)
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.

1 participant