Skip to content

Commit bdd946d

Browse files
committedFeb 3, 2020
Auto merge of #68665 - eddyb:debuginfo-early-create-var, r=nagisa
codegen: create DIVariables ahead of using them with llvm.dbg.declare. Instead of having `rustc_codegen_llvm` bundle creation of a `DIVariable` and `llvm.dbg.declare` into a single operation, they are now two separate methods, and the `DIVariable` is created earlier, specifically when `mir::VarDebugInfo`s are being partitioned into locals. While this isn't currently needed, it's a prerequisite for #48300, which adds fragmented debuginfo, where one `mir::VarDebugInfo` has multiple parts of itself mapped to different `mir::Place`s. For debuggers to see one composite variable instead of several ones with the same name, we need to create a single `DIVariable` and share it between multiple `llvm.dbg.declare` calls, which are likely pointing to different MIR locals. That makes the `per_local_var_debug_info` partitioning a good spot to do this in, as we can create *exactly* one `DIVariable` per `mir::VarDebugInfo`, and refer to it as many things as needed. I'm opening this PR separately because I want to test its perf impact in isolation (see #48300 (comment)). r? @nagisa or @oli-obk cc @michaelwoerister @nikomatsakis
2 parents c58e09f + e35dfad commit bdd946d

File tree

9 files changed

+209
-94
lines changed

9 files changed

+209
-94
lines changed
 

‎src/librustc_codegen_llvm/builder.rs

+1
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ impl BackendTypes for Builder<'_, 'll, 'tcx> {
5757
type Funclet = <CodegenCx<'ll, 'tcx> as BackendTypes>::Funclet;
5858

5959
type DIScope = <CodegenCx<'ll, 'tcx> as BackendTypes>::DIScope;
60+
type DIVariable = <CodegenCx<'ll, 'tcx> as BackendTypes>::DIVariable;
6061
}
6162

6263
impl ty::layout::HasDataLayout for Builder<'_, '_, '_> {

‎src/librustc_codegen_llvm/common.rs

+1
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@ impl BackendTypes for CodegenCx<'ll, 'tcx> {
9191
type Funclet = Funclet<'ll>;
9292

9393
type DIScope = &'ll llvm::debuginfo::DIScope;
94+
type DIVariable = &'ll llvm::debuginfo::DIVariable;
9495
}
9596

9697
impl CodegenCx<'ll, 'tcx> {

‎src/librustc_codegen_llvm/debuginfo/mod.rs

+52-34
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ use self::utils::{create_DIArray, is_node_local_to_unit, span_start, DIB};
1111

1212
use crate::llvm;
1313
use crate::llvm::debuginfo::{
14-
DIArray, DIBuilder, DIFile, DIFlags, DILexicalBlock, DISPFlags, DIScope, DIType,
14+
DIArray, DIBuilder, DIFile, DIFlags, DILexicalBlock, DISPFlags, DIScope, DIType, DIVariable,
1515
};
1616
use rustc::middle::codegen_fn_attrs::CodegenFnAttrFlags;
1717
use rustc::ty::subst::{GenericArgKind, SubstsRef};
@@ -143,33 +143,23 @@ pub fn finalize(cx: &CodegenCx<'_, '_>) {
143143
};
144144
}
145145

