예제 #1
0
        public static MethodSpecTag CreateMethodSpec(Clarity.Rpa.MethodSlotType slotType, CppMethodSpec methodSpec)
        {
            if ((slotType == MethodSlotType.Static) != methodSpec.CppMethod.Static)
                throw new ArgumentException("Static flag mismatch");

            TypeSpecTag[] genericTypes = null;

            List<TypeSpecTag> genericTypesList = new List<TypeSpecTag>();

            if (methodSpec.GenericParameters != null)
                foreach (CLRTypeSpec type in methodSpec.GenericParameters)
                    genericTypesList.Add(CreateTypeTag(type));

            genericTypes = genericTypesList.ToArray();

            return new MethodSpecTag(slotType,
                genericTypes,
                (TypeSpecClassTag)CreateTypeTag(methodSpec.CppMethod.DeclaredInClassSpec),
                methodSpec.CppMethod.VtableSlotTag
                );
        }
예제 #2
0
 public MidInstruction(OpcodeEnum opcode, CodeLocationTag codeLocation, CppMethodSpec methodSpecArg, CLRTypeSpec typeSpecArg, SsaRegister regArg, SsaRegister regArg2, SsaRegister[] regArgs)
 {
     Opcode = opcode;
     CodeLocation = codeLocation;
     TypeSpecArg = typeSpecArg;
     MethodSpecArg = methodSpecArg;
     RegArg = regArg;
     RegArg2 = regArg2;
     RegArgs = regArgs;
 }