mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-09-25 17:20:48 +00:00
Rewrite calculateDbgValueHistory to make it (hopefully) more transparent.
This change preserves the original algorithm of generating history for user variables, but makes it more clear. High-level description of algorithm: Scan all the machine basic blocks and machine instructions in the order they are emitted to the object file. Do the following: 1) If we see a DBG_VALUE instruction, add it to the history of the corresponding user variable. Keep track of all user variables, whose locations are described by a register. 2) If we see a regular instruction, look at all the registers it clobbers, and terminate the location range for all variables described by these registers. 3) At the end of the basic block, terminate location ranges for all user variables described by some register. Although this change shouldn't be user-visible (the contents of .debug_loc section should be the same), it changes some internal assumptions about the set of instructions used to track the variable locations. Watching the bots. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@209225 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -1201,10 +1201,10 @@ DwarfDebug::collectVariableInfo(SmallPtrSet<const MDNode *, 16> &Processed) {
|
||||
const MachineInstr *End = HI[1];
|
||||
DEBUG(dbgs() << "DotDebugLoc Pair:\n"
|
||||
<< "\t" << *Begin << "\t" << *End << "\n");
|
||||
if (End->isDebugValue())
|
||||
if (End->isDebugValue() && End->getDebugVariable() == DV)
|
||||
SLabel = getLabelBeforeInsn(End);
|
||||
else {
|
||||
// End is a normal instruction clobbering the range.
|
||||
// End is clobbering the range.
|
||||
SLabel = getLabelAfterInsn(End);
|
||||
assert(SLabel && "Forgot label after clobber instruction");
|
||||
++HI;
|
||||
@@ -1415,7 +1415,7 @@ void DwarfDebug::beginFunction(const MachineFunction *MF) {
|
||||
LabelsBeforeInsn[History.front()] = FunctionBeginSym;
|
||||
|
||||
for (const MachineInstr *MI : History) {
|
||||
if (MI->isDebugValue())
|
||||
if (MI->isDebugValue() && MI->getDebugVariable() == DV)
|
||||
requestLabelBeforeInsn(MI);
|
||||
else
|
||||
requestLabelAfterInsn(MI);
|
||||
|
Reference in New Issue
Block a user