llvm-project/llvm/lib
Marco Elver 280333021e [SanitizeCoverage] Add support for NoSanitizeCoverage function attribute
We really ought to support no_sanitize("coverage") in line with other
sanitizers. This came up again in discussions on the Linux-kernel
mailing lists, because we currently do workarounds using objtool to
remove coverage instrumentation. Since that support is only on x86, to
continue support coverage instrumentation on other architectures, we
must support selectively disabling coverage instrumentation via function
attributes.

Unfortunately, for SanitizeCoverage, it has not been implemented as a
sanitizer via fsanitize= and associated options in Sanitizers.def, but
rolls its own option fsanitize-coverage. This meant that we never got
"automatic" no_sanitize attribute support.

Implement no_sanitize attribute support by special-casing the string
"coverage" in the NoSanitizeAttr implementation. To keep the feature as
unintrusive to existing IR generation as possible, define a new negative
function attribute NoSanitizeCoverage to propagate the information
through to the instrumentation pass.

Fixes: https://bugs.llvm.org/show_bug.cgi?id=49035

Reviewed By: vitalybuka, morehouse

Differential Revision: https://reviews.llvm.org/D102772
2021-05-25 12:57:14 +02:00
..
Analysis [ConstProp] propagate poison from vector reduction element(s) to result 2021-05-24 10:34:40 -04:00
AsmParser [SanitizeCoverage] Add support for NoSanitizeCoverage function attribute 2021-05-25 12:57:14 +02:00
BinaryFormat [NFC] Reordering parameters in getFile and getFileOrSTDIN 2021-03-25 09:47:49 -04:00
Bitcode [SanitizeCoverage] Add support for NoSanitizeCoverage function attribute 2021-05-25 12:57:14 +02:00
Bitstream
CodeGen [GlobalISel] Silence unused variable warning in Release builds. NFC. 2021-05-25 10:55:29 +02:00
DWARFLinker [MC] Refactor MCObjectFileInfo initialization and allow targets to create MCObjectFileInfo 2021-05-23 14:15:23 -07:00
DebugInfo Add support for DWARF embedded source to llvm-symbolizer. 2021-05-20 21:40:28 +04:00
Demangle [Demangle][Rust] Parse function signatures 2021-05-22 11:49:08 +02:00
ExecutionEngine Fix MSVC "truncation of constant value" warning. NFCI. 2021-05-25 11:35:57 +01:00
Extensions
FileCheck Fix PR46880: Fail CHECK-NOT with undefined variable 2021-04-20 14:42:46 +01:00
Frontend [NFC][OMP] Fix 'unused' warning 2021-05-24 17:14:38 -07:00
FuzzMutate [NFC] Reordering parameters in getFile and getFileOrSTDIN 2021-03-25 09:47:49 -04:00
Fuzzer
IR [SanitizeCoverage] Add support for NoSanitizeCoverage function attribute 2021-05-25 12:57:14 +02:00
IRReader [NFC] Reordering parameters in getFile and getFileOrSTDIN 2021-03-25 09:47:49 -04:00
InterfaceStub
LTO [SampleFDO] New hierarchical discriminator for Flow Sensitive SampleFDO 2021-05-18 16:23:43 -07:00
LineEditor
Linker Linker: Avoid scheduling the link of a global value twice due to an alias 2021-04-28 13:22:10 -07:00
MC [MC] Refactor MCObjectFileInfo initialization and allow targets to create MCObjectFileInfo 2021-05-23 14:15:23 -07:00
MCA [MCA][RegisterFile] Refactor the move elimination logic to address PR50258. 2021-05-08 18:10:35 +01:00
Object [MC] Refactor MCObjectFileInfo initialization and allow targets to create MCObjectFileInfo 2021-05-23 14:15:23 -07:00
ObjectYAML [AMDGPU] Add gfx1034 target 2021-05-13 14:25:18 -04:00
Option
Passes Revert "[LoopUnrollAndJam] Change LoopUnrollAndJamPass to LoopNest pass" 2021-05-25 11:39:49 +09:00
ProfileData [CoverageMapping] Handle gaps in counter IDs for source-based coverage 2021-05-19 10:46:38 -07:00
Remarks [Support] Don't include VirtualFileSystem.h in CommandLine.h 2021-04-21 10:19:01 -04:00
Support [Windows] Use TerminateProcess to exit without running destructors 2021-05-22 23:41:40 +03:00
TableGen [TableGen] Make the NUL character invalid in .td files 2021-05-13 10:17:45 -04:00
Target [CostModel][X86] Improve accuracy of vXi8/vXi16 vector non-uniform shift costs on AVX2/AVX512 targets 2021-05-25 11:35:57 +01:00
Testing [SystemZ][z/OS] Add IsText Argument to GetFile and GetFileOrSTDIN 2021-04-16 10:08:36 -04:00
TextAPI [TextAPI] Reformat llvm_unreachable message 2021-05-11 09:59:26 -07:00
ToolDrivers [NFC] Reordering parameters in getFile and getFileOrSTDIN 2021-03-25 09:47:49 -04:00
Transforms [SanitizeCoverage] Add support for NoSanitizeCoverage function attribute 2021-05-25 12:57:14 +02:00
WindowsManifest
XRay
CMakeLists.txt