IC backend: progress

This commit is contained in:
araq
2025-12-11 14:33:53 +01:00
parent 1514706def
commit c1205b2f0a
2 changed files with 5 additions and 2 deletions

View File

@@ -61,6 +61,8 @@ proc hcrOn(p: BProc): bool = p.module.config.hcrOn
proc addForwardedProc(m: BModule, prc: PSym) =
m.g.forwardedProcs.add(prc)
proc newModule*(g: BModuleList; module: PSym; conf: ConfigRef): BModule
proc findPendingModule(m: BModule, s: PSym): BModule =
# TODO fixme
if m.config.symbolFiles == v2Sf or optCompress in m.config.globalOptions:
@@ -69,6 +71,8 @@ proc findPendingModule(m: BModule, s: PSym): BModule =
else:
var ms = getModule(s)
result = m.g.modules[ms.position]
if result == nil:
result = newModule(m.g, ms, m.config)
proc initLoc(k: TLocKind, lode: PNode, s: TStorageLoc, flags: TLocFlags = {}): TLoc =
result = TLoc(k: k, storage: s, lode: lode,
@@ -2368,7 +2372,7 @@ proc rawNewModule(g: BModuleList; module: PSym, filename: AbsoluteFile): BModule
proc rawNewModule(g: BModuleList; module: PSym; conf: ConfigRef): BModule =
result = rawNewModule(g, module, AbsoluteFile toFullPath(conf, module.position.FileIndex))
proc newModule*(g: BModuleList; module: PSym; conf: ConfigRef): BModule =
proc newModule(g: BModuleList; module: PSym; conf: ConfigRef): BModule =
# we should create only one cgen module for each module sym
result = rawNewModule(g, module, conf)
if module.position >= g.modules.len:

View File

@@ -514,7 +514,6 @@ proc setCmd*(conf: ConfigRef, cmd: Command) =
of cmdCompileToNif: conf.backend = backendNif
of cmdNifC:
conf.backend = backendC # NIF to C compilation
conf.globalOptions.incl optCompress # enable NIF loading
of cmdM:
# cmdM requires optCompress for proper IC handling (include files, etc.)
conf.globalOptions.incl optCompress