mirror of
https://github.com/danbulant/Cosmos
synced 2026-05-20 12:58:39 +00:00
47 lines
No EOL
1.3 KiB
C#
47 lines
No EOL
1.3 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
|
|
namespace Indy.IL2CPU.Assembler {
|
|
public sealed class StackContent {
|
|
public StackContent(int aSize) {
|
|
Size = aSize;
|
|
}
|
|
|
|
public StackContent(int aSize, Type aType)
|
|
: this(aSize) {
|
|
IsNumber = (aType == typeof(byte)
|
|
|| aType == typeof(sbyte)
|
|
|| aType == typeof(Boolean)
|
|
|| aType == typeof(short)
|
|
|| aType == typeof(ushort)
|
|
|| aType == typeof(int)
|
|
|| aType == typeof(uint)
|
|
|| aType == typeof(long)
|
|
|| aType == typeof(ulong)
|
|
|| aType == typeof(Single)
|
|
|| aType == typeof(Double));
|
|
IsFloat = (aType == typeof(Single) || aType == typeof(Double));
|
|
IsSigned = (aType == typeof(sbyte)
|
|
|| aType == typeof(short)
|
|
|| aType == typeof(int)
|
|
|| aType == typeof(long)
|
|
|| aType == typeof(Single)
|
|
|| aType == typeof(Double));
|
|
ContentType = aType;
|
|
}
|
|
|
|
public StackContent(int aSize, bool aIsNumber, bool aIsFloat, bool aIsSigned)
|
|
: this(aSize) {
|
|
IsNumber = aIsNumber;
|
|
IsFloat = aIsFloat;
|
|
IsSigned = aIsSigned;
|
|
}
|
|
public readonly int Size;
|
|
public readonly bool IsNumber = false;
|
|
public readonly bool IsFloat = false;
|
|
public readonly bool IsSigned = false;
|
|
public readonly Type ContentType = null;
|
|
public readonly bool IsBox = false;
|
|
}
|
|
} |