Remove 'no_sanitize_memtag'. Add 'sanitize_memtag'.
authorMitch Phillips <31459023+hctim@users.noreply.github.com>
Wed, 13 Jul 2022 15:39:26 +0000 (08:39 -0700)
committerMitch Phillips <31459023+hctim@users.noreply.github.com>
Wed, 13 Jul 2022 15:54:41 +0000 (08:54 -0700)
commit90e5a8ac475fa3c2fa7c22a341e798d6f7356b54
treea0b13d99de440f2e29b9981def322f6948fabdd6
parent4f281fa2a86b1806ec3143373795d8eac559e37f
Remove 'no_sanitize_memtag'. Add 'sanitize_memtag'.

For MTE globals, we should have clang emit the attribute for all GV's
that it creates, and then use that in the upcoming AArch64 global
tagging IR pass. We need a positive attribute for this sanitizer (rather
than implicit sanitization of all globals) because it needs to interact
with other parts of LLVM, including:

  1. Suppressing certain global optimisations (like merging),
  2. Emitting extra directives by the ASM writer, and
  3. Putting extra information in the symbol table entries.

While this does technically make the LLVM IR / bitcode format
non-backwards-compatible, nobody should have used this attribute yet,
because it's a no-op.

Reviewed By: eugenis

Differential Revision: https://reviews.llvm.org/D128950
12 files changed:
clang/lib/CodeGen/SanitizerMetadata.cpp
clang/test/CodeGen/memtag-globals.cpp
clang/test/CodeGen/sanitizer-special-case-list-globals.c
llvm/include/llvm/AsmParser/LLToken.h
llvm/include/llvm/IR/GlobalValue.h
llvm/lib/AsmParser/LLLexer.cpp
llvm/lib/AsmParser/LLParser.cpp
llvm/lib/Bitcode/Reader/BitcodeReader.cpp
llvm/lib/Bitcode/Writer/BitcodeWriter.cpp
llvm/lib/IR/AsmWriter.cpp
llvm/test/Assembler/globalvariable-attributes.ll
llvm/test/Bitcode/compatibility.ll