public string DumpType(TargetType type)
        {
            StringBuilder sb = new StringBuilder();

            sb.Append(type.Name);
            sb.Append(":");
            sb.Append(type.HasFixedSize);
            sb.Append(":");
            sb.Append(type.Size);
            sb.Append(":");
            sb.Append(type.Kind);
            sb.Append(" ");

            switch (type.Kind)
            {
            case TargetObjectKind.Fundamental:
                sb.Append(((TargetFundamentalType)type).FundamentalKind);
                break;

            case TargetObjectKind.Pointer: {
                TargetPointerType ptype = (TargetPointerType)type;
                sb.Append(ptype.IsTypesafe);
                sb.Append(":");
                sb.Append(ptype.HasStaticType);
                if (ptype.HasStaticType)
                {
                    sb.Append(":");
                    sb.Append(ptype.StaticType.Name);
                }
                break;
            }

            case TargetObjectKind.Array:
                sb.Append(((TargetArrayType)type).ElementType.Name);
                break;

#if FIXME
            case TargetObjectKind.Alias: {
                TargetTypeAlias alias = (TargetTypeAlias)type;
                sb.Append(alias.TargetName);
                if (alias.TargetType != null)
                {
                    sb.Append(":");
                    sb.Append(alias.TargetType.Name);
                }
                break;
            }
#endif
            }

            return(sb.ToString());
        }
Beispiel #2
0
 internal TargetPointerObject(TargetPointerType type, TargetLocation location)
     : base(type, location)
 {
     this.Type = type;
 }
Beispiel #3
0
 internal TargetPointerObject(TargetPointerType type, TargetLocation location)
     : base(type, location)
 {
     this.Type = type;
 }