================
@@ -899,6 +899,11 @@ void CodeGenFunction::StartFunction(GlobalDecl GD,
QualType RetTy,
if (CodeGenOpts.PointerAuth.IndirectGotos)
Fn->addFnAttr("ptrauth-indirect-gotos");
+ // Add return control flow integrity attributes for RISCV.
+ if (CodeGenOpts.CFProtectionReturn &&
----------------
jaidTw wrote:
`cf-protection-return` on RISC-V could be controlled at a per-function
granularity (i.e. use function attributes to suppress the instruction
generation for some functions), so we still need a function attribute to tag it.
I moved it to `setTargetAttributes` for RISC-V, thanks for the advice.
https://github.com/llvm/llvm-project/pull/112477
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits