about summary refs log tree commit diff
path: root/src/rustllvm/RustWrapper.cpp
diff options
context:
space:
mode:
authorNicholas Nethercote <nnethercote@mozilla.com>2018-04-19 15:13:20 +1000
committerNicholas Nethercote <nnethercote@mozilla.com>2018-06-08 09:00:17 +1000
commitb0440d359b0dab992e8f01d63523799a72c81285 (patch)
treed0012b134f27abb24bef1f2ab1323e189012fd9d /src/rustllvm/RustWrapper.cpp
parentbe5f17ccff09569c2dd22df9330364a92fec2295 (diff)
downloadrust-b0440d359b0dab992e8f01d63523799a72c81285.tar.gz
rust-b0440d359b0dab992e8f01d63523799a72c81285.zip
Avoid useless Vec clones in pending_obligations().
The only instance of `ObligationForest` in use has an obligation type of
`PendingPredicateObligation`, which contains a `PredicateObligation` and a
`Vec<Ty>`.

`FulfillmentContext::pending_obligations()` calls
`ObligationForest::pending_obligations()`, which clones all the
`PendingPredicateObligation`s. But the `Vec<Ty>` field of those cloned
obligations is never touched.

This patch changes `ObligationForest::pending_obligations()` to
`map_pending_obligations` -- which gives callers control about which part
of the obligation to clone -- and takes advantage of the change to avoid
cloning the `Vec<Ty>`. The change speeds up runs of a few rustc-perf
benchmarks, the best by 1%.
Diffstat (limited to 'src/rustllvm/RustWrapper.cpp')
0 files changed, 0 insertions, 0 deletions