diff options
author | Nick Lewycky <nicholas@mxc.ca> | 2013-03-09 02:06:37 +0000 |
---|---|---|
committer | Nick Lewycky <nicholas@mxc.ca> | 2013-03-09 02:06:37 +0000 |
commit | 03aed11cdb6eb6a71f1f3d5a6a9b8dd6e68ba064 (patch) | |
tree | 0f16fc16f528656ec26fa1e0dcbb01eb2064d238 /llvm/lib | |
parent | 6c9265b07e1f43d9fa122724e2102e650cf28483 (diff) | |
download | bcm5719-llvm-03aed11cdb6eb6a71f1f3d5a6a9b8dd6e68ba064.tar.gz bcm5719-llvm-03aed11cdb6eb6a71f1f3d5a6a9b8dd6e68ba064.zip |
Fix bug introduced in r176616 when making function identifier numbers stable.
Count the subprograms, not the compile units.
llvm-svn: 176751
Diffstat (limited to 'llvm/lib')
-rw-r--r-- | llvm/lib/Transforms/Instrumentation/GCOVProfiling.cpp | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/llvm/lib/Transforms/Instrumentation/GCOVProfiling.cpp b/llvm/lib/Transforms/Instrumentation/GCOVProfiling.cpp index c448caa15ab..cc0356e3d6a 100644 --- a/llvm/lib/Transforms/Instrumentation/GCOVProfiling.cpp +++ b/llvm/lib/Transforms/Instrumentation/GCOVProfiling.cpp @@ -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, |