summary refs log tree commit diff stats
path: root/compiler/cgen.nim
diff options
context:
space:
mode:
authorAraq <rumpf_a@web.de>2014-07-15 09:30:58 +0200
committerAraq <rumpf_a@web.de>2014-07-15 09:30:58 +0200
commit0743f78012e954f5295df7923ccabd472a5a7502 (patch)
tree5d681c9835f01019e8ae83e14c0cd49d1a6c0d38 /compiler/cgen.nim
parent7fa399f51c39e6661876223009d5003cd2e0cf99 (diff)
parent18ded6c23d72cd21fa0aa10ff61dc6f9af40832c (diff)
downloadNim-0743f78012e954f5295df7923ccabd472a5a7502.tar.gz
Merge branch 'master' of https://github.com/Araq/Nimrod
Diffstat (limited to 'compiler/cgen.nim')
-rw-r--r--compiler/cgen.nim8
1 files changed, 6 insertions, 2 deletions
diff --git a/compiler/cgen.nim b/compiler/cgen.nim
index 8d66d7a3b..e2f3b5ab0 100644
--- a/compiler/cgen.nim
+++ b/compiler/cgen.nim
@@ -14,7 +14,8 @@ import
   options, intsets,
   nversion, nimsets, msgs, crc, bitsets, idents, lists, types, ccgutils, os,
   times, ropes, math, passes, rodread, wordrecg, treetab, cgmeth,
-  rodutils, renderer, idgen, cgendata, ccgmerge, semfold, aliases, lowerings
+  rodutils, renderer, idgen, cgendata, ccgmerge, semfold, aliases, lowerings,
+  semparallel
 
 when options.hasTinyCBackend:
   import tccgen
@@ -503,7 +504,8 @@ proc assignLocalVar(p: BProc, s: PSym) =
     if sfRegister in s.flags: app(decl, " register")
     #elif skipTypes(s.typ, abstractInst).kind in GcTypeKinds:
     #  app(decl, " GC_GUARD")
-    if sfVolatile in s.flags or p.nestedTryStmts.len > 0: 
+    if sfVolatile in s.flags or (p.nestedTryStmts.len > 0 and
+                                 gCmd != cmdCompileToCpp):
       app(decl, " volatile")
     appf(decl, " $1;$n", [s.loc.r])
   else:
@@ -1048,6 +1050,7 @@ proc getSomeInitName(m: PSym, suffix: string): PRope =
   assert m.owner.kind == skPackage
   if {sfSystemModule, sfMainModule} * m.flags == {}:
     result = m.owner.name.s.mangle.toRope
+    result.app "_"
   result.app m.name.s
   result.app suffix
   
@@ -1382,6 +1385,7 @@ proc myClose(b: PPassContext, n: PNode): PNode =
   registerModuleToMain(m.module)
 
   if sfMainModule in m.module.flags: 
+    m.objHasKidsValid = true
     var disp = generateMethodDispatchers()
     for i in 0..sonsLen(disp)-1: genProcAux(m, disp.sons[i].sym)
     genMainProc(m)