forked from OSchip/llvm-project
DwarfDebug: Check for null DebugLocs
`DL` might be null, so check for that before using accessors. A WIP patch to make `DIDescriptors` more strict fails otherwise. As a bonus, I think the logic is easier to follow now (despite the extra nesting depth). llvm-svn: 232836
This commit is contained in:
parent
a3bdc328a5
commit
d3a057733f
|
@ -970,7 +970,8 @@ void DwarfDebug::beginInstruction(const MachineInstr *MI) {
|
|||
// Check if source location changes, but ignore DBG_VALUE locations.
|
||||
if (!MI->isDebugValue()) {
|
||||
DebugLoc DL = MI->getDebugLoc();
|
||||
if (DL != PrevInstLoc && (!DL.isUnknown() || UnknownLocations)) {
|
||||
if (DL != PrevInstLoc) {
|
||||
if (!DL.isUnknown()) {
|
||||
unsigned Flags = 0;
|
||||
PrevInstLoc = DL;
|
||||
if (DL == PrologEndLoc) {
|
||||
|
@ -982,13 +983,14 @@ void DwarfDebug::beginInstruction(const MachineInstr *MI) {
|
|||
Asm->OutStreamer.getContext().getCurrentDwarfLoc().getLine())
|
||||
Flags |= DWARF2_FLAG_IS_STMT;
|
||||
|
||||
if (!DL.isUnknown()) {
|
||||
const MDNode *Scope = DL.getScope(Asm->MF->getFunction()->getContext());
|
||||
recordSourceLine(DL.getLine(), DL.getCol(), Scope, Flags);
|
||||
} else
|
||||
} else if (UnknownLocations) {
|
||||
PrevInstLoc = DL;
|
||||
recordSourceLine(0, 0, nullptr, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Insert labels where requested.
|
||||
DenseMap<const MachineInstr *, MCSymbol *>::iterator I =
|
||||
|
|
Loading…
Reference in New Issue