================
@@ -2860,9 +2861,25 @@ static void setLinkageForGV(llvm::GlobalValue *GV, const 
NamedDecl *ND) {
     GV->setLinkage(llvm::GlobalValue::ExternalWeakLinkage);
 }
 
+static bool HasExistingGeneralizedTypeMD(llvm::Function *F) {
+  llvm::MDNode *MD = F->getMetadata(llvm::LLVMContext::MD_type);
+  if (!MD || !isa<llvm::MDString>(MD->getOperand(1)))
+    return false;
----------------
Prabhuk wrote:

This is to make sure that `CreateFunctionTypeMetadataforIcall` does not add 
duplicate ".generalized" type metadata. Given that the function can add 
non-generalized type metadata, checking the actual string becomes necessary.

https://github.com/llvm/llvm-project/pull/117036
_______________________________________________
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

Reply via email to