@@ -981,9 +981,8 @@ class SILPrinter : public SILInstructionVisitor<SILPrinter> {
981
981
982
982
// Print results.
983
983
auto results = I->getResults ();
984
- if (results.size () == 1 &&
985
- I->isStaticInitializerInst () &&
986
- I == &I->getParent ()->back ()) {
984
+ if (results.size () == 1 && !I->isDeleted () && I->isStaticInitializerInst ()
985
+ && I == &I->getParent ()->back ()) {
987
986
*this << " %initval = " ;
988
987
} else if (results.size () == 1 ) {
989
988
ID Name = Ctx.getID (results[0 ]);
@@ -1011,7 +1010,8 @@ class SILPrinter : public SILInstructionVisitor<SILPrinter> {
1011
1010
1012
1011
// Maybe print debugging information.
1013
1012
bool printedSlashes = false ;
1014
- if (Ctx.printDebugInfo () && !I->isStaticInitializerInst ()) {
1013
+ if (Ctx.printDebugInfo () && !I->isDeleted ()
1014
+ && !I->isStaticInitializerInst ()) {
1015
1015
auto &SM = I->getModule ().getASTContext ().SourceMgr ;
1016
1016
printDebugLocRef (I->getLoc (), SM);
1017
1017
printDebugScopeRef (I->getDebugScope (), SM);
@@ -1439,6 +1439,9 @@ class SILPrinter : public SILInstructionVisitor<SILPrinter> {
1439
1439
1440
1440
void printForwardingOwnershipKind (OwnershipForwardingMixin *inst,
1441
1441
SILValue op) {
1442
+ if (!op)
1443
+ return ;
1444
+
1442
1445
if (inst->getForwardingOwnershipKind () != op.getOwnershipKind ()) {
1443
1446
*this << " , forwarding: @" << inst->getForwardingOwnershipKind ();
1444
1447
}
0 commit comments