clean up tyConst remnants
This commit is contained in:
parent
f488ed973d
commit
b3de34548d
10 changed files with 32 additions and 37 deletions
|
|
@ -350,7 +350,7 @@ type
|
||||||
tyFloat, tyFloat32, tyFloat64, tyFloat128,
|
tyFloat, tyFloat32, tyFloat64, tyFloat128,
|
||||||
tyUInt, tyUInt8, tyUInt16, tyUInt32, tyUInt64,
|
tyUInt, tyUInt8, tyUInt16, tyUInt32, tyUInt64,
|
||||||
tyUnused0,
|
tyUnused0,
|
||||||
tyConst, tyMutable, tyVarargs,
|
tyUnused1, tyMutable, tyVarargs,
|
||||||
tyUnused
|
tyUnused
|
||||||
tyProxy # used as errornous type (for idetools)
|
tyProxy # used as errornous type (for idetools)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -122,7 +122,7 @@ proc mapType(typ: PType): TCTypeKind =
|
||||||
of tyOpenArray, tyArrayConstr, tyArray, tyVarargs: result = ctArray
|
of tyOpenArray, tyArrayConstr, tyArray, tyVarargs: result = ctArray
|
||||||
of tyObject, tyTuple: result = ctStruct
|
of tyObject, tyTuple: result = ctStruct
|
||||||
of tyGenericBody, tyGenericInst, tyGenericParam, tyDistinct, tyOrdinal,
|
of tyGenericBody, tyGenericInst, tyGenericParam, tyDistinct, tyOrdinal,
|
||||||
tyConst, tyMutable, tyTypeDesc:
|
tyMutable, tyTypeDesc:
|
||||||
result = mapType(lastSon(typ))
|
result = mapType(lastSon(typ))
|
||||||
of tyEnum:
|
of tyEnum:
|
||||||
if firstOrd(typ) < 0:
|
if firstOrd(typ) < 0:
|
||||||
|
|
@ -711,7 +711,7 @@ proc getTypeDescAux(m: BModule, typ: PType, check: var IntSet): Rope =
|
||||||
of 1, 2, 4, 8: addf(m.s[cfsTypes], "typedef NU$2 $1;$n", [result, rope(s*8)])
|
of 1, 2, 4, 8: addf(m.s[cfsTypes], "typedef NU$2 $1;$n", [result, rope(s*8)])
|
||||||
else: addf(m.s[cfsTypes], "typedef NU8 $1[$2];$n",
|
else: addf(m.s[cfsTypes], "typedef NU8 $1[$2];$n",
|
||||||
[result, rope(getSize(t))])
|
[result, rope(getSize(t))])
|
||||||
of tyGenericInst, tyDistinct, tyOrdinal, tyConst, tyMutable, tyTypeDesc:
|
of tyGenericInst, tyDistinct, tyOrdinal, tyMutable, tyTypeDesc:
|
||||||
result = getTypeDescAux(m, lastSon(t), check)
|
result = getTypeDescAux(m, lastSon(t), check)
|
||||||
else:
|
else:
|
||||||
internalError("getTypeDescAux(" & $t.kind & ')')
|
internalError("getTypeDescAux(" & $t.kind & ')')
|
||||||
|
|
|
||||||
|
|
@ -106,7 +106,7 @@ proc getUniqueType*(key: PType): PType =
|
||||||
of tyDistinct:
|
of tyDistinct:
|
||||||
if key.deepCopy != nil: result = key
|
if key.deepCopy != nil: result = key
|
||||||
else: result = getUniqueType(lastSon(key))
|
else: result = getUniqueType(lastSon(key))
|
||||||
of tyGenericInst, tyOrdinal, tyMutable, tyConst, tyStatic:
|
of tyGenericInst, tyOrdinal, tyMutable, tyStatic:
|
||||||
result = getUniqueType(lastSon(key))
|
result = getUniqueType(lastSon(key))
|
||||||
#let obj = lastSon(key)
|
#let obj = lastSon(key)
|
||||||
#if obj.sym != nil and obj.sym.name.s == "TOption":
|
#if obj.sym != nil and obj.sym.name.s == "TOption":
|
||||||
|
|
@ -153,7 +153,7 @@ proc getUniqueType*(key: PType): PType =
|
||||||
else:
|
else:
|
||||||
# ugh, we need the canon here:
|
# ugh, we need the canon here:
|
||||||
result = slowSearch(key, k)
|
result = slowSearch(key, k)
|
||||||
of tyUnused, tyUnused0: internalError("getUniqueType")
|
of tyUnused, tyUnused0, tyUnused1: internalError("getUniqueType")
|
||||||
|
|
||||||
proc tableGetType*(tab: TIdTable, key: PType): RootRef =
|
proc tableGetType*(tab: TIdTable, key: PType): RootRef =
|
||||||
# returns nil if we need to declare this type
|
# returns nil if we need to declare this type
|
||||||
|
|
|
||||||
|
|
@ -151,7 +151,7 @@ proc mapType(typ: PType): TJSTypeKind =
|
||||||
of tyPointer:
|
of tyPointer:
|
||||||
# treat a tyPointer like a typed pointer to an array of bytes
|
# treat a tyPointer like a typed pointer to an array of bytes
|
||||||
result = etyBaseIndex
|
result = etyBaseIndex
|
||||||
of tyRange, tyDistinct, tyOrdinal, tyConst, tyMutable, tyProxy:
|
of tyRange, tyDistinct, tyOrdinal, tyMutable, tyProxy:
|
||||||
result = mapType(t.sons[0])
|
result = mapType(t.sons[0])
|
||||||
of tyInt..tyInt64, tyUInt..tyUInt64, tyEnum, tyChar: result = etyInt
|
of tyInt..tyInt64, tyUInt..tyUInt64, tyEnum, tyChar: result = etyInt
|
||||||
of tyBool: result = etyBool
|
of tyBool: result = etyBool
|
||||||
|
|
@ -170,7 +170,7 @@ proc mapType(typ: PType): TJSTypeKind =
|
||||||
else: result = etyNone
|
else: result = etyNone
|
||||||
of tyProc: result = etyProc
|
of tyProc: result = etyProc
|
||||||
of tyCString: result = etyString
|
of tyCString: result = etyString
|
||||||
of tyUnused, tyUnused0: internalError("mapType")
|
of tyUnused, tyUnused0, tyUnused1: internalError("mapType")
|
||||||
|
|
||||||
proc mapType(p: PProc; typ: PType): TJSTypeKind =
|
proc mapType(p: PProc; typ: PType): TJSTypeKind =
|
||||||
if p.target == targetPHP: result = etyObject
|
if p.target == targetPHP: result = etyObject
|
||||||
|
|
|
||||||
|
|
@ -290,7 +290,7 @@ proc litAux(n: PNode, x: BiggestInt, size: int): string =
|
||||||
proc skip(t: PType): PType =
|
proc skip(t: PType): PType =
|
||||||
result = t
|
result = t
|
||||||
while result.kind in {tyGenericInst, tyRange, tyVar, tyDistinct, tyOrdinal,
|
while result.kind in {tyGenericInst, tyRange, tyVar, tyDistinct, tyOrdinal,
|
||||||
tyConst, tyMutable}:
|
tyMutable}:
|
||||||
result = lastSon(result)
|
result = lastSon(result)
|
||||||
if n.typ != nil and n.typ.skip.kind in {tyBool, tyEnum}:
|
if n.typ != nil and n.typ.skip.kind in {tyBool, tyEnum}:
|
||||||
let enumfields = n.typ.skip.n
|
let enumfields = n.typ.skip.n
|
||||||
|
|
|
||||||
|
|
@ -224,12 +224,12 @@ proc liftBodyAux(c: var TLiftCtx; t: PType; body, x, y: PNode) =
|
||||||
of tyFromExpr, tyProxy, tyBuiltInTypeClass, tyUserTypeClass,
|
of tyFromExpr, tyProxy, tyBuiltInTypeClass, tyUserTypeClass,
|
||||||
tyUserTypeClassInst, tyCompositeTypeClass, tyAnd, tyOr, tyNot, tyAnything,
|
tyUserTypeClassInst, tyCompositeTypeClass, tyAnd, tyOr, tyNot, tyAnything,
|
||||||
tyMutable, tyGenericParam, tyGenericBody, tyNil, tyExpr, tyStmt,
|
tyMutable, tyGenericParam, tyGenericBody, tyNil, tyExpr, tyStmt,
|
||||||
tyTypeDesc, tyGenericInvocation, tyConst, tyForward:
|
tyTypeDesc, tyGenericInvocation, tyForward:
|
||||||
internalError(c.info, "assignment requested for type: " & typeToString(t))
|
internalError(c.info, "assignment requested for type: " & typeToString(t))
|
||||||
of tyOrdinal, tyRange,
|
of tyOrdinal, tyRange,
|
||||||
tyGenericInst, tyFieldAccessor, tyStatic, tyVar:
|
tyGenericInst, tyFieldAccessor, tyStatic, tyVar:
|
||||||
liftBodyAux(c, lastSon(t), body, x, y)
|
liftBodyAux(c, lastSon(t), body, x, y)
|
||||||
of tyUnused, tyUnused0: internalError("liftBodyAux")
|
of tyUnused, tyUnused0, tyUnused1: internalError("liftBodyAux")
|
||||||
|
|
||||||
proc newProcType(info: TLineInfo; owner: PSym): PType =
|
proc newProcType(info: TLineInfo; owner: PSym): PType =
|
||||||
result = newType(tyProc, owner)
|
result = newType(tyProc, owner)
|
||||||
|
|
|
||||||
|
|
@ -124,7 +124,7 @@ proc instantiateDestructor(c: PContext, typ: PType): PType =
|
||||||
# destructor that must be used for the varialbe.
|
# destructor that must be used for the varialbe.
|
||||||
# The destructor is either user-defined or automatically
|
# The destructor is either user-defined or automatically
|
||||||
# generated by the compiler in a member-wise fashion.
|
# generated by the compiler in a member-wise fashion.
|
||||||
var t = skipTypes(typ, {tyConst, tyMutable}).skipGenericAlias
|
var t = skipTypes(typ, {tyMutable}).skipGenericAlias
|
||||||
let typeHoldingUserDefinition = if t.kind == tyGenericInst: t.base else: t
|
let typeHoldingUserDefinition = if t.kind == tyGenericInst: t.base else: t
|
||||||
|
|
||||||
if typeHoldingUserDefinition.destructor != nil:
|
if typeHoldingUserDefinition.destructor != nil:
|
||||||
|
|
|
||||||
|
|
@ -51,18 +51,17 @@ const
|
||||||
# TODO: Remove tyTypeDesc from each abstractX and (where necessary)
|
# TODO: Remove tyTypeDesc from each abstractX and (where necessary)
|
||||||
# replace with typedescX
|
# replace with typedescX
|
||||||
abstractPtrs* = {tyVar, tyPtr, tyRef, tyGenericInst, tyDistinct, tyOrdinal,
|
abstractPtrs* = {tyVar, tyPtr, tyRef, tyGenericInst, tyDistinct, tyOrdinal,
|
||||||
tyConst, tyMutable, tyTypeDesc}
|
tyMutable, tyTypeDesc}
|
||||||
abstractVar* = {tyVar, tyGenericInst, tyDistinct, tyOrdinal,
|
abstractVar* = {tyVar, tyGenericInst, tyDistinct, tyOrdinal,
|
||||||
tyConst, tyMutable, tyTypeDesc}
|
tyMutable, tyTypeDesc}
|
||||||
abstractRange* = {tyGenericInst, tyRange, tyDistinct, tyOrdinal,
|
abstractRange* = {tyGenericInst, tyRange, tyDistinct, tyOrdinal,
|
||||||
tyConst, tyMutable, tyTypeDesc}
|
tyMutable, tyTypeDesc}
|
||||||
abstractVarRange* = {tyGenericInst, tyRange, tyVar, tyDistinct, tyOrdinal,
|
abstractVarRange* = {tyGenericInst, tyRange, tyVar, tyDistinct, tyOrdinal,
|
||||||
tyConst, tyMutable, tyTypeDesc}
|
tyMutable, tyTypeDesc}
|
||||||
abstractInst* = {tyGenericInst, tyDistinct, tyConst, tyMutable, tyOrdinal,
|
abstractInst* = {tyGenericInst, tyDistinct, tyMutable, tyOrdinal,
|
||||||
tyTypeDesc}
|
tyTypeDesc}
|
||||||
|
|
||||||
skipPtrs* = {tyVar, tyPtr, tyRef, tyGenericInst, tyConst, tyMutable,
|
skipPtrs* = {tyVar, tyPtr, tyRef, tyGenericInst, tyMutable, tyTypeDesc}
|
||||||
tyTypeDesc}
|
|
||||||
# typedescX is used if we're sure tyTypeDesc should be included (or skipped)
|
# typedescX is used if we're sure tyTypeDesc should be included (or skipped)
|
||||||
typedescPtrs* = abstractPtrs + {tyTypeDesc}
|
typedescPtrs* = abstractPtrs + {tyTypeDesc}
|
||||||
typedescInst* = abstractInst + {tyTypeDesc}
|
typedescInst* = abstractInst + {tyTypeDesc}
|
||||||
|
|
@ -116,8 +115,7 @@ proc isFloatLit*(t: PType): bool {.inline.} =
|
||||||
proc isCompatibleToCString(a: PType): bool =
|
proc isCompatibleToCString(a: PType): bool =
|
||||||
if a.kind == tyArray:
|
if a.kind == tyArray:
|
||||||
if (firstOrd(a.sons[0]) == 0) and
|
if (firstOrd(a.sons[0]) == 0) and
|
||||||
(skipTypes(a.sons[0], {tyRange, tyConst,
|
(skipTypes(a.sons[0], {tyRange, tyMutable, tyGenericInst}).kind in
|
||||||
tyMutable, tyGenericInst}).kind in
|
|
||||||
{tyInt..tyInt64, tyUInt..tyUInt64}) and
|
{tyInt..tyInt64, tyUInt..tyUInt64}) and
|
||||||
(a.sons[1].kind == tyChar):
|
(a.sons[1].kind == tyChar):
|
||||||
result = true
|
result = true
|
||||||
|
|
@ -151,13 +149,12 @@ proc isOrdinalType(t: PType): bool =
|
||||||
const
|
const
|
||||||
# caution: uint, uint64 are no ordinal types!
|
# caution: uint, uint64 are no ordinal types!
|
||||||
baseKinds = {tyChar,tyInt..tyInt64,tyUInt8..tyUInt32,tyBool,tyEnum}
|
baseKinds = {tyChar,tyInt..tyInt64,tyUInt8..tyUInt32,tyBool,tyEnum}
|
||||||
parentKinds = {tyRange, tyOrdinal, tyConst, tyMutable, tyGenericInst,
|
parentKinds = {tyRange, tyOrdinal, tyMutable, tyGenericInst, tyDistinct}
|
||||||
tyDistinct}
|
|
||||||
t.kind in baseKinds or (t.kind in parentKinds and isOrdinalType(t.sons[0]))
|
t.kind in baseKinds or (t.kind in parentKinds and isOrdinalType(t.sons[0]))
|
||||||
|
|
||||||
proc enumHasHoles(t: PType): bool =
|
proc enumHasHoles(t: PType): bool =
|
||||||
var b = t
|
var b = t
|
||||||
while b.kind in {tyConst, tyMutable, tyRange, tyGenericInst}: b = b.sons[0]
|
while b.kind in {tyMutable, tyRange, tyGenericInst}: b = b.sons[0]
|
||||||
result = b.kind == tyEnum and tfEnumHasHoles in b.flags
|
result = b.kind == tyEnum and tfEnumHasHoles in b.flags
|
||||||
|
|
||||||
proc iterOverTypeAux(marker: var IntSet, t: PType, iter: TTypeIter,
|
proc iterOverTypeAux(marker: var IntSet, t: PType, iter: TTypeIter,
|
||||||
|
|
@ -275,7 +272,7 @@ proc analyseObjectWithTypeFieldAux(t: PType,
|
||||||
if res == frHeader: result = frHeader
|
if res == frHeader: result = frHeader
|
||||||
if result == frNone:
|
if result == frNone:
|
||||||
if isObjectWithTypeFieldPredicate(t): result = frHeader
|
if isObjectWithTypeFieldPredicate(t): result = frHeader
|
||||||
of tyGenericInst, tyDistinct, tyConst, tyMutable:
|
of tyGenericInst, tyDistinct, tyMutable:
|
||||||
result = analyseObjectWithTypeFieldAux(lastSon(t), marker)
|
result = analyseObjectWithTypeFieldAux(lastSon(t), marker)
|
||||||
of tyArray, tyArrayConstr, tyTuple:
|
of tyArray, tyArrayConstr, tyTuple:
|
||||||
for i in countup(0, sonsLen(t) - 1):
|
for i in countup(0, sonsLen(t) - 1):
|
||||||
|
|
@ -534,7 +531,7 @@ proc typeToString(typ: PType, prefer: TPreferedDesc = preferName): string =
|
||||||
add(result, typeToString(t.sons[i]))
|
add(result, typeToString(t.sons[i]))
|
||||||
if i < sonsLen(t) - 1: add(result, ", ")
|
if i < sonsLen(t) - 1: add(result, ", ")
|
||||||
add(result, ')')
|
add(result, ')')
|
||||||
of tyPtr, tyRef, tyVar, tyMutable, tyConst:
|
of tyPtr, tyRef, tyVar, tyMutable:
|
||||||
result = typeToStr[t.kind]
|
result = typeToStr[t.kind]
|
||||||
if t.len >= 2:
|
if t.len >= 2:
|
||||||
setLen(result, result.len-1)
|
setLen(result, result.len-1)
|
||||||
|
|
@ -606,7 +603,7 @@ proc firstOrd(t: PType): BiggestInt =
|
||||||
else:
|
else:
|
||||||
assert(t.n.sons[0].kind == nkSym)
|
assert(t.n.sons[0].kind == nkSym)
|
||||||
result = t.n.sons[0].sym.position
|
result = t.n.sons[0].sym.position
|
||||||
of tyGenericInst, tyDistinct, tyConst, tyMutable, tyTypeDesc, tyFieldAccessor:
|
of tyGenericInst, tyDistinct, tyMutable, tyTypeDesc, tyFieldAccessor:
|
||||||
result = firstOrd(lastSon(t))
|
result = firstOrd(lastSon(t))
|
||||||
of tyOrdinal:
|
of tyOrdinal:
|
||||||
if t.len > 0: result = firstOrd(lastSon(t))
|
if t.len > 0: result = firstOrd(lastSon(t))
|
||||||
|
|
@ -642,8 +639,7 @@ proc lastOrd(t: PType): BiggestInt =
|
||||||
of tyEnum:
|
of tyEnum:
|
||||||
assert(t.n.sons[sonsLen(t.n) - 1].kind == nkSym)
|
assert(t.n.sons[sonsLen(t.n) - 1].kind == nkSym)
|
||||||
result = t.n.sons[sonsLen(t.n) - 1].sym.position
|
result = t.n.sons[sonsLen(t.n) - 1].sym.position
|
||||||
of tyGenericInst, tyDistinct, tyConst, tyMutable,
|
of tyGenericInst, tyDistinct, tyMutable, tyTypeDesc, tyFieldAccessor:
|
||||||
tyTypeDesc, tyFieldAccessor:
|
|
||||||
result = lastOrd(lastSon(t))
|
result = lastOrd(lastSon(t))
|
||||||
of tyProxy: result = 0
|
of tyProxy: result = 0
|
||||||
of tyOrdinal:
|
of tyOrdinal:
|
||||||
|
|
@ -656,7 +652,7 @@ proc lastOrd(t: PType): BiggestInt =
|
||||||
proc lengthOrd(t: PType): BiggestInt =
|
proc lengthOrd(t: PType): BiggestInt =
|
||||||
case t.kind
|
case t.kind
|
||||||
of tyInt64, tyInt32, tyInt: result = lastOrd(t)
|
of tyInt64, tyInt32, tyInt: result = lastOrd(t)
|
||||||
of tyDistinct, tyConst, tyMutable: result = lengthOrd(t.sons[0])
|
of tyDistinct, tyMutable: result = lengthOrd(t.sons[0])
|
||||||
else:
|
else:
|
||||||
let last = lastOrd t
|
let last = lastOrd t
|
||||||
let first = firstOrd t
|
let first = firstOrd t
|
||||||
|
|
@ -965,7 +961,7 @@ proc sameTypeAux(x, y: PType, c: var TSameTypeClosure): bool =
|
||||||
result = a.sym.position == b.sym.position
|
result = a.sym.position == b.sym.position
|
||||||
of tyGenericInvocation, tyGenericBody, tySequence,
|
of tyGenericInvocation, tyGenericBody, tySequence,
|
||||||
tyOpenArray, tySet, tyRef, tyPtr, tyVar, tyArrayConstr,
|
tyOpenArray, tySet, tyRef, tyPtr, tyVar, tyArrayConstr,
|
||||||
tyArray, tyProc, tyConst, tyMutable, tyVarargs,
|
tyArray, tyProc, tyMutable, tyVarargs,
|
||||||
tyOrdinal, tyTypeClasses, tyFieldAccessor:
|
tyOrdinal, tyTypeClasses, tyFieldAccessor:
|
||||||
cycleCheck()
|
cycleCheck()
|
||||||
if a.kind == tyUserTypeClass and a.n != nil: return a.n == b.n
|
if a.kind == tyUserTypeClass and a.n != nil: return a.n == b.n
|
||||||
|
|
@ -980,7 +976,7 @@ proc sameTypeAux(x, y: PType, c: var TSameTypeClosure): bool =
|
||||||
sameValue(a.n.sons[1], b.n.sons[1])
|
sameValue(a.n.sons[1], b.n.sons[1])
|
||||||
of tyGenericInst: discard
|
of tyGenericInst: discard
|
||||||
of tyNone: result = false
|
of tyNone: result = false
|
||||||
of tyUnused, tyUnused0: internalError("sameFlags")
|
of tyUnused, tyUnused0, tyUnused1: internalError("sameFlags")
|
||||||
|
|
||||||
proc sameBackendType*(x, y: PType): bool =
|
proc sameBackendType*(x, y: PType): bool =
|
||||||
var c = initSameTypeClosure()
|
var c = initSameTypeClosure()
|
||||||
|
|
@ -1144,7 +1140,7 @@ proc typeAllowedAux(marker: var IntSet, typ: PType, kind: TSymKind,
|
||||||
else: result = typeAllowedAux(marker, t.lastSon, skVar, flags+{taHeap})
|
else: result = typeAllowedAux(marker, t.lastSon, skVar, flags+{taHeap})
|
||||||
of tyPtr:
|
of tyPtr:
|
||||||
result = typeAllowedAux(marker, t.lastSon, skVar, flags+{taHeap})
|
result = typeAllowedAux(marker, t.lastSon, skVar, flags+{taHeap})
|
||||||
of tyArrayConstr, tySet, tyConst, tyMutable:
|
of tyArrayConstr, tySet, tyMutable:
|
||||||
for i in countup(0, sonsLen(t) - 1):
|
for i in countup(0, sonsLen(t) - 1):
|
||||||
result = typeAllowedAux(marker, t.sons[i], kind, flags)
|
result = typeAllowedAux(marker, t.sons[i], kind, flags)
|
||||||
if result != nil: break
|
if result != nil: break
|
||||||
|
|
@ -1161,7 +1157,7 @@ proc typeAllowedAux(marker: var IntSet, typ: PType, kind: TSymKind,
|
||||||
# for now same as error node; we say it's a valid type as it should
|
# for now same as error node; we say it's a valid type as it should
|
||||||
# prevent cascading errors:
|
# prevent cascading errors:
|
||||||
result = nil
|
result = nil
|
||||||
of tyUnused, tyUnused0: internalError("typeAllowedAux")
|
of tyUnused, tyUnused0, tyUnused1: internalError("typeAllowedAux")
|
||||||
|
|
||||||
proc typeAllowed*(t: PType, kind: TSymKind): PType =
|
proc typeAllowed*(t: PType, kind: TSymKind): PType =
|
||||||
# returns 'nil' on success and otherwise the part of the type that is
|
# returns 'nil' on success and otherwise the part of the type that is
|
||||||
|
|
@ -1312,7 +1308,7 @@ proc computeSizeAux(typ: PType, a: var BiggestInt): BiggestInt =
|
||||||
if result < 0: return
|
if result < 0: return
|
||||||
if a < maxAlign: a = maxAlign
|
if a < maxAlign: a = maxAlign
|
||||||
result = align(result, a)
|
result = align(result, a)
|
||||||
of tyGenericInst, tyDistinct, tyGenericBody, tyMutable, tyConst:
|
of tyGenericInst, tyDistinct, tyGenericBody, tyMutable:
|
||||||
result = computeSizeAux(lastSon(typ), a)
|
result = computeSizeAux(lastSon(typ), a)
|
||||||
of tyTypeDesc:
|
of tyTypeDesc:
|
||||||
result = computeSizeAux(typ.base, a)
|
result = computeSizeAux(typ.base, a)
|
||||||
|
|
|
||||||
|
|
@ -266,7 +266,6 @@ proc mapTypeToAstX(t: PType; info: TLineInfo;
|
||||||
of tyUInt16: result = atomicType("uint16", mUint16)
|
of tyUInt16: result = atomicType("uint16", mUint16)
|
||||||
of tyUInt32: result = atomicType("uint32", mUint32)
|
of tyUInt32: result = atomicType("uint32", mUint32)
|
||||||
of tyUInt64: result = atomicType("uint64", mUint64)
|
of tyUInt64: result = atomicType("uint64", mUint64)
|
||||||
of tyConst: result = mapTypeToBracket("const", mNone, t, info)
|
|
||||||
of tyMutable: result = mapTypeToBracket("mutable", mNone, t, info)
|
of tyMutable: result = mapTypeToBracket("mutable", mNone, t, info)
|
||||||
of tyVarargs: result = mapTypeToBracket("varargs", mVarargs, t, info)
|
of tyVarargs: result = mapTypeToBracket("varargs", mVarargs, t, info)
|
||||||
of tyProxy: result = atomicType("error", mNone)
|
of tyProxy: result = atomicType("error", mNone)
|
||||||
|
|
@ -290,7 +289,7 @@ proc mapTypeToAstX(t: PType; info: TLineInfo;
|
||||||
result.add atomicType("static", mNone)
|
result.add atomicType("static", mNone)
|
||||||
if t.n != nil:
|
if t.n != nil:
|
||||||
result.add t.n.copyTree
|
result.add t.n.copyTree
|
||||||
of tyUnused, tyUnused0: internalError("mapTypeToAstX")
|
of tyUnused, tyUnused0, tyUnused1: internalError("mapTypeToAstX")
|
||||||
|
|
||||||
proc opMapTypeToAst*(t: PType; info: TLineInfo): PNode =
|
proc opMapTypeToAst*(t: PType; info: TLineInfo): PNode =
|
||||||
result = mapTypeToAstX(t, info, false, true)
|
result = mapTypeToAstX(t, info, false, true)
|
||||||
|
|
|
||||||
|
|
@ -91,7 +91,7 @@ type
|
||||||
ntyFloat, ntyFloat32, ntyFloat64, ntyFloat128,
|
ntyFloat, ntyFloat32, ntyFloat64, ntyFloat128,
|
||||||
ntyUInt, ntyUInt8, ntyUInt16, ntyUInt32, ntyUInt64,
|
ntyUInt, ntyUInt8, ntyUInt16, ntyUInt32, ntyUInt64,
|
||||||
ntyUnused0,
|
ntyUnused0,
|
||||||
ntyConst, ntyMutable, ntyVarargs,
|
ntyUnused1, ntyMutable, ntyVarargs,
|
||||||
ntyUnused,
|
ntyUnused,
|
||||||
ntyError,
|
ntyError,
|
||||||
ntyBuiltinTypeClass, ntyConcept, ntyConceptInst, ntyComposite,
|
ntyBuiltinTypeClass, ntyConcept, ntyConceptInst, ntyComposite,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue