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