Skip to content

[strliteral-upgrade] Change Strings.h constants to be constexpr inste… #15975

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 1 commit into from
Apr 17, 2018

Conversation

gottesmm
Copy link
Contributor

…ad of static.

Otherwise they can not be passed to StringLiteral. That would prevent me from
landing DaveZ's StringSwitch improvements from apple/swift-llvm#84 since
StringSwitch only takes StringLiterals now.

@gottesmm
Copy link
Contributor Author

@gottesmm
Copy link
Contributor Author

I looked into why this was not necessary on master-next. It was necessary! We just worked around it. See: 609b151

Copy link
Contributor

@davezarzycki davezarzycki left a comment

Choose a reason for hiding this comment

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

LGTM. Personally, I'd try mechanically changing all static const strings in the headers to constexpr const strings, but reasonable people could disagree about whether this is wise or not.

Also, can you please revert the withInnerNUL workaround after landing the constexpr fix?

@@ -16,72 +16,72 @@
namespace swift {

/// The extension for serialized modules.
static const char SERIALIZED_MODULE_EXTENSION[] = "swiftmodule";
constexpr const char SERIALIZED_MODULE_EXTENSION[] = "swiftmodule";
Copy link
Contributor

Choose a reason for hiding this comment

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

These should still be static, thanks! Otherwise they'll get emitted into every file that includes this one.

@gottesmm gottesmm force-pushed the strliteral-upgrade branch from 8c9e7fc to c2b797f Compare April 17, 2018 17:02
@gottesmm
Copy link
Contributor Author

@swift-ci smoke test

2 similar comments
@gottesmm
Copy link
Contributor Author

@swift-ci smoke test

@gottesmm
Copy link
Contributor Author

@swift-ci smoke test

@gottesmm gottesmm force-pushed the strliteral-upgrade branch 2 times, most recently from 20f42bd to 030e2be Compare April 17, 2018 17:37
…c instead of static.

Otherwise they can not be passed to StringLiteral. That would prevent me from
landing DaveZ's StringSwitch improvements from apple/swift-llvm#84 since
StringSwitch only takes StringLiterals now.
@gottesmm gottesmm force-pushed the strliteral-upgrade branch from 030e2be to b402696 Compare April 17, 2018 17:38
@gottesmm
Copy link
Contributor Author

2 similar comments
@gottesmm
Copy link
Contributor Author

@gottesmm
Copy link
Contributor Author

@gottesmm gottesmm merged commit 9f96706 into swiftlang:master Apr 17, 2018
@gottesmm gottesmm deleted the strliteral-upgrade branch April 17, 2018 18:36
@gottesmm
Copy link
Contributor Author

@davezarzycki That is going to cause a merge conflict... so yes, I need to fix it ; ).

@gottesmm
Copy link
Contributor Author

Nope, I was wrong, but I will fix it.

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