diff options
author | Zahary Karadjov <zahary@gmail.com> | 2012-10-06 14:50:05 +0300 |
---|---|---|
committer | Zahary Karadjov <zahary@gmail.com> | 2012-10-06 14:51:46 +0300 |
commit | c27637747ac34787dfc54ae86322f5254833cf06 (patch) | |
tree | df75e437ea9276385848cbbfdccacad585bb00ee /compiler | |
parent | a85b5797184065f1b007fad93b2d27c91f2632e9 (diff) | |
download | Nim-c27637747ac34787dfc54ae86322f5254833cf06.tar.gz |
bugfix: closures as default param values
Diffstat (limited to 'compiler')
-rwxr-xr-x | compiler/ccgstmts.nim | 5 | ||||
-rwxr-xr-x | compiler/cgen.nim | 13 | ||||
-rw-r--r-- | compiler/cgendata.nim | 2 |
3 files changed, 3 insertions, 17 deletions
diff --git a/compiler/ccgstmts.nim b/compiler/ccgstmts.nim index 9cb5d732b..4ff309424 100755 --- a/compiler/ccgstmts.nim +++ b/compiler/ccgstmts.nim @@ -778,11 +778,6 @@ proc genPragma(p: BProc, n: PNode) = genEmit(p, it) of wBreakpoint: genBreakPoint(p, it) - of wDeadCodeElim: - if not (optDeadCodeElim in gGlobalOptions): - # we need to keep track of ``deadCodeElim`` pragma - if (sfDeadCodeElim in p.module.module.flags): - addPendingModule(p.module) of wWatchpoint: genWatchpoint(p, it) else: nil diff --git a/compiler/cgen.nim b/compiler/cgen.nim index 1ba56863a..2c58eecec 100755 --- a/compiler/cgen.nim +++ b/compiler/cgen.nim @@ -38,17 +38,11 @@ proc addForwardedProc(m: BModule, prc: PSym) = m.forwardedProcs.add(prc) inc(gForwardedProcsCounter) -proc addPendingModule(m: BModule) = - for i in countup(0, high(gPendingModules)): - if gPendingModules[i] == m: - InternalError("module already pending: " & m.module.name.s) - gPendingModules.add(m) - proc findPendingModule(m: BModule, s: PSym): BModule = var ms = getModule(s) if ms.id == m.module.id: return m - for i in countup(0, high(gPendingModules)): - result = gPendingModules[i] + for i in countup(0, high(gModules)): + result = gModules[i] if result.module.id == ms.id: return # else we found no pending module: This can happen for procs that are in # a module that is already closed. This is fine, don't generate code for @@ -1021,8 +1015,7 @@ proc newModule(module: PSym, filename: string): BModule = if (optDeadCodeElim in gGlobalOptions): if (sfDeadCodeElim in module.flags): InternalError("added pending module twice: " & filename) - addPendingModule(result) - + proc myOpen(module: PSym, filename: string): PPassContext = result = newModule(module, filename) if optGenIndex in gGlobalOptions and generatedHeader == nil: diff --git a/compiler/cgendata.nim b/compiler/cgendata.nim index 57911c004..d0d0eece8 100644 --- a/compiler/cgendata.nim +++ b/compiler/cgendata.nim @@ -115,8 +115,6 @@ type var mainModProcs*, mainModInit*, mainDatInit*: PRope # parts of the main module gMapping*: PRope # the generated mapping file (if requested) - gPendingModules*: seq[BModule] = @[] # list of modules that are not - # finished with code generation gModules*: seq[BModule] = @[] # list of all compiled modules gForwardedProcsCounter*: int = 0 |