[clang] [clang][ptrauth] add support for options parameter to __ptrauth (PR #136828)
Oliver Hunt via cfe-commits
cfe-commits at lists.llvm.org
Wed Apr 23 03:29:03 PDT 2025
ojhunt wrote:
@cor3ntin the option selection down stream is a StringSwitch on the authentication mode, and then a sequence of (not large, I think just two) `if (option == constant)` checks to set up specific options.
Previous PRs have suggested maps, etc for such conditions, and a map of option=>handler seemed consistent with that in this case, but I'm really on the fence about which. Absent the map approach (just typing directly into the comment w/o checking code) I think the alternative is that the option handler looks like:
```cpp
switchswitch(option)
.Case("strip", ...)
.Case("sign-and-strip", ...)
.Case("sign-and-auth", ...);
// 'else' here I think is handled by a flag
else if (option == thing1) { .... }
else if (option == thing2) { ... }
```
Any thoughts on which you consider preferable? I think either works as the gross portion of this code is already just the tokenisation.
https://github.com/llvm/llvm-project/pull/136828
More information about the cfe-commits
mailing list