swift
e8e613bd - RCIdentity: fix another case of not-RC-identity-preserving casts.

Commit
4 years ago
RCIdentity: fix another case of not-RC-identity-preserving casts. When casting from existentials to class - and vice versa - it can happen that a cast is not RC identity preserving (because of potential bridging). This also affects mayRelease() of such cast instructions. For details see the comments in SILDynamicCastInst::isRCIdentityPreserving(). This change also includes some refactoring: I centralized the logic in SILDynamicCastInst::isRCIdentityPreserving(). rdar://problem/70454804
Author
Committer
Parents
  • include/swift/SIL
    • File
      DynamicCasts.h
  • lib
    • SIL
      • IR
        • File
          SILInstruction.cpp
      • Utils
        • File
          DynamicCasts.cpp
        • File
          MemAccessUtils.cpp
    • SILOptimizer/Analysis
      • File
        RCIdentityAnalysis.cpp
  • test/SILOptimizer
    • retain_release_code_motion.sil