#include <assert.h>
#include <limits.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "InstrProfiling.h"
#include "InstrProfilingInternal.h"
#include "InstrProfilingUtil.h"
#define INSTR_PROF_VALUE_PROF_DATA
#define INSTR_PROF_COMMON_API_IMPL
#define INSTR_PROF_VALUE_PROF_MEMOP_API
#include "profile/InstrProfData.inc"
static int hasStaticCounters = …;
static int OutOfNodesWarnings = …;
static int hasNonDefaultValsPerSite = …;
#define INSTR_PROF_MAX_VP_WARNS …
#define INSTR_PROF_DEFAULT_NUM_VAL_PER_SITE …
#define INSTR_PROF_VNODE_POOL_SIZE …
#ifndef _MSC_VER
COMPILER_RT_VISIBILITY ValueProfNode
lprofValueProfNodes[INSTR_PROF_VNODE_POOL_SIZE] COMPILER_RT_SECTION(…);
#endif
COMPILER_RT_VISIBILITY uint32_t VPMaxNumValsPerSite = …;
COMPILER_RT_VISIBILITY void lprofSetupValueProfiler(void) { … }
COMPILER_RT_VISIBILITY void lprofSetMaxValsPerSite(uint32_t MaxVals) { … }
COMPILER_RT_VISIBILITY void
__llvm_profile_set_num_value_sites(__llvm_profile_data *Data,
uint32_t ValueKind, uint16_t NumValueSites) { … }
COMPILER_RT_VISIBILITY const __llvm_profile_data *
__llvm_profile_iterate_data(const __llvm_profile_data *Data) { … }
COMPILER_RT_VISIBILITY void *
__llvm_get_function_addr(const __llvm_profile_data *Data) { … }
static int allocateValueProfileCounters(__llvm_profile_data *Data) { … }
static ValueProfNode *allocateOneNode(void) { … }
static COMPILER_RT_ALWAYS_INLINE void
instrumentTargetValueImpl(uint64_t TargetValue, void *Data,
uint32_t CounterIndex, uint64_t CountValue) { … }
COMPILER_RT_VISIBILITY void
__llvm_profile_instrument_target(uint64_t TargetValue, void *Data,
uint32_t CounterIndex) { … }
COMPILER_RT_VISIBILITY void
__llvm_profile_instrument_target_value(uint64_t TargetValue, void *Data,
uint32_t CounterIndex,
uint64_t CountValue) { … }
COMPILER_RT_VISIBILITY void
__llvm_profile_instrument_memop(uint64_t TargetValue, void *Data,
uint32_t CounterIndex) { … }
ValueProfRuntimeRecord;
static uint32_t getNumValueSitesRT(const void *R, uint32_t VK) { … }
static uint32_t getNumValueDataRT(const void *R, uint32_t VK) { … }
static uint32_t getNumValueDataForSiteRT(const void *R, uint32_t VK,
uint32_t S) { … }
static ValueProfRuntimeRecord RTRecord;
static ValueProfRecordClosure RTRecordClosure = …;
static uint32_t
initializeValueProfRuntimeRecord(const __llvm_profile_data *Data,
uint8_t *SiteCountArray[]) { … }
static ValueProfNode *getNextNValueData(uint32_t VK, uint32_t Site,
InstrProfValueData *Dst,
ValueProfNode *StartNode, uint32_t N) { … }
static uint32_t getValueProfDataSizeWrapper(void) { … }
static uint32_t getNumValueDataForSiteWrapper(uint32_t VK, uint32_t S) { … }
static VPDataReaderType TheVPDataReader = …;
COMPILER_RT_VISIBILITY VPDataReaderType *lprofGetVPDataReader(void) { … }