Ejemplo n.º 1
0
 /// <summary>
 /// Generate a iput opcode.
 /// </summary>
 internal static RCode IPut(this XTypeReference type)
 {
     if (type.IsDexWide())
     {
         return(RCode.Iput_wide);
     }
     if (type.IsVoid())
     {
         throw new ArgumentException("Unexpected void expression type");
     }
     if (type.IsDexBoolean())
     {
         return(RCode.Iput_boolean);
     }
     if (type.IsDexChar())
     {
         return(RCode.Iput_char);
     }
     if (type.IsDexShort())
     {
         return(RCode.Iput_short);
     }
     if (type.IsDexByte())
     {
         return(RCode.Iput_byte);
     }
     if (type.IsDexValue())
     {
         return(RCode.Iput);
     }
     if (type.IsDexObject())
     {
         return(RCode.Iput_object);
     }
     throw new ArgumentException("Unknown type in iput " + type);
 }