[PATCH] D128958: Add assembler plumbing for sanitize_memtag

Florian Mayer via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jul 1 08:59:01 PDT 2022


fmayer added inline comments.


================
Comment at: llvm/lib/MC/MCSymbolELF.cpp:39
+  // One bit.
+  ELF_IsMemoryTagged = 13,
 };
----------------
_Shift for consistency?


================
Comment at: llvm/lib/MC/MCSymbolELF.cpp:204
+
+void MCSymbolELF::setTagged(bool Tagged) {
+  uint32_t OtherFlags = getFlags() & ~(0x1 << ELF_IsMemoryTagged);
----------------
Consider turning this into explicit branches, which I think is easier to understand. Up to you though.


```
uint32_t NewFlags;
if (Tagged)
   NewFlags = getFlags() | (1x << ELF_IsMemoryTagged);
else
   NewFlags = getFlags() & ~(1x << ELF_IsMemoryTagged);
```


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D128958



More information about the llvm-commits mailing list