rust/compiler/rustc_builtin_macros/src
bors 78a46efff0 Auto merge of #88832 - pcwalton:debug-unit-variant-fast-path, r=oli-obk
Introduce a fast path that avoids the `debug_tuple` abstraction when deriving Debug for unit-like enum variants.

The intent here is to allow LLVM to remove the switch entirely in favor of an
indexed load from a table of constant strings, which is likely what the
programmer would write in C. Unfortunately, LLVM currently doesn't perform this
optimization due to a bug, but there is [a
patch](https://reviews.llvm.org/D109565) that fixes this issue. I've verified
that, with that patch applied on top of this commit, Debug for unit-like tuple
variants becomes a load, reducing the O(n) code bloat to O(1).

Note that inlining `DebugTuple::finish()` wasn't enough to allow LLVM to
optimize the code properly; I had to avoid the abstraction entirely. Not using
the abstraction is likely better for compile time anyway.

Part of #88793.

r? `@oli-obk`
2021-09-17 01:00:11 +00:00
..
deriving Introduce a fast path that avoids the debug_tuple abstraction when deriving 2021-09-10 12:07:03 -07:00
format_foreign
asm.rs Rollup merge of #88209 - Amanieu:asm_in_underscore, r=nagisa 2021-09-11 08:23:40 -07:00
assert.rs
cfg_accessible.rs
cfg_eval.rs cfg_eval: Replace multiple unwraps with a single unwrap 2021-06-20 18:54:45 +03:00
cfg.rs
cmdline_attrs.rs
compile_error.rs
concat_idents.rs
concat.rs
derive.rs Various diagnostics clean ups/tweaks 2021-07-19 08:43:35 -07:00
env.rs
format_foreign.rs
format.rs Rollup merge of #87441 - ibraheemdev:i-86865, r=cjgillot 2021-09-10 08:23:15 -07:00
global_allocator.rs Remove box syntax from rustc_builtin_macros 2021-08-18 09:25:26 +02:00
lib.rs Remove box syntax from rustc_builtin_macros 2021-08-18 09:25:26 +02:00
llvm_asm.rs
log_syntax.rs
panic.rs
proc_macro_harness.rs Compute proc_macros in resolutions. 2021-09-01 20:13:16 +02:00
source_util.rs Compute a better lint_node_id during expansion 2021-07-17 23:03:56 -05:00
standard_library_imports.rs Use LocalExpnId where possible. 2021-07-17 19:41:02 +02:00
test_harness.rs Remove Session.used_attrs and move logic to CheckAttrVisitor 2021-08-21 13:27:27 -05:00
test.rs proof of concept add test type on prints 2021-05-03 15:22:19 +02:00
trace_macros.rs
util.rs