[all-commits] [llvm/llvm-project] fd2a5c: [memprof] Introduce writeMemProf (NFC) (#87698)

Kazu Hirata via All-commits all-commits at lists.llvm.org
Thu Apr 4 13:37:17 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: fd2a5c46d8450f0f37a468d4e5f06a9662abae2d
      https://github.com/llvm/llvm-project/commit/fd2a5c46d8450f0f37a468d4e5f06a9662abae2d
  Author: Kazu Hirata <kazu at google.com>
  Date:   2024-04-04 (Thu, 04 Apr 2024)

  Changed paths:
    M llvm/lib/ProfileData/InstrProfWriter.cpp

  Log Message:
  -----------
  [memprof] Introduce writeMemProf (NFC) (#87698)

This patch refactors the serialization of MemProf data to a switch
statement style:

  switch (Version) {
  case Version0:
    return ...;
  case Version1:
    return ...;
  }

just like IndexedMemProfRecord::serialize.

A reasonable amount of code is shared and factored out to helper
functions between writeMemProfV0 and writeMemProfV1 to the extent that
doens't hamper readability.



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list