/// Creates debug information for the given local variable.
///
/// This function assumes that there's a datum for each pattern component of the
/// local in `bcx.fcx.lllocals`.
/// Adds the created metadata nodes directly to the crate's IR.
Creates debug information for the given local variable.
This function assumes that there's a datum for each pattern component of the
local in `bcx.fcx.lllocals`.
Adds the created metadata nodes directly to the crate's IR.
Creates debug information for the given local variable . This function assumes that there ' s a datum for each pattern component of the local in ` bcx . fcx . lllocals ` . Adds the created metadata nodes directly to the crate ' s IR .
pub fn create_local_var_metadata(bcx: Block, local: &hir::Local) {
    if bcx.unreachable.get() ||
       fn_should_be_ignored(bcx.fcx) ||
       bcx.sess().opts.debuginfo != FullDebugInfo  {
        return;
    }
    let locals = bcx.fcx.lllocals.borrow();
    pat_util::pat_bindings(&local.pat, |_, node_id, span, var_name| {
        let datum = match locals.get(&node_id) {
            Some(datum) => datum,
            None => {
                span_bug!(span,
                          "no entry in lllocals table for {}",
                          node_id);
            }
        };
        if unsafe { llvm::LLVMIsAAllocaInst(datum.val) } == ptr::null_mut() {
            span_bug!(span, "debuginfo::create_local_var_metadata() - \
                             Referenced variable location is not an alloca!");
        }
        let scope_metadata = scope_metadata(bcx.fcx, node_id, span);
        declare_local(bcx,
                      var_name.node,
                      datum.ty,
                      scope_metadata,
                      VariableAccess::DirectVariable { alloca: datum.val },
                      VariableKind::LocalVariable,
                      span);
    })
}
pub fn create_local_var_metadata ( bcx : Block , local : & hir :: Local ) { if bcx . unreachable . get ( ) || fn_should_be_ignored ( bcx . fcx ) || bcx . sess ( ) . opts . debuginfo != FullDebugInfo { return ; } let locals = bcx . fcx . lllocals . borrow ( ) ; pat_util :: pat_bindings ( & local . pat , | _ , node_id , span , var_name | { let datum = match locals . get ( & node_id ) { Some ( datum ) => datum , None => { span_bug ! ( span " " node_id ) ; } } ; if unsafe { llvm :: LLVMIsAAllocaInst ( datum . val ) } == ptr :: null_mut ( ) { span_bug ! ( span " \
 " ) ; } let scope_metadata = scope_metadata ( bcx . fcx , node_id , span ) ; declare_local ( bcx , var_name . node , datum . ty , scope_metadata , VariableAccess :: DirectVariable { alloca : datum . val } , VariableKind :: LocalVariable , span ) ; } ) }
Creates debug information for the given local variable.
Creates debug information for the given local variable .
bcx
Block
local
&hir::Local