Commit afcdf180 by phoon

set line of exception handling basic blocks to zero

parent 1a758e17
...@@ -13,20 +13,22 @@ struct VisBasicBlock { ...@@ -13,20 +13,22 @@ struct VisBasicBlock {
VisBasicBlock(BasicBlock &BB, unsigned Function) VisBasicBlock(BasicBlock &BB, unsigned Function)
: Line(-1u), LineEnd(0), Function(Function) { : Line(-1u), LineEnd(0), Function(Function) {
for (auto &Inst : BB) { if (BB.begin()->getOpcode() != Instruction::LandingPad) {
if (auto Loc = Inst.getDebugLoc()) { for (auto &Inst : BB) {
if (Loc.getLine() == 0) if (auto Loc = Inst.getDebugLoc()) {
continue; if (Loc.getLine() == 0)
auto theLoc = Loc.get(); continue;
if (auto loc_tmp = theLoc->getInlinedAt()) { auto theLoc = Loc.get();
while (loc_tmp->getInlinedAt()) { if (auto loc_tmp = theLoc->getInlinedAt()) {
loc_tmp = loc_tmp->getInlinedAt(); while (loc_tmp->getInlinedAt()) {
loc_tmp = loc_tmp->getInlinedAt();
}
theLoc = loc_tmp;
} }
theLoc = loc_tmp; Line = std::min(Line, theLoc->getLine());
} LineEnd = std::max(LineEnd, theLoc->getLine());
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
if (Line == -1u) if (Line == -1u)
......
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