diff options
| author | Devang Patel <dpatel@apple.com> | 2011-09-20 15:57:19 +0000 | 
|---|---|---|
| committer | Devang Patel <dpatel@apple.com> | 2011-09-20 15:57:19 +0000 | 
| commit | b011105d6c246a27aebe26a6f5f0bd45fc9ea802 (patch) | |
| tree | c729d321ac5658f6f42790f0248cc95b0a45b70f /llvm/lib/Transforms | |
| parent | 96a806199dc587608000f83a9e9bd919e848cab6 (diff) | |
| download | bcm5719-llvm-b011105d6c246a27aebe26a6f5f0bd45fc9ea802.tar.gz bcm5719-llvm-b011105d6c246a27aebe26a6f5f0bd45fc9ea802.zip | |
There is no need to write a local utility routine to find subprogram info if the utility routine is already available in DebugInfo.
llvm-svn: 140145
Diffstat (limited to 'llvm/lib/Transforms')
| -rw-r--r-- | llvm/lib/Transforms/Instrumentation/GCOVProfiling.cpp | 11 | 
1 files changed, 1 insertions, 10 deletions
| diff --git a/llvm/lib/Transforms/Instrumentation/GCOVProfiling.cpp b/llvm/lib/Transforms/Instrumentation/GCOVProfiling.cpp index 089c8b98761..16262932936 100644 --- a/llvm/lib/Transforms/Instrumentation/GCOVProfiling.cpp +++ b/llvm/lib/Transforms/Instrumentation/GCOVProfiling.cpp @@ -109,15 +109,6 @@ ModulePass *llvm::createGCOVProfilerPass(bool EmitNotes, bool EmitData,    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 {    class GCOVRecord {     protected: @@ -403,7 +394,7 @@ void GCOVProfiler::emitGCNO() {              if (Loc.isUnknown()) continue;              if (Line == Loc.getLine()) continue;              Line = Loc.getLine(); -            if (SP != findSubprogram(DIScope(Loc.getScope(*Ctx)))) continue; +            if (SP != getDISubprogram(Loc.getScope(*Ctx))) continue;              GCOVLines &Lines = Block.getFile(SP.getFilename());              Lines.addLine(Loc.getLine()); | 

