Exemple #1
0
 static public ILMethodInvokation GetTechnicalInstanceILMethodInvokation(this ILValue item, string name, IEnumerable <ILValue> arguments)
 {
     return(item.GetILMethodInvokation(
                item.GetValueType().GetTechnicalInstanceMethod(name, arguments.GetValueTypes()),
                arguments
                ));
 }
Exemple #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);
     });
 }
Exemple #3
0
 static public ILConstructorInvokation GetBaseILConstructor(this ILValue item, IEnumerable <ILValue> arguments)
 {
     return(item.GetILConstructorInvokation(
                item.GetValueType().BaseType.GetInstanceConstructor(arguments.GetValueTypes()),
                arguments
                ));
 }
Exemple #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));
        }
Exemple #5
0
        public override void RenderIL_Execute(ILCanvas canvas)
        {
            value.RenderIL_Load(canvas);

            if (value.GetValueType().IsVoidType() == false)
            {
                canvas.Emit_Pop();
            }
        }
Exemple #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;
        }
Exemple #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))));
        }
Exemple #8
0
 static public BasicType GetValueBasicType(this ILValue item)
 {
     return(item.GetValueType().GetBasicType());
 }
Exemple #9
0
 static public ILField GetILField(this ILValue item, string name)
 {
     return(item.GetILField(item.GetValueType().GetInstanceField(name)));
 }
Exemple #10
0
 public override Type GetValueType()
 {
     return(true_value.GetValueType().GetCommonAncestor(false_value.GetValueType()));
 }
Exemple #11
0
 static public ILCast NewExplicitCast(Type d, ILValue v)
 {
     return(new ILCast(ILCastInfos.GetExplicitILCastInfo(v.GetValueType(), d), v));
 }
Exemple #12
0
 static public ILCast NewThinCast(Type d, ILValue v)
 {
     return(new ILCast(ILCastInfos.GetThinILCastInfo(v.GetValueType(), d), v));
 }
Exemple #13
0
 public ILBinaryOperatorInvokation(BinaryOperatorType o, ILValue l, ILValue r) : this(l.GetValueType().GetBinaryOperator(r.GetValueType(), o), l, r)
 {
 }
Exemple #14
0
 public ILIndexed(ILValue t, ILValue i) : this(t.GetValueType().GetIndexer(i.GetValueType()), t, i)
 {
 }
Exemple #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));
 }
Exemple #16
0
 static public void RenderIL_LoadAddressInternal(this ILValue item, ILCanvas canvas)
 {
     item.RenderIL_Load(canvas);
     canvas.MakeAddressImmediate(item.GetValueType());
 }
Exemple #17
0
 public ILUnaryOperatorInvokation(UnaryOperatorType o, ILValue i) : this(i.GetValueType().GetUnaryOperator(o), i)
 {
 }