Commit Graph

14 Commits

Author SHA1 Message Date
csmoe 64f61c7888 remove indexed_vec re-export from rustc_data_structures 2019-09-29 16:48:31 +00:00
Vadim Petrochenkov e118eb6c79 librustc_data_structures: Unconfigure tests during normal build 2019-08-02 01:59:01 +03:00
Niko Matsakis 4c91bb9571 introduce a `VecGraph` abstraction that cheaply stores graphs
This is perhaps better than the linked list approach I was using
before. Lower memory overhead, Theta(N+E) storage. Does require a
sort. =)
2019-07-02 12:15:20 -04:00
Niko Matsakis 4e85665e08 implement the graph traits for SCC 2019-07-02 12:15:20 -04:00
Alexander Regueiro c3e182cf43 rustc: doc comments 2019-02-10 23:42:32 +00:00
Taiki Endo 3e2b5a4b08 librustc_data_structures => 2018 2019-02-09 01:36:22 +09:00
Mark Rousskov 2a663555dd Remove licenses 2018-12-25 21:08:33 -07:00
Andy Russell 4e35cbb22e
fix various typos in doc comments 2018-11-13 14:45:31 -05:00
Niko Matsakis eed2c09a64 nit: fix `all_sccs` comment 2018-07-13 01:29:10 -04:00
Niko Matsakis 114cdd0816 nit: improve SCC comments 2018-07-13 01:29:10 -04:00
Niko Matsakis 9d2999461f nit: clarify "keep it around" comment 2018-07-13 01:29:10 -04:00
Niko Matsakis 666c365db3 nit: s/successor/successors/ 2018-07-13 01:29:10 -04:00
Niko Matsakis ed36698031 compute region values using SCCs not iterative flow
The strategy is this:

- we compute SCCs once all outlives constraints are known
- we allocate a set of values **per region** for storing liveness
- we allocate a set of values **per SCC** for storing the final values
- when we add a liveness constraint to the region R, we also add it
  to the final value of the SCC to which R belongs
- then we can apply the constraints by just walking the DAG for the
  SCCs and union'ing the children (which have their liveness
  constraints within)

There are a few intermediate refactorings that I really ought to have
broken out into their own commits:

- reverse the constraint graph so that `R1: R2` means `R1 -> R2` and
  not `R2 -> R1`. This fits better with the SCC computation and new
  style of inference (`->` now means "take value from" and not "push
  value into")
  - this does affect some of the UI tests, since they traverse the
    graph, but mostly the artificial ones and they don't necessarily
    seem worse
- put some things (constraint set, etc) into `Rc`. This lets us root
  them to permit mutation and iteration. It also guarantees they don't
  change, which is critical to the correctness of the algorithm.
- Generalize various helpers that previously operated only on points
  to work on any sort of region element.
2018-07-13 01:29:10 -04:00
Niko Matsakis 0052ddd8ae introduce a generic SCC computation 2018-07-12 00:38:40 -04:00