[llvm-branch-commits] [llvm] [llvm-profgen] Extend llvm-profgen to generate vtable profiles with data access events. (PR #148013)

Mingming Liu via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Wed Jul 30 14:54:23 PDT 2025


================
@@ -344,6 +350,36 @@ void ProfiledBinary::setPreferredTextSegmentAddresses(const ELFFile<ELFT> &Obj,
     exitWithError("no executable segment found", FileName);
 }
 
+uint64_t ProfiledBinary::CanonicalizeNonTextAddress(uint64_t Address) {
+  uint64_t FileOffset = 0;
+  auto MMapIter = NonTextMMapEvents.lower_bound(Address);
+  if (MMapIter == NonTextMMapEvents.end())
+    return Address; // No non-text mmap event found, return the address as is.
+
+  const auto &MMapEvent = MMapIter->second;
+
+  // If the address is within the non-text mmap event, calculates its file
----------------
mingmingl-llvm wrote:

done.

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


More information about the llvm-branch-commits mailing list