本文整理汇总了C#中Dot42.CompilerLib.XModel.XTypeReference.IsUInt32方法的典型用法代码示例。如果您正苦于以下问题:C# XTypeReference.IsUInt32方法的具体用法?C# XTypeReference.IsUInt32怎么用?C# XTypeReference.IsUInt32使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Dot42.CompilerLib.XModel.XTypeReference
的用法示例。
在下文中一共展示了XTypeReference.IsUInt32方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: OpcodeForType
/// <summary>
/// Generate an Add opcode.
/// </summary>
private static RCode OpcodeForType(XTypeReference type, RCode[] opcodes)
{
if (type.IsInt32() || type.IsUInt32() || type.IsInt16() || type.IsUInt16() || type.IsChar() || type.IsByte() || type.IsSByte() || type.IsBoolean()) return opcodes[0];
if (type.IsInt64() || type.IsUInt64()) return opcodes[1];
if (type.IsFloat()) return opcodes[2];
if (type.IsDouble()) return opcodes[3];
XTypeDefinition typeDef;
if (type.TryResolve(out typeDef))
{
if (typeDef.IsEnum)
{
return OpcodeForType(typeDef.GetEnumUnderlyingType(), opcodes);
}
}
throw new ArgumentException("Unsupported type " + type);
}
示例2: GetAsEnumerableTMethodName
/// <summary>
/// Returns the method name when converting an array to an IEnumerableT in compiler helper.
///
/// (not sure if this is the best place for this method...)
/// </summary>
public static string GetAsEnumerableTMethodName(XTypeReference sourceArrayElementType)
{
var convertMethodName = "AsObjectEnumerable";
if (sourceArrayElementType.IsPrimitive)
{
if (sourceArrayElementType.IsBoolean()) convertMethodName = "AsBoolEnumerable";
else if (sourceArrayElementType.IsByte()) convertMethodName = "AsByteEnumerable";
else if (sourceArrayElementType.IsSByte()) convertMethodName = "AsSByteEnumerable";
else if (sourceArrayElementType.IsChar()) convertMethodName = "AsCharEnumerable";
else if (sourceArrayElementType.IsInt16()) convertMethodName = "AsInt16Enumerable";
else if (sourceArrayElementType.IsUInt16()) convertMethodName = "AsUInt16Enumerable";
else if (sourceArrayElementType.IsInt32()) convertMethodName = "AsInt32Enumerable";
else if (sourceArrayElementType.IsUInt32()) convertMethodName = "AsUInt32Enumerable";
else if (sourceArrayElementType.IsInt64()) convertMethodName = "AsInt64Enumerable";
else if (sourceArrayElementType.IsFloat()) convertMethodName = "AsFloatEnumerable";
else if (sourceArrayElementType.IsDouble()) convertMethodName = "AsDoubleEnumerable";
else throw new ArgumentOutOfRangeException("Unknown primitive array element type " + sourceArrayElementType);
}
return convertMethodName;
}
示例3: CanPullComparisonUp
private static bool CanPullComparisonUp(AstCode code, XTypeReference arg1, XTypeReference arg2, PullTarget target)
{
if (arg1 == null || arg2 == null)
return false;
bool isReference = arg1.IsDexObject() && arg1.IsDexObject();
if (!isReference && !arg1.IsSame(arg2))
return false;
if (target == PullTarget.Comparison)
return true;
if (arg1.Is(XTypeReferenceKind.Float))
return false;
if (arg1.IsDexWide())
return false;
bool isEq = IsEqualsBranchOrComparison(code);
if (isEq)
return true;
bool isUnsigned = arg1.IsUInt16() || arg1.IsUInt32(); // TODO: check if we really have to exclude unsigned.
if (isReference || isUnsigned)
return false;
return true;
}