@@ -328,34 +328,6 @@ namespace {
328
328
329
329
bool isOperandIndirect () const { return Strategy == CastStrategy::Address; }
330
330
331
- ManagedValue emitOperand (Expr *operand) {
332
- AbstractionPattern mostGeneral =
333
- SGF.SGM .Types .getMostGeneralAbstraction ();
334
- auto &origSourceTL = SGF.getTypeLowering (mostGeneral, SourceType);
335
-
336
- SGFContext ctx;
337
-
338
- std::unique_ptr<TemporaryInitialization> temporary;
339
- if (isOperandIndirect () && SGF.silConv .useLoweredAddresses ()) {
340
- temporary = SGF.emitTemporary (Loc, origSourceTL);
341
- ctx = SGFContext (temporary.get ());
342
- }
343
-
344
- auto result =
345
- SGF.emitRValueAsOrig (operand, mostGeneral, origSourceTL, ctx);
346
-
347
- if (isOperandIndirect () && SGF.silConv .useLoweredAddresses ()) {
348
- // Force the result into the temporary if it's not already there.
349
- if (!result.isInContext ()) {
350
- result.forwardInto (SGF, Loc, temporary->getAddress ());
351
- temporary->finishInitialization (SGF);
352
- }
353
- return temporary->getManagedAddress ();
354
- }
355
-
356
- return result;
357
- }
358
-
359
331
RValue emitUnconditionalCast (ManagedValue operand, SGFContext ctx) {
360
332
// The cast functions don't know how to work with anything but
361
333
// the most general possible abstraction level.
@@ -542,17 +514,6 @@ namespace {
542
514
};
543
515
} // end anonymous namespace
544
516
545
- void SILGenFunction::emitCheckedCastBranchOld (
546
- SILLocation loc, Expr *source, Type targetType, SGFContext ctx,
547
- llvm::function_ref<void (ManagedValue)> handleTrue,
548
- llvm::function_ref<void()> handleFalse, ProfileCounter TrueCount,
549
- ProfileCounter FalseCount) {
550
- CheckedCastEmitterOld emitter (*this , loc, source->getType (), targetType);
551
- ManagedValue operand = emitter.emitOperand (source);
552
- emitter.emitConditional (operand, CastConsumptionKind::TakeAlways, ctx,
553
- handleTrue, handleFalse, TrueCount, FalseCount);
554
- }
555
-
556
517
void SILGenFunction::emitCheckedCastBranchOld (
557
518
SILLocation loc, ConsumableManagedValue src, Type sourceType,
558
519
CanType targetType, SGFContext ctx,
0 commit comments