Exemple #1
0
static int write_buffer(int flags, char *buffer)
{
        if (flags & PGO_HIB) {
                return __llvm_profile_write_buffer_internal(
                        buffer,
                        &__pgo_hib_DataStart, &__pgo_hib_DataEnd,
                        &__pgo_hib_CountersStart, &__pgo_hib_CountersEnd,
                        &__pgo_hib_NamesStart, &__pgo_hib_NamesEnd);
        } else {
                return __llvm_profile_write_buffer(buffer);
        }
}
int __llvm_profile_write_buffer(char *Buffer) {
  /* Match logic in __llvm_profile_get_size_for_buffer().
   * Match logic in __llvm_profile_write_file().
   */
  const __llvm_profile_data *DataBegin = __llvm_profile_begin_data();
  const __llvm_profile_data *DataEnd = __llvm_profile_end_data();
  const uint64_t *CountersBegin = __llvm_profile_begin_counters();
  const uint64_t *CountersEnd   = __llvm_profile_end_counters();
  const char *NamesBegin = __llvm_profile_begin_names();
  const char *NamesEnd   = __llvm_profile_end_names();

  return __llvm_profile_write_buffer_internal(Buffer, DataBegin, DataEnd,
                                              CountersBegin, CountersEnd,
                                              NamesBegin, NamesEnd);
}