@@ -143,6 +143,12 @@ import Swift
143
143
% HAS_TASK_EXECUTOR = any('taskExecutor:' in param for param in PARAMS)
144
144
%
145
145
% ARROW_RETURN_TYPE = "-> Bool " if IS_ADD_UNLESS_CANCELLED else ""
146
+ %
147
+ % if IS_DISCARDING:
148
+ % TASK_CREATE_FN = 'Builtin.createDiscardingTask'
149
+ % else:
150
+ % TASK_CREATE_FN = 'Builtin.createTask'
151
+ % end
146
152
147
153
% if IFDEF:
148
154
#if ${IFDEF}
@@ -240,7 +246,7 @@ extension ${TYPE} {
240
246
if var name {
241
247
task =
242
248
name.withUTF8 { nameBytes in
243
- Builtin.createTask (
249
+ ${TASK_CREATE_FN} (
244
250
flags: flags,
245
251
initialSerialExecutor: builtinSerialExecutor,
246
252
taskGroup: _group,
@@ -256,7 +262,7 @@ extension ${TYPE} {
256
262
% if HAS_TASK_EXECUTOR:
257
263
if task == nil, let taskExecutor {
258
264
#if $BuiltinCreateAsyncTaskOwnedTaskExecutor
259
- task = Builtin.createTask (
265
+ task = ${TASK_CREATE_FN} (
260
266
flags: flags,
261
267
initialSerialExecutor: builtinSerialExecutor,
262
268
taskGroup: _group,
@@ -267,7 +273,7 @@ extension ${TYPE} {
267
273
let executorBuiltin: Builtin.Executor =
268
274
taskExecutor.asUnownedTaskExecutor().executor
269
275
270
- task = Builtin.createTask (
276
+ task = ${TASK_CREATE_FN} (
271
277
flags: flags,
272
278
initialSerialExecutor: builtinSerialExecutor,
273
279
taskGroup: _group,
@@ -279,7 +285,7 @@ extension ${TYPE} {
279
285
280
286
% # The baseline fallback, if no other create calls could be used
281
287
if task == nil {
282
- task = Builtin.createTask (
288
+ task = ${TASK_CREATE_FN} (
283
289
flags: flags,
284
290
initialSerialExecutor: builtinSerialExecutor,
285
291
taskGroup: _group,
@@ -303,8 +309,3 @@ extension ${TYPE} {
303
309
% end
304
310
% end
305
311
% end
306
-
307
- // FIXME: The following sources should be in SourceCompatibilityShims.swift,
308
- // but the current build has trouble including the generated gyb sources
309
- // such that they are available to the same module. As we move to the
310
- // new build style we should resolve this. rdar://145171772
0 commit comments