Skip to content

Commit

Permalink
Account for debuginfo on _0 without naming it.
Browse files Browse the repository at this point in the history
  • Loading branch information
cjgillot committed Mar 15, 2023
1 parent e7b998c commit 2adf2cd
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions compiler/rustc_codegen_ssa/src/mir/debuginfo.rs
Original file line number Diff line number Diff line change
Expand Up @@ -241,11 +241,6 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
pub fn debug_introduce_local(&self, bx: &mut Bx, local: mir::Local) {
let full_debug_info = bx.sess().opts.debuginfo == DebugInfo::Full;

// FIXME(eddyb) maybe name the return place as `_0` or `return`?
if local == mir::RETURN_PLACE {
return;
}

let vars = match &self.per_local_var_debug_info {
Some(per_local) => &per_local[local],
None => return,
Expand Down Expand Up @@ -302,7 +297,8 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {

let local_ref = &self.locals[local];

let name = if bx.sess().fewer_names() {
// FIXME Should the return place be named?
let name = if bx.sess().fewer_names() || local == mir::RETURN_PLACE {
None
} else {
Some(match whole_local_var.or(fallback_var.clone()) {
Expand Down

0 comments on commit 2adf2cd

Please sign in to comment.