rust/src/librustc_passes
bors e471c206cf Auto merge of #50418 - nnethercote:cmt, r=eddyb
Avoid many `cmt` allocations.

`cmt` is a ref-counted wrapper around `cmt_` The use of refcounting
keeps `cmt` handling simple, but a lot of `cmt` instances are very
short-lived, and heap-allocating the short-lived ones takes up time.

This patch changes things in the following ways.

- Most of the functions that produced `cmt` instances now produce `cmt_`
  instances. The `Rc::new` calls that occurred within those functions
  now occur at their call sites (but only when necessary, which isn't
  that often).

- Many of the functions that took `cmt` arguments now take `&cmt_`
  arguments. This includes all the methods in the `Delegate` trait.

As a result, the vast majority of the heap allocations are avoided. In
an extreme case, the number of calls to malloc in tuple-stress drops
from 9.9M to 7.9M, a drop of 20%. And the compile times for many runs of
coercions, deep-vector, and tuple-stress drop by 1--2%.
2018-05-05 08:52:28 +00:00
..
Cargo.toml Removed unused dependencies on rustc_const_math 2018-04-30 18:18:33 +02:00
ast_validation.rs Auto merge of #49372 - Phlosioneer:inherent-impl-default-error-message, r=nagisa 2018-04-23 10:40:08 +00:00
diagnostics.rs Nuke the entire ctfe from orbit, it's the only way to be sure 2018-03-08 08:08:14 +01:00
hir_stats.rs Add GenericParam, refactor Generics in ast, hir, rustdoc 2017-12-21 13:38:10 +01:00
lib.rs Removed unused dependencies on rustc_const_math 2018-04-30 18:18:33 +02:00
loops.rs Suggest removing value from `break` when invalid 2018-01-28 11:14:09 -08:00
mir_stats.rs Unify MIR assert messages and const eval errors 2018-04-30 18:29:15 +02:00
rvalue_promotion.rs Avoid many `cmt` allocations. 2018-05-03 22:14:35 +10:00