aboutsummaryrefslogtreecommitdiff
path: root/lib/profile/InstrProfilingMergeFile.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/profile/InstrProfilingMergeFile.c')
-rw-r--r--lib/profile/InstrProfilingMergeFile.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/lib/profile/InstrProfilingMergeFile.c b/lib/profile/InstrProfilingMergeFile.c
index ac5ee9fbedc6..dc1bc9762676 100644
--- a/lib/profile/InstrProfilingMergeFile.c
+++ b/lib/profile/InstrProfilingMergeFile.c
@@ -10,6 +10,8 @@
|* stored in files.
\*===----------------------------------------------------------------------===*/
+#if !defined(__Fuchsia__)
+
#include "InstrProfiling.h"
#include "InstrProfilingInternal.h"
#include "InstrProfilingUtil.h"
@@ -17,25 +19,27 @@
#define INSTR_PROF_VALUE_PROF_DATA
#include "InstrProfData.inc"
-void (*VPMergeHook)(ValueProfData *,
- __llvm_profile_data *) = &lprofMergeValueProfData;
-
/* Merge value profile data pointed to by SrcValueProfData into
* in-memory profile counters pointed by to DstData. */
void lprofMergeValueProfData(ValueProfData *SrcValueProfData,
__llvm_profile_data *DstData) {
- unsigned I, S, V, C;
+ unsigned I, S, V, DstIndex = 0;
InstrProfValueData *VData;
ValueProfRecord *VR = getFirstValueProfRecord(SrcValueProfData);
for (I = 0; I < SrcValueProfData->NumValueKinds; I++) {
VData = getValueProfRecordValueData(VR);
+ unsigned SrcIndex = 0;
for (S = 0; S < VR->NumValueSites; S++) {
uint8_t NV = VR->SiteCountArray[S];
for (V = 0; V < NV; V++) {
- for (C = 0; C < VData[V].Count; C++)
- __llvm_profile_instrument_target(VData[V].Value, DstData, S);
+ __llvm_profile_instrument_target_value(VData[SrcIndex].Value, DstData,
+ DstIndex, VData[SrcIndex].Count);
+ ++SrcIndex;
}
+ ++DstIndex;
}
VR = getValueProfRecordNext(VR);
}
}
+
+#endif