Skip to content

Commit

Permalink
AST: Promote BuiltinUnprotectedStackAlloc feature to baseline.
Browse files Browse the repository at this point in the history
  • Loading branch information
tshortli committed Jul 9, 2024
1 parent 53451ca commit ab99cac
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 10 deletions.
2 changes: 1 addition & 1 deletion include/swift/Basic/Features.def
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ BASELINE_LANGUAGE_FEATURE(BuiltinCreateAsyncDiscardingTaskInGroup, 0, "Task crea
BASELINE_LANGUAGE_FEATURE(BuiltinCreateAsyncTaskWithExecutor, 0, "Task create builtin with extra executor preference")
BASELINE_LANGUAGE_FEATURE(BuiltinCreateAsyncDiscardingTaskInGroupWithExecutor, 0, "Task create in discarding task group with extra executor preference")
BASELINE_LANGUAGE_FEATURE(BuiltinStackAlloc, 0, "Builtin.stackAlloc")
LANGUAGE_FEATURE(BuiltinUnprotectedStackAlloc, 0, "Builtin.unprotectedStackAlloc")
BASELINE_LANGUAGE_FEATURE(BuiltinUnprotectedStackAlloc, 0, "Builtin.unprotectedStackAlloc")
LANGUAGE_FEATURE(BuiltinAllocVector, 0, "Builtin.allocVector")
BASELINE_LANGUAGE_FEATURE(BuiltinTaskRunInline, 0, "Builtin.taskRunInline")
BASELINE_LANGUAGE_FEATURE(BuiltinUnprotectedAddressOf, 0, "Builtin.unprotectedAddressOf")
Expand Down
1 change: 0 additions & 1 deletion lib/AST/FeatureSet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,6 @@ static bool usesFeatureRethrowsProtocol(Decl *decl) {
return usesFeatureRethrowsProtocol(decl, checked);
}

UNINTERESTING_FEATURE(BuiltinUnprotectedStackAlloc)
UNINTERESTING_FEATURE(BuiltinAllocVector)

static bool usesFeatureNewCxxMethodSafetyHeuristics(Decl *decl) {
Expand Down
8 changes: 0 additions & 8 deletions stdlib/public/core/TemporaryAllocation.swift
Original file line number Diff line number Diff line change
Expand Up @@ -189,19 +189,11 @@ internal func _withUnprotectedUnsafeTemporaryAllocation<
// notice and complain.)
let result: R

#if $BuiltinUnprotectedStackAlloc
let stackAddress = Builtin.unprotectedStackAlloc(
capacity._builtinWordValue,
MemoryLayout<T>.stride._builtinWordValue,
alignment._builtinWordValue
)
#else
let stackAddress = Builtin.stackAlloc(
capacity._builtinWordValue,
MemoryLayout<T>.stride._builtinWordValue,
alignment._builtinWordValue
)
#endif

// The multiple calls to Builtin.stackDealloc() are because defer { } produces
// a child function at the SIL layer and that conflicts with the verifier's
Expand Down

0 comments on commit ab99cac

Please sign in to comment.