@@ -1102,6 +1102,12 @@ class SILBuilder {
11021102 getSILDebugLocation (Loc), Op, Ty, getFunction (), C.OpenedArchetypes ));
11031103 }
11041104
1105+ UncheckedValueCastInst *createUncheckedValueCast (SILLocation Loc, SILValue Op,
1106+ SILType Ty) {
1107+ return insert (UncheckedValueCastInst::create (
1108+ getSILDebugLocation (Loc), Op, Ty, getFunction (), C.OpenedArchetypes ));
1109+ }
1110+
11051111 RefToBridgeObjectInst *createRefToBridgeObject (SILLocation Loc, SILValue Ref,
11061112 SILValue Bits) {
11071113 auto Ty = SILType::getBridgeObjectType (getASTContext ());
@@ -1847,7 +1853,18 @@ class SILBuilder {
18471853 // Unchecked cast helpers
18481854 // ===--------------------------------------------------------------------===//
18491855
1850- // Create the appropriate cast instruction based on result type.
1856+ // / Create the appropriate cast instruction based on result type.
1857+ // /
1858+ // / NOTE: We allow for non-layout compatible casts that shrink the underlying
1859+ // / type we are bit casting!
1860+ SingleValueInstruction *
1861+ createUncheckedReinterpretCast (SILLocation Loc, SILValue Op, SILType Ty);
1862+
1863+ // / Create an appropriate cast instruction based on result type.
1864+ // /
1865+ // / NOTE: This assumes that the input and the result cast are layout
1866+ // / compatible. Reduces to createUncheckedReinterpretCast when ownership is
1867+ // / disabled.
18511868 SingleValueInstruction *createUncheckedBitCast (SILLocation Loc, SILValue Op,
18521869 SILType Ty);
18531870
0 commit comments