mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[Concurrency] Enable TaskGroup/DiscardingTaskGroup in Embedded Swift
This commit is contained in:
@@ -1750,6 +1750,38 @@ static ManagedValue emitBuiltinCreateDiscardingTask(
|
||||
CreateTaskOptions::Discarding });
|
||||
}
|
||||
|
||||
// Emit SIL for the named builtin: createTaskGroup.
|
||||
// These formally take a metatype argument that's never actually used, so
|
||||
// we ignore it.
|
||||
static ManagedValue emitBuiltinCreateTaskGroup(SILGenFunction &SGF,
|
||||
SILLocation loc,
|
||||
SubstitutionMap subs,
|
||||
ArrayRef<ManagedValue> args,
|
||||
SGFContext C) {
|
||||
auto &ctx = SGF.getASTContext();
|
||||
auto resultType = SILType::getRawPointerType(ctx);
|
||||
auto value = SGF.B.createBuiltin(
|
||||
loc, ctx.getIdentifier(getBuiltinName(BuiltinValueKind::CreateTaskGroup)),
|
||||
resultType, subs, {});
|
||||
return ManagedValue::forObjectRValueWithoutOwnership(value);
|
||||
}
|
||||
|
||||
// Emit SIL for the named builtin: createTaskGroupWithFlags.
|
||||
// These formally take a metatype argument that's never actually used, so
|
||||
// we ignore it.
|
||||
static ManagedValue emitBuiltinCreateTaskGroupWithFlags(
|
||||
SILGenFunction &SGF, SILLocation loc, SubstitutionMap subs,
|
||||
ArrayRef<ManagedValue> args, SGFContext C) {
|
||||
auto &ctx = SGF.getASTContext();
|
||||
auto resultType = SILType::getRawPointerType(ctx);
|
||||
auto value = SGF.B.createBuiltin(
|
||||
loc,
|
||||
ctx.getIdentifier(
|
||||
getBuiltinName(BuiltinValueKind::CreateTaskGroupWithFlags)),
|
||||
resultType, subs, {args[0].getValue()});
|
||||
return ManagedValue::forObjectRValueWithoutOwnership(value);
|
||||
}
|
||||
|
||||
ManagedValue
|
||||
SILGenFunction::emitCreateAsyncMainTask(SILLocation loc, SubstitutionMap subs,
|
||||
ManagedValue flags,
|
||||
|
||||
Reference in New Issue
Block a user