summary refs log tree commit diff stats
path: root/compiler
diff options
context:
space:
mode:
authorAraq <rumpf_a@web.de>2013-05-19 01:52:06 +0200
committerAraq <rumpf_a@web.de>2013-05-19 01:52:06 +0200
commit2189e9a60f8db752d9423857bafd3c2d63618546 (patch)
tree4f1326d1606b2539d3910abf566b9e4e07e5f3de /compiler
parent814fca7de569cdfd1fefb9ca932f5ba41383c10f (diff)
downloadNim-2189e9a60f8db752d9423857bafd3c2d63618546.tar.gz
fixes #420
Diffstat (limited to 'compiler')
-rw-r--r--compiler/ccgtypes.nim4
-rw-r--r--compiler/cgen.nim9
2 files changed, 9 insertions, 4 deletions
diff --git a/compiler/ccgtypes.nim b/compiler/ccgtypes.nim
index 6f54f7e2f..427b0ec86 100644
--- a/compiler/ccgtypes.nim
+++ b/compiler/ccgtypes.nim
@@ -85,11 +85,11 @@ proc mangleName(s: PSym): PRope =
       #
       # Even with all these inefficient checks, the bootstrap
       # time is actually improved. This is probably because so many
-      # rope concatenations and are now eliminated.
+      # rope concatenations are now eliminated.
       #
       # Future notes:
       # sfFromGeneric seems to be needed in order to avoid multiple
-      # definitions of certain varialbes generated in transf with
+      # definitions of certain variables generated in transf with
       # names such as:
       # `r`, `res`
       # I need to study where these come from.
diff --git a/compiler/cgen.nim b/compiler/cgen.nim
index ddb9ec0ad..92216d278 100644
--- a/compiler/cgen.nim
+++ b/compiler/cgen.nim
@@ -1078,6 +1078,11 @@ proc genModule(m: BModule, cfilenoext: string): PRope =
     app(result, genSectionEnd(i))
   app(result, m.s[cfsInitProc])
 
+proc newPreInitProc(m: BModule): BProc =
+  result = newProc(nil, m)
+  # little hack so that unique temporaries are generated:
+  result.labels = 100_000
+
 proc rawNewModule(module: PSym, filename: string): BModule =
   new(result)
   InitLinkedList(result.headerFiles)
@@ -1091,7 +1096,7 @@ proc rawNewModule(module: PSym, filename: string): BModule =
   result.typeInfoMarker = initIntSet()
   result.initProc = newProc(nil, result)
   result.initProc.options = gOptions
-  result.preInitProc = newProc(nil, result)
+  result.preInitProc = newPreInitProc(result)
   initNodeTable(result.dataCache)
   result.typeStack = @[]
   result.forwardedProcs = @[]
@@ -1111,7 +1116,7 @@ proc resetModule*(m: var BModule) =
   initIdTable(m.forwTypeCache)
   m.initProc = newProc(nil, m)
   m.initProc.options = gOptions
-  m.preInitProc = newProc(nil, m)
+  m.preInitProc = newPreInitProc(m)
   initNodeTable(m.dataCache)
   m.typeStack = @[]
   m.forwardedProcs = @[]