Skip to content

Commit

Permalink
Rename hasCorrelation to __llvm_profile_has_correlation
Browse files Browse the repository at this point in the history
  • Loading branch information
ZequanWu committed Nov 2, 2023
1 parent 9593cde commit 7fa9930
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion compiler-rt/lib/profile/InstrProfiling.c
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,6 @@ COMPILER_RT_VISIBILITY void __llvm_profile_reset_counters(void) {
lprofSetProfileDumped(0);
}

COMPILER_RT_VISIBILITY int hasCorrelation() {
COMPILER_RT_VISIBILITY int __llvm_profile_has_correlation() {
return (__llvm_profile_get_version() & VARIANT_MASK_DBG_CORRELATE) != 0ULL;
}
2 changes: 1 addition & 1 deletion compiler-rt/lib/profile/InstrProfiling.h
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ uint64_t __llvm_profile_get_magic(void);
uint64_t __llvm_profile_get_version(void);

/*! \brief If the binary is compiled with profile correlation. */
int hasCorrelation();
int __llvm_profile_has_correlation();

/*! \brief Get the number of entries in the profile data section. */
uint64_t __llvm_profile_get_num_data(const __llvm_profile_data *Begin,
Expand Down
6 changes: 3 additions & 3 deletions compiler-rt/lib/profile/InstrProfilingBuffer.c
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ uint64_t __llvm_profile_get_size_for_buffer(void) {
COMPILER_RT_VISIBILITY
uint64_t __llvm_profile_get_num_data(const __llvm_profile_data *Begin,
const __llvm_profile_data *End) {
if (hasCorrelation())
if (__llvm_profile_has_correlation())
return 0;
intptr_t BeginI = (intptr_t)Begin, EndI = (intptr_t)End;
return ((EndI + sizeof(__llvm_profile_data) - 1) - BeginI) /
Expand All @@ -66,7 +66,7 @@ uint64_t __llvm_profile_get_num_data(const __llvm_profile_data *Begin,
COMPILER_RT_VISIBILITY
uint64_t __llvm_profile_get_data_size(const __llvm_profile_data *Begin,
const __llvm_profile_data *End) {
if (hasCorrelation())
if (__llvm_profile_has_correlation())
return 0;
return __llvm_profile_get_num_data(Begin, End) * sizeof(__llvm_profile_data);
}
Expand Down Expand Up @@ -98,7 +98,7 @@ uint64_t __llvm_profile_get_num_bitmap_bytes(const char *Begin,

COMPILER_RT_VISIBILITY
uint64_t __llvm_profile_get_name_size(const char *Begin, const char *End) {
if (hasCorrelation())
if (__llvm_profile_has_correlation())
return 0;
return End - Begin;
}
Expand Down
2 changes: 1 addition & 1 deletion compiler-rt/lib/profile/InstrProfilingMerge.c
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ int __llvm_profile_merge_from_buffer(const char *ProfileData,

// Merge counters by iterating the entire counter section when correlation is
// enabled.
if (hasCorrelation()) {
if (__llvm_profile_has_correlation()) {
for (SrcCounter = SrcCountersStart,
DstCounter = __llvm_profile_begin_counters();
SrcCounter < SrcCountersEnd;) {
Expand Down
2 changes: 1 addition & 1 deletion compiler-rt/lib/profile/InstrProfilingWriter.c
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ lprofWriteDataImpl(ProfDataWriter *Writer, const __llvm_profile_data *DataBegin,
const char *BitmapBegin, const char *BitmapEnd,
VPDataReaderType *VPDataReader, const char *NamesBegin,
const char *NamesEnd, int SkipNameDataWrite) {
int ProfileCorrelation = hasCorrelation();
int ProfileCorrelation = __llvm_profile_has_correlation();

/* Calculate size of sections. */
const uint64_t DataSectionSize =
Expand Down

0 comments on commit 7fa9930

Please sign in to comment.