Example #1
0
        public static IType FindType(this ICompilation compilation, StackType stackType, Sign sign = Sign.None)
        {
            switch (stackType)
            {
            case StackType.Unknown:
                return(SpecialType.UnknownType);

            case StackType.Ref:
                return(new ByReferenceType(SpecialType.UnknownType));

            default:
                return(compilation.FindType(stackType.ToKnownTypeCode(sign)));
            }
        }
Example #2
0
        public ILVariable RegisterVariable(VariableKind kind, StackType stackType, string name = null)
        {
            var type = Method.Compilation.FindType(stackType.ToKnownTypeCode());

            return(RegisterVariable(kind, type, stackType, name));
        }