================ @@ -61,3 +79,28 @@ CodeGen::getConstantSignedPointer(CodeGenModule &CGM, llvm::Constant *Pointer, return CGM.getConstantSignedPointer(Pointer, Key, StorageAddress, OtherDiscriminator); } + +/// If applicable, sign a given constant function pointer with the ABI rules for +/// functionType. +llvm::Constant *CodeGenModule::getFunctionPointer(llvm::Constant *Pointer, + QualType FunctionType, + GlobalDecl GD) { + assert(FunctionType->isFunctionType() || + FunctionType->isFunctionReferenceType() || + FunctionType->isFunctionPointerType()); + + if (auto PointerAuth = getFunctionPointerAuthInfo(FunctionType)) { + return getConstantSignedPointer( + Pointer, PointerAuth.getKey(), nullptr, ---------------- kovdan01 wrote:
nit ```suggestion Pointer, PointerAuth.getKey(), /*StorageAddress=*/nullptr, ``` https://github.com/llvm/llvm-project/pull/93906 _______________________________________________ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits