diff options
author | Araq <rumpf_a@web.de> | 2011-09-24 09:35:00 +0200 |
---|---|---|
committer | Araq <rumpf_a@web.de> | 2011-09-24 09:35:00 +0200 |
commit | bd2d146c7705a7c155d6fd70b6238623b0e88513 (patch) | |
tree | 9c539538c50f13e3ac282d5cc13f464ee5c4d5c1 /compiler | |
parent | 3824b6ea5f320f956473bdfaf0894fe89c90f0ab (diff) | |
download | Nim-bd2d146c7705a7c155d6fd70b6238623b0e88513.tar.gz |
got rid of tyPureObject; broke bootstrapping; use generated C code
Diffstat (limited to 'compiler')
-rwxr-xr-x | compiler/ast.nim | 4 | ||||
-rwxr-xr-x | compiler/ccgtypes.nim | 2 | ||||
-rwxr-xr-x | compiler/ecmasgen.nim | 10 |
3 files changed, 11 insertions, 5 deletions
diff --git a/compiler/ast.nim b/compiler/ast.nim index 200f32ed2..fb4300c89 100755 --- a/compiler/ast.nim +++ b/compiler/ast.nim @@ -265,6 +265,10 @@ type tyIter, # unused tyProxy # currently unused +const + tyPureObject* = tyTuple + +type TTypeKinds* = set[TTypeKind] TNodeFlag* = enum diff --git a/compiler/ccgtypes.nim b/compiler/ccgtypes.nim index 99f9ba3b0..0123b69f9 100755 --- a/compiler/ccgtypes.nim +++ b/compiler/ccgtypes.nim @@ -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], diff --git a/compiler/ecmasgen.nim b/compiler/ecmasgen.nim index d597da193..42643b39e 100755 --- a/compiler/ecmasgen.nim +++ b/compiler/ecmasgen.nim @@ -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, |