From adf62863f35c84e4c5708f3dc5a1589ce958a238 Mon Sep 17 00:00:00 2001 From: Dimitry Andric Date: Sun, 25 Aug 2024 12:56:24 +0200 Subject: Vendor import of llvm-project branch release/19.x llvmorg-19.1.0-rc3-0-g437434df21d8. --- clang/lib/CodeGen/CodeGenFunction.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'clang/lib/CodeGen/CodeGenFunction.cpp') diff --git a/clang/lib/CodeGen/CodeGenFunction.cpp b/clang/lib/CodeGen/CodeGenFunction.cpp index af201554898f..2b2e23f1e5d7 100644 --- a/clang/lib/CodeGen/CodeGenFunction.cpp +++ b/clang/lib/CodeGen/CodeGenFunction.cpp @@ -880,8 +880,12 @@ void CodeGenFunction::StartFunction(GlobalDecl GD, QualType RetTy, // Add pointer authentication attributes. const CodeGenOptions &CodeGenOpts = CGM.getCodeGenOpts(); + if (CodeGenOpts.PointerAuth.ReturnAddresses) + Fn->addFnAttr("ptrauth-returns"); if (CodeGenOpts.PointerAuth.FunctionPointers) Fn->addFnAttr("ptrauth-calls"); + if (CodeGenOpts.PointerAuth.AuthTraps) + Fn->addFnAttr("ptrauth-auth-traps"); if (CodeGenOpts.PointerAuth.IndirectGotos) Fn->addFnAttr("ptrauth-indirect-gotos"); -- cgit v1.3