mirror of
https://github.com/nim-lang/Nim.git
synced 2026-04-19 14:00:35 +00:00
Allow better optimisations by removing NOINLINE from module init procs
This commit is contained in:
committed by
Andreas Rumpf
parent
02f01470ab
commit
6c0185d4b7
@@ -1115,8 +1115,8 @@ proc registerModuleToMain(g: BModuleList; m: PSym) =
|
||||
var
|
||||
init = m.getInitName
|
||||
datInit = m.getDatInitName
|
||||
addf(g.mainModProcs, "NIM_EXTERNC N_NOINLINE(void, $1)(void);$N", [init])
|
||||
addf(g.mainModProcs, "NIM_EXTERNC N_NOINLINE(void, $1)(void);$N", [datInit])
|
||||
addf(g.mainModProcs, "N_LIB_PRIVATE N_NIMCALL(void, $1)(void);$N", [init])
|
||||
addf(g.mainModProcs, "N_LIB_PRIVATE N_NIMCALL(void, $1)(void);$N", [datInit])
|
||||
if sfSystemModule notin m.flags:
|
||||
addf(g.mainDatInit, "\t$1();$N", [datInit])
|
||||
let initCall = "\t$1();$N" % [init]
|
||||
@@ -1127,7 +1127,7 @@ proc registerModuleToMain(g: BModuleList; m: PSym) =
|
||||
|
||||
proc genInitCode(m: BModule) =
|
||||
var initname = getInitName(m.module)
|
||||
var prc = "NIM_EXTERNC N_NOINLINE(void, $1)(void) {$N" % [initname]
|
||||
var prc = "N_LIB_PRIVATE N_NIMCALL(void, $1)(void) {$N" % [initname]
|
||||
if m.typeNodes > 0:
|
||||
appcg(m, m.s[cfsTypeInit1], "static #TNimNode $1[$2];$n",
|
||||
[m.typeNodesName, rope(m.typeNodes)])
|
||||
@@ -1169,7 +1169,7 @@ proc genInitCode(m: BModule) =
|
||||
add(prc, deinitGCFrame(m.initProc))
|
||||
addf(prc, "}$N$N", [])
|
||||
|
||||
prc.addf("NIM_EXTERNC N_NOINLINE(void, $1)(void) {$N",
|
||||
prc.addf("N_LIB_PRIVATE N_NIMCALL(void, $1)(void) {$N",
|
||||
[getDatInitName(m.module)])
|
||||
|
||||
for i in cfsTypeInit1..cfsDynLibInit:
|
||||
|
||||
Reference in New Issue
Block a user