Skip to content

Commit c6181e6

Browse files
committed
[ABI] Renamed method descriptor's SignedAsData to IsAsync.
In 26b3549, new bits were spoken for in MethodDescriptorFlags and ProtocolRequirementFlags to indicate that a field is an async function pointer and as such must is treated as data for the purposes of ptrauth. Previously, that bit was named IsSignedAsData because indeed async function pointers must be signed and authed as data. We should make the representation semantic, however, so here that name is changed to IsAsync.
1 parent dbea482 commit c6181e6

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

include/swift/ABI/MetadataValues.h

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -317,7 +317,7 @@ class MethodDescriptorFlags {
317317
KindMask = 0x0F, // 16 kinds should be enough for anybody
318318
IsInstanceMask = 0x10,
319319
IsDynamicMask = 0x20,
320-
IsSignedAsDataMask = 0x40,
320+
IsAsyncMask = 0x40,
321321
ExtraDiscriminatorShift = 16,
322322
ExtraDiscriminatorMask = 0xFFFF0000,
323323
};
@@ -346,12 +346,12 @@ class MethodDescriptorFlags {
346346
return copy;
347347
}
348348

349-
MethodDescriptorFlags withIsSignedAsData(bool isSignedAsData) const {
349+
MethodDescriptorFlags withIsAsync(bool isAsync) const {
350350
auto copy = *this;
351-
if (isSignedAsData)
352-
copy.Value |= IsSignedAsDataMask;
351+
if (isAsync)
352+
copy.Value |= IsAsyncMask;
353353
else
354-
copy.Value &= ~IsSignedAsDataMask;
354+
copy.Value &= ~IsAsyncMask;
355355
return copy;
356356
}
357357

@@ -372,7 +372,7 @@ class MethodDescriptorFlags {
372372
/// Note that 'init' is not considered an instance member.
373373
bool isInstance() const { return Value & IsInstanceMask; }
374374

375-
bool isSignedAsData() const { return Value & IsSignedAsDataMask; }
375+
bool isAsync() const { return Value & IsAsyncMask; }
376376

377377
uint16_t getExtraDiscriminator() const {
378378
return (Value >> ExtraDiscriminatorShift);
@@ -539,7 +539,7 @@ class ProtocolRequirementFlags {
539539
enum : int_type {
540540
KindMask = 0x0F, // 16 kinds should be enough for anybody
541541
IsInstanceMask = 0x10,
542-
IsSignedAsDataMask = 0x20,
542+
IsAsyncMask = 0x20,
543543
ExtraDiscriminatorShift = 16,
544544
ExtraDiscriminatorMask = 0xFFFF0000,
545545
};
@@ -559,12 +559,12 @@ class ProtocolRequirementFlags {
559559
return copy;
560560
}
561561

562-
ProtocolRequirementFlags withIsSignedAsData(bool isSignedAsData) const {
562+
ProtocolRequirementFlags withIsAsync(bool isAsync) const {
563563
auto copy = *this;
564-
if (isSignedAsData)
565-
copy.Value |= IsSignedAsDataMask;
564+
if (isAsync)
565+
copy.Value |= IsAsyncMask;
566566
else
567-
copy.Value &= ~IsSignedAsDataMask;
567+
copy.Value &= ~IsAsyncMask;
568568
return copy;
569569
}
570570

@@ -582,7 +582,7 @@ class ProtocolRequirementFlags {
582582
/// Note that 'init' is not considered an instance member.
583583
bool isInstance() const { return Value & IsInstanceMask; }
584584

585-
bool isSignedAsData() const { return Value & IsSignedAsDataMask; }
585+
bool isAsync() const { return Value & IsAsyncMask; }
586586

587587
bool isSignedWithAddress() const {
588588
return getKind() != Kind::BaseProtocol;

0 commit comments

Comments
 (0)