Beispiel #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"));
        }
Beispiel #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"));
        }
Beispiel #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"));
        }