@@ -3352,11 +3352,24 @@ bool SILParser::parseSpecificSILInstruction(SILBuilder &B,
33523352 break ;
33533353 }
33543354 case SILInstructionKind::DestroyValueInst: {
3355- bool poisonRefs = false ;
3356- if (parseSILOptional (poisonRefs, *this , " poison" )
3357- || parseTypedValueRef (Val, B) || parseSILDebugLocation (InstLoc, B))
3355+ PoisonRefs_t poisonRefs = DontPoisonRefs;
3356+ IsDeadEnd_t isDeadEnd = IsntDeadEnd;
3357+ StringRef attributeName;
3358+ SourceLoc attributeLoc;
3359+ while (parseSILOptional (attributeName, attributeLoc, *this )) {
3360+ if (attributeName == " poison" )
3361+ poisonRefs = PoisonRefs;
3362+ else if (attributeName == " dead_end" )
3363+ isDeadEnd = IsDeadEnd;
3364+ else {
3365+ P.diagnose (attributeLoc, diag::sil_invalid_attribute_for_instruction,
3366+ attributeName, " destroy_value" );
3367+ return true ;
3368+ }
3369+ }
3370+ if (parseTypedValueRef (Val, B) || parseSILDebugLocation (InstLoc, B))
33583371 return true ;
3359- ResultVal = B.createDestroyValue (InstLoc, Val, PoisonRefs_t ( poisonRefs) );
3372+ ResultVal = B.createDestroyValue (InstLoc, Val, poisonRefs, isDeadEnd );
33603373 break ;
33613374 }
33623375 case SILInstructionKind::BeginCOWMutationInst: {
0 commit comments