Example #1
0
/// emitBranchAndCleanups - Emit a branch to the given jump destination,
/// threading out through any cleanups we might need to run.  This does not
/// pop the cleanup stack.
void CleanupManager::emitBranchAndCleanups(JumpDest Dest,
                                           SILLocation BranchLoc,
                                           ArrayRef<SILValue> Args) {
  SILGenBuilder &B = Gen.getBuilder();
  assert(B.hasValidInsertionPoint() && "Emitting branch in invalid spot");
  emitCleanups(Dest.getDepth(), Dest.getCleanupLocation(), /*popCleanups=*/false);
  B.createBranch(BranchLoc, Dest.getBlock(), Args);
}