diff options
| author | Eduard-Mihai Burtescu <edy.burt@gmail.com> | 2018-05-28 14:16:09 +0300 |
|---|---|---|
| committer | Eduard-Mihai Burtescu <edy.burt@gmail.com> | 2018-05-30 20:30:09 +0300 |
| commit | 85d44c42764fb87e1f581fa6206727e82cd7d52d (patch) | |
| tree | ec32fc25dcc7b3962c9fa5120887c16b55b80184 /src/librustc_codegen_llvm | |
| parent | 74d09399c1289a20b1c258153f005f2604f9ec46 (diff) | |
| download | rust-85d44c42764fb87e1f581fa6206727e82cd7d52d.tar.gz rust-85d44c42764fb87e1f581fa6206727e82cd7d52d.zip | |
rustc: rename mir::VisibilityScope to mir::SourceScope.
Diffstat (limited to 'src/librustc_codegen_llvm')
| -rw-r--r-- | src/librustc_codegen_llvm/debuginfo/create_scope_map.rs | 18 | ||||
| -rw-r--r-- | src/librustc_codegen_llvm/mir/mod.rs | 10 |
2 files changed, 14 insertions, 14 deletions
diff --git a/src/librustc_codegen_llvm/debuginfo/create_scope_map.rs b/src/librustc_codegen_llvm/debuginfo/create_scope_map.rs index bddb3d90940..24d9ff492d5 100644 --- a/src/librustc_codegen_llvm/debuginfo/create_scope_map.rs +++ b/src/librustc_codegen_llvm/debuginfo/create_scope_map.rs @@ -15,7 +15,7 @@ use super::utils::{DIB, span_start}; use llvm; use llvm::debuginfo::DIScope; use common::CodegenCx; -use rustc::mir::{Mir, VisibilityScope}; +use rustc::mir::{Mir, SourceScope}; use libc::c_uint; use std::ptr; @@ -45,13 +45,13 @@ impl MirDebugScope { /// Produce DIScope DIEs for each MIR Scope which has variables defined in it. /// If debuginfo is disabled, the returned vector is empty. pub fn create_mir_scopes(cx: &CodegenCx, mir: &Mir, debug_context: &FunctionDebugContext) - -> IndexVec<VisibilityScope, MirDebugScope> { + -> IndexVec<SourceScope, MirDebugScope> { let null_scope = MirDebugScope { scope_metadata: ptr::null_mut(), file_start_pos: BytePos(0), file_end_pos: BytePos(0) }; - let mut scopes = IndexVec::from_elem(null_scope, &mir.visibility_scopes); + let mut scopes = IndexVec::from_elem(null_scope, &mir.source_scopes); let debug_context = match *debug_context { FunctionDebugContext::RegularContext(ref data) => data, @@ -62,15 +62,15 @@ pub fn create_mir_scopes(cx: &CodegenCx, mir: &Mir, debug_context: &FunctionDebu }; // Find all the scopes with variables defined in them. - let mut has_variables = BitVector::new(mir.visibility_scopes.len()); + let mut has_variables = BitVector::new(mir.source_scopes.len()); for var in mir.vars_iter() { let decl = &mir.local_decls[var]; has_variables.insert(decl.source_info.scope.index()); } // Instantiate all scopes. - for idx in 0..mir.visibility_scopes.len() { - let scope = VisibilityScope::new(idx); + for idx in 0..mir.source_scopes.len() { + let scope = SourceScope::new(idx); make_mir_scope(cx, &mir, &has_variables, debug_context, scope, &mut scopes); } @@ -81,13 +81,13 @@ fn make_mir_scope(cx: &CodegenCx, mir: &Mir, has_variables: &BitVector, debug_context: &FunctionDebugContextData, - scope: VisibilityScope, - scopes: &mut IndexVec<VisibilityScope, MirDebugScope>) { + scope: SourceScope, + scopes: &mut IndexVec<SourceScope, MirDebugScope>) { if scopes[scope].is_valid() { return; } - let scope_data = &mir.visibility_scopes[scope]; + let scope_data = &mir.source_scopes[scope]; let parent_scope = if let Some(parent) = scope_data.parent_scope { make_mir_scope(cx, mir, has_variables, debug_context, parent, scopes); scopes[parent] diff --git a/src/librustc_codegen_llvm/mir/mod.rs b/src/librustc_codegen_llvm/mir/mod.rs index d34f881bf9d..4c0d7fee783 100644 --- a/src/librustc_codegen_llvm/mir/mod.rs +++ b/src/librustc_codegen_llvm/mir/mod.rs @@ -99,7 +99,7 @@ pub struct FunctionCx<'a, 'tcx:'a> { locals: IndexVec<mir::Local, LocalRef<'tcx>>, /// Debug information for MIR scopes. - scopes: IndexVec<mir::VisibilityScope, debuginfo::MirDebugScope>, + scopes: IndexVec<mir::SourceScope, debuginfo::MirDebugScope>, /// If this function is being monomorphized, this contains the type substitutions used. param_substs: &'tcx Substs<'tcx>, @@ -158,9 +158,9 @@ impl<'a, 'tcx> FunctionCx<'a, 'tcx> { // DILocations inherit source file name from the parent DIScope. Due to macro expansions // it may so happen that the current span belongs to a different file than the DIScope - // corresponding to span's containing visibility scope. If so, we need to create a DIScope + // corresponding to span's containing source scope. If so, we need to create a DIScope // "extension" into that file. - fn scope_metadata_for_loc(&self, scope_id: mir::VisibilityScope, pos: BytePos) + fn scope_metadata_for_loc(&self, scope_id: mir::SourceScope, pos: BytePos) -> llvm::debuginfo::DIScope { let scope_metadata = self.scopes[scope_id].scope_metadata; if pos < self.scopes[scope_id].file_start_pos || @@ -411,7 +411,7 @@ fn create_funclets<'a, 'tcx>( /// indirect. fn arg_local_refs<'a, 'tcx>(bx: &Builder<'a, 'tcx>, fx: &FunctionCx<'a, 'tcx>, - scopes: &IndexVec<mir::VisibilityScope, debuginfo::MirDebugScope>, + scopes: &IndexVec<mir::SourceScope, debuginfo::MirDebugScope>, memory_locals: &BitVector) -> Vec<LocalRef<'tcx>> { let mir = fx.mir; @@ -420,7 +420,7 @@ fn arg_local_refs<'a, 'tcx>(bx: &Builder<'a, 'tcx>, let mut llarg_idx = fx.fn_ty.ret.is_indirect() as usize; // Get the argument scope, if it exists and if we need it. - let arg_scope = scopes[mir::ARGUMENT_VISIBILITY_SCOPE]; + let arg_scope = scopes[mir::OUTERMOST_SOURCE_SCOPE]; let arg_scope = if arg_scope.is_valid() && bx.sess().opts.debuginfo == FullDebugInfo { Some(arg_scope.scope_metadata) } else { |
