[compiler-rt] [compiler-rt][nfc] Return size 0 explicitly when both pointers are NULL (PR #81789)

Mingming Liu via llvm-commits llvm-commits at lists.llvm.org
Wed Feb 14 13:22:38 PST 2024


================
@@ -93,11 +93,15 @@ uint64_t __llvm_profile_get_counters_size(const char *Begin, const char *End) {
 COMPILER_RT_VISIBILITY
 uint64_t __llvm_profile_get_num_bitmap_bytes(const char *Begin,
                                              const char *End) {
+  if (Begin == NULL && End == NULL)
----------------
minglotus-6 wrote:

Makes sense, done!

A little bit more context, I decided to do this when working on a profile-only change for type profiling (https://github.com/llvm/llvm-project/pull/81691/files). If type profiling is off (which is the case initially), the pointer to relevant sections are null.

https://github.com/llvm/llvm-project/pull/81789


More information about the llvm-commits mailing list