Allow better optimisations by removing NOINLINE from module init procs
This commit is contained in:
parent
02f01470ab
commit
6c0185d4b7
1 changed files with 4 additions and 4 deletions
|
|
@ -1115,8 +1115,8 @@ proc registerModuleToMain(g: BModuleList; m: PSym) =
|
||||||
var
|
var
|
||||||
init = m.getInitName
|
init = m.getInitName
|
||||||
datInit = m.getDatInitName
|
datInit = m.getDatInitName
|
||||||
addf(g.mainModProcs, "NIM_EXTERNC N_NOINLINE(void, $1)(void);$N", [init])
|
addf(g.mainModProcs, "N_LIB_PRIVATE N_NIMCALL(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", [datInit])
|
||||||
if sfSystemModule notin m.flags:
|
if sfSystemModule notin m.flags:
|
||||||
addf(g.mainDatInit, "\t$1();$N", [datInit])
|
addf(g.mainDatInit, "\t$1();$N", [datInit])
|
||||||
let initCall = "\t$1();$N" % [init]
|
let initCall = "\t$1();$N" % [init]
|
||||||
|
|
@ -1127,7 +1127,7 @@ proc registerModuleToMain(g: BModuleList; m: PSym) =
|
||||||
|
|
||||||
proc genInitCode(m: BModule) =
|
proc genInitCode(m: BModule) =
|
||||||
var initname = getInitName(m.module)
|
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:
|
if m.typeNodes > 0:
|
||||||
appcg(m, m.s[cfsTypeInit1], "static #TNimNode $1[$2];$n",
|
appcg(m, m.s[cfsTypeInit1], "static #TNimNode $1[$2];$n",
|
||||||
[m.typeNodesName, rope(m.typeNodes)])
|
[m.typeNodesName, rope(m.typeNodes)])
|
||||||
|
|
@ -1169,7 +1169,7 @@ proc genInitCode(m: BModule) =
|
||||||
add(prc, deinitGCFrame(m.initProc))
|
add(prc, deinitGCFrame(m.initProc))
|
||||||
addf(prc, "}$N$N", [])
|
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)])
|
[getDatInitName(m.module)])
|
||||||
|
|
||||||
for i in cfsTypeInit1..cfsDynLibInit:
|
for i in cfsTypeInit1..cfsDynLibInit:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue