Skip to content

Commit fcca37b

Browse files
committed
Fixes for the 5.5 branch
1 parent 1e6c662 commit fcca37b

File tree

3 files changed

+3
-26
lines changed

3 files changed

+3
-26
lines changed

lib/AST/Builtins.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1427,7 +1427,7 @@ Type swift::getAsyncTaskAndContextType(ASTContext &ctx) {
14271427
static ValueDecl *getCreateAsyncTask(ASTContext &ctx, Identifier id) {
14281428
BuiltinFunctionBuilder builder(ctx);
14291429
auto genericParam = makeGenericParam().build(builder);
1430-
builder.addParameter(makeConcrete(ctx.getIntType())); // 0 flags
1430+
builder.addParameter(makeConcrete(ctx.getIntDecl()->getDeclaredInterfaceType())); // 0 flags
14311431
auto extInfo = ASTExtInfoBuilder().withAsync().withThrows().build();
14321432
builder.addParameter(
14331433
makeConcrete(FunctionType::get({ }, genericParam, extInfo))); // 1 operation
@@ -1438,7 +1438,7 @@ static ValueDecl *getCreateAsyncTask(ASTContext &ctx, Identifier id) {
14381438
static ValueDecl *getCreateAsyncTaskInGroup(ASTContext &ctx, Identifier id) {
14391439
BuiltinFunctionBuilder builder(ctx);
14401440
auto genericParam = makeGenericParam().build(builder); // <T>
1441-
builder.addParameter(makeConcrete(ctx.getIntType())); // 0 flags
1441+
builder.addParameter(makeConcrete(ctx.getIntDecl()->getDeclaredInterfaceType())); // 0 flags
14421442
builder.addParameter(makeConcrete(ctx.TheRawPointerType)); // 1 group
14431443
auto extInfo = ASTExtInfoBuilder().withAsync().withThrows().build();
14441444
builder.addParameter(

stdlib/public/Concurrency/Task.swift

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -859,29 +859,6 @@ public func _taskFutureGet<T>(_ task: Builtin.NativeObject) async -> T
859859
@_silgen_name("swift_task_future_wait_throwing")
860860
public func _taskFutureGetThrowing<T>(_ task: Builtin.NativeObject) async throws -> T
861861

862-
@available(SwiftStdlib 5.5, *)
863-
public func _runChildTask<T>(
864-
operation: @Sendable @escaping () async throws -> T
865-
) async -> Builtin.NativeObject {
866-
let currentTask = Builtin.getCurrentAsyncTask()
867-
868-
// Set up the job flags for a new task.
869-
var flags = JobFlags()
870-
flags.kind = .task
871-
flags.priority = getJobFlags(currentTask).priority ?? .unspecified
872-
flags.isFuture = true
873-
flags.isChildTask = true
874-
875-
// Create the asynchronous task future.
876-
let (task, _) = Builtin.createAsyncTaskFuture(
877-
Int(flags.bits), operation)
878-
879-
// Enqueue the resulting job.
880-
_enqueueJobGlobal(Builtin.convertTaskToJob(task))
881-
882-
return task
883-
}
884-
885862
@available(SwiftStdlib 5.5, *)
886863
@_silgen_name("swift_task_cancel")
887864
func _taskCancel(_ task: Builtin.NativeObject)

test/SILOptimizer/closure_lifetime_fixup.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ public func testGeneric(c: C) {
6767
// CHECK: [[PA:%.*]] = partial_apply [callee_guaranteed] [on_stack]
6868
// CHECK: [[MD:%.*]] = mark_dependence [[PA]]
6969
// CHECK: [[CONV:%.*]] = convert_function [[MD]]
70-
// CHECK: [[BAL:%.*]] = builtin "startAsyncLet"<String>([[CONV]]
70+
// CHECK: [[BAL:%.*]] = builtin "startAsyncLet"<String>({{.*}}, [[CONV]]
7171
// CHECK: builtin "endAsyncLet"([[BAL]] : $Builtin.RawPointer, [[MD]]
7272
// CHECK: } // end sil function '$s22closure_lifetime_fixup12testAsyncLetyS2SYaF'
7373

0 commit comments

Comments
 (0)