Skip to content

Commit 906f0b4

Browse files
committed
Address review comments
1 parent d76c814 commit 906f0b4

File tree

3 files changed

+10
-8
lines changed

3 files changed

+10
-8
lines changed

include/swift/Option/Options.td

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -905,9 +905,9 @@ def disable_autolinking_runtime_compatibility : Flag<["-"], "disable-autolinking
905905
HelpText<"Do not use autolinking for runtime compatibility libraries">;
906906

907907
def disable_autolinking_runtime_compatibility_dynamic_replacements
908-
: Flag<[ "-" ],
909-
"disable-autolinking-runtime-compatibility-dynamic-replacements">,
908+
: Flag<[ "-" ], "disable-autolinking-runtime-compatibility-dynamic-replacements">,
910909
Flags<[ FrontendOption ]>,
911-
HelpText<"Do not use autolinking for runtime compatibility libraries">;
910+
HelpText<"Do not use autolinking for the dynamic replacement runtime "
911+
"compatibility library">;
912912

913913
include "FrontendOptions.td"

stdlib/public/CompatibilityDynamicReplacements/DynamicReplaceable.cpp

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,12 @@ extern "C" char *swift_getFunctionReplacement50(char **ReplFnPtr, char *CurrFn)
3535
if (RawReplFn == CurrFn)
3636
return nullptr;
3737

38-
auto origKey = (uintptr_t)SWIFT_THREAD_GETSPECIFIC(SWIFT_RUNTIME2_TLS_KEY);
38+
auto origKey =
39+
(uintptr_t)SWIFT_THREAD_GETSPECIFIC(SWIFT_COMPATIBILITY_50_TLS_KEY);
3940
if ((origKey & 0x1) != 0) {
4041
auto mask = ((uintptr_t)-1) < 1;
4142
auto resetKey = origKey & mask;
42-
SWIFT_THREAD_SETSPECIFIC(SWIFT_RUNTIME2_TLS_KEY, (void *)resetKey);
43+
SWIFT_THREAD_SETSPECIFIC(SWIFT_COMPATIBILITY_50_TLS_KEY, (void *)resetKey);
4344
return nullptr;
4445
}
4546
return ReplFn;
@@ -52,9 +53,10 @@ extern "C" char *swift_getOrigOfReplaceable50(char **OrigFnPtr) {
5253
return swift_getOrigOfReplaceable(OrigFnPtr);
5354

5455
char *OrigFn = *OrigFnPtr;
55-
auto origKey = (uintptr_t)SWIFT_THREAD_GETSPECIFIC(SWIFT_RUNTIME2_TLS_KEY);
56+
auto origKey =
57+
(uintptr_t)SWIFT_THREAD_GETSPECIFIC(SWIFT_COMPATIBILITY_50_TLS_KEY);
5658
auto newKey = origKey | 0x1;
57-
SWIFT_THREAD_SETSPECIFIC(SWIFT_RUNTIME2_TLS_KEY, (void *)newKey);
59+
SWIFT_THREAD_SETSPECIFIC(SWIFT_COMPATIBILITY_50_TLS_KEY, (void *)newKey);
5860
return OrigFn;
5961
}
6062

stdlib/public/runtime/ThreadLocalStorage.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ extern "C" int pthread_key_init_np(int key, void (*destructor)(void *));
6060

6161
# define SWIFT_RUNTIME_TLS_KEY __PTK_FRAMEWORK_SWIFT_KEY0
6262
# define SWIFT_STDLIB_TLS_KEY __PTK_FRAMEWORK_SWIFT_KEY1
63-
# define SWIFT_RUNTIME2_TLS_KEY __PTK_FRAMEWORK_SWIFT_KEY2
63+
# define SWIFT_COMPATIBILITY_50_TLS_KEY __PTK_FRAMEWORK_SWIFT_KEY2
6464

6565
#endif
6666

0 commit comments

Comments
 (0)