Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

removes packed trees IC #24377

Open
wants to merge 11 commits into
base: devel
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion compiler/ccgtypes.nim
Original file line number Diff line number Diff line change
Expand Up @@ -1962,7 +1962,6 @@ proc genTypeInfoV1(m: BModule; t: PType; info: TLineInfo): Rope =
owner = m.module.position.int32

m.g.typeInfoMarker[sig] = (str: result, owner: owner)
rememberEmittedTypeInfo(m.g.graph, FileIndex(owner), $result)

case t.kind
of tyEmpty, tyVoid: result = cIntValue(0)
Expand Down
44 changes: 4 additions & 40 deletions compiler/cgen.nim
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ when not defined(leanCompiler):

import std/strutils except `%`, addf # collides with ropes.`%`

from ic / ic import ModuleBackendFlag
import std/[dynlib, math, tables, sets, os, intsets, hashes]

const
Expand Down Expand Up @@ -62,13 +61,8 @@ proc addForwardedProc(m: BModule, prc: PSym) =
m.g.forwardedProcs.add(prc)

proc findPendingModule(m: BModule, s: PSym): BModule =
# TODO fixme
if m.config.symbolFiles == v2Sf:
let ms = s.itemId.module #getModule(s)
result = m.g.modules[ms]
else:
var ms = getModule(s)
result = m.g.modules[ms.position]
var ms = getModule(s)
result = m.g.modules[ms.position]

proc initLoc(k: TLocKind, lode: PNode, s: TStorageLoc, flags: TLocFlags = {}): TLoc =
result = TLoc(k: k, storage: s, lode: lode,
Expand Down Expand Up @@ -1420,8 +1414,7 @@ proc genProcNoForward(m: BModule, prc: PSym) =
#if prc.loc.k == locNone:
# mangle the inline proc based on the module where it is defined -
# not on the first module that uses it
let m2 = if m.config.symbolFiles != disabledSf: m
else: findPendingModule(m, prc)
let m2 = findPendingModule(m, prc)
fillProcLoc(m2, prc.ast[namePos])
#elif {sfExportc, sfImportc} * prc.flags == {}:
# # reset name to restore consistency in case of hashing collisions:
Expand Down Expand Up @@ -1775,33 +1768,6 @@ proc genMainProc(m: BModule) =
if m.config.cppCustomNamespace.len > 0:
openNamespaceNim(m.config.cppCustomNamespace, m.s[cfsProcs])

proc registerInitProcs*(g: BModuleList; m: PSym; flags: set[ModuleBackendFlag]) =
## Called from the IC backend.
if HasDatInitProc in flags:
let datInit = getSomeNameForModule(g.config, g.config.toFullPath(m.info.fileIndex).AbsoluteFile) & "DatInit000"
g.mainModProcs.addf("N_LIB_PRIVATE N_NIMCALL(void, $1)(void);$N", [datInit])
g.mainDatInit.addf("\t$1();$N", [datInit])
if HasModuleInitProc in flags:
let init = getSomeNameForModule(g.config, g.config.toFullPath(m.info.fileIndex).AbsoluteFile) & "Init000"
g.mainModProcs.addf("N_LIB_PRIVATE N_NIMCALL(void, $1)(void);$N", [init])
let initCall = "\t$1();$N" % [init]
if sfMainModule in m.flags:
g.mainModInit.add(initCall)
elif sfSystemModule in m.flags:
g.mainDatInit.add(initCall) # systemInit must called right after systemDatInit if any
else:
g.otherModsInit.add(initCall)

proc whichInitProcs*(m: BModule): set[ModuleBackendFlag] =
# called from IC.
result = {}
if m.hcrOn or m.preInitProc.s(cpsInit).buf.len > 0 or m.preInitProc.s(cpsStmts).buf.len > 0:
result.incl HasModuleInitProc
for i in cfsTypeInit1..cfsDynLibInit:
if m.s[i].buf.len != 0:
result.incl HasDatInitProc
break

proc registerModuleToMain(g: BModuleList; m: BModule) =
let
init = m.getInitName
Expand Down Expand Up @@ -1896,7 +1862,6 @@ proc genDatInitCode(m: BModule) =

if moduleDatInitRequired:
m.s[cfsDatInitProc].add(extract(prc))
#rememberFlag(m.g.graph, m.module, HasDatInitProc)

# Very similar to the contents of symInDynamicLib - basically only the
# things needed for the hot code reloading runtime procs to be loaded
Expand Down Expand Up @@ -2027,7 +1992,6 @@ proc genInitCode(m: BModule) =

if moduleInitRequired or sfMainModule in m.module.flags:
m.s[cfsInitProc].add(extract(prc))
#rememberFlag(m.g.graph, m.module, HasModuleInitProc)

genDatInitCode(m)

Expand Down Expand Up @@ -2288,7 +2252,7 @@ proc writeModule(m: BModule, pending: bool) =
var cf = Cfile(nimname: m.module.name.s, cname: cfile,
obj: completeCfilePath(m.config, toObjFile(m.config, cfile)), flags: {})
var code = genModule(m, cf)
if code != "" or m.config.symbolFiles != disabledSf:
if code != "":
when hasTinyCBackend:
if m.config.cmd == cmdTcc:
tccgen.compileCCode($code, m.config)
Expand Down
178 changes: 0 additions & 178 deletions compiler/ic/bitabs.nim

This file was deleted.

Loading