got rid of tyPureObject; broke bootstrapping; use generated C code
This commit is contained in:
parent
3824b6ea5f
commit
bd2d146c77
7 changed files with 19 additions and 14 deletions
|
|
@ -265,6 +265,10 @@ type
|
|||
tyIter, # unused
|
||||
tyProxy # currently unused
|
||||
|
||||
const
|
||||
tyPureObject* = tyTuple
|
||||
|
||||
type
|
||||
TTypeKinds* = set[TTypeKind]
|
||||
|
||||
TNodeFlag* = enum
|
||||
|
|
|
|||
|
|
@ -553,7 +553,7 @@ proc genTypeInfoAuxBase(m: BModule, typ: PType, name, base: PRope) =
|
|||
allocMemTI(m, typ, name)
|
||||
if (typ.kind == tyObject) and (tfFinal in typ.flags) and
|
||||
(typ.sons[0] == nil):
|
||||
nimtypeKind = ord(high(TTypeKind)) + 1 # tyPureObject
|
||||
nimtypeKind = ord(tyPureObject)
|
||||
else:
|
||||
nimtypeKind = ord(typ.kind)
|
||||
appf(m.s[cfsTypeInit3],
|
||||
|
|
|
|||
|
|
@ -86,7 +86,7 @@ proc initProc(p: var TProc, globals: PGlobals, module: BModule, procDef: PNode,
|
|||
|
||||
const
|
||||
MappedToObject = {tyObject, tyArray, tyArrayConstr, tyTuple, tyOpenArray,
|
||||
tySet, tyVar, tyRef, tyPtr}
|
||||
tySet, tyVar, tyRef, tyPtr, tyBigNum}
|
||||
|
||||
proc mapType(typ: PType): TEcmasTypeKind =
|
||||
var t = skipTypes(typ, abstractInst)
|
||||
|
|
@ -99,13 +99,15 @@ proc mapType(typ: PType): TEcmasTypeKind =
|
|||
of tyPointer:
|
||||
# treat a tyPointer like a typed pointer to an array of bytes
|
||||
result = etyInt
|
||||
of tyRange, tyDistinct, tyOrdinal: result = mapType(t.sons[0])
|
||||
of tyInt..tyInt64, tyEnum, tyChar: result = etyInt
|
||||
of tyRange, tyDistinct, tyOrdinal, tyConst, tyMutable, tyIter, tyVarargs,
|
||||
tyProxy:
|
||||
result = mapType(t.sons[0])
|
||||
of tyInt..tyInt64, tyUInt..tyUInt64, tyEnum, tyChar: result = etyInt
|
||||
of tyBool: result = etyBool
|
||||
of tyFloat..tyFloat128: result = etyFloat
|
||||
of tySet: result = etyObject # map a set to a table
|
||||
of tyString, tySequence: result = etyInt # little hack to get right semantics
|
||||
of tyObject, tyArray, tyArrayConstr, tyTuple, tyOpenArray:
|
||||
of tyObject, tyArray, tyArrayConstr, tyTuple, tyOpenArray, tyBigNum:
|
||||
result = etyObject
|
||||
of tyNil: result = etyNull
|
||||
of tyGenericInst, tyGenericParam, tyGenericBody, tyGenericInvokation, tyNone,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue