Prior to this commit, when lowering SIL instructions that should are
"hidden" for the purposes of debugging, the compiler just attaches the
location of the previous instruction in the name of keeping a simpler
line table.
However, this is wrong for many reasons. One such reason is this: at the
start of a basic block, inheriting the previous debug location will
almost certainly cause the instruction to have a random location in the
code, as it will depend on whatever BB was visited previously.
Other examples can be seen in the tests affect by this commit, which
changes lowering to use Line 0 instead of the line number of the
previous instruction.
CodeView doesn't handle line 0 the same way DWARF does, so this commit
preserves the old behavior for the CodeView path.
The test changes here are effectively undoing some of the diffs from
158772c2ab.
rdar://139826231&110187845
We want the static version of Dispatch here. If we don't use that version,
we'll fail the tests on the release branches (but strangely not on main
for some reason).
rdar://115774613
When we're statically linking the standard library, we need to force
the inclusion of the backtracing code in the runtime, otherwise we don't
get on-crash backtraces.
Also, add a test to make sure that this works.
rdar://115774613