Skip to content

Add #include "swift/Basic/Assertions.h" to a lot of source files #74184

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
Jun 20, 2024

Conversation

tbkka
Copy link
Contributor

@tbkka tbkka commented Jun 6, 2024

This makes the new assertion macros from #73675 available throughout the project.

This does not change any current behavior. The new assertion macros have different names and will have no impact until folks start using ASSERT, CONDITIONAL_ASSERT, and DEBUG_ASSERT in code instead of the old assert macro.

Although I don't plan to bring over new assertions wholesale into the current release branch, it's entirely possible that various changes in main will use the new assertions; having this basic support in the release branch will simplify that. (This is why I'm adding the includes as a separate pass from rewriting the individual assertions, to make it possible to implement the support in the release branch without copying any actual assertion changes.)

Although I don't plan to bring over new assertions wholesale
into the current qualification branch, it's entirely possible
that various minor changes in main will use the new assertions;
having this basic support in the release branch will simplify that.
(This is why I'm adding the includes as a separate pass from
rewriting the individual assertions)
@tbkka
Copy link
Contributor Author

tbkka commented Jun 6, 2024

@swift-ci Please test

@ahoppen ahoppen removed their request for review June 6, 2024 21:39
Copy link
Contributor

@beccadax beccadax left a comment

Choose a reason for hiding this comment

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

Weird flex, but okay.

(I'd like to understand why Assertions.h imports stdint.h, though; there's a comment about that now on the previous PR.)

@tbkka
Copy link
Contributor Author

tbkka commented Jun 19, 2024

@swift-ci Please smoke test Linux platform

@tbkka
Copy link
Contributor Author

tbkka commented Jun 20, 2024

@swift-ci Please smoke test

@tbkka tbkka merged commit 598e510 into swiftlang:main Jun 20, 2024
3 checks passed
@tbkka tbkka deleted the tbkka-assertions2 branch August 1, 2024 16:39
nico added a commit to nico/swift that referenced this pull request Aug 5, 2024
They are not used. Demangling uses `assert()` from <cassert>,
and macros from lib/Demangling/DemanglerAssert.h.

Reverts the lib/Demangling changes from swiftlang#74184.

No behavior change.
nico added a commit to nico/swift that referenced this pull request Aug 5, 2024
They are not used. Demangling uses `assert()` from <cassert>,
and macros from lib/Demangling/DemanglerAssert.h.

Reverts the lib/Demangling changes from swiftlang#74184.

No behavior change.
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