From c5bc95676bf2063c54b3f010fc713d95b4e4dd68 Mon Sep 17 00:00:00 2001 From: khyperia Date: Tue, 6 Oct 2020 15:39:12 +0200 Subject: 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. --- compiler/rustc_codegen_ssa/src/mir/debuginfo.rs | 1 + 1 file changed, 1 insertion(+) (limited to 'compiler/rustc_codegen_ssa/src/mir') 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 DebugScope { 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); } -- cgit 1.4.1-3-g733a5