Skip to content

Commit 8be1077

Browse files
committed
Revert "Merge pull request swiftlang#75316 from drexin/wip-131960281"
This reverts commit e3577ed, reversing changes made to f3acbb0.
1 parent 2bc788c commit 8be1077

File tree

2 files changed

+1
-30
lines changed

2 files changed

+1
-30
lines changed

lib/IRGen/GenCall.cpp

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3232,19 +3232,7 @@ class AsyncCallEmission final : public CallEmission {
32323232

32333233
bool mayReturnErrorDirectly = mayReturnTypedErrorDirectly();
32343234
if (mayReturnErrorDirectly && !nativeSchema.requiresIndirect()) {
3235-
llvm::Value *resultAgg;
3236-
if (resultTys.size() == 1) {
3237-
resultAgg = Builder.CreateExtractValue(result, numAsyncContextParams);
3238-
} else {
3239-
auto resultTy = llvm::StructType::get(IGM.getLLVMContext(), resultTys);
3240-
resultAgg = llvm::UndefValue::get(resultTy);
3241-
for (unsigned i = 0, e = resultTys.size(); i != e; ++i) {
3242-
llvm::Value *elt =
3243-
Builder.CreateExtractValue(result, numAsyncContextParams + i);
3244-
resultAgg = Builder.CreateInsertValue(resultAgg, elt, i);
3245-
}
3246-
}
3247-
return emitToUnmappedExplosionWithDirectTypedError(resultType, resultAgg,
3235+
return emitToUnmappedExplosionWithDirectTypedError(resultType, result,
32483236
out);
32493237
} else if (resultTys.size() == 1) {
32503238
result = Builder.CreateExtractValue(result, numAsyncContextParams);

test/IRGen/typed_throws.swift

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -188,20 +188,3 @@ func throwsGenericAsync<T: Error>(x: Bool, y: T) async throws(T) -> Int {
188188

189189
return 32
190190
}
191-
192-
enum TinyError: Error {
193-
case a
194-
}
195-
196-
@available(SwiftStdlib 6.0, *)
197-
func mayThrowAsyncTiny(x: Bool) async throws(TinyError) -> Bool {
198-
guard x else {
199-
throw .a
200-
}
201-
return false
202-
}
203-
204-
@available(SwiftStdlib 6.0, *)
205-
func callsMayThrowAsyncTiny(x: Bool) async {
206-
_ = try! await mayThrowAsyncTiny(x: x)
207-
}

0 commit comments

Comments
 (0)