Skip to content

Commit fd6dae9

Browse files
committed
Update sanitize_* IR documentation.
sanitize_none was never actually committed, and should be removed. no_sanitize_memtag is to be removed in D128950. sanitize_memtag is new in D128950. Also update the comments on other no_sanitize_* to indicate that they're impacted by the sanitizer ignorelist and the global-disable attribute. Reviewed By: eugenis Differential Revision: https://reviews.llvm.org/D129410
1 parent 7045519 commit fd6dae9

File tree

1 file changed

+21
-9
lines changed

1 file changed

+21
-9
lines changed

llvm/docs/LangRef.rst

Lines changed: 21 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -746,8 +746,8 @@ Syntax::
746746
<global | constant> <Type> [<InitializerConstant>]
747747
[, section "name"] [, partition "name"]
748748
[, comdat [($name)]] [, align <Alignment>]
749-
[, no_sanitize] [, no_sanitize_address]
750-
[, no_sanitize_hwaddress] [, sanitize_address_dyninit]
749+
[, no_sanitize_address] [, no_sanitize_hwaddress]
750+
[, sanitize_address_dyninit] [, sanitize_memtag]
751751
(, !name !N)*
752752

753753
For example, the following defines a global in a numbered address space
@@ -2327,19 +2327,31 @@ Attributes may be set to communicate additional information about a global varia
23272327
Unlike :ref:`function attributes <fnattrs>`, attributes on a global variable
23282328
are grouped into a single :ref:`attribute group <attrgrp>`.
23292329

2330-
``no_sanitize``
2331-
This attribute indicates that the global variable should not have any
2332-
sanitizers applied to it, either because it was in the sanitizer ignore
2333-
list, or it was annotated with
2334-
`__attribute__((disable_sanitizer_instrumentation))`.
23352330
``no_sanitize_address``
23362331
This attribute indicates that the global variable should not have
23372332
AddressSanitizer instrumentation applied to it, because it was annotated
2338-
with `__attribute__((no_sanitize("address")))`.
2333+
with `__attribute__((no_sanitize("address")))`,
2334+
`__attribute__((disable_sanitizer_instrumentation))`, or included in the
2335+
`-fsanitize-ignorelist` file.
23392336
``no_sanitize_hwaddress``
23402337
This attribute indicates that the global variable should not have
23412338
HWAddressSanitizer instrumentation applied to it, because it was annotated
2342-
with `__attribute__((no_sanitize("hwaddress")))`.
2339+
with `__attribute__((no_sanitize("hwaddress")))`,
2340+
`__attribute__((disable_sanitizer_instrumentation))`, or included in the
2341+
`-fsanitize-ignorelist` file.
2342+
``sanitize_memtag``
2343+
This attribute indicates that the global variable should have AArch64 memory
2344+
tags (MTE) instrumentation applied to it. This attribute causes the
2345+
suppression of certain optimisations, like GlobalMerge, as well as ensuring
2346+
extra directives are emitted in the assembly and extra bits of metadata are
2347+
placed in the object file so that the linker can ensure the accesses are
2348+
protected by MTE. This attribute is added by clang when
2349+
`-fsanitize=memtag-globals` is provided, as long as the global is not marked
2350+
with `__attribute__((no_sanitize("memtag")))`,
2351+
`__attribute__((disable_sanitizer_instrumentation))`, or included in the
2352+
`-fsanitize-ignorelist` file. The AArch64 Globals Tagging pass may remove
2353+
this attribute when it's not possible to tag the global (e.g. it's a TLS
2354+
variable).
23432355
``sanitize_address_dyninit``
23442356
This attribute indicates that the global variable, when instrumented with
23452357
AddressSanitizer, should be checked for ODR violations. This attribute is

0 commit comments

Comments
 (0)