[llvm-branch-commits] [llvm] [llvm][AsmPrinter] Emit call graph section (PR #87576)

Paul Kirth via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Fri Apr 18 23:51:45 PDT 2025


================
@@ -1948,6 +2045,28 @@ void AsmPrinter::emitFunctionBody() {
         break;
       }
 
+      // FIXME: Some indirect calls can get lowered to jump instructions,
+      // resulting in emitting labels for them. The extra information can
+      // be neglected while disassembling but still takes space in the binary.
+      if (TM.Options.EmitCallGraphSection && MI.isCall()) {
+        // Only indirect calls have type identifiers set.
+        const auto &CallSiteInfo = CallSitesInfoMap.find(&MI);
----------------
ilovepi wrote:

```suggestion
        const auto &CallSiteInfo = CallSitesInfoMap.find(&MI);
      if(CallSiteInfoe == CaleSitesInfoMap.end())
        return;
```
Maybe not syntactically correct here, but I feel like there should be some early exit here that reduces nesting or maybe this is a helper function that handles some of this complexity?

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


More information about the llvm-branch-commits mailing list