]> Cypherpunks repositories - gostls13.git/commit
cmd/compile: derive len/cap relations in factsTable.update
authorAustin Clements <austin@google.com>
Fri, 23 Mar 2018 21:25:26 +0000 (17:25 -0400)
committerAustin Clements <austin@google.com>
Tue, 22 May 2018 14:15:43 +0000 (14:15 +0000)
commit4816eface10125bc915c8a0dfff7fe1489827b8c
tree04cf876a240e2595358a40c278a630f6e4bb63db
parent8d8f620f686f596a34d75d0bc251b46d8c476891
cmd/compile: derive len/cap relations in factsTable.update

Currently, the prove pass derives implicit relations between len and
cap in the code that adds branch conditions. This is fine right now
because that's the only place we can encounter len and cap, but we're
about to add a second way to add assertions to the facts table that
can also produce facts involving len and cap.

Prepare for this by moving the fact derivation from updateRestrictions
(where it only applies on branches) to factsTable.update, which can
derive these facts no matter where the root facts come from.

Passes toolstash -cmp.

Change-Id: If09692d9eb98ffaa93f4cfa58ed2d8ba0887c111
Reviewed-on: https://go-review.googlesource.com/102602
Run-TryBot: Austin Clements <austin@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: David Chase <drchase@google.com>
src/cmd/compile/internal/ssa/prove.go