Skip to content

Commit 7f26d97

Browse files
authored
Don't use resilient getter for playgroundPrintHook when resilience is off (swiftlang#33848)
1 parent e885a6d commit 7f26d97

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

stdlib/cmake/modules/AddSwiftStdlib.cmake

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -298,6 +298,9 @@ function(_add_target_variant_c_compile_flags)
298298
list(APPEND result "-DSWIFT_OBJC_INTEROP=0")
299299
endif()
300300

301+
# TODO(mracek): This should get turned off for non-ABI-stable environments.
302+
list(APPEND result "-DSWIFT_LIBRARY_EVOLUTION=1")
303+
301304
if(NOT SWIFT_ENABLE_COMPATIBILITY_OVERRIDES)
302305
list(APPEND result "-DSWIFT_RUNTIME_NO_COMPATIBILITY_OVERRIDES")
303306
endif()

stdlib/public/runtime/ReflectionMirror.mm

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -328,8 +328,13 @@ AnyReturn subscript(intptr_t i, const char **outName,
328328
void *fptr;
329329
HeapObject *context;
330330
};
331+
#if SWIFT_LIBRARY_EVOLUTION
331332
SWIFT_RUNTIME_STDLIB_API SWIFT_CC(swift) swift_closure
332333
MANGLE_SYM(s20_playgroundPrintHookySScSgvg)();
334+
#else
335+
SWIFT_RUNTIME_STDLIB_API swift_closure
336+
MANGLE_SYM(s20_playgroundPrintHookySScSgvp);
337+
#endif
333338

334339
static bool _shouldReportMissingReflectionMetadataWarnings() {
335340
// Missing metadata warnings noise up playground sessions and aren't really
@@ -339,7 +344,11 @@ static bool _shouldReportMissingReflectionMetadataWarnings() {
339344
// Guesstimate whether we're in a playground by looking at the
340345
// _playgroundPrintHook variable in the standard library, which is set during
341346
// playground execution.
347+
#if SWIFT_LIBRARY_EVOLUTION
342348
auto hook = MANGLE_SYM(s20_playgroundPrintHookySScSgvg)();
349+
#else
350+
auto hook = MANGLE_SYM(s20_playgroundPrintHookySScSgvp);
351+
#endif
343352
if (hook.fptr) {
344353
swift_release(hook.context);
345354
return false;

0 commit comments

Comments
 (0)