ARC Analysis in one pass (#16849)

* Analyse last reads all at once

* Integrate firstWrite analysis

* Small cleanup

* Use sets instead of seqs

* Remove instrTargets

* Reap the benefits

* Implement error diagnostics

* Operate on DFA index for lastRead analysis

* Use mgetOrPut
This commit is contained in:
Clyybber 2021-02-09 14:20:58 +01:00 • committed by GitHub
commit ab740cb5b9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 139 additions and 128 deletions

View file

@ -491,6 +491,8 @@ type
nfDefaultRefsParam # a default param value references another parameter
# the flag is applied to proc default values and to calls
nfExecuteOnReload # A top-level statement that will be executed during reloads
nfLastRead # this node is a last read
nfFirstWrite# this node is a first write
TNodeFlags* = set[TNodeFlag]
TTypeFlag* = enum # keep below 32 for efficiency reasons (now: ~40)
@ -1014,7 +1016,7 @@ const
nfDotSetter, nfDotField,
nfIsRef, nfIsPtr, nfPreventCg, nfLL,
nfFromTemplate, nfDefaultRefsParam,
nfExecuteOnReload}
nfExecuteOnReload, nfLastRead, nfFirstWrite}
namePos* = 0
patternPos* = 1 # empty except for term rewriting macros
genericParamsPos* = 2