Merge branch 'master' of github.com:Araq/Nimrod
This commit is contained in:
commit
5a83bd8812
3 changed files with 3 additions and 17 deletions
|
|
@ -778,11 +778,6 @@ proc genPragma(p: BProc, n: PNode) =
|
||||||
genEmit(p, it)
|
genEmit(p, it)
|
||||||
of wBreakpoint:
|
of wBreakpoint:
|
||||||
genBreakPoint(p, it)
|
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:
|
of wWatchpoint:
|
||||||
genWatchpoint(p, it)
|
genWatchpoint(p, it)
|
||||||
else: nil
|
else: nil
|
||||||
|
|
|
||||||
|
|
@ -38,17 +38,11 @@ proc addForwardedProc(m: BModule, prc: PSym) =
|
||||||
m.forwardedProcs.add(prc)
|
m.forwardedProcs.add(prc)
|
||||||
inc(gForwardedProcsCounter)
|
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 =
|
proc findPendingModule(m: BModule, s: PSym): BModule =
|
||||||
var ms = getModule(s)
|
var ms = getModule(s)
|
||||||
if ms.id == m.module.id: return m
|
if ms.id == m.module.id: return m
|
||||||
for i in countup(0, high(gPendingModules)):
|
for i in countup(0, high(gModules)):
|
||||||
result = gPendingModules[i]
|
result = gModules[i]
|
||||||
if result.module.id == ms.id: return
|
if result.module.id == ms.id: return
|
||||||
# else we found no pending module: This can happen for procs that are in
|
# 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
|
# 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 (optDeadCodeElim in gGlobalOptions):
|
||||||
if (sfDeadCodeElim in module.flags):
|
if (sfDeadCodeElim in module.flags):
|
||||||
InternalError("added pending module twice: " & filename)
|
InternalError("added pending module twice: " & filename)
|
||||||
addPendingModule(result)
|
|
||||||
|
|
||||||
proc myOpen(module: PSym, filename: string): PPassContext =
|
proc myOpen(module: PSym, filename: string): PPassContext =
|
||||||
result = newModule(module, filename)
|
result = newModule(module, filename)
|
||||||
if optGenIndex in gGlobalOptions and generatedHeader == nil:
|
if optGenIndex in gGlobalOptions and generatedHeader == nil:
|
||||||
|
|
|
||||||
|
|
@ -115,8 +115,6 @@ type
|
||||||
var
|
var
|
||||||
mainModProcs*, mainModInit*, mainDatInit*: PRope # parts of the main module
|
mainModProcs*, mainModInit*, mainDatInit*: PRope # parts of the main module
|
||||||
gMapping*: PRope # the generated mapping file (if requested)
|
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
|
gModules*: seq[BModule] = @[] # list of all compiled modules
|
||||||
gForwardedProcsCounter*: int = 0
|
gForwardedProcsCounter*: int = 0
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue