Files
swift-mirror/include/swift/Basic/Features.def
John McCall efeb818161 Clean up the TaskGroup ABI:
- stop storing the parent task in the TaskGroup at the .swift level
- make sure that swift_taskGroup_isCancelled is implied by the parent
  task being cancelled
- make the TaskGroup structs frozen
- make the withTaskGroup functions inlinable
- remove swift_taskGroup_create
- teach IRGen to allocate memory for the task group
- don't deallocate the task group in swift_taskGroup_destroy

To achieve the allocation change, introduce paired create/destroy builtins.

Furthermore, remove the _swiftRetain and _swiftRelease functions and
several calls to them.  Replace them with uses of the appropriate builtins.
I should probably change the builtins to return retained, since they're
working with a managed type, but I'll do that in a separate commit.
2021-04-09 03:06:31 -04:00

50 lines
2.2 KiB
C++

//===--- Features.def - Swift Features Metaprogramming ----------*- C++ -*-===//
//
// This source file is part of the Swift.org open source project
//
// Copyright (c) 2014 - 2017 Apple Inc. and the Swift project authors
// Licensed under Apache License v2.0 with Runtime Library Exception
//
// See https://swift.org/LICENSE.txt for license information
// See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
//
//===----------------------------------------------------------------------===//
//
// This file defines macros used for macro-metaprogramming with language
// features.
//
//
// LANGUAGE_FEATURE(FeatureName, SENumber, Description, Option)
//
// The LANGUAGE_FEATURE macro describes each named feature that is
// introduced in Swift. It allows Swift code to check for a particular
// feature with "#if $FeatureName" in source code.
//
// FeatureName: The name given to this feature to be used in source code,
// e.g., AsyncAwait.
// SENumber: The number assigned to this feature in the Swift Evolution
// process, or 0 if there isn't one.
// Description: A string literal describing the feature.
// Option: either a reference to a language option in the form
// "langOpts.<option name>" or "true" to indicate that it's always
// enabled.
//===----------------------------------------------------------------------===//
#ifndef LANGUAGE_FEATURE
# error define LANGUAGE_FEATURE before including Features.def
#endif
LANGUAGE_FEATURE(StaticAssert, 0, "#assert", langOpts.EnableExperimentalStaticAssert)
LANGUAGE_FEATURE(AsyncAwait, 296, "async/await", true)
LANGUAGE_FEATURE(MarkerProtocol, 0, "@_marker protocol", true)
LANGUAGE_FEATURE(Actors, 0, "actors", langOpts.EnableExperimentalConcurrency)
LANGUAGE_FEATURE(ConcurrentFunctions, 0, "@concurrent functions", true)
LANGUAGE_FEATURE(RethrowsProtocol, 0, "@rethrows protocol", true)
LANGUAGE_FEATURE(GlobalActors, 0, "Global actors", langOpts.EnableExperimentalConcurrency)
LANGUAGE_FEATURE(BuiltinJob, 0, "Builtin.Job type", true)
LANGUAGE_FEATURE(Sendable, 0, "Sendable and @Sendable", true)
LANGUAGE_FEATURE(BuiltinContinuation, 0, "Continuation builtins", true)
LANGUAGE_FEATURE(BuiltinTaskGroup, 0, "TaskGroup builtins", true)
#undef LANGUAGE_FEATURE