Skip to content

Commit 2bc788c

Browse files
committed
Revert "Merge pull request swiftlang#75379 from drexin/wip-132122011"
This reverts commit 618a9bf, reversing changes made to 448596c.
1 parent 291abb6 commit 2bc788c

File tree

2 files changed

+2
-19
lines changed

2 files changed

+2
-19
lines changed

lib/IRGen/IRGenSIL.cpp

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4385,7 +4385,6 @@ static void emitReturnInst(IRGenSILFunction &IGF,
43854385
if (fnType->hasErrorResult()) {
43864386
error.add(getNullErrorValue());
43874387
}
4388-
43894388
emitAsyncReturn(IGF, asyncLayout, funcResultType, fnType, result, error);
43904389
} else {
43914390
auto funcLang = IGF.CurSILFn->getLoweredFunctionType()->getLanguage();
@@ -4435,13 +4434,12 @@ void IRGenSILFunction::visitThrowInst(swift::ThrowInst *i) {
44354434
}
44364435

44374436
llvm::Value *expandedResult = llvm::UndefValue::get(combined.combinedTy);
4438-
auto *structTy = dyn_cast<llvm::StructType>(combined.combinedTy);
44394437

44404438
if (!errorSchema.getExpandedType(IGM)->isVoidTy()) {
44414439
auto nativeError =
44424440
errorSchema.mapIntoNative(IGM, *this, errorResult, silErrorTy, false);
44434441

4444-
if (structTy) {
4442+
if (auto *structTy = dyn_cast<llvm::StructType>(combined.combinedTy)) {
44454443
for (unsigned i : combined.errorValueMapping) {
44464444
llvm::Value *elt = nativeError.claimNext();
44474445
auto *nativeTy = structTy->getElementType(i);
@@ -4460,11 +4458,7 @@ void IRGenSILFunction::visitThrowInst(swift::ThrowInst *i) {
44604458
combined.combinedTy, /*forExtraction*/ false);
44614459
}
44624460
} else {
4463-
if (forAsync && structTy) {
4464-
emitAllExtractValues(expandedResult, structTy, out);
4465-
} else {
4466-
out = expandedResult;
4467-
}
4461+
out = expandedResult;
44684462
}
44694463
};
44704464

test/IRGen/typed_throws.swift

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -205,14 +205,3 @@ func mayThrowAsyncTiny(x: Bool) async throws(TinyError) -> Bool {
205205
func callsMayThrowAsyncTiny(x: Bool) async {
206206
_ = try! await mayThrowAsyncTiny(x: x)
207207
}
208-
209-
struct EmptyError: Error {}
210-
211-
@available(SwiftStdlib 6.0, *)
212-
func mayThrowEmptyErrorAsync(x: Bool) async throws(EmptyError) -> String? {
213-
guard x else {
214-
throw EmptyError()
215-
}
216-
217-
return ""
218-
}

0 commit comments

Comments
 (0)