Skip to content

Commit

Permalink
rustc_codegen_llvm: remove unnecessary special-casing of root scopes'…
Browse files Browse the repository at this point in the history
… children.
  • Loading branch information
eddyb committed Feb 8, 2020
1 parent 6cad754 commit d6ccbf6
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions src/librustc_codegen_llvm/debuginfo/create_scope_map.rs
Expand Up @@ -66,14 +66,8 @@ fn make_mir_scope(
if !has_variables.contains(scope) {
// Do not create a DIScope if there are no variables
// defined in this MIR Scope, to avoid debuginfo bloat.

// However, we don't skip creating a nested scope if
// our parent is the root, because we might want to
// put arguments in the root and not have shadowing.
if parent_scope.scope_metadata.unwrap() != fn_metadata {
debug_context.scopes[scope] = parent_scope;
return;
}
debug_context.scopes[scope] = parent_scope;
return;
}

let loc = span_start(cx, scope_data.span);
Expand Down

0 comments on commit d6ccbf6

Please sign in to comment.