================ @@ -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 && ---------------- efriedma-quic wrote:
We already set a module flag cf-protection-return; why do we need both a module flag and a function flag? If we do need something RISCV-specific here, can we do it in setTargetAttributes, or something like that? https://github.com/llvm/llvm-project/pull/112477 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits