diff --git a/compiler/reorder.nim b/compiler/reorder.nim index daeb482482..4fabf9041a 100644 --- a/compiler/reorder.nim +++ b/compiler/reorder.nim @@ -7,6 +7,9 @@ import when defined(nimPreviewSlimSystem): import std/assertions +when defined(nimDebugReorder): + import std/tables + type DepN = ref object pnode: PNode @@ -14,11 +17,11 @@ type onStack: bool kids: seq[DepN] hAQ, hIS, hB, hCmd: int - when defined(debugReorder): + when defined(nimDebugReorder): expls: seq[string] DepG = seq[DepN] -when defined(debugReorder): +when defined(nimDebugReorder): var idNames = newTable[int, string]() proc newDepN(id: int, pnode: PNode): DepN = @@ -33,7 +36,7 @@ proc newDepN(id: int, pnode: PNode): DepN = result.hIS = -1 result.hB = -1 result.hCmd = -1 - when defined(debugReorder): + when defined(nimDebugReorder): result.expls = @[] proc accQuoted(cache: IdentCache; n: PNode): PIdent = @@ -49,16 +52,16 @@ proc addDecl(cache: IdentCache; n: PNode; declares: var IntSet) = of nkPragmaExpr: addDecl(cache, n[0], declares) of nkIdent: declares.incl n.ident.id - when defined(debugReorder): + when defined(nimDebugReorder): idNames[n.ident.id] = n.ident.s of nkSym: declares.incl n.sym.name.id - when defined(debugReorder): + when defined(nimDebugReorder): idNames[n.sym.name.id] = n.sym.name.s of nkAccQuoted: let a = accQuoted(cache, n) declares.incl a.id - when defined(debugReorder): + when defined(nimDebugReorder): idNames[a.id] = a.s of nkEnumFieldDef: addDecl(cache, n[0], declares) @@ -193,7 +196,7 @@ proc mergeSections(conf: ConfigRef; comps: seq[seq[DepN]], res: PNode) = # consecutive type and const sections var wmsg = "Circular dependency detected. `codeReordering` pragma may not be able to" & " reorder some nodes properly" - when defined(debugReorder): + when defined(nimDebugReorder): wmsg &= ":\n" for i in 0..