@@ -1102,6 +1102,12 @@ class SILBuilder {
1102
1102
getSILDebugLocation (Loc), Op, Ty, getFunction (), C.OpenedArchetypes ));
1103
1103
}
1104
1104
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
+
1105
1111
RefToBridgeObjectInst *createRefToBridgeObject (SILLocation Loc, SILValue Ref,
1106
1112
SILValue Bits) {
1107
1113
auto Ty = SILType::getBridgeObjectType (getASTContext ());
@@ -1847,7 +1853,18 @@ class SILBuilder {
1847
1853
// Unchecked cast helpers
1848
1854
// ===--------------------------------------------------------------------===//
1849
1855
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.
1851
1868
SingleValueInstruction *createUncheckedBitCast (SILLocation Loc, SILValue Op,
1852
1869
SILType Ty);
1853
1870
0 commit comments