Skip to content

Commit 50d3913

Browse files
committed
[SE-0458] Enable strict memory safety in the Swift standard library
1 parent 7977e46 commit 50d3913

File tree

4 files changed

+4
-3
lines changed

4 files changed

+4
-3
lines changed

Runtimes/Core/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ add_compile_options(
182182
"$<$<COMPILE_LANGUAGE:Swift>:SHELL:-enable-experimental-feature NoncopyableGenerics2>"
183183
"$<$<COMPILE_LANGUAGE:Swift>:SHELL:-enable-experimental-feature SuppressedAssociatedTypes>"
184184
"$<$<COMPILE_LANGUAGE:Swift>:SHELL:-enable-experimental-feature SE427NoInferenceOnExtension>"
185-
"$<$<COMPILE_LANGUAGE:Swift>:SHELL:-enable-experimental-feature AllowUnsafeAttribute>"
185+
"$<$<COMPILE_LANGUAGE:Swift>:SHELL:-strict-memory-safety>"
186186
"$<$<COMPILE_LANGUAGE:Swift>:SHELL:-enable-experimental-feature NonescapableTypes>"
187187
"$<$<COMPILE_LANGUAGE:Swift>:SHELL:-enable-experimental-feature LifetimeDependence>"
188188
"$<$<COMPILE_LANGUAGE:Swift>:SHELL:-enable-experimental-feature MemberImportVisibility>"

stdlib/cmake/modules/SwiftSource.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -628,7 +628,7 @@ function(_compile_swift_files
628628
list(APPEND swift_flags "-enable-experimental-feature" "NoncopyableGenerics2")
629629
list(APPEND swift_flags "-enable-experimental-feature" "SuppressedAssociatedTypes")
630630
list(APPEND swift_flags "-enable-experimental-feature" "SE427NoInferenceOnExtension")
631-
list(APPEND swift_flags "-enable-experimental-feature" "AllowUnsafeAttribute")
631+
632632
list(APPEND swift_flags "-enable-experimental-feature" "NonescapableTypes")
633633
list(APPEND swift_flags "-enable-experimental-feature" "LifetimeDependence")
634634

stdlib/public/SwiftOnoneSupport/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ set(swiftOnoneSupport_common_options
77

88
"${SWIFT_SOURCE_DIR}/stdlib/linker-support/magic-symbols-for-install-name.c"
99

10-
SWIFT_COMPILE_FLAGS "-parse-stdlib" "-Xllvm" "-sil-inline-generics=false" "-Xfrontend" "-validate-tbd-against-ir=none" "-Xfrontend" "-check-onone-completeness" "-Xfrontend" "-disable-access-control" "${SWIFT_RUNTIME_SWIFT_COMPILE_FLAGS}" "${SWIFT_STANDARD_LIBRARY_SWIFT_FLAGS}"
10+
SWIFT_COMPILE_FLAGS "-parse-stdlib" "-Xllvm" "-sil-inline-generics=false" "-Xfrontend" "-validate-tbd-against-ir=none" "-Xfrontend" "-check-onone-completeness" "-Xfrontend" "-disable-access-control" "-strict-memory-safety" "${SWIFT_RUNTIME_SWIFT_COMPILE_FLAGS}" "${SWIFT_STANDARD_LIBRARY_SWIFT_FLAGS}"
1111
LINK_FLAGS "${SWIFT_RUNTIME_SWIFT_LINK_FLAGS}")
1212

1313
if(CMAKE_BUILD_TYPE STREQUAL "Debug" AND BOOTSTRAPPING_MODE STREQUAL "BOOTSTRAPPING")

stdlib/public/core/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -322,6 +322,7 @@ list(APPEND swift_stdlib_compile_flags "-enable-experimental-feature" "BitwiseCo
322322
list(APPEND swift_stdlib_compile_flags "-enable-experimental-feature" "ValueGenerics")
323323
list(APPEND swift_stdlib_compile_flags "-enable-experimental-feature" "AddressableParameters")
324324
list(APPEND swift_stdlib_compile_flags "-enable-experimental-feature" "AddressableTypes")
325+
list(APPEND swift_stdlib_compile_flags "-strict-memory-safety")
325326

326327
if("${SWIFT_NATIVE_SWIFT_TOOLS_PATH}" STREQUAL "")
327328
set(swift_bin_dir "${CMAKE_BINARY_DIR}/bin")

0 commit comments

Comments
 (0)