[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
Fri Jul 18 14:51:45 PDT 2025


================
@@ -946,6 +978,14 @@ SampleContextFrameVector ProfiledBinary::symbolize(const InstructionPointer &IP,
   return CallStack;
 }
 
+StringRef ProfiledBinary::symbolizeDataAddress(uint64_t Address) {
+  DIGlobal DataDIGlobal = unwrapOrError(
+      Symbolizer->symbolizeData(SymbolizerPath.str(), {Address, 0}),
+      SymbolizerPath);
+  auto It = NameStrings.insert(DataDIGlobal.Name);
+  return StringRef(*It.first);
----------------
mingmingl-llvm wrote:

hmm not really. The original `It` is actually of type `pair<decltype(NameStrings)::iterator, bool>`, I revised the code slightly to make the types and names more explicit.

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


More information about the llvm-branch-commits mailing list