Merge commit '4f83a4258deb99f3288a7122c0d5a78200931c61' into subtree-update_cg_gcc_2025-04-25

This commit is contained in:
Antoni Boucher
2025-04-25 10:44:19 -04:00
10 changed files with 46 additions and 39 deletions

View File

@@ -126,14 +126,15 @@ fn make_mir_scope<'gcc, 'tcx>(
return;
};
if let Some(ref vars) = *variables {
if !vars.contains(scope) && scope_data.inlined.is_none() {
// Do not create a DIScope if there are no variables defined in this
// MIR `SourceScope`, and it's not `inlined`, to avoid debuginfo bloat.
debug_context.scopes[scope] = parent_scope;
instantiated.insert(scope);
return;
}
if let Some(ref vars) = *variables
&& !vars.contains(scope)
&& scope_data.inlined.is_none()
{
// Do not create a DIScope if there are no variables defined in this
// MIR `SourceScope`, and it's not `inlined`, to avoid debuginfo bloat.
debug_context.scopes[scope] = parent_scope;
instantiated.insert(scope);
return;
}
let loc = cx.lookup_debug_loc(scope_data.span.lo());