Skip to content

[LLVM] Add string equality operator #17

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
Oct 17, 2022
Merged

Conversation

egorzhdan
Copy link
Contributor

This allows checking strings for equality, e.g. llvmString == "some swift string literal" without an explicit string conversion.

Inspired by a similar operator in SwiftCompilerSources, with a minor difference that this works for raw LLVM StringRefs, not for wrapped LLVM StringRefs: https://github.com/apple/swift/blob/aea26bbc6e59520c067f2f5dc85b1d9f1cd28d2e/SwiftCompilerSources/Sources/Basic/Utils.swift#L69

This allows checking strings for equality, e.g. `llvmString == "some swift string literal"` without an explicit string conversion.
@egorzhdan egorzhdan merged commit a132e1c into llvm.org/main Oct 17, 2022
@egorzhdan egorzhdan deleted the string-equals branch October 17, 2022 12:48
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.

1 participant