mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Refactoring the C++ thunk to directly return the Swift::Expected intead od the SWIFT_RETURN_THUNK macro
This commit is contained in:
@@ -38,7 +38,7 @@ public func emptyThrowFunction() throws { print("passEmptyThrowFunction") }
|
||||
// CHECK: #ifdef __cpp_exceptions
|
||||
// CHECK: throw (Swift::Error(opaqueError));
|
||||
// CHECK: #else
|
||||
// CHECK: return SWIFT_RETURN_THUNK(void, Swift::Error(opaqueError));
|
||||
// CHECK: return Swift::Expected<void>(Swift::Error(opaqueError));
|
||||
// CHECK: #endif
|
||||
// CHECK: }
|
||||
|
||||
@@ -64,7 +64,7 @@ public func testDestroyedError() throws { throw DestroyedError() }
|
||||
// CHECK: #ifdef __cpp_exceptions
|
||||
// CHECK: throw (Swift::Error(opaqueError));
|
||||
// CHECK: #else
|
||||
// CHECK: return SWIFT_RETURN_THUNK(void, Swift::Error(opaqueError));
|
||||
// CHECK: return Swift::Expected<void>(Swift::Error(opaqueError));
|
||||
// CHECK: #endif
|
||||
// CHECK: }
|
||||
|
||||
@@ -82,7 +82,7 @@ public func throwFunction() throws {
|
||||
// CHECK: #ifdef __cpp_exceptions
|
||||
// CHECK: throw (Swift::Error(opaqueError));
|
||||
// CHECK: #else
|
||||
// CHECK: return SWIFT_RETURN_THUNK(void, Swift::Error(opaqueError));
|
||||
// CHECK: return Swift::Expected<void>(Swift::Error(opaqueError));
|
||||
// CHECK: #endif
|
||||
// CHECK: }
|
||||
|
||||
@@ -103,7 +103,7 @@ public func throwFunctionWithPossibleReturn(_ a: Int) throws -> Int {
|
||||
// CHECK: #ifdef __cpp_exceptions
|
||||
// CHECK: throw (Swift::Error(opaqueError));
|
||||
// CHECK: #else
|
||||
// CHECK: return SWIFT_RETURN_THUNK(swift::Int, Swift::Error(opaqueError));
|
||||
// CHECK: return Swift::Expected<swift::Int>(Swift::Error(opaqueError));
|
||||
// CHECK: #endif
|
||||
// CHECK: return SWIFT_RETURN_THUNK(swift::Int, returnValue);
|
||||
// CHECK: }
|
||||
@@ -122,7 +122,7 @@ public func throwFunctionWithReturn() throws -> Int {
|
||||
// CHECK: #ifdef __cpp_exceptions
|
||||
// CHECK: throw (Swift::Error(opaqueError));
|
||||
// CHECK: #else
|
||||
// CHECK: return SWIFT_RETURN_THUNK(swift::Int, Swift::Error(opaqueError));
|
||||
// CHECK: return Swift::Expected<swift::Int>(Swift::Error(opaqueError));
|
||||
// CHECK: #endif
|
||||
// CHECK: return SWIFT_RETURN_THUNK(swift::Int, returnValue);
|
||||
// CHECK: }
|
||||
|
||||
Reference in New Issue
Block a user