thavlak: code style changes
This commit is contained in:
parent
170cb4f4cb
commit
9eee15f668
1 changed files with 20 additions and 18 deletions
|
|
@ -110,7 +110,7 @@ proc setNestingLevel(self: ref SimpleLoop, level: int) =
|
|||
self.nestingLevel = level
|
||||
if level == 0: self.isRoot = true
|
||||
|
||||
var loop_counter: int = 0
|
||||
var loopCounter: int = 0
|
||||
|
||||
type
|
||||
Lsg = object
|
||||
|
|
@ -119,8 +119,8 @@ type
|
|||
|
||||
proc createNewLoop(self: var Lsg): ref SimpleLoop =
|
||||
result = newSimpleLoop()
|
||||
loop_counter += 1
|
||||
result.counter = loop_counter
|
||||
loopCounter += 1
|
||||
result.counter = loopCounter
|
||||
|
||||
proc addLoop(self: var Lsg, l: ref SimpleLoop) =
|
||||
self.loops.add l
|
||||
|
|
@ -196,7 +196,9 @@ proc newHavlakLoopFinder(cfg: Cfg, lsg: Lsg): HavlakLoopFinder =
|
|||
proc isAncestor(w: int, v: int, last: seq[int]): bool =
|
||||
w <= v and v <= last[w]
|
||||
|
||||
proc dfs(currentNode: ref BasicBlock, nodes: var seq[ref UnionFindNode], number: var Table[ref BasicBlock, int], last: var seq[int], current: int): int =
|
||||
proc dfs(currentNode: ref BasicBlock, nodes: var seq[ref UnionFindNode],
|
||||
number: var Table[ref BasicBlock, int],
|
||||
last: var seq[int], current: int): int =
|
||||
var stack = @[(currentNode, current)]
|
||||
while stack.len > 0:
|
||||
let (currentNode, current) = stack.pop()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue