Skip to content

Commit

Permalink
fixes #24395; remove ndi (#24396)
Browse files Browse the repository at this point in the history
fixes  #24395
  • Loading branch information
ringabout authored Nov 1, 2024
1 parent 7b47987 commit 8b88b5f
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 64 deletions.
3 changes: 0 additions & 3 deletions compiler/ccgtypes.nim
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,6 @@ proc fillBackendName(m: BModule; s: PSym) =
result.add '_'
result.add(idOrSig(s, m.module.name.s.mangle, m.sigConflicts, m.config))
s.loc.snippet = result
writeMangledName(m.ndi, s, m.config)

proc fillParamName(m: BModule; s: PSym) =
if s.loc.snippet == "":
Expand All @@ -105,7 +104,6 @@ proc fillParamName(m: BModule; s: PSym) =
# That would lead to either needing to reload `proxy` or to overwrite the
# executable file for the main module, which is running (or both!) -> error.
s.loc.snippet = res.rope
writeMangledName(m.ndi, s, m.config)

proc fillLocalName(p: BProc; s: PSym) =
assert s.kind in skLocalVars+{skTemp}
Expand All @@ -121,7 +119,6 @@ proc fillLocalName(p: BProc; s: PSym) =
result.add "_" & rope(counter+1)
p.sigConflicts.inc(key)
s.loc.snippet = result
if s.kind != skTemp: writeMangledName(p.module.ndi, s, p.config)

proc scopeMangledParam(p: BProc; param: PSym) =
## parameter generation only takes BModule, not a BProc, so we have to
Expand Down
8 changes: 1 addition & 7 deletions compiler/cgen.nim
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import
nversion, nimsets, msgs, bitsets, idents, types,
ccgutils, ropes, wordrecg, treetab, cgmeth,
rodutils, renderer, cgendata, aliases,
lowerings, ndi, lineinfos, pathutils, transf,
lowerings, lineinfos, pathutils, transf,
injectdestructors, astmsgs, modulepaths, pushpoppragmas,
mangleutils

Expand Down Expand Up @@ -2129,9 +2129,6 @@ proc rawNewModule(g: BModuleList; module: PSym, filename: AbsoluteFile): BModule
if sfSystemModule in module.flags:
incl result.flags, preventStackTrace
excl(result.preInitProc.options, optStackTrace)
let ndiName = if optCDebug in g.config.globalOptions: changeFileExt(completeCfilePath(g.config, filename), "ndi")
else: AbsoluteFile""
open(result.ndi, ndiName, g.config)

proc rawNewModule(g: BModuleList; module: PSym; conf: ConfigRef): BModule =
result = rawNewModule(g, module, AbsoluteFile toFullPath(conf, module.position.FileIndex))
Expand Down Expand Up @@ -2261,7 +2258,6 @@ proc shouldRecompile(m: BModule; code: Rope, cfile: Cfile): bool =
# it would generate multiple 'main' procs, for instance.

proc writeModule(m: BModule, pending: bool) =
template onExit() = close(m.ndi, m.config)
let cfile = getCFile(m)
if moduleHasChanged(m.g.graph, m.module):
genInitCode(m)
Expand All @@ -2279,12 +2275,10 @@ proc writeModule(m: BModule, pending: bool) =
when hasTinyCBackend:
if m.config.cmd == cmdTcc:
tccgen.compileCCode($code, m.config)
onExit()
return

if not shouldRecompile(m, code, cf): cf.flags = {CfileFlag.Cached}
addFileToCompile(m.config, cf)
onExit()

proc updateCachedModule(m: BModule) =
let cfile = getCFile(m)
Expand Down
3 changes: 1 addition & 2 deletions compiler/cgendata.nim
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

import
ast, ropes, options,
ndi, lineinfos, pathutils, modulegraphs
lineinfos, pathutils, modulegraphs

import std/[intsets, tables, sets]

Expand Down Expand Up @@ -172,7 +172,6 @@ type
# OpenGL wrapper
sigConflicts*: CountTable[SigHash]
g*: BModuleList
ndi*: NdiFile

template config*(m: BModule): ConfigRef = m.g.config
template config*(p: BProc): ConfigRef = p.module.g.config
Expand Down
52 changes: 0 additions & 52 deletions compiler/ndi.nim

This file was deleted.

0 comments on commit 8b88b5f

Please sign in to comment.