bugfixes for the guarded data flow analysis

This commit is contained in:
Araq 2013-06-12 00:41:02 +02:00
commit 0097305953
5 changed files with 103 additions and 71 deletions

View file

@ -156,6 +156,12 @@ proc equalSets(a, b: PNode): bool =
toBitSet(b, y)
result = bitSetEquals(x, y)
proc complement*(a: PNode): PNode =
var x: TBitSet
toBitSet(a, x)
for i in countup(0, high(x)): x[i] = not x[i]
result = toTreeSet(x, a.typ, a.info)
proc cardSet(s: PNode): BiggestInt =
# here we can do better than converting it into a compact set
# we just count the elements directly