[clang] [llvm] Computing, storing, and restoring conservative call graphs with LLVM (PR #80104)

Matt Arsenault via cfe-commits cfe-commits at lists.llvm.org
Wed Feb 28 23:45:14 PST 2024


================
@@ -2714,7 +2714,17 @@ static void setLinkageForGV(llvm::GlobalValue *GV, const NamedDecl *ND) {
 
 void CodeGenModule::CreateFunctionTypeMetadataForIcall(const FunctionDecl *FD,
                                                        llvm::Function *F) {
-  // Only if we are checking indirect calls.
+  bool EmittedMDIdGeneralized = false;
+  if (CodeGenOpts.CallGraphSection &&
+      (!F->hasLocalLinkage() ||
+       F->getFunction().hasAddressTaken(nullptr, /* IgnoreCallbackUses */ true,
+                                        /* IgnoreAssumeLikeCalls */ true,
+                                        /* IgnoreLLVMUsed */ false))) {
----------------
arsenm wrote:

```suggestion
       F->getFunction().hasAddressTaken(nullptr, /* IgnoreCallbackUses= */ true,
                                        /* IgnoreAssumeLikeCalls= */ true,
                                        /* IgnoreLLVMUsed= */ false))) {
```

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


More information about the cfe-commits mailing list