[PATCH] D112421: [clang][ARM] PACBTI-M frontend support

Momchil Velikov via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Nov 25 08:57:53 PST 2021


chill added inline comments.


================
Comment at: clang/lib/CodeGen/TargetInfo.cpp:6377
+
+        static const char *SignReturnAddrStr[] = {"none", "non-leaf", "all"};
+        Fn->addFnAttr("sign-return-address",
----------------
vhscampos wrote:
> I reckon selecting the string using a switch statement on BPI.SignReturnAddr is more type safe than doing it like this. The current selection is prone to out of bounds accesses to the array in case the enum changes. Please consider so.
Guard it with an assert.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D112421/new/

https://reviews.llvm.org/D112421



More information about the cfe-commits mailing list