Skip to content

Commit cabd44d

Browse files
authored
Merge pull request #11058 from aschwaighofer/add_comment
2 parents 0c0532a + ebf7230 commit cabd44d

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

include/swift/SIL/SILNodes.def

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -283,6 +283,10 @@ ABSTRACT_VALUE(SILInstruction, ValueBase)
283283
INST(ObjCMetatypeToObjectInst, ConversionInst, objc_metatype_to_object, None, DoesNotRelease)
284284
INST(ObjCExistentialMetatypeToObjectInst, ConversionInst, objc_existential_metatype_to_object, None,
285285
DoesNotRelease)
286+
// We have to use a MayRead here to block moving the ultimate release
287+
// accross the cast (which reads the type metadata). With Semantic SIL we
288+
// should be able to move this back to None - it should model the scoping
289+
// and forbid the compiler from moving the ultimate retain.
286290
INST(UnconditionalCheckedCastValueInst, ConversionInst, unconditional_checked_cast_value, MayRead, DoesNotRelease)
287291
INST(UnconditionalCheckedCastInst, ConversionInst, unconditional_checked_cast, MayRead, DoesNotRelease)
288292
VALUE_RANGE(ConversionInst, UpcastInst, UnconditionalCheckedCastInst)

0 commit comments

Comments
 (0)