Ejemplo n.º 1
0
        internal LocalBuilder GetNamedLocal(Type type, string name)
        {
            Assert.NotNull(type);

            if (_emitDebugSymbols && name != null)
            {
                LocalBuilder lb = _ilg.DeclareLocal(type);
                // TODO: we need to set the lexical scope properly, so it can
                // be freed and reused!
                lb.SetLocalSymInfo(name);
                return(lb);
            }
            return(_ilg.GetLocal(type));
        }
Ejemplo n.º 2
0
        internal LabelInfo(ILGen il, LabelTarget node, bool canReturn)
        {
            _ilg       = il;
            Node       = node;
            Label      = il.DefineLabel();
            _canReturn = canReturn;
            if (node != null && node.Type != typeof(void))
            {
                Value = il.DeclareLocal(node.Type);
            }

            // Until we have more information, default to a leave instruction, which always works
            _opCode = OpCodes.Leave;
        }