[all-commits] [llvm/llvm-project] 26fabd: [memprof] Pass FrameIdConverter and CallStackIdCon...

Kazu Hirata via All-commits all-commits at lists.llvm.org
Wed May 15 17:53:50 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 26fabdded34f8cea490060a70188a07ad6b76b8b
      https://github.com/llvm/llvm-project/commit/26fabdded34f8cea490060a70188a07ad6b76b8b
  Author: Kazu Hirata <kazu at google.com>
  Date:   2024-05-15 (Wed, 15 May 2024)

  Changed paths:
    M llvm/include/llvm/ProfileData/MemProf.h
    M llvm/lib/ProfileData/MemProf.cpp
    M llvm/unittests/ProfileData/MemProfTest.cpp

  Log Message:
  -----------
  [memprof] Pass FrameIdConverter and CallStackIdConverter by reference (#92327)

CallStackIdConverter sets LastUnmappedId when a mapping failure
occurs.  Now, since toMemProfRecord takes an instance of
CallStackIdConverter by value, namely std::function, the caller of
toMemProfRecord never receives the mapping failure that occurs inside
toMemProfRecord.  The same problem applies to FrameIdConverter.

The patch fixes the problem by passing FrameIdConverter and
CallStackIdConverter by reference, namely llvm::function_ref.

While I am it, this patch deletes the copy constructor and copy
assignment operator to avoid accidental copies.



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