[clang] [llvm] [MTE] Add an attribute to opt-in memory tagging of global variables while using fsanitize=memtag-globals (#166380) (PR #182028)

Florian Mayer via cfe-commits cfe-commits at lists.llvm.org
Thu Feb 19 13:19:24 PST 2026


================
@@ -2662,6 +2662,10 @@ static uint64_t globalSize(const llvm::GlobalVariable &G) {
 }
 
 static bool shouldTagGlobal(const llvm::GlobalVariable &G) {
+  auto Meta = G.getSanitizerMetadata();
----------------
fmayer wrote:

nit

```cc

if (G.getSanitizerMetadata().ForceMemtag)
  return true;
```

https://github.com/llvm/llvm-project/pull/182028


More information about the cfe-commits mailing list