summary refs log tree commit diff stats
path: root/compiler/lambdalifting.nim
diff options
context:
space:
mode:
authorAraq <rumpf_a@web.de>2014-04-16 08:44:57 +0200
committerAraq <rumpf_a@web.de>2014-04-16 08:44:57 +0200
commit8e08ff559f4c03587c683b1bf2ef71f256af3824 (patch)
tree58b3814cc079243ab759ba80e1d7a7802fa0caab /compiler/lambdalifting.nim
parentb961e47bfe519bf456a3e8a0dba3025a3c047b04 (diff)
downloadNim-8e08ff559f4c03587c683b1bf2ef71f256af3824.tar.gz
first version of 'spawn'
Diffstat (limited to 'compiler/lambdalifting.nim')
-rw-r--r--compiler/lambdalifting.nim31
1 files changed, 0 insertions, 31 deletions
diff --git a/compiler/lambdalifting.nim b/compiler/lambdalifting.nim
index 440468ac4..c5b9d0f00 100644
--- a/compiler/lambdalifting.nim
+++ b/compiler/lambdalifting.nim
@@ -141,12 +141,6 @@ type
     closureParam, state, resultSym: PSym # only if isIter
     obj: PType # only if isIter
 
-proc createObj(owner: PSym, info: TLineInfo): PType =
-  result = newType(tyObject, owner)
-  rawAddSon(result, nil)
-  incl result.flags, tfFinal
-  result.n = newNodeI(nkRecList, info)
-
 proc getStateType(iter: PSym): PType =
   var n = newNodeI(nkRange, iter.info)
   addSon(n, newIntNode(nkIntLit, -1))
@@ -189,15 +183,6 @@ proc getEnvParam(routine: PSym): PSym =
   let hidden = lastSon(params)
   if hidden.kind == nkSym and hidden.sym.name.s == paramName:
     result = hidden.sym
-    
-proc addField(obj: PType; s: PSym) =
-  # because of 'gensym' support, we have to mangle the name with its ID.
-  # This is hacky but the clean solution is much more complex than it looks.
-  var field = newSym(skField, getIdent(s.name.s & $s.id), s.owner, s.info)
-  let t = skipIntLit(s.typ)
-  field.typ = t
-  field.position = sonsLen(obj.n)
-  addSon(obj.n, newSymNode(field))
 
 proc initIterContext(c: POuterContext, iter: PSym) =
   c.fn = iter
@@ -273,22 +258,6 @@ proc addDep(e, d: PEnv, owner: PSym): PSym =
   rawAddSon(result.typ, d.obj)
   addField(e.obj, result)
   e.deps.add((d, result))
-  
-proc indirectAccess(a: PNode, b: PSym, info: TLineInfo): PNode = 
-  # returns a[].b as a node
-  var deref = newNodeI(nkHiddenDeref, info)
-  deref.typ = a.typ.sons[0]
-  assert deref.typ.kind == tyObject
-  let field = getSymFromList(deref.typ.n, getIdent(b.name.s & $b.id))
-  assert field != nil, b.name.s
-  addSon(deref, a)
-  result = newNodeI(nkDotExpr, info)
-  addSon(result, deref)
-  addSon(result, newSymNode(field))
-  result.typ = field.typ
-
-proc indirectAccess(a, b: PSym, info: TLineInfo): PNode =
-  result = indirectAccess(newSymNode(a), b, info)
 
 proc newCall(a, b: PSym): PNode =
   result = newNodeI(nkCall, a.info)