================
@@ -1484,6 +1484,39 @@ void AddUnalignedAccessWarning(ArgStringList &CmdArgs) {
 }
 }
 
+static void handlePAuthABIOption(const ArgList &DriverArgs,
+                                 ArgStringList &CC1Args, const Driver &D) {
+  if (!DriverArgs.hasArg(options::OPT_fptrauth_intrinsics,
----------------
kovdan01 wrote:

> See addOptInFlag.

Do you mean that we need to replace

```
  if (!DriverArgs.hasArg(options::OPT_fptrauth_xxx,
                         options::OPT_fno_ptrauth_xxx))
    CC1Args.push_back("-fptrauth-xxx");
```

with

```
  DriverArgs.addOptInFlag(CC1Args, options::OPT_fptrauth_xxx,
                          options::OPT_fno_ptrauth_xxx);
```

...?

If so, this does not look correct - `addOptInFlag` would add the flag present 
(if any) in `DriverArgs` to `CC1Args`, but we want to append a list of ptrauth 
flags to cc1 args unconditionally if `pauthabi` is passed as branch protection.

Do I miss smth? I suppose I might have misunderstood you point.

> But the implementation seems quite different from the title/description.

Hmm, it actually looks consistent to me, the implementation seems matching the 
description from my point of view - we want to add a bunch of arguments with 
`-mbranch-protection=pauthabi` used as a shortcut, we do that. Could you please 
describe what is inconsistent between description and implementation in a bit 
more detail?

https://github.com/llvm/llvm-project/pull/97237
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to