[Clang] Introduce -fexperimental-sanitize-metadata=
authorMarco Elver <elver@google.com>
Tue, 6 Sep 2022 13:49:39 +0000 (15:49 +0200)
committerMarco Elver <elver@google.com>
Wed, 7 Sep 2022 19:25:40 +0000 (21:25 +0200)
commitc4842bb2e98e2f1ee23bb3bc753752816927b7b3
tree84311d7aa32826988e50bc4ad3b3ffb0dd548a8a
parent97c2220565abcef6c3fd674dcca98f7176e132c5
[Clang] Introduce -fexperimental-sanitize-metadata=

Introduces the frontend flag -fexperimental-sanitize-metadata=, which
enables SanitizerBinaryMetadata instrumentation.

The first intended user of the binary metadata emitted will be a variant
of GWP-TSan [1]. The plan is to open source a stable and production
quality version of GWP-TSan. The development of which, however, requires
upstream compiler support.

[1] https://llvm.org/devmtg/2020-09/slides/Morehouse-GWP-Tsan.pdf

Until the tool has been open sourced, we mark this kind of
instrumentation as "experimental", and reserve the option to change
binary format, remove features, and similar.

Reviewed By: vitalybuka, MaskRay

Differential Revision: https://reviews.llvm.org/D130888
clang/include/clang/Basic/CodeGenOptions.def
clang/include/clang/Basic/CodeGenOptions.h
clang/include/clang/Driver/Options.td
clang/include/clang/Driver/SanitizerArgs.h
clang/lib/CodeGen/BackendUtil.cpp
clang/lib/Driver/SanitizerArgs.cpp
clang/test/CodeGen/sanitize-metadata.c [new file with mode: 0644]
clang/test/Driver/fsanitize-metadata.c [new file with mode: 0644]