mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-24 08:24:33 +00:00
There is no need to write a local utility routine to find subprogram info if the utility routine is already available in DebugInfo.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@140145 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -109,15 +109,6 @@ ModulePass *llvm::createGCOVProfilerPass(bool EmitNotes, bool EmitData,
|
|||||||
return new GCOVProfiler(EmitNotes, EmitData, Use402Format);
|
return new GCOVProfiler(EmitNotes, EmitData, Use402Format);
|
||||||
}
|
}
|
||||||
|
|
||||||
static DISubprogram findSubprogram(DIScope Scope) {
|
|
||||||
while (!Scope.isSubprogram()) {
|
|
||||||
assert(Scope.isLexicalBlock() &&
|
|
||||||
"Debug location not lexical block or subprogram");
|
|
||||||
Scope = DILexicalBlock(Scope).getContext();
|
|
||||||
}
|
|
||||||
return DISubprogram(Scope);
|
|
||||||
}
|
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
class GCOVRecord {
|
class GCOVRecord {
|
||||||
protected:
|
protected:
|
||||||
@ -403,7 +394,7 @@ void GCOVProfiler::emitGCNO() {
|
|||||||
if (Loc.isUnknown()) continue;
|
if (Loc.isUnknown()) continue;
|
||||||
if (Line == Loc.getLine()) continue;
|
if (Line == Loc.getLine()) continue;
|
||||||
Line = Loc.getLine();
|
Line = Loc.getLine();
|
||||||
if (SP != findSubprogram(DIScope(Loc.getScope(*Ctx)))) continue;
|
if (SP != getDISubprogram(Loc.getScope(*Ctx))) continue;
|
||||||
|
|
||||||
GCOVLines &Lines = Block.getFile(SP.getFilename());
|
GCOVLines &Lines = Block.getFile(SP.getFilename());
|
||||||
Lines.addLine(Loc.getLine());
|
Lines.addLine(Loc.getLine());
|
||||||
|
Reference in New Issue
Block a user