@@ -845,15 +845,12 @@ TryCatchFinallyScopes::runCleanupPad(CleanupCursor scope,
845845 //
846846 // cleanuppad:
847847 // %0 = cleanuppad within %funclet[]
848- // %frame = nullptr
849- // if (!_d_enter_cleanup(%frame)) br label %cleanupret
850- // else br label %copy
848+ // br label %copy
851849 //
852850 // copy:
853851 // invoke _dtor to %cleanupret unwind %unwindTo [ "funclet"(token %0) ]
854852 //
855853 // cleanupret:
856- // _d_leave_cleanup(%frame)
857854 // cleanupret %0 unwind %unwindTo
858855 //
859856 llvm::BasicBlock *cleanupbb = irs.insertBB (" cleanuppad" );
@@ -863,28 +860,14 @@ TryCatchFinallyScopes::runCleanupPad(CleanupCursor scope,
863860
864861 llvm::BasicBlock *cleanupret = irs.insertBBAfter (cleanupbb, " cleanupret" );
865862
866- // preparation to allocate some space on the stack where _d_enter_cleanup
867- // can place an exception frame (but not done here)
868- auto frame = getNullPtr ();
869-
870863 const auto savedInsertPoint = irs.saveInsertPoint ();
871864
872- auto endFn = getRuntimeFunction (Loc (), irs.module , " _d_leave_cleanup" );
873- irs.ir ->SetInsertPoint (cleanupret);
874- irs.DBuilder .EmitStopPoint (irs.func ()->decl ->loc );
875- irs.ir ->CreateCall (endFn, frame,
876- {llvm::OperandBundleDef (" funclet" , cleanuppad)}, " " );
877865 llvm::CleanupReturnInst::Create (cleanuppad, unwindTo, cleanupret);
878866
879867 auto copybb = cleanupScopes[scope].runCopying (irs, cleanupbb, cleanupret,
880868 unwindTo, cleanuppad);
881869
882- auto beginFn = getRuntimeFunction (Loc (), irs.module , " _d_enter_cleanup" );
883- irs.ir ->SetInsertPoint (cleanupbb);
884- irs.DBuilder .EmitStopPoint (irs.func ()->decl ->loc );
885- auto exec = irs.ir ->CreateCall (
886- beginFn, frame, {llvm::OperandBundleDef (" funclet" , cleanuppad)}, " " );
887- createBranch (exec, copybb, cleanupret, cleanupbb);
870+ createBranch (copybb, cleanupbb);
888871
889872 return cleanupbb;
890873}
0 commit comments