about summary refs log tree commit diff
path: root/compiler/rustc_codegen_gcc
diff options
context:
space:
mode:
authorNicholas Nethercote <n.nethercote@gmail.com>2022-03-23 11:46:22 +1100
committerNicholas Nethercote <n.nethercote@gmail.com>2022-03-25 12:35:52 +1100
commit6817442ec7d9f29abfb080314f3c45ff5e3e633a (patch)
treede02bcbb8b9359321f7bce1a99f9db92ef1376dc /compiler/rustc_codegen_gcc
parent904e70a7b00f41b168add13a33bc14f200442ad0 (diff)
downloadrust-6817442ec7d9f29abfb080314f3c45ff5e3e633a.tar.gz
rust-6817442ec7d9f29abfb080314f3c45ff5e3e633a.zip
Split `NamedMatch::MatchNonterminal` in two.
The `Lrc` is only relevant within `transcribe()`. There, the `Lrc` is
helpful for the non-`NtTT` cases, because the entire nonterminal is
cloned. But for the `NtTT` cases the inner token tree is cloned (a full
clone) and so the `Lrc` is of no help.

This commit splits the `NtTT` and non-`NtTT` cases, avoiding the useless
`Lrc` in the former case, for the following effect on macro-heavy
crates.
- It reduces the total number of allocations a lot.
- It increases the size of some of the remaining allocations.
- It doesn't affect *peak* memory usage, because the larger allocations
  are short-lived.

This overall gives a speed win.
Diffstat (limited to 'compiler/rustc_codegen_gcc')
0 files changed, 0 insertions, 0 deletions