implemented a stack trace profiler
This commit is contained in:
parent
4a435a8fb4
commit
214c7a2ebd
11 changed files with 241 additions and 65 deletions
|
|
@ -265,6 +265,10 @@ proc genWhileStmt(p: BProc, t: PNode) =
|
|||
let label = assignLabel(p.blocks[p.breakIdx])
|
||||
lineF(p, cpsStmts, "if (!$1) goto $2;$n", [rdLoc(a), label])
|
||||
genStmts(p, t.sons[1])
|
||||
|
||||
if optProfiler in p.options:
|
||||
# invoke at loop body exit:
|
||||
lineCg(p, cpsStmts, "#nimProfile();$n")
|
||||
endBlock(p)
|
||||
|
||||
dec(p.withinLoop)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue