about summary refs log tree commit diff
path: root/src/rustllvm/RustWrapper.cpp
diff options
context:
space:
mode:
authorNicholas Nethercote <nnethercote@mozilla.com>2019-02-15 09:10:02 +1100
committerNicholas Nethercote <nnethercote@mozilla.com>2019-02-18 09:46:33 +1100
commitf8801f3bf641f0277087e6621d09f9a6a373b36c (patch)
treed58803ac7c531e5911f4f3e17d843f80ac401708 /src/rustllvm/RustWrapper.cpp
parentd26bf742db0754893567401e49ae8b016c878a92 (diff)
downloadrust-f8801f3bf641f0277087e6621d09f9a6a373b36c.tar.gz
rust-f8801f3bf641f0277087e6621d09f9a6a373b36c.zip
Remove `LazyTokenStream`.
It's present within `Token::Interpolated` as an optimization, so that if
a nonterminal is converted to a `TokenStream` multiple times, the
first-computed value is saved and reused.

But in practice it's not needed. `interpolated_to_tokenstream()` is a
cold function: it's only called a few dozen times while compiling rustc
itself, and a few hundred times across the entire `rustc-perf` suite.
Furthermore, when it is called, it is almost always the first
conversion, so no benefit is gained from it.

So this commit removes `LazyTokenStream`, along with the now-unnecessary
`Token::interpolated()`.

As well as a significant simplification, the removal speeds things up
slightly, mostly due to not having to `drop` the `LazyTokenStream`
instances.
Diffstat (limited to 'src/rustllvm/RustWrapper.cpp')
0 files changed, 0 insertions, 0 deletions