Skip to content

Commit 744b87f

Browse files
resolve review feedback
1 parent 393d166 commit 744b87f

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

compiler-rt/lib/profile/InstrProfilingBuffer.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -93,15 +93,13 @@ uint64_t __llvm_profile_get_data_size(const __llvm_profile_data *Begin,
9393
COMPILER_RT_VISIBILITY
9494
uint64_t __llvm_profile_get_num_vtable(const VTableProfData *Begin,
9595
const VTableProfData *End) {
96-
// Convert pointers to intptr_t to use integer arithmetic.
97-
intptr_t EndI = (intptr_t)End, BeginI = (intptr_t)Begin;
98-
return (EndI - BeginI) / sizeof(VTableProfData);
96+
return End - Begin;
9997
}
10098

10199
COMPILER_RT_VISIBILITY
102100
uint64_t __llvm_profile_get_vtable_section_size(const VTableProfData *Begin,
103101
const VTableProfData *End) {
104-
return __llvm_profile_get_num_vtable(Begin, End) * sizeof(VTableProfData);
102+
return (intptr_t)(End) - (intptr_t)(Begin);
105103
}
106104

107105
COMPILER_RT_VISIBILITY size_t __llvm_profile_counter_entry_size(void) {

0 commit comments

Comments
 (0)