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
Why shouldn't this always be line 0? A call to a check handler is always auto-generated.