/*! * \brief Register an instrumented function. * * Calls to this are emitted by clang with -fprofile-instr-generate. Such * calls are only required (and only emitted) on targets where we haven't * implemented linker magic to find the bounds of the sections. */ COMPILER_RT_VISIBILITY void __llvm_profile_register_function(void *Data_) { /* TODO: Only emit this function if we can't use linker magic. */ const __llvm_profile_data *Data = (__llvm_profile_data *)Data_; if (!DataFirst) { DataFirst = Data; DataLast = Data + 1; CountersFirst = Data->CounterPtr; CountersLast = (uint64_t *)Data->CounterPtr + Data->NumCounters; return; } DataFirst = (const __llvm_profile_data *)getMinAddr(DataFirst, Data); CountersFirst = (uint64_t *)getMinAddr(CountersFirst, Data->CounterPtr); DataLast = (const __llvm_profile_data *)getMaxAddr(DataLast, Data + 1); CountersLast = (uint64_t *)getMaxAddr( CountersLast, (uint64_t *)Data->CounterPtr + Data->NumCounters); }
COMPILER_RT_VISIBILITY void __llvm_profile_register_names_function(void *NamesStart, uint64_t NamesSize) { if (!NamesFirst) { NamesFirst = (const char *)NamesStart; NamesLast = (const char *)NamesStart + NamesSize; return; } NamesFirst = (const char *)getMinAddr(NamesFirst, NamesStart); NamesLast = (const char *)getMaxAddr(NamesLast, (const char *)NamesStart + NamesSize); }
uINT dptAddrRange_C::incBottomUp() { if (++curAddr.lun > chanInfo[curAddr.chan-minChan].maxLun) { curAddr.lun = 0; if (++curAddr.id > chanInfo[curAddr.chan-minChan].maxId) { curAddr.id = 0; if (++curAddr.chan > maxChan) { curAddr = getMaxAddr(); maxFlag = 1; } } } return (!maxFlag); }