Commit 1a758e17 by phoon

get original line of source code for inlined function call

parent 89d9e054
...@@ -17,8 +17,15 @@ struct VisBasicBlock { ...@@ -17,8 +17,15 @@ struct VisBasicBlock {
if (auto Loc = Inst.getDebugLoc()) { if (auto Loc = Inst.getDebugLoc()) {
if (Loc.getLine() == 0) if (Loc.getLine() == 0)
continue; continue;
Line = std::min(Line, Loc.getLine()); auto theLoc = Loc.get();
LineEnd = std::max(LineEnd, Loc.getLine()); if (auto loc_tmp = theLoc->getInlinedAt()) {
while (loc_tmp->getInlinedAt()) {
loc_tmp = loc_tmp->getInlinedAt();
}
theLoc = loc_tmp;
}
Line = std::min(Line, theLoc->getLine());
LineEnd = std::max(LineEnd, theLoc->getLine());
} }
} }
// Restore to 0 when debug info is not available // Restore to 0 when debug info is not available
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment