We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 7b137cc + c115d8c commit a132e1cCopy full SHA for a132e1c
Sources/LLVM/LLVM_Utils.swift
@@ -29,6 +29,16 @@ extension StaticString {
29
}
30
31
32
+public func ==(lhs: llvm.StringRef, rhs: StaticString) -> Bool {
33
+ let lhsBuffer = UnsafeBufferPointer<UInt8>(
34
+ start: lhs.__bytes_beginUnsafe(),
35
+ count: Int(lhs.__bytes_endUnsafe() - lhs.__bytes_beginUnsafe()))
36
+ return rhs.withUTF8Buffer { (rhsBuffer: UnsafeBufferPointer<UInt8>) in
37
+ if lhsBuffer.count != rhsBuffer.count { return false }
38
+ return lhsBuffer.elementsEqual(rhsBuffer, by: ==)
39
+ }
40
+}
41
+
42
extension llvm.Twine: ExpressibleByStringLiteral {
43
public init(stringLiteral value: String) {
44
self.init(value)
0 commit comments