@@ -146,13 +146,6 @@ irgen::getAsyncContextLayout(IRGenModule &IGM, CanSILFunctionType originalType,
146
146
typeInfos.push_back (&ti);
147
147
}
148
148
149
- // SwiftError **errorResult;
150
- auto errorCanType = IGM.Context .getExceptionType ();
151
- auto errorType = SILType::getPrimitiveObjectType (errorCanType);
152
- auto &errorTypeInfo =
153
- IGM.getTypeInfoForLowered (CanInOutType::get (errorCanType));
154
- typeInfos.push_back (&errorTypeInfo);
155
- valTypes.push_back (errorType);
156
149
// Add storage for data used by runtime entry points.
157
150
// See TaskFutureWaitAsyncContext.
158
151
if (kind.isSpecial ()) {
@@ -196,22 +189,18 @@ irgen::getAsyncContextLayout(IRGenModule &IGM, CanSILFunctionType originalType,
196
189
} break ;
197
190
}
198
191
}
199
- bool canHaveValidError = substitutedType->hasErrorResult ();
200
192
return AsyncContextLayout (IGM, LayoutStrategy::Optimal, valTypes, typeInfos,
201
- originalType, substitutedType, substitutionMap,
202
- errorType, canHaveValidError);
193
+ originalType, substitutedType, substitutionMap);
203
194
}
204
195
205
196
AsyncContextLayout::AsyncContextLayout (
206
197
IRGenModule &IGM, LayoutStrategy strategy, ArrayRef<SILType> fieldTypes,
207
198
ArrayRef<const TypeInfo *> fieldTypeInfos, CanSILFunctionType originalType,
208
- CanSILFunctionType substitutedType, SubstitutionMap substitutionMap,
209
- SILType errorType, bool canHaveValidError)
199
+ CanSILFunctionType substitutedType, SubstitutionMap substitutionMap)
210
200
: StructLayout(IGM, /* decl=*/ nullptr , LayoutKind::NonHeapObject, strategy,
211
201
fieldTypeInfos, /* typeToFill*/ nullptr ),
212
202
originalType(originalType), substitutedType(substitutedType),
213
- substitutionMap(substitutionMap), errorType(errorType),
214
- canHaveValidError(canHaveValidError) {
203
+ substitutionMap(substitutionMap) {
215
204
#ifndef NDEBUG
216
205
assert (fieldTypeInfos.size () == fieldTypes.size () &&
217
206
" type infos don't match types" );
@@ -2317,13 +2306,6 @@ class AsyncCallEmission final : public CallEmission {
2317
2306
IGF.Builder .CreateZExt (dynamicContextSize32, IGF.IGM .SizeTy );
2318
2307
contextBuffer = emitAllocAsyncContext (IGF, dynamicContextSize);
2319
2308
context = layout.emitCastTo (IGF, contextBuffer.getAddress ());
2320
- if (layout.canHaveError ()) {
2321
- auto fieldLayout = layout.getErrorLayout ();
2322
- auto ptrToAddr =
2323
- fieldLayout.project (IGF, context, /* offsets*/ llvm::None);
2324
- auto errorSlot = IGF.getAsyncCalleeErrorResultSlot (layout.getErrorType ());
2325
- IGF.Builder .CreateStore (errorSlot.getAddress (), ptrToAddr);
2326
- }
2327
2309
}
2328
2310
void end () override {
2329
2311
assert (contextBuffer.isValid ());
0 commit comments