control flow graphs: introduce 'join' points for easy analyses based on abstract interpretation
This commit is contained in:
parent
2fb8b1d132
commit
11022fea1b
3 changed files with 395 additions and 154 deletions
|
|
@ -184,7 +184,7 @@ proc isHarmlessVar*(s: PSym; c: Con): bool =
|
|||
inc usages
|
||||
#of useWithinCall:
|
||||
# if c.g[i].sym == s: return false
|
||||
of goto, fork:
|
||||
of goto, fork, InstrKind.join:
|
||||
discard "we do not perform an abstract interpretation yet"
|
||||
result = usages <= 1
|
||||
|
||||
|
|
@ -246,6 +246,8 @@ proc isLastRead(n: PNode; c: var Con): bool =
|
|||
if not takenForks.containsOrIncl(pc):
|
||||
pcs.add pc + c.g[pc].dest
|
||||
inc pc
|
||||
of InstrKind.join:
|
||||
inc pc
|
||||
#echo c.graph.config $ n.info, " last read here!"
|
||||
return true
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue