[clang] [llvm] [PAC][Driver] Implement `-mbranch-protection=pauthabi` option (PR #97237)
Daniil Kovalev via cfe-commits
cfe-commits at lists.llvm.org
Wed Jul 3 03:00:16 PDT 2024
================
@@ -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
More information about the cfe-commits
mailing list