File tree Expand file tree Collapse file tree 3 files changed +10
-3
lines changed Expand file tree Collapse file tree 3 files changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ if(CMAKE_SYSTEM_NAME STREQUAL Windows)
66 option (BUILD_SHARED_LIBS "Build shared libraries by default" YES )
77endif ()
88
9- set (min_supported_swift_version 5.8 )
9+ set (min_supported_swift_version 5.9 )
1010if (CMAKE_Swift_COMPILER_VERSION VERSION_LESS "${min_supported_swift_version} " )
1111 message (FATAL_ERROR "Outdated Swift compiler: "
1212 "Swift ${min_supported_swift_version} or newer is required." )
Original file line number Diff line number Diff line change @@ -2,7 +2,8 @@ add_library(LLVM_Utils
22 LLVM_Utils.swift)
33target_compile_options (LLVM_Utils PUBLIC
44 "-emit-module"
5- "-Xfrontend" "-enable-experimental-cxx-interop" )
5+ "SHELL:-Xcc -std=c++17"
6+ "-cxx-interoperability-mode=default" )
67target_include_directories (LLVM_Utils PUBLIC
78 "${LLVM_MAIN_INCLUDE_DIR} "
89 "${LLVM_INCLUDE_DIR} " )
Original file line number Diff line number Diff line change 1414
1515extension String {
1616 public init ( _ stringRef: llvm . StringRef ) {
17- self . init ( cxxString : stringRef. str ( ) )
17+ self . init ( stringRef. str ( ) )
1818 }
1919
2020 public func withStringRef< Result> ( _ body: ( llvm . StringRef ) -> Result ) -> Result {
@@ -34,9 +34,15 @@ extension StaticString {
3434}
3535
3636public func == ( lhs: llvm . StringRef , rhs: StaticString ) -> Bool {
37+ #if $NewCxxMethodSafetyHeuristics
38+ let lhsBuffer = UnsafeBufferPointer < UInt8 > (
39+ start: lhs. bytes_begin ( ) ,
40+ count: Int ( lhs. bytes_end ( ) - lhs. bytes_begin ( ) ) )
41+ #else
3742 let lhsBuffer = UnsafeBufferPointer < UInt8 > (
3843 start: lhs. __bytes_beginUnsafe ( ) ,
3944 count: Int ( lhs. __bytes_endUnsafe ( ) - lhs. __bytes_beginUnsafe ( ) ) )
45+ #endif
4046 return rhs. withUTF8Buffer { ( rhsBuffer: UnsafeBufferPointer < UInt8 > ) in
4147 if lhsBuffer. count != rhsBuffer. count { return false }
4248 return lhsBuffer. elementsEqual ( rhsBuffer, by: == )
You can’t perform that action at this time.
0 commit comments