[Swift in WebKit] Adopt the new spelling of some Swift-Cxx interop annotations - #75641
Conversation
…notations https://bugs.webkit.org/show_bug.cgi?id=326059 rdar://188992301 Reviewed by NOBODY (OOPS!). Rename SWIFT_ESCAPABLE, SWIFT_ESCAPABLE_IF, and SWIFT_NONESCAPABLE to SWIFT_SELF_CONTAINED, SWIFT_SELF_CONTAINED_IF, and SWIFT_VIEW respectively. * Source/WTF/wtf/EscapableByteSpan.h: * Source/WTF/wtf/Function.h: (WTF::Function<Out): * Source/WTF/wtf/HashMap.h: * Source/WTF/wtf/InlineWeakPtr.h: * Source/WTF/wtf/InlineWeakRef.h: * Source/WTF/wtf/RangeSet.h: * Source/WTF/wtf/Ref.h: * Source/WTF/wtf/RefPtr.h: * Source/WTF/wtf/RetainPtr.h: * Source/WTF/wtf/SwiftBridging.h: * Source/WTF/wtf/ThreadSafeWeakPtr.h: * Source/WTF/wtf/UniqueRef.h: * Source/WTF/wtf/Variant.h: * Source/WTF/wtf/Vector.h: * Source/WTF/wtf/WeakPtr.h: * Source/WTF/wtf/text/CString.h: * Source/WTF/wtf/text/WTFString.h: * Source/WebCore/platform/SelectionGeometry.h: * Source/WebCore/platform/graphics/IntRect.h: * Source/WebGPU/WebGPU/QuerySet.h: * Source/WebGPU/WebGPU/WebGPU.h: * Source/WebKit/Shared/SessionState.h:
|
EWS run on current version of this PR (hash 38a3b25) Details |
Xazax-hun
left a comment
There was a problem hiding this comment.
Looks good from the toolchain point of view. Added some nits inline for your consideration, but none of them are blockers.
| #ifndef SWIFT_NONESCAPABLE | ||
| #define SWIFT_NONESCAPABLE SWIFT_VIEW | ||
| #endif | ||
| #else |
There was a problem hiding this comment.
nit: I wonder if a comment might make it clearer what this else belongs to.
| // prefer the new spellings. | ||
| #ifdef SWIFT_VIEW | ||
| #ifndef SWIFT_ESCAPABLE | ||
| #define SWIFT_ESCAPABLE SWIFT_SELF_CONTAINED |
There was a problem hiding this comment.
Alternatively, if we don't want WebKit to ever use the old names, they could expand to something like static_assert(false, "SWIFT_ESCAPABLE is removed; use SWIFT_SELF_CONTAINED"). What do you think?
There was a problem hiding this comment.
Alternatively, if that doesn't produce the message we want, we could try #pragma GCC poison OLD_MACRO or something similar.
There was a problem hiding this comment.
Or you might be able to do something like:
#pragma clang deprecated(SWIFT_ESCAPABLE, "use 'SWIFT_SELF_CONTAINED' instead")
🧪 jsc-wpe
38a3b25
38a3b25