Ejemplo n.º 1
0
        public static object GetOperand(T instruction)
        {
            Instruction cilInst = instruction as Instruction;

            if (cilInst != null)
            {
                return(cilInst.Operand);
            }
            ILinearInstruction linearInst = instruction as ILinearInstruction;

            if (linearInst != null)
            {
                return(linearInst.Operand);
            }
            throw new NotSupportedException(string.Format("Unsupported adaptee"));
        }
Ejemplo n.º 2
0
        public static FlowControl GetFlowControl(T instruction)
        {
            Instruction cilInst = instruction as Instruction;

            if (cilInst != null)
            {
                return(cilInst.OpCode.FlowControl);
            }
            ILinearInstruction linearInst = instruction as ILinearInstruction;

            if (linearInst != null)
            {
                return(linearInst.FlowControl);
            }
            throw new NotSupportedException(string.Format("Unsupported adaptee"));
        }
Ejemplo n.º 3
0
        public static T GetNext(T instruction)
        {
            Instruction cilInst = instruction as Instruction;

            if (cilInst != null)
            {
                return(cilInst.Next as T);
            }
            ILinearInstruction linearInst = instruction as ILinearInstruction;

            if (linearInst != null)
            {
                return(linearInst.GetNext() as T);
            }
            throw new NotSupportedException(string.Format("Unsupported adaptee"));
        }