mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-13 20:32:21 +00:00
While printing "interesting" breakpoint locations for debug info quality test harness, focus only on entry block's terminator for now.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@124610 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
bb6d14fbfe
commit
97f6d5b241
@ -349,34 +349,19 @@ struct BreakpointPrinter : public FunctionPass {
|
|||||||
}
|
}
|
||||||
|
|
||||||
virtual bool runOnFunction(Function &F) {
|
virtual bool runOnFunction(Function &F) {
|
||||||
for (Function::iterator I = F.begin(), E = F.end(); I != E; ++I) {
|
|
||||||
BasicBlock::const_iterator BI = I->end();
|
|
||||||
--BI;
|
|
||||||
do {
|
|
||||||
const Instruction *In = BI;
|
|
||||||
const DebugLoc DL = In->getDebugLoc();
|
|
||||||
if (!DL.isUnknown()) {
|
|
||||||
DIScope S(DL.getScope(getGlobalContext()));
|
|
||||||
Out << S.getFilename() << " " << DL.getLine() << "\n";
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
--BI;
|
|
||||||
} while (BI != I->begin());
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
BasicBlock &EntryBB = F.getEntryBlock();
|
BasicBlock &EntryBB = F.getEntryBlock();
|
||||||
for (Function::iterator I = F.begin(), E = F.end(); I != E; ++I) {
|
BasicBlock::const_iterator BI = EntryBB.end();
|
||||||
BasicBlock *BB = I;
|
--BI;
|
||||||
if (BB == &EntryBB) continue;
|
do {
|
||||||
for (BasicBlock::iterator BI = I->begin(), BE = I->end(); BI != BE; ++BI)
|
const Instruction *In = BI;
|
||||||
if (CallInst *CI = dyn_cast<CallInst>(BI)) {
|
const DebugLoc DL = In->getDebugLoc();
|
||||||
const DebugLoc DL = CI->getDebugLoc();
|
if (!DL.isUnknown()) {
|
||||||
if (!DL.isUnknown()) {
|
DIScope S(DL.getScope(getGlobalContext()));
|
||||||
DIScope S(DL.getScope(getGlobalContext()));
|
Out << S.getFilename() << " " << DL.getLine() << "\n";
|
||||||
Out << S.getFilename() << " " << DL.getLine() << "\n";
|
break;
|
||||||
}
|
}
|
||||||
}
|
--BI;
|
||||||
}
|
} while (BI != EntryBB.begin());
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user