Skip to content

[PrintAsObjC] Add '__attribute__((return))' for 'Never' return methods #7137

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 2 commits into from
Jan 30, 2017

Conversation

rintaro
Copy link
Member

@rintaro rintaro commented Jan 30, 2017

  • Add SWIFT_NORETURN macro to the prologue. This macro is evaluated to __attribute__((noreturn)) where supported.
  • Apply SWIFT_NORETURN to isUninhabited() return type methods.

Additionally, for _cdecl functions:

  • Support SWIFT_NORETURN and SWIFT_WARN_UNUSED_RESULT.
  • Print (void) instead of () for functions that takes no arguments.

* Add 'SWIFT_NORETURN' macro to the prologue. This macro is evaluated to
  '__attribute__((noreturn))' where supported.
* Apply 'SWIFT_NORETURN' to 'isUninhabited()' methods.
…unctions

Additionally, Print '(void)' instead '()' for functions that takes no arguments.
@rintaro
Copy link
Member Author

rintaro commented Jan 30, 2017

@swift-ci Please smoke test

@rintaro rintaro changed the title Add '__attribute__((return))' for 'Never' return methods [PrintAsObjC] Add '__attribute__((return))' for 'Never' return methods Jan 30, 2017
@slavapestov
Copy link
Contributor

Nice, thanks!

@slavapestov slavapestov merged commit 9424f2b into swiftlang:master Jan 30, 2017
@rintaro rintaro deleted the printasobjc-noreturn branch January 30, 2017 12:32
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