ARC: solves phase ordering problems (#12654)
This commit is contained in:
parent
f22d3c75aa
commit
a14abc5708
9 changed files with 65 additions and 62 deletions
|
|
@ -33,7 +33,7 @@ import
|
|||
nversion, msgs, idents, types, tables,
|
||||
ropes, math, passes, ccgutils, wordrecg, renderer,
|
||||
intsets, cgmeth, lowerings, sighashes, modulegraphs, lineinfos, rodutils,
|
||||
transf
|
||||
transf, injectdestructors
|
||||
|
||||
|
||||
from modulegraphs import ModuleGraph, PPassContext
|
||||
|
|
@ -2259,7 +2259,10 @@ proc genProc(oldProc: PProc, prc: PSym): Rope =
|
|||
else:
|
||||
returnStmt = "return $#;$n" % [a.res]
|
||||
|
||||
let transformedBody = transformBody(oldProc.module.graph, prc, cache = false)
|
||||
var transformedBody = transformBody(oldProc.module.graph, prc, cache = false)
|
||||
if sfInjectDestructors in prc.flags:
|
||||
transformedBody = injectDestructorCalls(oldProc.module.graph, prc, transformedBody)
|
||||
|
||||
p.nested: genStmt(p, transformedBody)
|
||||
|
||||
var def: Rope
|
||||
|
|
@ -2540,7 +2543,9 @@ proc genModule(p: PProc, n: PNode) =
|
|||
add(p.body, frameCreate(p,
|
||||
makeJSString("module " & p.module.module.name.s),
|
||||
makeJSString(toFilename(p.config, p.module.module.info))))
|
||||
let transformedN = transformStmt(p.module.graph, p.module.module, n)
|
||||
var transformedN = transformStmt(p.module.graph, p.module.module, n)
|
||||
if sfInjectDestructors in p.module.module.flags:
|
||||
transformedN = injectDestructorCalls(p.module.graph, p.module.module, transformedN)
|
||||
if p.config.hcrOn and n.kind == nkStmtList:
|
||||
let moduleSym = p.module.module
|
||||
var moduleLoadedVar = rope(moduleSym.name.s) & "_loaded" &
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue