|
75 | 75 | // CHECK: }
|
76 | 76 | // CHECK-NEXT: inline String(String &&) { abort(); }
|
77 | 77 | // CHECK-NEXT: static inline String init();
|
| 78 | +// CHECK-NEXT: inline UTF8View getUtf8() const; |
| 79 | +// CHECK-NEXT: inline void setUtf8(const UTF8View& newValue); |
| 80 | +// CHECK-NEXT: inline bool isContiguousUTF8() const; |
78 | 81 | // CHECK-NEXT: #if defined(__OBJC__)
|
79 | 82 | // CHECK-NEXT: inline __attribute__((always_inline)) operator NSString * _Nonnull () const noexcept {
|
80 | 83 | // CHECK-NEXT: return (__bridge_transfer NSString *)(_impl::$sSS10FoundationE19_bridgeToObjectiveCSo8NSStringCyF(_impl::swift_interop_passDirect_Swift_String(_getOpaquePointer())));
|
|
87 | 90 | // CHECK-NEXT: }
|
88 | 91 | // CHECK-EMPTY:
|
89 | 92 | // CHECK-NEXT: #endif
|
90 |
| -// CHECK-NEXT: #ifndef SWIFT_CXX_INTEROP_HIDE_STL_OVERLAY |
91 |
| -// CHECK-NEXT: inline __attribute__((always_inline)) String(const std::string &str) noexcept { |
92 |
| -// CHECK-NEXT: auto res = _impl::$sSS7cStringSSSPys4Int8VG_tcfC(str.c_str()); |
93 |
| -// CHECK-NEXT: memcpy(_getOpaquePointer(), &res, sizeof(res)); |
94 |
| -// CHECK-NEXT: } |
| 93 | +// CHECK-NEXT: #define SWIFT_CXX_INTEROP_STRING_MIXIN |
| 94 | +// CHECK-NEXT: // Look for the C++ interop support header relative to clang's resource dir: |
| 95 | +// CHECK-NEXT: // '<toolchain>/usr/lib/clang/<version>/include/../../../swift/swiftToCxx'. |
| 96 | +// CHECK-NEXT: #if __has_include(<../../../swift/swiftToCxx/_SwiftStdlibCxxOverlay.h>) |
| 97 | +// CHECK-NEXT: #include <../../../swift/swiftToCxx/_SwiftStdlibCxxOverlay.h> |
| 98 | +// CHECK-NEXT: #elif __has_include(<../../../../../lib/swift/swiftToCxx/_SwiftStdlibCxxOverlay.h>) |
| 99 | +// CHECK-NEXT: // '<toolchain>/usr/local/lib/clang/<version>/include/../../../../../lib/swift/swiftToCxx'. |
| 100 | +// CHECK-NEXT: #include <../../../../../lib/swift/swiftToCxx/_SwiftStdlibCxxOverlay.h> |
| 101 | +// CHECK-NEXT: // Alternatively, allow user to find the header using additional include path into '<toolchain>/lib/swift'. |
| 102 | +// CHECK-NEXT: #elif __has_include(<swiftToCxx/_SwiftStdlibCxxOverlay.h>) |
| 103 | +// CHECK-NEXT: #include <swiftToCxx/_SwiftStdlibCxxOverlay.h> |
95 | 104 | // CHECK-NEXT: #endif
|
96 | 105 | // CHECK-NEXT: private:
|
97 | 106 |
|
| 107 | +// CHECK: class UTF8View final { |
| 108 | +// CHECK: inline UTF8View(UTF8View &&) { abort(); } |
| 109 | +// CHECK-NEXT: inline String_Index getStartIndex() const; |
| 110 | +// CHECK-NEXT: inline String_Index getEndIndex() const; |
| 111 | +// CHECK-NEXT: inline String_Index index(const String_Index& i, swift::Int n) const; |
| 112 | +// CHECK-NEXT: inline Swift::Optional<String_Index> index(const String_Index& i, swift::Int n, const String_Index& limit) const; |
| 113 | +// CHECK-NEXT: inline swift::Int distance(const String_Index& i, const String_Index& j) const; |
| 114 | +// CHECK-NEXT: inline uint8_t operator [](const String_Index& i) const; |
| 115 | +// CHECK: inline String getDescription() const; |
| 116 | +// CHECK: inline swift::Int getCount() const; |
| 117 | +// CHECK-NEXT: private: |
| 118 | + |
98 | 119 | // CHECK: #if __has_include(<../../../swift/swiftToCxx/_SwiftStdlibCxxOverlay.h>)
|
99 | 120 | // CHECK-NEXT: #include <../../../swift/swiftToCxx/_SwiftStdlibCxxOverlay.h>
|
100 | 121 | // CHECK-NEXT: #elif __has_include(<../../../../../lib/swift/swiftToCxx/_SwiftStdlibCxxOverlay.h>)
|
|
0 commit comments