llvmbot wrote:

<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-clang

Author: None (aokblast)

<details>
<summary>Changes</summary>

In FreeBSD, we use ifunc to select best performance function in load time. 
However, the resolver is also a function itself but not been tagged kcfi by 
clang.  The problems is caused by 
```
if (D)
CodeGenModule::SetFunctionAttribute()
``` 
called by CodeGenModule::GetOrCreateLLVMFunction where  D is empty originally.

---
Full diff: https://github.com/llvm/llvm-project/pull/96400.diff


1 Files Affected:

- (modified) clang/lib/CodeGen/CodeGenModule.cpp (+1-1) 


``````````diff
diff --git a/clang/lib/CodeGen/CodeGenModule.cpp 
b/clang/lib/CodeGen/CodeGenModule.cpp
index c8898ce196c1e..3e1f650884a7a 100644
--- a/clang/lib/CodeGen/CodeGenModule.cpp
+++ b/clang/lib/CodeGen/CodeGenModule.cpp
@@ -5995,7 +5995,7 @@ void CodeGenModule::emitIFuncDefinition(GlobalDecl GD) {
   llvm::Type *DeclTy = getTypes().ConvertTypeForMem(D->getType());
   llvm::Type *ResolverTy = llvm::GlobalIFunc::getResolverFunctionType(DeclTy);
   llvm::Constant *Resolver =
-      GetOrCreateLLVMFunction(IFA->getResolver(), ResolverTy, {},
+      GetOrCreateLLVMFunction(IFA->getResolver(), ResolverTy, GD,
                               /*ForVTable=*/false);
   llvm::GlobalIFunc *GIF =
       llvm::GlobalIFunc::create(DeclTy, 0, llvm::Function::ExternalLinkage,

``````````

</details>


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

Reply via email to