146-
impl DebugInfoBuilderMethods<'tcx> for Builder<'a, 'll, 'tcx> {
147-
fn declare_local(
146+
impl DebugInfoBuilderMethods for Builder<'a, 'll, 'tcx> {
147+
// FIXME(eddyb) find a common convention for all of the debuginfo-related
148+
// names (choose between `dbg`, `debug`, `debuginfo`, `debug_info` etc.).
149+
fn dbg_var_addr(
148150
&mut self,
149151
dbg_context: &FunctionDebugContext<&'ll DIScope>,
150-
variable_name: ast::Name,
151-
variable_type: Ty<'tcx>,
152+
dbg_var: &'ll DIVariable,
152153
scope_metadata: &'ll DIScope,
153154
variable_alloca: Self::Value,
154155
direct_offset: Size,
155156
indirect_offsets: &[Size],
156-
variable_kind: VariableKind,
157157
span: Span,
158158
) {
159159
assert!(!dbg_context.source_locations_enabled);
160160
let cx = self.cx();
161161

162-
let file = span_start(cx, span).file;
163-
let file_metadata = file_metadata(cx, &file.name, dbg_context.defining_crate);
164-
165162
let loc = span_start(cx, span);
166-
let type_metadata = type_metadata(cx, variable_type, span);
167-
168-
let (argument_index, dwarf_tag) = match variable_kind {
169-
ArgumentVariable(index) => (index as c_uint, DW_TAG_arg_variable),
170-
LocalVariable => (0, DW_TAG_auto_variable),
171-
};
172-
let align = cx.align_of(variable_type);
173163

174164
// Convert the direct and indirect offsets to address ops.
175165
let op_deref = || unsafe { llvm::LLVMRustDIBuilderCreateOpDeref() };
@@ -188,32 +178,19 @@ impl DebugInfoBuilderMethods<'tcx> for Builder<'a, 'll, 'tcx> {
188178
}
189179
}
190180

191-
let name = SmallCStr::new(&variable_name.as_str());
192-
let metadata = unsafe {
193-
llvm::LLVMRustDIBuilderCreateVariable(
194-
DIB(cx),
195-
dwarf_tag,
196-
scope_metadata,
197-
name.as_ptr(),
198-
file_metadata,
199-
loc.line as c_uint,
200-
type_metadata,
201-
cx.sess().opts.optimize != config::OptLevel::No,
202-
DIFlags::FlagZero,
203-
argument_index,
204-
align.bytes() as u32,
205-
)
206-
};
181+
// FIXME(eddyb) maybe this information could be extracted from `var`,
182+
// to avoid having to pass it down in both places?
207183
source_loc::set_debug_location(
208184
self,
209185
InternalDebugLocation::new(scope_metadata, loc.line, loc.col.to_usize()),
210186
);
211187
unsafe {
212188
let debug_loc = llvm::LLVMGetCurrentDebugLocation(self.llbuilder);
189+
// FIXME(eddyb) replace `llvm.dbg.declare` with `llvm.dbg.addr`.
213190
let instr = llvm::LLVMRustDIBuilderInsertDeclareAtEnd(
214191
DIB(cx),
215192
variable_alloca,
216-
metadata,
193+
dbg_var,
217194
addr_ops.as_ptr(),
218195
addr_ops.len() as c_uint,
219196
debug_loc,
@@ -313,7 +290,8 @@ impl DebugInfoMethods<'tcx> for CodegenCx<'ll, 'tcx> {
313290
// Get the linkage_name, which is just the symbol name
314291
let linkage_name = mangled_name_of_instance(self, instance);
315292

316-
let scope_line = span_start(self, span).line;
293+
// FIXME(eddyb) does this need to be separate from `loc.line` for some reason?
294+
let scope_line = loc.line;
317295

318296
let function_name = CString::new(name).unwrap();
319297
let linkage_name = SmallCStr::new(&linkage_name.name.as_str());
@@ -558,4 +536,44 @@ impl DebugInfoMethods<'tcx> for CodegenCx<'ll, 'tcx> {
558536
fn debuginfo_finalize(&self) {
559537
finalize(self)
560538
}
539+
540+
// FIXME(eddyb) find a common convention for all of the debuginfo-related
541+
// names (choose between `dbg`, `debug`, `debuginfo`, `debug_info` etc.).
542+
fn create_dbg_var(
543+
&self,
544+
dbg_context: &FunctionDebugContext<&'ll DIScope>,
545+
variable_name: ast::Name,
546+
variable_type: Ty<'tcx>,
547+
scope_metadata: &'ll DIScope,
548+
variable_kind: VariableKind,
549+
span: Span,
550+
) -> &'ll DIVariable {
551+
let loc = span_start(self, span);
552+
let file_metadata = file_metadata(self, &loc.file.name, dbg_context.defining_crate);
553+
554+
let type_metadata = type_metadata(self, variable_type, span);
555+
556+
let (argument_index, dwarf_tag) = match variable_kind {
557+
ArgumentVariable(index) => (index as c_uint, DW_TAG_arg_variable),
558+
LocalVariable => (0, DW_TAG_auto_variable),
559+
};
560+
let align = self.align_of(variable_type);
561+
562+
let name = SmallCStr::new(&variable_name.as_str());
563+
unsafe {
564+
llvm::LLVMRustDIBuilderCreateVariable(
565+
DIB(self),
566+
dwarf_tag,
567+
scope_metadata,
568+
name.as_ptr(),
569+
file_metadata,
570+
loc.line as c_uint,
571+
type_metadata,
572+
self.sess().opts.optimize != config::OptLevel::No,
573+
DIFlags::FlagZero,
574+
argument_index,
575+
align.bytes() as u32,
576+
)
577+
}
578+
}
561579
}

‎src/librustc_codegen_ssa/mir/debuginfo.rs

+125-49
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
use crate::traits::*;
22
use rustc::mir;
33
use rustc::session::config::DebugInfo;
4+
use rustc::ty;
45
use rustc::ty::layout::{LayoutOf, Size};
5-
use rustc::ty::TyCtxt;
66
use rustc_hir::def_id::CrateNum;
77
use rustc_index::vec::IndexVec;
88

9-
use rustc_span::symbol::kw;
9+
use rustc_span::symbol::{kw, Symbol};
1010
use rustc_span::{BytePos, Span};
1111

1212
use super::OperandValue;
@@ -24,6 +24,19 @@ pub enum VariableKind {
2424
LocalVariable,
2525
}
2626

27+
/// Like `mir::VarDebugInfo`, but within a `mir::Local`.
28+
#[derive(Copy, Clone)]
29+
pub struct PerLocalVarDebugInfo<'tcx, D> {
30+
pub name: Symbol,
31+
pub source_info: mir::SourceInfo,
32+
33+
/// `DIVariable` returned by `create_dbg_var`.
34+
pub dbg_var: Option<D>,
35+
36+
/// `.place.projection` from `mir::VarDebugInfo`.
37+
pub projection: &'tcx ty::List<mir::PlaceElem<'tcx>>,
38+
}
39+
2740
#[derive(Clone, Copy, Debug)]
2841
pub struct DebugScope<D> {
2942
pub scope_metadata: Option<D>,
@@ -103,6 +116,8 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
103116
// FIXME(eddyb) use `llvm.dbg.value` (which would work for operands),
104117
// not just `llvm.dbg.declare` (which requires `alloca`).
105118
pub fn debug_introduce_local(&self, bx: &mut Bx, local: mir::Local) {
119+
let full_debug_info = bx.sess().opts.debuginfo == DebugInfo::Full;
120+
106121
// FIXME(eddyb) maybe name the return place as `_0` or `return`?
107122
if local == mir::RETURN_PLACE {
108123
return;
@@ -112,35 +127,63 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
112127
Some(per_local) => &per_local[local],
113128
None => return,
114129
};
115-
let whole_local_var = vars.iter().copied().find(|var| var.place.projection.is_empty());
116-
let has_proj = || vars.iter().any(|var| !var.place.projection.is_empty());
130+
let whole_local_var = vars.iter().find(|var| var.projection.is_empty()).copied();
131+
let has_proj = || vars.iter().any(|var| !var.projection.is_empty());
117132

118-
let (fallback_var, kind) = if self.mir.local_kind(local) == mir::LocalKind::Arg {
133+
let fallback_var = if self.mir.local_kind(local) == mir::LocalKind::Arg {
119134
let arg_index = local.index() - 1;
120135

121136
// Add debuginfo even to unnamed arguments.
122137
// FIXME(eddyb) is this really needed?
123-
let var = if arg_index == 0 && has_proj() {
138+
if arg_index == 0 && has_proj() {
124139
// Hide closure environments from debuginfo.
125140
// FIXME(eddyb) shouldn't `ArgumentVariable` indices
126141
// be offset to account for the hidden environment?
127142
None
143+
} else if whole_local_var.is_some() {
144+
// No need to make up anything, there is a `mir::VarDebugInfo`
145+
// covering the whole local.
146+
// FIXME(eddyb) take `whole_local_var.source_info.scope` into
147+
// account, just in case it doesn't use `ArgumentVariable`
148+
// (after #67586 gets fixed).
149+
None
128150
} else {
129-
Some(mir::VarDebugInfo {
130-
name: kw::Invalid,
131-
source_info: self.mir.local_decls[local].source_info,
132-
place: local.into(),
151+
let name = kw::Invalid;
152+
let decl = &self.mir.local_decls[local];
153+
let (scope, span) = if full_debug_info {
154+
self.debug_loc(decl.source_info)
155+
} else {
156+
(None, decl.source_info.span)
157+
};
158+
let dbg_var = scope.map(|scope| {
159+
// FIXME(eddyb) is this `+ 1` needed at all?
160+
let kind = VariableKind::ArgumentVariable(arg_index + 1);
161+
162+
self.cx.create_dbg_var(
163+
self.debug_context.as_ref().unwrap(),
164+
name,
165+
self.monomorphize(&decl.ty),
166+
scope,
167+
kind,
168+
span,
169+
)
170+
});
171+
172+
Some(PerLocalVarDebugInfo {
173+
name,
174+
source_info: decl.source_info,
175+
dbg_var,
176+
projection: ty::List::empty(),
133177
})
134-
};
135-
(var, VariableKind::ArgumentVariable(arg_index + 1))
178+
}
136179
} else {
137-
(None, VariableKind::LocalVariable)
180+
None
138181
};
139182

140183
let local_ref = &self.locals[local];
141184

142185
if !bx.sess().fewer_names() {
143-
let name = match whole_local_var.or(fallback_var.as_ref()) {
186+
let name = match whole_local_var.or(fallback_var) {
144187
Some(var) if var.name != kw::Invalid => var.name.to_string(),
145188
_ => format!("{:?}", local),
146189
};
@@ -163,7 +206,7 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
163206
}
164207
}
165208

166-
if bx.sess().opts.debuginfo != DebugInfo::Full {
209+
if !full_debug_info {
167210
return;
168211
}
169212

@@ -178,22 +221,15 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
178221
_ => return,
179222
};
180223

181-
let vars = vars.iter().copied().chain(if whole_local_var.is_none() {
182-
fallback_var.as_ref()
183-
} else {
184-
None
185-
});
224+
let vars = vars.iter().copied().chain(fallback_var);
186225

187226
for var in vars {
188227
let mut layout = base.layout;
189228
let mut direct_offset = Size::ZERO;
190229
// FIXME(eddyb) use smallvec here.
191230
let mut indirect_offsets = vec![];
192231

193-
let kind =
194-
if var.place.projection.is_empty() { kind } else { VariableKind::LocalVariable };
195-
196-
for elem in &var.place.projection[..] {
232+
for elem in &var.projection[..] {
197233
match *elem {
198234
mir::ProjectionElem::Deref => {
199235
indirect_offsets.push(Size::ZERO);
@@ -202,7 +238,7 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
202238
.ty
203239
.builtin_deref(true)
204240
.unwrap_or_else(|| {
205-
span_bug!(var.source_info.span, "cannot deref `{}`", layout.ty,)
241+
span_bug!(var.source_info.span, "cannot deref `{}`", layout.ty)
206242
})
207243
.ty,
208244
);
@@ -219,24 +255,24 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
219255
_ => span_bug!(
220256
var.source_info.span,
221257
"unsupported var debuginfo place `{:?}`",
222-
var.place,
258+
mir::Place { local, projection: var.projection },
223259
),
224260
}
225261
}
226262

227263
let (scope, span) = self.debug_loc(var.source_info);
228264
if let Some(scope) = scope {
229-
bx.declare_local(
230-
debug_context,
231-
var.name,
232-
layout.ty,
233-
scope,
234-
base.llval,
235-
direct_offset,
236-
&indirect_offsets,
237-
kind,
238-
span,
239-
);
265+
if let Some(dbg_var) = var.dbg_var {
266+
bx.dbg_var_addr(
267+
debug_context,
268+
dbg_var,
269+
scope,
270+
base.llval,
271+
direct_offset,
272+
&indirect_offsets,
273+
span,
274+
);
275+
}
240276
}
241277
}
242278
}
@@ -248,20 +284,60 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
248284
}
249285
}
250286
}
251-
}
252287

253-
/// Partition all `VarDebuginfo` in `body`, by their base `Local`.
254-
pub fn per_local_var_debug_info(
255-
tcx: TyCtxt<'tcx>,
256-
body: &'a mir::Body<'tcx>,
257-
) -> Option<IndexVec<mir::Local, Vec<&'a mir::VarDebugInfo<'tcx>>>> {
258-
if tcx.sess.opts.debuginfo == DebugInfo::Full || !tcx.sess.fewer_names() {
259-
let mut per_local = IndexVec::from_elem(vec![], &body.local_decls);
260-
for var in &body.var_debug_info {
261-
per_local[var.place.local].push(var);
288+
/// Partition all `VarDebugInfo` in `self.mir`, by their base `Local`.
289+
pub fn compute_per_local_var_debug_info(
290+
&self,
291+
) -> Option<IndexVec<mir::Local, Vec<PerLocalVarDebugInfo<'tcx, Bx::DIVariable>>>> {
292+
let full_debug_info = self.cx.sess().opts.debuginfo == DebugInfo::Full;
293+
294+
if !(full_debug_info || !self.cx.sess().fewer_names()) {
295+
return None;
296+
}
297+
298+
let mut per_local = IndexVec::from_elem(vec![], &self.mir.local_decls);
299+
for var in &self.mir.var_debug_info {
300+
let (scope, span) = if full_debug_info {
301+
self.debug_loc(var.source_info)
302+
} else {
303+
(None, var.source_info.span)
304+
};
305+
let dbg_var = scope.map(|scope| {
306+
let place = var.place;
307+
let var_ty = self.monomorphized_place_ty(place.as_ref());
308+
let var_kind = if self.mir.local_kind(place.local) == mir::LocalKind::Arg
309+
&& place.projection.is_empty()
310+
{
311+
// FIXME(eddyb, #67586) take `var.source_info.scope` into
312+
// account to avoid using `ArgumentVariable` more than once
313+
// per argument local.
314+
315+
let arg_index = place.local.index() - 1;
316+
317+
// FIXME(eddyb) shouldn't `ArgumentVariable` indices be
318+
// offset in closures to account for the hidden environment?
319+
// Also, is this `+ 1` needed at all?
320+
VariableKind::ArgumentVariable(arg_index + 1)
321+
} else {
322+
VariableKind::LocalVariable
323+
};
324+
self.cx.create_dbg_var(
325+
self.debug_context.as_ref().unwrap(),
326+
var.name,
327+
var_ty,
328+
scope,
329+
var_kind,
330+
span,
331+
)
332+
});
333+
334+
per_local[var.place.local].push(PerLocalVarDebugInfo {
335+
name: var.name,
336+
source_info: var.source_info,
337+
dbg_var,
338+
projection: var.place.projection,
339+
});
262340
}
263341
Some(per_local)
264-
} else {
265-
None
266342
}
267343
}

‎src/librustc_codegen_ssa/mir/mod.rs

+8-5
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ use rustc_index::bit_set::BitSet;
1111
use rustc_index::vec::IndexVec;
1212

1313
use self::analyze::CleanupKind;
14-
use self::debuginfo::FunctionDebugContext;
14+
use self::debuginfo::{FunctionDebugContext, PerLocalVarDebugInfo};
1515
use self::place::PlaceRef;
1616
use rustc::mir::traversal;
1717

@@ -74,9 +74,10 @@ pub struct FunctionCx<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> {
7474
/// notably `expect`.
7575
locals: IndexVec<mir::Local, LocalRef<'tcx, Bx::Value>>,
7676

77-
/// All `VarDebuginfo` from the MIR body, partitioned by `Local`.
78-
/// This is `None` if no variable debuginfo/names are needed.
79-
per_local_var_debug_info: Option<IndexVec<mir::Local, Vec<&'tcx mir::VarDebugInfo<'tcx>>>>,
77+
/// All `VarDebugInfo` from the MIR body, partitioned by `Local`.
78+
/// This is `None` if no var`#[non_exhaustive]`iable debuginfo/names are needed.
79+
per_local_var_debug_info:
80+
Option<IndexVec<mir::Local, Vec<PerLocalVarDebugInfo<'tcx, Bx::DIVariable>>>>,
8081

8182
/// Caller location propagated if this function has `#[track_caller]`.
8283
caller_location: Option<OperandRef<'tcx, Bx::Value>>,
@@ -178,10 +179,12 @@ pub fn codegen_mir<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>>(
178179
funclets,
179180
locals: IndexVec::new(),
180181
debug_context,
181-
per_local_var_debug_info: debuginfo::per_local_var_debug_info(cx.tcx(), mir_body),
182+
per_local_var_debug_info: None,
182183
caller_location: None,
183184
};
184185

186+
fx.per_local_var_debug_info = fx.compute_per_local_var_debug_info();
187+
185188
let memory_locals = analyze::non_ssa_locals(&fx);
186189

187190
// Allocate variable and temp allocas

‎src/librustc_codegen_ssa/traits/backend.rs

+3
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,10 @@ pub trait BackendTypes {
2121
type Type: CodegenObject;
2222
type Funclet;
2323

24+
// FIXME(eddyb) find a common convention for all of the debuginfo-related
25+
// names (choose between `Dbg`, `Debug`, `DebugInfo`, `DI` etc.).
2426
type DIScope: Copy;
27+
type DIVariable: Copy;
2528
}
2629

2730
pub trait Backend<'tcx>:

‎src/librustc_codegen_ssa/traits/builder.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ pub enum OverflowOp {
2828

2929
pub trait BuilderMethods<'a, 'tcx>:
3030
HasCodegen<'tcx>
31-
+ DebugInfoBuilderMethods<'tcx>
31+
+ DebugInfoBuilderMethods
3232
+ ArgAbiMethods<'tcx>
3333
+ AbiBuilderMethods<'tcx>
3434
+ IntrinsicCallMethods<'tcx>

‎src/librustc_codegen_ssa/traits/debuginfo.rs

+17-5
Original file line numberDiff line numberDiff line change
@@ -30,20 +30,32 @@ pub trait DebugInfoMethods<'tcx>: BackendTypes {
3030
defining_crate: CrateNum,
3131
) -> Self::DIScope;
3232
fn debuginfo_finalize(&self);
33-
}
3433

35-
pub trait DebugInfoBuilderMethods<'tcx>: BackendTypes {
36-
fn declare_local(
37-
&mut self,
34+
// FIXME(eddyb) find a common convention for all of the debuginfo-related
35+
// names (choose between `dbg`, `debug`, `debuginfo`, `debug_info` etc.).
36+
fn create_dbg_var(
37+
&self,
3838
dbg_context: &FunctionDebugContext<Self::DIScope>,
3939
variable_name: Name,
4040
variable_type: Ty<'tcx>,
4141
scope_metadata: Self::DIScope,
42+
variable_kind: VariableKind,
43+
span: Span,
44+
) -> Self::DIVariable;
45+
}
46+
47+
pub trait DebugInfoBuilderMethods: BackendTypes {
48+
// FIXME(eddyb) find a common convention for all of the debuginfo-related
49+
// names (choose between `dbg`, `debug`, `debuginfo`, `debug_info` etc.).
50+
fn dbg_var_addr(
51+
&mut self,
52+
dbg_context: &FunctionDebugContext<Self::DIScope>,
53+
dbg_var: Self::DIVariable,
54+
scope_metadata: Self::DIScope,
4255
variable_alloca: Self::Value,
4356
direct_offset: Size,
4457
// NB: each offset implies a deref (i.e. they're steps in a pointer chain).
4558
indirect_offsets: &[Size],
46-
variable_kind: VariableKind,
4759
span: Span,
4860
);
4961
fn set_source_location(

‎src/librustc_codegen_ssa/traits/mod.rs

+1
Original file line numberDiff line numberDiff line change
@@ -93,5 +93,6 @@ pub trait HasCodegen<'tcx>:
9393
Type = Self::Type,
9494
Funclet = Self::Funclet,
9595
DIScope = Self::DIScope,
96+
DIVariable = Self::DIVariable,
9697
>;
9798
}

0 commit comments

Comments
 (0)
Please sign in to comment.