[llvm] r176751 - Fix bug introduced in r176616 when making function identifier numbers stable.
Nick Lewycky
nicholas at mxc.ca
Fri Mar 8 18:06:37 PST 2013
Author: nicholas
Date: Fri Mar 8 20:06:37 2013
New Revision: 176751
URL: http://llvm.org/viewvc/llvm-project?rev=176751&view=rev
Log:
Fix bug introduced in r176616 when making function identifier numbers stable.
Count the subprograms, not the compile units.
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=176751&r1=176750&r2=176751&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Instrumentation/GCOVProfiling.cpp (original)
+++ llvm/trunk/lib/Transforms/Instrumentation/GCOVProfiling.cpp Fri Mar 8 20:06:37 2013
@@ -665,10 +665,8 @@ void GCOVProfiler::insertCounterWriteout
Builder.CreateCall2(StartFile,
Builder.CreateGlobalStringPtr(FilenameGcda),
Builder.CreateGlobalStringPtr(Version));
- for (ArrayRef<std::pair<GlobalVariable *, MDNode *> >::iterator
- I = CountersBySP.begin(), E = CountersBySP.end();
- I != E; ++I) {
- DISubprogram SP(I->second);
+ for (unsigned j = 0, e = CountersBySP.size(); j != e; ++j) {
+ DISubprogram SP(CountersBySP[j].second);
Builder.CreateCall3(EmitFunction,
Builder.getInt32(i),
NoFunctionNamesInData ?
@@ -676,7 +674,7 @@ void GCOVProfiler::insertCounterWriteout
Builder.CreateGlobalStringPtr(SP.getName()),
Builder.getInt8(UseExtraChecksum));
- GlobalVariable *GV = I->first;
+ GlobalVariable *GV = CountersBySP[j].first;
unsigned Arcs =
cast<ArrayType>(GV->getType()->getElementType())->getNumElements();
Builder.CreateCall2(EmitArcs,
More information about the llvm-commits
mailing list