[llvm-branch-commits] [clang] [clang] Implement function pointer signing and authenticated function calls (PR #93906)
Daniil Kovalev via llvm-branch-commits
llvm-branch-commits at lists.llvm.org
Mon Jun 17 08:01:13 PDT 2024
================
@@ -938,6 +939,32 @@ class CodeGenModule : public CodeGenTypeCache {
// Return the function body address of the given function.
llvm::Constant *GetFunctionStart(const ValueDecl *Decl);
+ /// Return a function pointer for a reference to the given function.
+ /// This correctly handles weak references, but does not apply a
+ /// pointer signature.
+ llvm::Constant *getRawFunctionPointer(GlobalDecl GD,
+ llvm::Type *Ty = nullptr);
+
+ /// Return the ABI-correct function pointer value for a reference
+ /// to the given function. This will apply a pointer signature if
+ /// necessary, caching the result for the given function.
+ llvm::Constant *getFunctionPointer(GlobalDecl GD, llvm::Type *Ty = nullptr);
+
+ /// Return the ABI-correct function pointer value for a reference
+ /// to the given function. This will apply a pointer signature if
+ /// necessary, but will only cache the result if \p FD is passed.
----------------
kovdan01 wrote:
> but will only cache the result if \p FD is passed.
You probably misspelled GD?
https://github.com/llvm/llvm-project/pull/93906
More information about the llvm-branch-commits
mailing list