コード例 #1
0
 static bool ConversionOperations(Instruction instruction,
                                  MetaMidRepresentationOperationFactory operationFactory)
 {
     if (instruction.OpCode == OpCodes.Conv_U1)
     {
         operationFactory.ConvU1();
         return(true);
     }
     if (instruction.OpCode == OpCodes.Conv_I)
     {
         operationFactory.ConvI();
         return(true);
     }
     if (instruction.OpCode == OpCodes.Conv_I4)
     {
         operationFactory.ConvI4();
         return(true);
     }
     if (instruction.OpCode == OpCodes.Conv_I8)
     {
         operationFactory.ConvI8();
         return(true);
     }
     if (instruction.OpCode == OpCodes.Conv_R4)
     {
         operationFactory.ConvR4();
         return(true);
     }
     if (instruction.OpCode == OpCodes.Conv_R8)
     {
         operationFactory.ConvR8();
         return(true);
     }
     return(false);
 }
コード例 #2
0
 private static bool ConversionOperations(string opcodeStr,
                                          MetaMidRepresentationOperationFactory operationFactory)
 {
     if (opcodeStr == "conv.u1")
     {
         operationFactory.ConvU1();
         return(true);
     }
     if (opcodeStr == "conv.i")
     {
         operationFactory.ConvI();
         return(true);
     }
     if (opcodeStr == "conv.i4")
     {
         operationFactory.ConvI4();
         return(true);
     }
     if (opcodeStr == "conv.i8")
     {
         operationFactory.ConvI8();
         return(true);
     }
     if (opcodeStr == "conv.r4")
     {
         operationFactory.ConvR4();
         return(true);
     }
     if (opcodeStr == "conv.r8")
     {
         operationFactory.ConvR8();
         return(true);
     }
     return(false);
 }