diff options
Diffstat (limited to 'compiler')
-rwxr-xr-x | compiler/ccgexprs.nim | 8 | ||||
-rwxr-xr-x | compiler/ccgstmts.nim | 4 | ||||
-rwxr-xr-x | compiler/ccgtypes.nim | 4 | ||||
-rw-r--r-- | compiler/lambdalifting.nim | 3 | ||||
-rwxr-xr-x | compiler/semthreads.nim | 4 |
5 files changed, 11 insertions, 12 deletions
diff --git a/compiler/ccgexprs.nim b/compiler/ccgexprs.nim index 81d122859..d03142208 100755 --- a/compiler/ccgexprs.nim +++ b/compiler/ccgexprs.nim @@ -139,9 +139,9 @@ proc getStorageLoc(n: PNode): TStorageLoc = case n.kind of nkSym: case n.sym.kind - of skParam, skForVar, skTemp: + of skParam, skTemp: result = OnStack - of skVar, skResult, skLet: + of skVar, skForVar, skResult, skLet: if sfGlobal in n.sym.flags: result = OnHeap else: result = OnStack of skConst: @@ -1652,7 +1652,7 @@ proc expr(p: BProc, e: PNode, d: var TLoc) = genComplexConst(p, sym, d) of skEnumField: putIntoDest(p, d, e.typ, toRope(sym.position)) - of skVar, skResult, skLet: + of skVar, skForVar, skResult, skLet: if sfGlobal in sym.flags: genVarPrototype(p.module, sym) if sym.loc.r == nil or sym.loc.t == nil: InternalError(e.info, "expr: var not init " & sym.name.s) @@ -1664,7 +1664,7 @@ proc expr(p: BProc, e: PNode, d: var TLoc) = putLocIntoDest(p, d, sym.loc) else: putLocIntoDest(p, d, sym.loc) - of skForVar, skTemp: + of skTemp: if sym.loc.r == nil or sym.loc.t == nil: InternalError(e.info, "expr: temp not init " & sym.name.s) putLocIntoDest(p, d, sym.loc) diff --git a/compiler/ccgstmts.nim b/compiler/ccgstmts.nim index d0112f9d7..f725a31f1 100755 --- a/compiler/ccgstmts.nim +++ b/compiler/ccgstmts.nim @@ -23,7 +23,7 @@ proc genVarTuple(p: BProc, n: PNode) = for i in countup(0, L-3): var v = n.sons[i].sym if sfCompileTime in v.flags: continue - if sfGlobal in v.flags and v.kind != skForVar: + if sfGlobal in v.flags: assignGlobalVar(p, v) genObjectInit(p, cpsInit, v.typ, v.loc, true) else: @@ -49,7 +49,7 @@ proc genSingleVar(p: BProc, a: PNode) = var v = a.sons[0].sym if sfCompileTime in v.flags: return var immediateAsgn = a.sons[2].kind != nkEmpty - if sfGlobal in v.flags and v.kind != skForVar: + if sfGlobal in v.flags: assignGlobalVar(p, v) genObjectInit(p, cpsInit, v.typ, v.loc, true) else: diff --git a/compiler/ccgtypes.nim b/compiler/ccgtypes.nim index 4207e4dba..8c211186f 100755 --- a/compiler/ccgtypes.nim +++ b/compiler/ccgtypes.nim @@ -37,10 +37,10 @@ proc mangleName(s: PSym): PRope = case s.kind of skProc, skMethod, skConverter, skConst: result = toRope("@") - of skVar, skResult, skLet: + of skVar, skForVar, skResult, skLet: if sfGlobal in s.flags: result = toRope("@") else: result = toRope("%") - of skForVar, skTemp, skParam, skType, skEnumField, skModule: + of skTemp, skParam, skType, skEnumField, skModule: result = toRope("%") else: InternalError(s.info, "mangleName") app(result, toRope(mangle(s.name.s))) diff --git a/compiler/lambdalifting.nim b/compiler/lambdalifting.nim index a22252a30..dc6469563 100644 --- a/compiler/lambdalifting.nim +++ b/compiler/lambdalifting.nim @@ -11,8 +11,7 @@ # included from transf.nim const - declarativeDefs = {nkProcDef, nkMethodDef, nkIteratorDef, - nkConverterDef} + declarativeDefs = {nkProcDef, nkMethodDef, nkIteratorDef, nkConverterDef} procDefs = nkLambdaKinds + declarativeDefs proc indirectAccess(a, b: PSym, info: TLineInfo): PNode = diff --git a/compiler/semthreads.nim b/compiler/semthreads.nim index 1295723cf..09668a912 100755 --- a/compiler/semthreads.nim +++ b/compiler/semthreads.nim @@ -107,14 +107,14 @@ proc analyseSym(c: PProcCtx, n: PNode): TThreadOwner = result = c.mapping[v.id] if result != toUndefined: return case v.kind - of skVar, skLet, skResult: + of skVar, skForVar, skLet, skResult: result = toNil if sfGlobal in v.flags: if sfThread in v.flags: result = toMine elif containsGarbageCollectedRef(v.typ): result = toTheirs - of skTemp, skForVar: result = toNil + of skTemp: result = toNil of skConst: result = toMine of skParam: result = c.mapping[v.id] |