@@ -2111,9 +2111,9 @@ void DwarfDebug::beginInstruction(const MachineInstr *MI) {
2111
2111
// (The new location might be an explicit line 0, which we do emit.)
2112
2112
if (DL.getLine () == 0 && LastAsmLine == 0 )
2113
2113
return ;
2114
- if (DL == PrologEndLoc) {
2114
+ if (MI == PrologEndLoc) {
2115
2115
Flags |= DWARF2_FLAG_PROLOGUE_END | DWARF2_FLAG_IS_STMT;
2116
- PrologEndLoc = DebugLoc () ;
2116
+ PrologEndLoc = nullptr ;
2117
2117
}
2118
2118
// If the line changed, we call that a new statement; unless we went to
2119
2119
// line 0 and came back, in which case it is not a new statement. We also
@@ -2131,10 +2131,11 @@ void DwarfDebug::beginInstruction(const MachineInstr *MI) {
2131
2131
PrevInstLoc = DL;
2132
2132
}
2133
2133
2134
- static std::pair<DebugLoc, bool > findPrologueEndLoc (const MachineFunction *MF) {
2134
+ static std::pair<const MachineInstr *, bool >
2135
+ findPrologueEndLoc (const MachineFunction *MF) {
2135
2136
// First known non-DBG_VALUE and non-frame setup location marks
2136
2137
// the beginning of the function body.
2137
- DebugLoc LineZeroLoc;
2138
+ const MachineInstr * LineZeroLoc = nullptr ;
2138
2139
const Function &F = MF->getFunction ();
2139
2140
2140
2141
// Some instructions may be inserted into prologue after this function. Must
@@ -2151,9 +2152,9 @@ static std::pair<DebugLoc, bool> findPrologueEndLoc(const MachineFunction *MF) {
2151
2152
// meaningful breakpoint. If none is found, return the first
2152
2153
// location after the frame setup.
2153
2154
if (MI.getDebugLoc ().getLine ())
2154
- return std::make_pair (MI. getDebugLoc () , IsEmptyPrologue);
2155
+ return std::make_pair (&MI , IsEmptyPrologue);
2155
2156
2156
- LineZeroLoc = MI. getDebugLoc () ;
2157
+ LineZeroLoc = &MI ;
2157
2158
}
2158
2159
IsEmptyPrologue = false ;
2159
2160
}
@@ -2184,10 +2185,10 @@ static void recordSourceLine(AsmPrinter &Asm, unsigned Line, unsigned Col,
2184
2185
Discriminator, Fn);
2185
2186
}
2186
2187
2187
- DebugLoc DwarfDebug::emitInitialLocDirective ( const MachineFunction &MF,
2188
- unsigned CUID) {
2189
- std::pair<DebugLoc , bool > PrologEnd = findPrologueEndLoc (&MF);
2190
- DebugLoc PrologEndLoc = PrologEnd.first ;
2188
+ const MachineInstr *
2189
+ DwarfDebug::emitInitialLocDirective ( const MachineFunction &MF, unsigned CUID) {
2190
+ std::pair<const MachineInstr * , bool > PrologEnd = findPrologueEndLoc (&MF);
2191
+ const MachineInstr * PrologEndLoc = PrologEnd.first ;
2191
2192
bool IsEmptyPrologue = PrologEnd.second ;
2192
2193
2193
2194
// Get beginning of function.
@@ -2206,7 +2207,7 @@ DebugLoc DwarfDebug::emitInitialLocDirective(const MachineFunction &MF,
2206
2207
CUID, getDwarfVersion(), getUnits());
2207
2208
return PrologEndLoc;
2208
2209
}
2209
- return DebugLoc() ;
2210
+ return nullptr ;
2210
2211
}
2211
2212
2212
2213
// Gather pre-function debug information. Assumes being called immediately
0 commit comments