summary refs log tree commit diff stats
path: root/compiler/vmdef.nim
diff options
context:
space:
mode:
authorAndreas Rumpf <rumpf_a@web.de>2018-05-12 09:38:41 +0200
committerAndreas Rumpf <rumpf_a@web.de>2018-05-12 09:38:41 +0200
commitfedc136985948a5b011a74ef49f97e43f2a3fe72 (patch)
tree3c03499dbae3e1d352b4e282670340d47babcaaf /compiler/vmdef.nim
parent1310279691c82a38ccbd5f6d8616619c0ce006c4 (diff)
downloadNim-fedc136985948a5b011a74ef49f97e43f2a3fe72.tar.gz
transf and vmgen compile again
Diffstat (limited to 'compiler/vmdef.nim')
-rw-r--r--compiler/vmdef.nim8
1 files changed, 4 insertions, 4 deletions
diff --git a/compiler/vmdef.nim b/compiler/vmdef.nim
index b0a559d2c..56ee45b6c 100644
--- a/compiler/vmdef.nim
+++ b/compiler/vmdef.nim
@@ -10,7 +10,7 @@
 ## This module contains the type definitions for the new evaluation engine.
 ## An instruction is 1-3 int32s in memory, it is a register based VM.
 
-import ast, passes, msgs, idents, intsets, options
+import ast, passes, msgs, idents, intsets, options, modulegraphs
 
 const
   byteExcess* = 128 # we use excess-K for immediates
@@ -207,18 +207,18 @@ type
     errorFlag*: string
     cache*: IdentCache
     config*: ConfigRef
+    graph*: ModuleGraph
 
   TPosition* = distinct int
 
   PEvalContext* = PCtx
 
-proc newCtx*(module: PSym; cache: IdentCache; config: ConfigRef = nil): PCtx =
-  let conf = if config != nil: config else: newConfigRef()
+proc newCtx*(module: PSym; cache: IdentCache; g: ModuleGraph): PCtx =
   PCtx(code: @[], debug: @[],
     globals: newNode(nkStmtListExpr), constants: newNode(nkStmtList), types: @[],
     prc: PProc(blocks: @[]), module: module, loopIterations: MaxLoopIterations,
     comesFromHeuristic: unknownLineInfo(), callbacks: @[], errorFlag: "",
-    cache: cache, config: conf)
+    cache: cache, config: g.config, graph: g)
 
 proc refresh*(c: PCtx, module: PSym) =
   c.module = module