Commit afcdf180 by phoon

set line of exception handling basic blocks to zero

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