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 | ec6f2559fe1e257d221c9b4ce6c32584f7cc99b2 (patch) | |
tree | 285e7c06592a31de51f7fbe5a983eed7a54a8aaf /lib/Transforms/Instrumentation | |
parent | 6aaf0561aee34a44c5ac1e48cef94e9458e0dab6 (diff) | |
download | llvm-ec6f2559fe1e257d221c9b4ce6c32584f7cc99b2.tar.gz llvm-ec6f2559fe1e257d221c9b4ce6c32584f7cc99b2.tar.bz2 llvm-ec6f2559fe1e257d221c9b4ce6c32584f7cc99b2.tar.xz |
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
Diffstat (limited to 'lib/Transforms/Instrumentation')
-rw-r--r-- | lib/Transforms/Instrumentation/GCOVProfiling.cpp | 11 |
1 files changed, 1 insertions, 10 deletions
diff --git a/lib/Transforms/Instrumentation/GCOVProfiling.cpp b/lib/Transforms/Instrumentation/GCOVProfiling.cpp index 089c8b9876..1626293293 100644 --- a/lib/Transforms/Instrumentation/GCOVProfiling.cpp +++ b/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()); |