[SanitizerCoverage] Add fallback DebugLocation for instrumented calls
authorJakob Koschel <jakobkoschel@gmail.com>
Mon, 17 Jul 2023 10:41:16 +0000 (12:41 +0200)
committerMarco Elver <elver@google.com>
Mon, 17 Jul 2023 15:52:06 +0000 (17:52 +0200)
commit913f7e93dac67ecff47bade862ba42f27cb68ca9
tree3d978b6364b8918a53e0d1dd417b327aa1d6e070
parent4a8b1249306ff11f229320abdeadf0c215a00400
[SanitizerCoverage] Add fallback DebugLocation for instrumented calls

When building the kernel with LTO, KCOV & debug information enabled,
multiple inlinable SanitizerCoverage functions require debug information
present.

In such cases we repurpose the InstrumentationIRBuilder that ensures
the necessary debug information is added if necessary.

This has been done analogous to the work for the ThreadSanitizer
in D124937.

Bug: https://github.com/ClangBuiltLinux/linux/issues/1721

Reviewed By: melver

Differential Revision: https://reviews.llvm.org/D155377
llvm/lib/Transforms/Instrumentation/SanitizerCoverage.cpp
llvm/test/Instrumentation/SanitizerCoverage/missing_dbg.ll [new file with mode: 0644]