[llvm] [AsmPrinter] Fix direct callee operand lookup in CallGraphSection (PR #218534)

Prabhu Rajasekaran via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 30 08:48:35 PDT 2026


================
@@ -1999,23 +1999,24 @@ void AsmPrinter::handleCallsiteForCallgraph(
     const MachineFunction::CallSiteInfoMap &CallSitesInfoMap,
     const MachineInstr &MI) {
   assert(MI.isCall() && "This method is meant for call instructions only.");
-  const MachineOperand &CalleeOperand = MI.getOperand(0);
-  if (CalleeOperand.isGlobal() || CalleeOperand.isSymbol()) {
-    // Handle direct calls.
-    MCSymbol *CalleeSymbol = nullptr;
-    switch (CalleeOperand.getType()) {
-    case llvm::MachineOperand::MO_GlobalAddress:
-      CalleeSymbol = getSymbol(CalleeOperand.getGlobal());
-      break;
-    case llvm::MachineOperand::MO_ExternalSymbol:
-      CalleeSymbol = GetExternalSymbolSymbol(CalleeOperand.getSymbolName());
-      break;
-    default:
-      llvm_unreachable(
-          "Expected to only handle direct call instructions here.");
+  for (const MachineOperand &CalleeOperand : MI.operands()) {
----------------
Prabhuk wrote:

Done. The getCalleeOperand for ARM change had landed and is used in this PR now. Updated the PR description to reflect the change. 

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


More information about the llvm-commits mailing list