[llvm-branch-commits] [clang] [clang] callee_type metadata for indirect calls (PR #117036)

Paul Kirth via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Wed Apr 23 10:07:28 PDT 2025


================
@@ -2860,9 +2861,23 @@ static void setLinkageForGV(llvm::GlobalValue *GV, const NamedDecl *ND) {
     GV->setLinkage(llvm::GlobalValue::ExternalWeakLinkage);
 }
 
-void CodeGenModule::CreateFunctionTypeMetadataForIcall(const FunctionDecl *FD,
+static bool hasExistingGeneralizedTypeMD(llvm::Function *F) {
+  llvm::MDNode *MD = F->getMetadata(llvm::LLVMContext::MD_type);
+  if (!MD)
+    return false;
+  return MD->hasGeneralizedMDString();
----------------
ilovepi wrote:

```suggestion
  return MD && MD->hasGeneralizedMDString();
```

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


More information about the llvm-branch-commits mailing list