Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions llvm/lib/CodeGen/MachineDebugify.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -123,10 +123,13 @@ bool applyDebugifyMetadataToMachineFunction(MachineModuleInfo &MMI,

// Find a suitable local variable for the DBG_VALUE.
unsigned Line = MI.getDebugLoc().getLine();
if (!Line2Var.count(Line))
auto It = Line2Var.find(Line);
if (It == Line2Var.end()) {
Line = EarliestDVI ? EarliestDVI->getDebugLoc().getLine()
: EarliestDVR->getDebugLoc().getLine();
DILocalVariable *LocalVar = Line2Var[Line];
It = Line2Var.try_emplace(Line).first;
}
DILocalVariable *LocalVar = It->second;
assert(LocalVar && "No variable for current line?");
VarSet.insert(LocalVar);

Expand Down