Please use GitHub pull requests for new patches. Avoid migrating existing patches. Phabricator shutdown timeline
Changeset View
Changeset View
Standalone View
Standalone View
llvm/lib/CodeGen/LiveDebugValues/InstrRefBasedImpl.cpp
Show First 20 Lines • Show All 1,320 Lines • ▼ Show 20 Lines | bool InstrRefBasedLDV::transferDebugValue(const MachineInstr &MI) { | ||||
DbgValueProperties Properties(MI); | DbgValueProperties Properties(MI); | ||||
// If there are no instructions in this lexical scope, do no location tracking | // If there are no instructions in this lexical scope, do no location tracking | ||||
// at all, this variable shouldn't get a legitimate location range. | // at all, this variable shouldn't get a legitimate location range. | ||||
auto *Scope = LS.findLexicalScope(MI.getDebugLoc().get()); | auto *Scope = LS.findLexicalScope(MI.getDebugLoc().get()); | ||||
if (Scope == nullptr) | if (Scope == nullptr) | ||||
return true; // handled it; by doing nothing | return true; // handled it; by doing nothing | ||||
// For now, ignore DBG_VALUE_LISTs when extending ranges. Allow it to | |||||
// contribute to locations in this block, but don't propagate further. | |||||
// Interpret it like a DBG_VALUE $noreg. | |||||
if (MI.isDebugValueList()) { | |||||
SmallVector<DbgOpID> EmptyDebugOps; | |||||
SmallVector<ResolvedDbgOp> EmptyResolvedDebugOps; | |||||
if (VTracker) | |||||
VTracker->defVar(MI, Properties, EmptyDebugOps); | |||||
if (TTracker) | |||||
TTracker->redefVar(MI, Properties, EmptyResolvedDebugOps); | |||||
return true; | |||||
} | |||||
// MLocTracker needs to know that this register is read, even if it's only | // MLocTracker needs to know that this register is read, even if it's only | ||||
// read by a debug inst. | // read by a debug inst. | ||||
for (const MachineOperand &MO : MI.debug_operands()) | for (const MachineOperand &MO : MI.debug_operands()) | ||||
if (MO.isReg() && MO.getReg() != 0) | if (MO.isReg() && MO.getReg() != 0) | ||||
(void)MTracker->readReg(MO.getReg()); | (void)MTracker->readReg(MO.getReg()); | ||||
// If we're preparing for the second analysis (variables), the machine value | // If we're preparing for the second analysis (variables), the machine value | ||||
// locations are already solved, and we report this DBG_VALUE and the value | // locations are already solved, and we report this DBG_VALUE and the value | ||||
▲ Show 20 Lines • Show All 2,757 Lines • Show Last 20 Lines |