[AddressSanitizer] Add fallback DebugLocation for instrumented calls
authorJakob Koschel <jakobkoschel@gmail.com>
Mon, 17 Jul 2023 10:40:48 +0000 (12:40 +0200)
committerMarco Elver <elver@google.com>
Mon, 17 Jul 2023 15:51:33 +0000 (17:51 +0200)
commit4a8b1249306ff11f229320abdeadf0c215a00400
treea955a5534d8b0b6651951f82c565e0ec38672572
parentfda45d9198c848a3cfa4c2f9f4a1162cf3a202d4
[AddressSanitizer] Add fallback DebugLocation for instrumented calls

When building the kernel with LTO, KASAN & debug information enabled,
multiple inlinable AddressSanitizer 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/D155376
llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp
llvm/test/Instrumentation/AddressSanitizer/missing_dbg.ll [new file with mode: 0644]