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
This commit is contained in:
Nick Lewycky 2013-03-09 02:06:37 +00:00
parent 17d2f77601
commit 8fa6dc431d

View File

@ -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,