1
Fork 0

rustc: turn mir::LocalDecl's visibility_source_info into a SourceScope.

This commit is contained in:
Eduard-Mihai Burtescu 2018-05-29 13:55:21 +03:00
parent 3da186b67f
commit 6c53972478
18 changed files with 44 additions and 55 deletions

View file

@ -265,7 +265,7 @@ pub fn codegen_mir<'a, 'tcx: 'a>(
if let Some(name) = decl.name {
// User variable
let debug_scope = fx.scopes[decl.visibility_source_info.scope];
let debug_scope = fx.scopes[decl.visibility_scope];
let dbg = debug_scope.is_valid() && bx.sess().opts.debuginfo == FullDebugInfo;
if !memory_locals.contains(local.index()) && !dbg {
@ -276,7 +276,10 @@ pub fn codegen_mir<'a, 'tcx: 'a>(
debug!("alloc: {:?} ({}) -> place", local, name);
let place = PlaceRef::alloca(&bx, layout, &name.as_str());
if dbg {
let (scope, span) = fx.debug_loc(decl.visibility_source_info);
let (scope, span) = fx.debug_loc(mir::SourceInfo {
span: decl.syntactic_source_info.span,
scope: decl.visibility_scope,
});
declare_local(&bx, &fx.debug_context, name, layout.ty, scope,
VariableAccess::DirectVariable { alloca: place.llval },
VariableKind::LocalVariable, span);