mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
64 lines
3.3 KiB
C++
64 lines
3.3 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(EffectfulProp, 310, "Effectful properties", true)
|
|
LANGUAGE_FEATURE(MarkerProtocol, 0, "@_marker protocol", true)
|
|
LANGUAGE_FEATURE(Actors, 0, "actors", true)
|
|
LANGUAGE_FEATURE(Actors2, 0, "actors #2 (TEMPORARY)", true)
|
|
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(BuiltinExecutor, 0, "Builtin.Executor type", true)
|
|
LANGUAGE_FEATURE(BuiltinContinuation, 0, "Continuation builtins", true)
|
|
LANGUAGE_FEATURE(BuiltinHopToActor, 0, "Builtin.HopToActor", true)
|
|
LANGUAGE_FEATURE(BuiltinTaskGroupWithArgument, 0, "TaskGroup builtins", true)
|
|
LANGUAGE_FEATURE(InheritActorContext, 0, "@_inheritActorContext attribute", true)
|
|
LANGUAGE_FEATURE(ImplicitSelfCapture, 0, "@_implicitSelfCapture attribute", true)
|
|
LANGUAGE_FEATURE(BuiltinBuildExecutor, 0, "Executor-building builtins", true)
|
|
LANGUAGE_FEATURE(BuiltinBuildMainExecutor, 0, "MainActor executor building builtin", true)
|
|
LANGUAGE_FEATURE(BuiltinCreateAsyncTaskInGroup, 0, "MainActor executor building builtin", true)
|
|
LANGUAGE_FEATURE(BuiltinMove, 0, "Builtin.move()", true)
|
|
LANGUAGE_FEATURE(BuiltinCopy, 0, "Builtin.copy()", true)
|
|
LANGUAGE_FEATURE(BuiltinStackAlloc, 0, "Builtin.stackAlloc", true)
|
|
LANGUAGE_FEATURE(SpecializeAttributeWithAvailability, 0, "@_specialize attribute with availability", true)
|
|
LANGUAGE_FEATURE(BuiltinAssumeAlignment, 0, "Builtin.assumeAlignment", true)
|
|
|
|
#undef LANGUAGE_FEATURE
|