Skip to content

Suppress a number of warnings in no-assert builds #17721

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
Jul 4, 2018

Conversation

airspeedswift
Copy link
Member

Lots of variables used only in asserts were warning in non-assert builds.

@airspeedswift airspeedswift changed the title Suppress a number of warnings about things used only in asserts Suppress a number of warnings in no-assert builds Jul 3, 2018
@airspeedswift
Copy link
Member Author

@swift-ci please test

@airspeedswift airspeedswift requested a review from jrose-apple July 3, 2018 21:49
Copy link
Contributor

@jrose-apple jrose-apple left a comment

Choose a reason for hiding this comment

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

Mostly looks good. Some suggestions for better options.

@@ -654,6 +654,7 @@ void ASTMangler::appendDeclName(const ValueDecl *decl) {
assert(((relatedEntityKind[0] >= 'a' && relatedEntityKind[0] <= 'j') ||
(relatedEntityKind[0] >= 'A' && relatedEntityKind[0] <= 'J')) &&
"Only [a-jA-J] are reserved for related entity kinds");
(void)relatedEntityKind;
return appendOperatorParam("L", synthesizedTypeAttr->getManglingName());
Copy link
Contributor

Choose a reason for hiding this comment

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

I think this was just supposed to use relatedEntityKind instead of calling getManglingName again.

@@ -874,6 +874,7 @@ namespace {

auto *dc = fn.getDecl()->getDeclContext();
assert(!isa<ExtensionDecl>(dc));
(void)dc;

if (fn.getDecl()->getDeclContext() == getType()) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Also a place to reuse dc.

@airspeedswift
Copy link
Member Author

@swift-ci please test

@swift-ci
Copy link
Contributor

swift-ci commented Jul 3, 2018

Build failed
Swift Test Linux Platform
Git Sha - a289699

@swift-ci
Copy link
Contributor

swift-ci commented Jul 3, 2018

Build failed
Swift Test OS X Platform
Git Sha - a289699

@airspeedswift
Copy link
Member Author

@swift-ci please test Linux platform

@airspeedswift airspeedswift merged commit 2b04e9f into swiftlang:master Jul 4, 2018
@airspeedswift airspeedswift deleted the squash-em branch July 4, 2018 14:15
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.

3 participants