[llvm] [llvm-profgen] Loading binary functions from .symtab when DWARF info is incomplete (PR #163654)

via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 2 13:26:07 PST 2025


================
@@ -522,7 +539,9 @@ void ProfiledBinary::setIsFuncEntry(FuncRange *FuncRange,
   // Set IsFuncEntry to ture if there is only one range in the function or the
   // RangeSymName from ELF is equal to its DWARF-based function name.
   if (FuncRange->Func->Ranges.size() == 1 ||
-      (!FuncRange->IsFuncEntry && FuncRange->getFuncName() == RangeSymName))
+      (!FuncRange->IsFuncEntry &&
+       (FuncRange->getFuncName() == RangeSymName ||
+        FuncRange->Func->NameStatus != DwarfNameStatus::Matched)))
----------------
HighW4y2H3ll wrote:

This is to make sure that all the top-level functions are properly marked with a `IsFuncEntry`. Otherwise, if the DWARF symbol is corrupted, we will miss some entries because of the name mismatch.

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


More information about the llvm-commits mailing list