Skip to content

Commit 6647ba5

Browse files
Merge pull request swiftlang#80469 from nate-chandler/bug/20250402/1
[IRGen] Fix LinkEntity::isTypeKind.
2 parents 562d7dc + f7dea2f commit 6647ba5

File tree

1 file changed

+13
-9
lines changed

1 file changed

+13
-9
lines changed

include/swift/IRGen/Linking.h

+13-9
Original file line numberDiff line numberDiff line change
@@ -453,6 +453,7 @@ class LinkEntity {
453453
ProtocolConformanceDescriptorRecord,
454454

455455
// These are both type kinds and protocol-conformance kinds.
456+
// TYPE KINDS: BEGIN {{
456457

457458
/// A lazy protocol witness accessor function. The pointer is a
458459
/// canonical TypeBase*, and the secondary pointer is a
@@ -503,9 +504,6 @@ class LinkEntity {
503504
/// A coroutine continuation prototype function.
504505
CoroutineContinuationPrototype,
505506

506-
/// A global function pointer for dynamically replaceable functions.
507-
DynamicallyReplaceableFunctionVariable,
508-
509507
/// A reference to a metaclass-stub for a statically specialized generic
510508
/// class.
511509
/// The pointer is a canonical TypeBase*.
@@ -525,6 +523,16 @@ class LinkEntity {
525523
/// The pointer is a canonical TypeBase*.
526524
NoncanonicalSpecializedGenericTypeMetadataCacheVariable,
527525

526+
/// Extended existential type shape.
527+
/// Pointer is the (generalized) existential type.
528+
/// SecondaryPointer is the GenericSignatureImpl*.
529+
ExtendedExistentialTypeShape,
530+
531+
// TYPE KINDS: END }}
532+
533+
/// A global function pointer for dynamically replaceable functions.
534+
DynamicallyReplaceableFunctionVariable,
535+
528536
/// Provides the data required to invoke an async function using the async
529537
/// calling convention in the form of the size of the context to allocate
530538
/// and the relative address of the function to call with that allocated
@@ -556,11 +564,6 @@ class LinkEntity {
556564
/// The pointer is a SILFunction*.
557565
AccessibleFunctionRecord,
558566

559-
/// Extended existential type shape.
560-
/// Pointer is the (generalized) existential type.
561-
/// SecondaryPointer is the GenericSignatureImpl*.
562-
ExtendedExistentialTypeShape,
563-
564567
/// A global struct containing a relative pointer to the single-yield
565568
/// coroutine ramp function and the fixed-size to be allocated in the
566569
/// caller.
@@ -624,7 +627,8 @@ class LinkEntity {
624627

625628
static bool isDeclKind(Kind k) { return k <= Kind::CoroFunctionPointerAST; }
626629
static bool isTypeKind(Kind k) {
627-
return k >= Kind::ProtocolWitnessTableLazyAccessFunction;
630+
return k >= Kind::ProtocolWitnessTableLazyAccessFunction &&
631+
k < Kind::DynamicallyReplaceableFunctionVariable;
628632
}
629633

630634
static bool isRootProtocolConformanceKind(Kind k) {

0 commit comments

Comments
 (0)