Skip to content

Commit 28380af

Browse files
committed
Auto merge of rust-lang#132010 - cuviper:alt-full-debuginfo, r=<try>
ci: Enable full `debuginfo-level=2` in `DEPLOY_ALT` It will be slower to build and produce larger artifacts, but hopefully it will help catch debuginfo regressions sooner, especially for problems that LLVM assertions would uncover. try-job: dist-x86_64-linux try-job: dist-x86_64-linux-alt
2 parents 86d69c7 + 61cd0c7 commit 28380af

File tree

2 files changed

+24
-8
lines changed

2 files changed

+24
-8
lines changed

compiler/rustc_codegen_ssa/src/mir/debuginfo.rs

+18-7
Original file line numberDiff line numberDiff line change
@@ -479,7 +479,8 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
479479

480480
let mut per_local = IndexVec::from_elem(vec![], &self.mir.local_decls);
481481
let mut constants = vec![];
482-
let mut params_seen: FxHashMap<_, Bx::DIVariable> = Default::default();
482+
let mut params_seen: FxHashMap<_, (Bx::DIVariable, Span, mir::SourceScope)> =
483+
Default::default();
483484
for var in &self.mir.var_debug_info {
484485
let dbg_scope_and_span = if full_debug_info {
485486
self.adjusted_span_and_dbg_scope(var.source_info)
@@ -498,7 +499,7 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
498499
}
499500
};
500501

501-
let dbg_var = dbg_scope_and_span.map(|(dbg_scope, _, span)| {
502+
let dbg_var = dbg_scope_and_span.and_then(|(dbg_scope, _, span)| {
502503
let var_kind = if let Some(arg_index) = var.argument_index
503504
&& var.composite.is_none()
504505
&& let mir::VarDebugInfoContents::Place(place) = var.value
@@ -524,18 +525,28 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
524525
VariableKind::LocalVariable
525526
};
526527

527-
if let VariableKind::ArgumentVariable(arg_index) = var_kind {
528+
Some(if let VariableKind::ArgumentVariable(arg_index) = var_kind {
528529
match params_seen.entry((dbg_scope, arg_index)) {
529-
Entry::Occupied(o) => o.get().clone(),
530+
Entry::Occupied(o) => {
531+
let (seen_var, seen_span, seen_source_scope) = o.get();
532+
if *seen_span == span && *seen_source_scope != var.source_info.scope {
533+
return None;
534+
} else {
535+
seen_var.clone()
536+
}
537+
}
530538
Entry::Vacant(v) => v
531-
.insert(
539+
.insert((
532540
self.cx.create_dbg_var(var.name, var_ty, dbg_scope, var_kind, span),
533-
)
541+
span,
542+
var.source_info.scope,
543+
))
544+
.0
534545
.clone(),
535546
}
536547
} else {
537548
self.cx.create_dbg_var(var.name, var_ty, dbg_scope, var_kind, span)
538-
}
549+
})
539550
});
540551

541552
let fragment = if let Some(ref fragment) = var.composite {

src/ci/run.sh

+6-1
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,12 @@ RUST_CONFIGURE_ARGS="$RUST_CONFIGURE_ARGS --release-channel=$RUST_RELEASE_CHANNE
120120
if [ "$DEPLOY$DEPLOY_ALT" = "1" ]; then
121121
RUST_CONFIGURE_ARGS="$RUST_CONFIGURE_ARGS --enable-llvm-static-stdcpp"
122122
RUST_CONFIGURE_ARGS="$RUST_CONFIGURE_ARGS --set rust.remap-debuginfo"
123-
RUST_CONFIGURE_ARGS="$RUST_CONFIGURE_ARGS --debuginfo-level-std=1"
123+
124+
if [ "$DEPLOY_ALT" != "" ]; then
125+
RUST_CONFIGURE_ARGS="$RUST_CONFIGURE_ARGS --debuginfo-level=2"
126+
else
127+
RUST_CONFIGURE_ARGS="$RUST_CONFIGURE_ARGS --debuginfo-level-std=1"
128+
fi
124129

125130
if [ "$NO_LLVM_ASSERTIONS" = "1" ]; then
126131
RUST_CONFIGURE_ARGS="$RUST_CONFIGURE_ARGS --disable-llvm-assertions"

0 commit comments

Comments
 (0)