@@ -1384,6 +1384,7 @@ bool InstrRefBasedLDV::transferDebugValue(const MachineInstr &MI) {
1384
1384
1385
1385
// MLocTracker needs to know that this register is read, even if it's only
1386
1386
// read by a debug inst.
1387
+ bool convertToSwiftAsyncEntryValue = false ;
1387
1388
for (const MachineOperand &MO : MI.debug_operands ())
1388
1389
if (MO.isReg () && MO.getReg () != 0 ) {
1389
1390
ValueIDNum RegId = MTracker->readReg (MO.getReg ());
@@ -1401,16 +1402,19 @@ bool InstrRefBasedLDV::transferDebugValue(const MachineInstr &MI) {
1401
1402
if (!Expr || !Expr->isEntryValue ()) {
1402
1403
if (TTracker)
1403
1404
TTracker->recoverAsEntryValue (V, Properties, RegId);
1404
- else {
1405
- const_cast <MachineInstr *>(&MI)
1406
- ->getOperand (MI.isDebugValueList () ? 1 : 3 )
1407
- .setMetadata (
1408
- DIExpression::prepend (Expr, DIExpression::EntryValue));
1409
- }
1405
+ else
1406
+ convertToSwiftAsyncEntryValue = true ;
1410
1407
}
1411
1408
}
1412
1409
}
1413
- // END SWIFT
1410
+
1411
+ if (convertToSwiftAsyncEntryValue && Expr) {
1412
+ const_cast <MachineInstr *>(&MI)
1413
+ ->getOperand (MI.isDebugValueList () ? 1 : 3 )
1414
+ .setMetadata (DIExpression::prepend (Expr, DIExpression::EntryValue));
1415
+ Properties.DIExpr = MI.getDebugExpression ();
1416
+ }
1417
+ // END SWIFT
1414
1418
1415
1419
// If we're preparing for the second analysis (variables), the machine value
1416
1420
// locations are already solved, and we report this DBG_VALUE and the value
0 commit comments