OpCode GetStoreRefParamCode(IType tag)
{
if (tag.IsValueType)
{
if (tag.IsEnum)
{
tag = TypeSystemServices.Map(GetEnumUnderlyingType(tag));
}
if (TypeSystemServices.IntType == tag
|| TypeSystemServices.UIntType == tag)
{
return OpCodes.Stind_I4;
}
if (IsLong(tag)
|| TypeSystemServices.ULongType == tag)
{
return OpCodes.Stind_I8;
}
if (TypeSystemServices.ByteType == tag)
{
return OpCodes.Stind_I1;
}
if (TypeSystemServices.ShortType == tag ||
TypeSystemServices.CharType == tag)
{
return OpCodes.Stind_I2;
}
if (TypeSystemServices.SingleType == tag)
{
return OpCodes.Stind_R4;
}
if (TypeSystemServices.DoubleType == tag)
{
return OpCodes.Stind_R8;
}
return OpCodes.Stobj;
}
return OpCodes.Stind_Ref;
}