[llvm] [llvm][AsmPrinter] Add direct calls to callgraph section (PR #155706)
Paul Kirth via llvm-commits
llvm-commits at lists.llvm.org
Mon Sep 15 09:54:27 PDT 2025
================
@@ -1866,20 +1875,39 @@ static StringRef getMIMnemonic(const MachineInstr &MI, MCStreamer &Streamer) {
return Name;
}
-void AsmPrinter::emitIndirectCalleeLabels(
+void AsmPrinter::emitCallsiteLabelsForCallgraph(
FunctionInfo &FuncInfo,
const MachineFunction::CallSiteInfoMap &CallSitesInfoMap,
const MachineInstr &MI) {
- // Only indirect calls have type identifiers set.
- const auto &CallSiteInfo = CallSitesInfoMap.find(&MI);
- if (CallSiteInfo == CallSitesInfoMap.end())
- return;
-
- for (ConstantInt *CalleeTypeId : CallSiteInfo->second.CalleeTypeIds) {
+ assert(MI.isCall() && "Callsite labels are meant for call instruction only.");
----------------
ilovepi wrote:
nit
```suggestion
assert(MI.isCall() && "Callsite labels are meant for call instructions only.");
```
https://github.com/llvm/llvm-project/pull/155706
More information about the llvm-commits
mailing list