Commit Graph

3 Commits

Author SHA1 Message Date
Adrian Prantl c9f2473b43 Ensure sanitizer check function calls have a !dbg location
Function calls without a !dbg location inside a function that has a
DISubprogram make it impossible to construct inline information and
are rejected by the verifier. This patch ensures that sanitizer check
function calls have a !dbg location, by carrying forward the location
of the preceding instruction or by inserting an artificial location if
necessary.

This fixes a crash when compiling the attached testcase with -Os.

rdar://problem/45311226

Differential Revision: https://reviews.llvm.org/D53459

Note: This reapllies r344915, modified to reuse the IRBuilder's
DebugLoc if one exists instead of picking the one from CGDebugInfo
since the latter may get reset when emitting thunks such as block
helpers in the middle of emitting another function.

llvm-svn: 347810
2018-11-28 21:44:06 +00:00
Vlad Tsyrklevich ca1c9791e3 Revert "Ensure sanitizer check function calls have a !dbg location"
This reverts commit r344915. It was causing exceptions on the
x86_64-linux-ubsan bot.

llvm-svn: 344961
2018-10-22 21:51:58 +00:00
Adrian Prantl 5f5b910495 Ensure sanitizer check function calls have a !dbg location
Function calls without a !dbg location inside a function that has a
DISubprogram make it impossible to construct inline information and
are rejected by the verifier. This patch ensures that sanitizer check
function calls have a !dbg location, by carrying forward the location
of the preceding instruction or by inserting an artificial location if
necessary.

This fixes a crash when compiling the attached testcase with -Os.

rdar://problem/45311226

Differential Revision: https://reviews.llvm.org/D53459

llvm-svn: 344915
2018-10-22 16:27:41 +00:00