about summary refs log tree commit diff
path: root/compiler/rustc_codegen_llvm/src
diff options
context:
space:
mode:
authorNicholas Nethercote <n.nethercote@gmail.com>2023-10-11 08:49:24 +1100
committerNicholas Nethercote <n.nethercote@gmail.com>2023-10-13 06:34:55 +1100
commit7d145a0fde3771662648df2de63e8f64033bf598 (patch)
treecde63d5fc5a9991aa12bb3c5de11b9aaeb3ed498 /compiler/rustc_codegen_llvm/src
parente3d8bbbfe29ab73afe1d258d6f69c2d6840a30ff (diff)
downloadrust-7d145a0fde3771662648df2de63e8f64033bf598.tar.gz
rust-7d145a0fde3771662648df2de63e8f64033bf598.zip
Merge `print_*` functions.
The handling of the `PpMode` variants is currently spread across three
functions: `print_after_parsing`, `print_after_hir_lowering`, and
`print_with_analysis`. Each one handles some of the variants. This split
is primarily because `print_after_parsing` has slightly different
arguments to the other two.

This commit changes the structure. It merges the three functions into a
single `print` function, and encapsulates the different arguments in a
new enum `PrintExtra`.

Benefits:
- The code is a little shorter.
- All the `PpMode` variants are handled in a single `match`, with no
  need for `unreachable!` arms.
- It enables the trait removal in the subsequent commit by reducing
  the number of `call_with_pp_support_ast` call sites from two to one.
Diffstat (limited to 'compiler/rustc_codegen_llvm/src')
0 files changed, 0 insertions, 0 deletions