Skip to content

Commit 3fa7849

Browse files
Merge pull request #71736 from nate-chandler/add-missing-flag
Add missing guard around new builtin.
2 parents 47e95d6 + 1906b28 commit 3fa7849

File tree

3 files changed

+7
-0
lines changed

3 files changed

+7
-0
lines changed

include/swift/Basic/Features.def

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,7 @@ LANGUAGE_FEATURE(TypedThrows, 413, "Typed throws")
125125
LANGUAGE_FEATURE(OptionalIsolatedParameters, 420, "Optional isolated parameters")
126126
SUPPRESSIBLE_LANGUAGE_FEATURE(Extern, 0, "@_extern")
127127
LANGUAGE_FEATURE(ExpressionMacroDefaultArguments, 422, "Expression macro as caller-side default argument")
128+
LANGUAGE_FEATURE(BuiltinStoreRaw, 0, "Builtin.storeRaw")
128129

129130
UPCOMING_FEATURE(ConciseMagicFile, 274, 6)
130131
UPCOMING_FEATURE(ForwardTrailingClosures, 286, 6)

lib/AST/ASTPrinter.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3008,6 +3008,8 @@ static bool usesFeatureExpressionMacroDefaultArguments(Decl *decl) {
30083008
return false;
30093009
}
30103010

3011+
static bool usesFeatureBuiltinStoreRaw(Decl *decl) { return false; }
3012+
30113013
static bool usesFeatureCodeItemMacros(Decl *decl) {
30123014
auto macro = dyn_cast<MacroDecl>(decl);
30133015
if (!macro)

stdlib/public/core/UnsafeRawPointer.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1316,7 +1316,11 @@ public struct UnsafeMutableRawPointer: _Pointer {
13161316
public func storeBytes<T : _BitwiseCopyable>(
13171317
of value: T, toByteOffset offset: Int = 0, as type: T.Type
13181318
) {
1319+
#if $BuiltinStoreRaw
13191320
Builtin.storeRaw(value, (self + offset)._rawValue)
1321+
#else
1322+
fatalError("Unsupported swift compiler!")
1323+
#endif
13201324
}
13211325
#endif
13221326
@inlinable

0 commit comments

Comments
 (0)