/// Creates debug information for a local variable introduced in the head of a
/// match-statement arm.
///
/// Adds the created metadata nodes directly to the crate's IR.
Creates debug information for a local variable introduced in the head of a
match-statement arm.

Adds the created metadata nodes directly to the crate's IR.
Creates debug information for a local variable introduced in the head of a match - statement arm . Adds the created metadata nodes directly to the crate ' s IR .
pub fn create_match_binding_metadata<'blk, 'tcx>(bcx: Block<'blk, 'tcx>,
                                                 variable_name: ast::Name,
                                                 binding: BindingInfo<'tcx>) {
    if bcx.unreachable.get() ||
       fn_should_be_ignored(bcx.fcx) ||
       bcx.sess().opts.debuginfo != FullDebugInfo {
        return;
    }
    let scope_metadata = scope_metadata(bcx.fcx, binding.id, binding.span);
    let aops = unsafe {
        [llvm::LLVMDIBuilderCreateOpDeref()]
    };
    // Regardless of the actual type (`T`) we're always passed the stack slot
    // (alloca) for the binding. For ByRef bindings that's a `T*` but for ByMove
    // bindings we actually have `T**`. So to get the actual variable we need to
    // dereference once more. For ByCopy we just use the stack slot we created
    // for the binding.
    let var_access = match binding.trmode {
        TransBindingMode::TrByCopy(llbinding) |
        TransBindingMode::TrByMoveIntoCopy(llbinding) => VariableAccess::DirectVariable {
            alloca: llbinding
        },
        TransBindingMode::TrByMoveRef => VariableAccess::IndirectVariable {
            alloca: binding.llmatch,
            address_operations: &aops
        },
        TransBindingMode::TrByRef => VariableAccess::DirectVariable {
            alloca: binding.llmatch
        }
    };
    declare_local(bcx,
                  variable_name,
                  binding.ty,
                  scope_metadata,
                  var_access,
                  VariableKind::LocalVariable,
                  binding.span);
}
pub fn create_match_binding_metadata < ' blk , ' tcx > ( bcx : Block < ' blk , ' tcx > , variable_name : ast :: Name , binding : BindingInfo < ' tcx > ) { if bcx . unreachable . get ( ) || fn_should_be_ignored ( bcx . fcx ) || bcx . sess ( ) . opts . debuginfo != FullDebugInfo { return ; } let scope_metadata = scope_metadata ( bcx . fcx , binding . id , binding . span ) ; let aops = unsafe { [ llvm :: LLVMDIBuilderCreateOpDeref ( ) ] } ; // Regardless of the actual type (`T`) we're always passed the stack slot // (alloca) for the binding. For ByRef bindings that's a `T*` but for ByMove // bindings we actually have `T**`. So to get the actual variable we need to // dereference once more. For ByCopy we just use the stack slot we created // for the binding. let var_access = match binding . trmode { TransBindingMode :: TrByCopy ( llbinding ) | TransBindingMode :: TrByMoveIntoCopy ( llbinding ) => VariableAccess :: DirectVariable { alloca : llbinding } , TransBindingMode :: TrByMoveRef => VariableAccess :: IndirectVariable { alloca : binding . llmatch , address_operations : & aops } , TransBindingMode :: TrByRef => VariableAccess :: DirectVariable { alloca : binding . llmatch } } ; declare_local ( bcx , variable_name , binding . ty , scope_metadata , var_access , VariableKind :: LocalVariable , binding . span ) ; }
Creates debug information for a local variable introduced in the head of a
match-statement arm.
Creates debug information for a local variable introduced in the head of a match - statement arm .
bcx
Block<'blk, 'tcx>
variable_name
ast::Name
binding
BindingInfo<'tcx>