[clang] [Clang][RISCV] Add preprocessor macros for Zicfilp CFI scheme (PR #109600)

Ming-Yi Lai via cfe-commits cfe-commits at lists.llvm.org
Tue Sep 24 03:56:29 PDT 2024


================
@@ -2022,6 +2035,20 @@ bool CompilerInvocation::ParseCodeGenArgs(CodeGenOptions &Opts, ArgList &Args,
       Diags.Report(diag::err_drv_invalid_value) << A->getAsString(Args) << Name;
   }
 
+  if (const Arg *A = Args.getLastArg(OPT_mcf_branch_label_scheme_EQ)) {
----------------
mylai-mtk wrote:

I suppose the check can be performed, given that only the RISC-V target uses it, and checking this prevents the flag from being claimed erroneously to some extent. However, this doesn't solve the claim issue completely, since at this point I don't have a `TargetInfo` that allows me to check if `zicfilp` is enabled; I only have the `TargetOptions::FeatureAsWritten` to be ready to check for the existence of `+experimental-zicfilp` from command line, which is less than ideal, I'd say.

Fixed (Checked) in #109784.

https://github.com/llvm/llvm-project/pull/109600


More information about the cfe-commits mailing list