[llvm-commits] [llvm] r140145 - /llvm/trunk/lib/Transforms/Instrumentation/GCOVProfiling.cpp
Devang Patel
dpatel at apple.com
Tue Sep 20 08:57:19 PDT 2011
Author: dpatel
Date: Tue Sep 20 10:57:19 2011
New Revision: 140145
URL: http://llvm.org/viewvc/llvm-project?rev=140145&view=rev
Log:
There is no need to write a local utility routine to find subprogram info if the utility routine is already available in DebugInfo.
Modified:
llvm/trunk/lib/Transforms/Instrumentation/GCOVProfiling.cpp
Modified: llvm/trunk/lib/Transforms/Instrumentation/GCOVProfiling.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Instrumentation/GCOVProfiling.cpp?rev=140145&r1=140144&r2=140145&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Instrumentation/GCOVProfiling.cpp (original)
+++ llvm/trunk/lib/Transforms/Instrumentation/GCOVProfiling.cpp Tue Sep 20 10:57:19 2011
@@ -109,15 +109,6 @@
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 @@
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());
More information about the llvm-commits
mailing list