@@ -202,21 +202,22 @@ SILValue EscapeAnalysis::getPointerBase(SILValue value) {
202
202
case ValueKind::RefToRawPointerInst:
203
203
case ValueKind::RefToBridgeObjectInst:
204
204
case ValueKind::BridgeObjectToRefInst:
205
+ return cast<SingleValueInstruction>(value)->getOperand (0 );
206
+
205
207
case ValueKind::UnconditionalCheckedCastInst:
208
+ case ValueKind::UncheckedAddrCastInst:
206
209
// DO NOT use LOADABLE_REF_STORAGE because unchecked references don't have
207
210
// retain/release instructions that trigger the 'default' case.
208
211
#define ALWAYS_OR_SOMETIMES_LOADABLE_CHECKED_REF_STORAGE (Name, ...) \
209
212
case ValueKind::RefTo##Name##Inst: \
210
213
case ValueKind::Name##ToRefInst:
211
214
#include " swift/AST/ReferenceStorage.def"
212
- return cast<SingleValueInstruction>(value)->getOperand (0 );
213
-
214
- case ValueKind::UncheckedAddrCastInst: {
215
- auto *uac = cast<UncheckedAddrCastInst>(value);
216
- SILValue op = uac->getOperand ();
215
+ {
216
+ auto *svi = cast<SingleValueInstruction>(value);
217
+ SILValue op = svi->getOperand (0 );
217
218
SILType srcTy = op->getType ().getObjectType ();
218
219
SILType destTy = value->getType ().getObjectType ();
219
- SILFunction *f = uac ->getFunction ();
220
+ SILFunction *f = svi ->getFunction ();
220
221
// If the source and destination of the cast don't agree on being a pointer,
221
222
// we bail. Otherwise we would miss important edges in the connection graph:
222
223
// e.g. loads of non-pointers are ignored, while it could be an escape of
0 commit comments