Fix an obvious bug in SampleProfileReaderGCC.
Summary: The CallTargetProfile should be added to FProfile to be consistent with other profile readers.
Reviewers: dnovillo, davidxl
Reviewed By: davidxl
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D30233
llvm-svn: 295852
diff --git a/llvm/lib/ProfileData/SampleProfReader.cpp b/llvm/lib/ProfileData/SampleProfReader.cpp
index af80b03..6d06360 100644
--- a/llvm/lib/ProfileData/SampleProfReader.cpp
+++ b/llvm/lib/ProfileData/SampleProfReader.cpp
@@ -681,11 +681,9 @@
if (!GcovBuffer.readInt64(TargetCount))
return sampleprof_error::truncated;
- if (Update) {
- FunctionSamples &TargetProfile = Profiles[TargetName];
- TargetProfile.addCalledTargetSamples(LineOffset, Discriminator,
- TargetName, TargetCount);
- }
+ if (Update)
+ FProfile->addCalledTargetSamples(LineOffset, Discriminator,
+ TargetName, TargetCount);
}
}