示例#1
0
 static public ILMethodInvokation GetTechnicalInstanceILMethodInvokation(this ILValue item, string name, IEnumerable <ILValue> arguments)
 {
     return(item.GetILMethodInvokation(
                item.GetValueType().GetTechnicalInstanceMethod(name, arguments.GetValueTypes()),
                arguments
                ));
 }
示例#2
0
 static public void UseLocalValue(this ILCanvas item, ILValue value, Process <ILLocal> process)
 {
     item.UseLocal(value.GetValueType(), delegate(ILLocal local) {
         local.RenderIL_Store(item, value);
         process(local);
     });
 }
示例#3
0
 static public ILConstructorInvokation GetBaseILConstructor(this ILValue item, IEnumerable <ILValue> arguments)
 {
     return(item.GetILConstructorInvokation(
                item.GetValueType().BaseType.GetInstanceConstructor(arguments.GetValueTypes()),
                arguments
                ));
 }
示例#4
0
        static private ILValue GetILCast(this ILValue item, Type destination_type, Operation <ILCast, Type, ILValue> operation)
        {
            if (item.GetValueType().CanILTreatAs(destination_type))
            {
                return(item);
            }

            return(operation(destination_type, item));
        }
示例#5
0
        public override void RenderIL_Execute(ILCanvas canvas)
        {
            value.RenderIL_Load(canvas);

            if (value.GetValueType().IsVoidType() == false)
            {
                canvas.Emit_Pop();
            }
        }
示例#6
0
        public ILLoadStatement(Operation <ILValue, ILBlock> o)
        {
            ILBlock block = new ILBlock();
            ILValue value = o(block);

            block.AddStatement(new ILLoad(value));

            type      = value.GetValueType();
            statement = block;
        }
示例#7
0
        public ILLocal CreateCementedLocal(ILValue value)
        {
            ILLocal local;

            if (value.Convert <ILLocal>(out local))
            {
                if (local.IsCemented())
                {
                    return(local);
                }
            }

            return(cemented_locals.AddAndGet(new ILLocal(value.GetValueType(), null, value, true))
                   .Chain(l => AddStatement(new ILInitializeLocal(l))));
        }
示例#8
0
 static public BasicType GetValueBasicType(this ILValue item)
 {
     return(item.GetValueType().GetBasicType());
 }
示例#9
0
 static public ILField GetILField(this ILValue item, string name)
 {
     return(item.GetILField(item.GetValueType().GetInstanceField(name)));
 }
示例#10
0
 public override Type GetValueType()
 {
     return(true_value.GetValueType().GetCommonAncestor(false_value.GetValueType()));
 }
示例#11
0
 static public ILCast NewExplicitCast(Type d, ILValue v)
 {
     return(new ILCast(ILCastInfos.GetExplicitILCastInfo(v.GetValueType(), d), v));
 }
示例#12
0
 static public ILCast NewThinCast(Type d, ILValue v)
 {
     return(new ILCast(ILCastInfos.GetThinILCastInfo(v.GetValueType(), d), v));
 }
示例#13
0
 public ILBinaryOperatorInvokation(BinaryOperatorType o, ILValue l, ILValue r) : this(l.GetValueType().GetBinaryOperator(r.GetValueType(), o), l, r)
 {
 }
示例#14
0
 public ILIndexed(ILValue t, ILValue i) : this(t.GetValueType().GetIndexer(i.GetValueType()), t, i)
 {
 }
示例#15
0
 static public ILCast NewCustomCast(Type d, ILValue v, bool cou, bool aio, bool aeo)
 {
     return(new ILCast(ILCastInfos.GetILCastInfo(v.GetValueType(), d, cou, aio, aeo), v));
 }
示例#16
0
 static public void RenderIL_LoadAddressInternal(this ILValue item, ILCanvas canvas)
 {
     item.RenderIL_Load(canvas);
     canvas.MakeAddressImmediate(item.GetValueType());
 }
示例#17
0
 public ILUnaryOperatorInvokation(UnaryOperatorType o, ILValue i) : this(i.GetValueType().GetUnaryOperator(o), i)
 {
 }