[PATCH] D81997: [AArch64] SLSHardening: compute correct thunk name for X29.

Kristof Beyls via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 17 06:58:44 PDT 2020


kristof.beyls marked 6 inline comments as done.
kristof.beyls added inline comments.


================
Comment at: llvm/lib/Target/AArch64/AArch64SLSHardening.cpp:145
 
 static std::array<const char *, 29> SLSBLRThunkNames{
     "__llvm_slsblr_thunk_x0",  "__llvm_slsblr_thunk_x1",
----------------
ostannard wrote:
> I think it would be better to change these two arrays into one array of structs, so that the relationship between them is more obvious.
Yes, agreed. Thanks for the suggestion. I think it made the code quite a bit nicer.


================
Comment at: llvm/lib/Target/AArch64/AArch64SLSHardening.cpp:179
+    if (Reg == SLSBLRThunkRegs[i]) {
+      Index = i;
+      break;
----------------
ostannard wrote:
> Could just `return SLSBLRThunkNames[i]` here.
After changing the structure of SLSBLRThunks, it seemed better to just search inline using llvm::find_if rather than in a separate function, so this comment does not apply anymore to the new version of the code.


================
Comment at: llvm/lib/Target/AArch64/AArch64SLSHardening.cpp:190
+    if (Name == SLSBLRThunkNames[i]) {
+      Index = i;
+      break;
----------------
ostannard wrote:
> Same as above,
Same reply as above too.


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

https://reviews.llvm.org/D81997





More information about the llvm-commits mailing list