summary refs log tree commit diff
path: root/compiler/rustc_codegen_ssa/src/traits
diff options
context:
space:
mode:
authorEduard-Mihai Burtescu <edy.burt@gmail.com>2020-02-10 22:52:30 +0200
committerEduard-Mihai Burtescu <edy.burt@gmail.com>2020-10-21 04:43:57 +0300
commit737499593db6d7702de3bf9d0070ec3f8e65d71e (patch)
tree30b14ba847c56ec3a71b80f248fc42b0e2dbf014 /compiler/rustc_codegen_ssa/src/traits
parent88d874de6395a5422caad1f61783dadd395d49d0 (diff)
downloadrust-737499593db6d7702de3bf9d0070ec3f8e65d71e.tar.gz
rust-737499593db6d7702de3bf9d0070ec3f8e65d71e.zip
rustc_codegen_llvm: expose DILocation to rustc_codegen_ssa.
Diffstat (limited to 'compiler/rustc_codegen_ssa/src/traits')
-rw-r--r--compiler/rustc_codegen_ssa/src/traits/backend.rs1
-rw-r--r--compiler/rustc_codegen_ssa/src/traits/debuginfo.rs7
-rw-r--r--compiler/rustc_codegen_ssa/src/traits/mod.rs1
3 files changed, 6 insertions, 3 deletions
diff --git a/compiler/rustc_codegen_ssa/src/traits/backend.rs b/compiler/rustc_codegen_ssa/src/traits/backend.rs
index 3fb189e1984..b9c555c2eb0 100644
--- a/compiler/rustc_codegen_ssa/src/traits/backend.rs
+++ b/compiler/rustc_codegen_ssa/src/traits/backend.rs
@@ -34,6 +34,7 @@ pub trait BackendTypes {
     // FIXME(eddyb) find a common convention for all of the debuginfo-related
     // names (choose between `Dbg`, `Debug`, `DebugInfo`, `DI` etc.).
     type DIScope: Copy;
+    type DILocation: Copy;
     type DIVariable: Copy;
 }
 
diff --git a/compiler/rustc_codegen_ssa/src/traits/debuginfo.rs b/compiler/rustc_codegen_ssa/src/traits/debuginfo.rs
index 3d2e0ac7be2..a7588eb4d14 100644
--- a/compiler/rustc_codegen_ssa/src/traits/debuginfo.rs
+++ b/compiler/rustc_codegen_ssa/src/traits/debuginfo.rs
@@ -30,6 +30,8 @@ pub trait DebugInfoMethods<'tcx>: BackendTypes {
         maybe_definition_llfn: Option<Self::Function>,
     ) -> Self::DIScope;
 
+    fn dbg_loc(&self, scope: Self::DIScope, span: Span) -> Self::DILocation;
+
     fn extend_scope_to_file(
         &self,
         scope_metadata: Self::DIScope,
@@ -55,14 +57,13 @@ pub trait DebugInfoBuilderMethods: BackendTypes {
     fn dbg_var_addr(
         &mut self,
         dbg_var: Self::DIVariable,
-        scope_metadata: Self::DIScope,
+        dbg_loc: Self::DILocation,
         variable_alloca: Self::Value,
         direct_offset: Size,
         // NB: each offset implies a deref (i.e. they're steps in a pointer chain).
         indirect_offsets: &[Size],
-        span: Span,
     );
-    fn set_source_location(&mut self, scope: Self::DIScope, span: Span);
+    fn set_dbg_loc(&mut self, dbg_loc: Self::DILocation);
     fn insert_reference_to_gdb_debug_scripts_section_global(&mut self);
     fn set_var_name(&mut self, value: Self::Value, name: &str);
 }
diff --git a/compiler/rustc_codegen_ssa/src/traits/mod.rs b/compiler/rustc_codegen_ssa/src/traits/mod.rs
index 82518b7f0c3..8ada6c10479 100644
--- a/compiler/rustc_codegen_ssa/src/traits/mod.rs
+++ b/compiler/rustc_codegen_ssa/src/traits/mod.rs
@@ -95,6 +95,7 @@ pub trait HasCodegen<'tcx>:
             Type = Self::Type,
             Funclet = Self::Funclet,
             DIScope = Self::DIScope,
+            DILocation = Self::DILocation,
             DIVariable = Self::DIVariable,
         >;
 }