aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Transforms/Instrumentation
diff options
context:
space:
mode:
authorNick Lewycky <nicholas@mxc.ca>2013-03-09 02:06:37 +0000
committerNick Lewycky <nicholas@mxc.ca>2013-03-09 02:06:37 +0000
commit8fa6dc431deb7a9aadc23ec0a7bdcb2d02330972 (patch)
tree7186c83e84c79421b42f81e575c587f68b900f6d /lib/Transforms/Instrumentation
parent17d2f776011cba33f7f5afb03c8066d35dbf8afc (diff)
downloadexternal_llvm-8fa6dc431deb7a9aadc23ec0a7bdcb2d02330972.zip
external_llvm-8fa6dc431deb7a9aadc23ec0a7bdcb2d02330972.tar.gz
external_llvm-8fa6dc431deb7a9aadc23ec0a7bdcb2d02330972.tar.bz2
Fix bug introduced in r176616 when making function identifier numbers stable.
Count the subprograms, not the compile units. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176751 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/Instrumentation')
-rw-r--r--lib/Transforms/Instrumentation/GCOVProfiling.cpp8
1 files changed, 3 insertions, 5 deletions
diff --git a/lib/Transforms/Instrumentation/GCOVProfiling.cpp b/lib/Transforms/Instrumentation/GCOVProfiling.cpp
index c448caa..cc0356e 100644
--- a/lib/Transforms/Instrumentation/GCOVProfiling.cpp
+++ b/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,