[compiler-rt] [llvm] [TypeProf][InstrPGO] Introduce raw and instr profile format change for type profiling. (PR #81691)

Snehasish Kumar via llvm-commits llvm-commits at lists.llvm.org
Fri Feb 16 13:52:43 PST 2024


================
@@ -191,7 +238,10 @@ COMPILER_RT_VISIBILITY int __llvm_profile_write_buffer_internal(
     const char *NamesBegin, const char *NamesEnd) {
   ProfDataWriter BufferWriter;
   initBufferWriter(&BufferWriter, Buffer);
-  return lprofWriteDataImpl(&BufferWriter, DataBegin, DataEnd, CountersBegin,
-                            CountersEnd, BitmapBegin, BitmapEnd, 0, NamesBegin,
-                            NamesEnd, 0);
+  // Set virtual table arguments to NULL since they are not supported yet.
+  return lprofWriteDataImpl(
+      &BufferWriter, DataBegin, DataEnd, CountersBegin, CountersEnd,
+      BitmapBegin, BitmapEnd, 0 /* VPDataReader */, NamesBegin, NamesEnd,
----------------
snehasish wrote:

If you specify the name before the argument like this: `/*VPDataReader=*/0` then clang-tidy bugprone [1] checks will catch it.

Another alternative would be to use options structs and named member initialization but that's more work (and some of the other methods here should be converted too).

[1] https://clang.llvm.org/extra/clang-tidy/checks/bugprone/argument-comment.html#bugprone-argument-comment

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


More information about the llvm-commits mailing list