Skip to content

Commit 00a88b9

Browse files
committed
Remove get_dbg_loc from DebugInfoBuilderMethods
It is only used within cg_llvm.
1 parent b17dba4 commit 00a88b9

File tree

3 files changed

+6
-9
lines changed

3 files changed

+6
-9
lines changed

compiler/rustc_codegen_gcc/src/debuginfo.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,10 +52,6 @@ impl<'a, 'gcc, 'tcx> DebugInfoBuilderMethods for Builder<'a, 'gcc, 'tcx> {
5252
fn clear_dbg_loc(&mut self) {
5353
self.location = None;
5454
}
55-
56-
fn get_dbg_loc(&self) -> Option<Self::DILocation> {
57-
self.location
58-
}
5955
}
6056

6157
/// Generate the `debug_context` in an MIR Body.

compiler/rustc_codegen_llvm/src/debuginfo/mod.rs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,12 @@ pub(crate) fn finalize(cx: &CodegenCx<'_, '_>) {
147147
}
148148
}
149149

150+
impl<'ll> Builder<'_, 'll, '_> {
151+
pub(crate) fn get_dbg_loc(&self) -> Option<&'ll DILocation> {
152+
unsafe { llvm::LLVMGetCurrentDebugLocation2(self.llbuilder) }
153+
}
154+
}
155+
150156
impl<'ll> DebugInfoBuilderMethods for Builder<'_, 'll, '_> {
151157
// FIXME(eddyb) find a common convention for all of the debuginfo-related
152158
// names (choose between `dbg`, `debug`, `debuginfo`, `debug_info` etc.).
@@ -209,10 +215,6 @@ impl<'ll> DebugInfoBuilderMethods for Builder<'_, 'll, '_> {
209215
}
210216
}
211217

212-
fn get_dbg_loc(&self) -> Option<&'ll DILocation> {
213-
unsafe { llvm::LLVMGetCurrentDebugLocation2(self.llbuilder) }
214-
}
215-
216218
fn insert_reference_to_gdb_debug_scripts_section_global(&mut self) {
217219
gdb::insert_reference_to_gdb_debug_scripts_section_global(self)
218220
}

compiler/rustc_codegen_ssa/src/traits/debuginfo.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,6 @@ pub trait DebugInfoBuilderMethods: BackendTypes {
8181
);
8282
fn set_dbg_loc(&mut self, dbg_loc: Self::DILocation);
8383
fn clear_dbg_loc(&mut self);
84-
fn get_dbg_loc(&self) -> Option<Self::DILocation>;
8584
fn insert_reference_to_gdb_debug_scripts_section_global(&mut self);
8685
fn set_var_name(&mut self, value: Self::Value, name: &str);
8786
}

0 commit comments

Comments
 (0)