-
Notifications
You must be signed in to change notification settings - Fork 10.5k
[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
Conversation
apple/swift-llvm#84 @swift-ci smoke test |
I looked into why this was not necessary on master-next. It was necessary! We just worked around it. See: 609b151 |
There was a problem hiding this 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?
include/swift/Strings.h
Outdated
@@ -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"; |
There was a problem hiding this comment.
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.
8c9e7fc
to
c2b797f
Compare
@swift-ci smoke test |
20f42bd
to
030e2be
Compare
…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.
030e2be
to
b402696
Compare
apple/swift-llvm#84 @swift-ci smoke test |
2 similar comments
apple/swift-llvm#84 @swift-ci smoke test |
apple/swift-llvm#84 @swift-ci smoke test |
@davezarzycki That is going to cause a merge conflict... so yes, I need to fix it ; ). |
Nope, I was wrong, but I will fix it. |
…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.