Skip to content

Commit a0664a9

Browse files
authored
Merge pull request swiftlang#87019 from meg-gupta/assertconf
Add -assert-config DisableReplacement to the private oslog library
2 parents 617deca + 114b782 commit a0664a9

File tree

3 files changed

+11
-0
lines changed

3 files changed

+11
-0
lines changed

stdlib/cmake/modules/AddSwiftStdlib.cmake

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1765,6 +1765,7 @@ endfunction()
17651765
# [INSTALL]
17661766
# [IS_STDLIB]
17671767
# [IS_STDLIB_CORE]
1768+
# [IS_OSLOG]
17681769
# [ONLY_SWIFTMODULE]
17691770
# [NO_SWIFTMODULE]
17701771
# [INSTALL_WITH_SHARED]
@@ -1875,6 +1876,9 @@ endfunction()
18751876
# IS_STDLIB_CORE
18761877
# Compile as the Swift standard library core.
18771878
#
1879+
# IS_OSLOG
1880+
# Treat the library as OSLog library.
1881+
#
18781882
# ONLY_SWIFTMODULE
18791883
# Do not build either static or shared, build just the .swiftmodule.
18801884
#
@@ -1964,6 +1968,7 @@ function(add_swift_target_library name)
19641968
IS_SDK_OVERLAY
19651969
IS_STDLIB
19661970
IS_STDLIB_CORE
1971+
IS_OSLOG
19671972
IS_SWIFT_ONLY
19681973
NOSWIFTRT
19691974
ONLY_SWIFTMODULE
@@ -2137,6 +2142,10 @@ function(add_swift_target_library name)
21372142
list(APPEND SWIFTLIB_SWIFT_COMPILE_FLAGS "-Xfrontend;-enable-lexical-lifetimes=false")
21382143
endif()
21392144

2145+
if (SWIFTLIB_IS_OSLOG)
2146+
list(APPEND SWIFTLIB_SWIFT_COMPILE_FLAGS "-Xfrontend;-assert-config;-Xfrontend;DisableReplacement")
2147+
endif()
2148+
21402149
if(NOT DEFINED SWIFTLIB_INSTALL_BINARY_SWIFTMODULE)
21412150
set(SWIFTLIB_INSTALL_BINARY_SWIFTMODULE TRUE)
21422151
endif()

stdlib/private/OSLog/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ if((SWIFT_BUILD_CLANG_OVERLAYS
1515
endif()
1616

1717
add_swift_target_library(swiftOSLogTestHelper
18+
IS_OSLOG
1819
IS_SDK_OVERLAY
1920
SHARED
2021

stdlib/private/OSLog/OSLogTestHelper.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ public let _noopClosure = { (x : String, y : UnsafeBufferPointer<UInt8>) in retu
4141
/// byte buffer and asserts a condition.
4242
@_semantics("oslog.requires_constant_arguments")
4343
@_transparent
44+
@_alwaysEmitIntoClient
4445
@_optimize(none)
4546
public // @testable
4647
func _osLogTestHelper(

0 commit comments

Comments
 (0)