You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@Araq
while working on something else I noticed that nkComesFrom is deadcode (never set) even though it's used quite a bit, so removing it would declutter a bit.
is there any chance nkComesFrom might be revived or is the new code path in wrapInComesFrom strictly better so that nkComesFrom can be removed + its corresponding code cleaned up?
was the goal of nkComesFrom to produce stacktrace entries for templates/macros as if they were function calls? if so, it would be useful to have it as an option (i had a WIP on that but done differently) but not sure that's what it was about
procwrapInComesFrom*(info: TLineInfo; sym: PSym; res: PNode): PNode=whentrue:
result= res
result.info = info
ifresult.kind in {nkStmtList, nkStmtListExpr} andresult.len >0:
result.lastSon.info = info
whenfalse:
# this hack is required tovar x =resultwhile x.kind == nkStmtListExpr: x = x.lastSon
if x.kind in nkCallKinds:
for i in1..<x.len:
if x[i].kind in nkCallKinds:
x[i].info = info
else:
result=newNodeI(nkStmtListExpr, info)
var d =newNodeI(nkComesFrom, info)
d.addnewSymNode(sym, info)
result.add d
result.add res
result.typ = res.typ
eg, this code is also dead because of that:
if it.kind == nkComesFrom:
if hasNimFrame and frameName ==nil:
inc p.labels
frameName ="FR"&rope(p.labels) &"_"let theMacro = it[0].sym
add p.s(cpsStmts), initFrameNoDebug(p, frameName,
makeCString theMacro.name.s,
quotedFilename(p.config, theMacro.info), it.info.line.int)
as well as initFrameNoDebug + deinitFrameNoDebug + some other code
The text was updated successfully, but these errors were encountered:
The idea of ComesFrom is that template expansions do not lose one debug stack frame. As you can see, the implementation was never finished but I think the idea is a good one so I'd rather keep the dead code.
@Araq
while working on something else I noticed that
nkComesFrom
is deadcode (never set) even though it's used quite a bit, so removing it would declutter a bit.nkComesFrom
might be revived or is the new code path inwrapInComesFrom
strictly better so thatnkComesFrom
can be removed + its corresponding code cleaned up?nkComesFrom
to produce stacktrace entries for templates/macros as if they were function calls? if so, it would be useful to have it as an option (i had a WIP on that but done differently) but not sure that's what it was abouteg, this code is also dead because of that:
as well as
initFrameNoDebug
+deinitFrameNoDebug
+ some other codeThe text was updated successfully, but these errors were encountered: