File tree Expand file tree Collapse file tree 2 files changed +6
-8
lines changed Expand file tree Collapse file tree 2 files changed +6
-8
lines changed Original file line number Diff line number Diff line change @@ -83,10 +83,8 @@ METADATAKIND(HeapGenericLocalVariable, 65)
83
83
// / A native error object.
84
84
METADATAKIND(ErrorObject, 128 )
85
85
86
- // / All metadata kinds in this range are non-isa metadata. Any "metadata" values
87
- // / outside of this range are objective-c class isa pointers. These isa pointers
88
- // / are of course not "true" swift metadata.
89
- ABSTRACTMETADATAKIND(NonIsaMetadata, Class, ErrorObject)
86
+ // getEnumeratedMetadataKind assumes that all the enumerated values here
87
+ // will be <= LastEnumeratedMetadataKind.
90
88
91
89
#undef ABSTRACTMETADATAKIND
92
90
#undef NOMINALTYPEMETADATAKIND
Original file line number Diff line number Diff line change @@ -39,12 +39,12 @@ enum class MetadataKind : uint32_t {
39
39
#include " MetadataKind.def"
40
40
};
41
41
42
+ const unsigned LastEnumeratedMetadataKind = 2047 ;
43
+
42
44
// / Try to translate the 'isa' value of a type/heap metadata into a value
43
45
// / of the MetadataKind enum.
44
- template <typename StoredPointer>
45
- MetadataKind getEnumeratedMetadataKind (StoredPointer kind) {
46
- if (kind > static_cast <StoredPointer>(MetadataKind::NonIsaMetadata_End) ||
47
- kind < static_cast <StoredPointer>(MetadataKind::NonIsaMetadata_Start))
46
+ inline MetadataKind getEnumeratedMetadataKind (uint64_t kind) {
47
+ if (kind > LastEnumeratedMetadataKind)
48
48
return MetadataKind::Class;
49
49
return MetadataKind (kind);
50
50
}
You can’t perform that action at this time.
0 commit comments