]> git.lizzy.rs Git - rust.git/commitdiff
debuginfo: Make debuginfo source location assignment more stable (Pt. 1)
authorMichael Woerister <michaelwoerister@posteo>
Thu, 11 Dec 2014 12:53:30 +0000 (13:53 +0100)
committerMichael Woerister <michaelwoerister@posteo>
Wed, 21 Jan 2015 09:48:10 +0000 (10:48 +0100)
So far, the source location an LLVM instruction was linked to was controlled by
`debuginfo::set_source_location()` and `debuginfo::clear_source_location()`.
This interface mimicked how LLVM's `IRBuilder` handles debug location
assignment. While this interface has some theoretical performance benefits, it
also makes things terribly unstable: One sets some quasi-global state and then
hopes that it is still correct when a given instruction is emitted---an
assumption that has been proven to not hold a bit too often.

This patch requires the debug source location to be passed to the actual
instruction emitting function. This makes source location assignment explicit
and will prevent future changes to `trans` from accidentally breaking things in
the majority of cases.

This patch does not yet implement the new principle for all instruction kinds
but the stepping experience should have improved significantly nonetheless
already.


No differences found