diff options
| author | khyperia <github@khyperia.com> | 2020-10-06 15:39:12 +0200 |
|---|---|---|
| committer | khyperia <github@khyperia.com> | 2020-10-06 15:39:12 +0200 |
| commit | c5bc95676bf2063c54b3f010fc713d95b4e4dd68 (patch) | |
| tree | 48612cce4283f9feddc67ad61e6e120776e13789 /compiler/rustc_codegen_ssa/src/mir | |
| parent | 5849a7eca90582ee59b67eb09548a2aa424d7f52 (diff) | |
| download | rust-c5bc95676bf2063c54b3f010fc713d95b4e4dd68.tar.gz rust-c5bc95676bf2063c54b3f010fc713d95b4e4dd68.zip | |
Let backends access span information
Sometimes, a backend may need to emit warnings, errors, or otherwise need to know the span of the current item in a basic block. So, add a set_span method to give the backend that information.
Diffstat (limited to 'compiler/rustc_codegen_ssa/src/mir')
| -rw-r--r-- | compiler/rustc_codegen_ssa/src/mir/debuginfo.rs | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/compiler/rustc_codegen_ssa/src/mir/debuginfo.rs b/compiler/rustc_codegen_ssa/src/mir/debuginfo.rs index d8a530d98fa..26a646b0293 100644 --- a/compiler/rustc_codegen_ssa/src/mir/debuginfo.rs +++ b/compiler/rustc_codegen_ssa/src/mir/debuginfo.rs @@ -55,6 +55,7 @@ impl<D> DebugScope<D> { impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> { pub fn set_debug_loc(&self, bx: &mut Bx, source_info: mir::SourceInfo) { let (scope, span) = self.debug_loc(source_info); + bx.set_span(span); if let Some(scope) = scope { bx.set_source_location(scope, span); } |
