diff options
| author | Nicholas Nethercote <n.nethercote@gmail.com> | 2022-03-23 11:46:22 +1100 |
|---|---|---|
| committer | Nicholas Nethercote <n.nethercote@gmail.com> | 2022-03-25 12:35:52 +1100 |
| commit | 6817442ec7d9f29abfb080314f3c45ff5e3e633a (patch) | |
| tree | de02bcbb8b9359321f7bce1a99f9db92ef1376dc /compiler/rustc_codegen_gcc | |
| parent | 904e70a7b00f41b168add13a33bc14f200442ad0 (diff) | |
| download | rust-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
