diff options
| author | bors <bors@rust-lang.org> | 2021-09-25 11:01:13 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2021-09-25 11:01:13 +0000 |
| commit | aef45770f835d75242627f400840c78794f98072 (patch) | |
| tree | 7b5865ddded53c74df393ce6f48f5dcd48275953 /compiler/rustc_codegen_llvm/src | |
| parent | e0b68ae6c0acbdfe4c8d2b330df209ea88716eea (diff) | |
| parent | fc8edf12cd280eb1e78ccce896ca6b4fdadd1b5b (diff) | |
| download | rust-aef45770f835d75242627f400840c78794f98072.tar.gz rust-aef45770f835d75242627f400840c78794f98072.zip | |
Auto merge of #89030 - nbdd0121:box2, r=jonas-schievink
Introduce `Rvalue::ShallowInitBox` Polished version of #88700. Implements MCP rust-lang/compiler-team#460, and should allow #43596 to go forward. In short, creating an empty box is split from a nullary-op `NullOp::Box` into two steps, first a call to `exchange_malloc`, then a `Rvalue::ShallowInitBox` which transmutes `*mut u8` to a shallow-initialized `Box<T>`. This allows the `exchange_malloc` call to unwind. Details can be found in the MCP. `NullOp::Box` is not yet removed, purely to make reverting easier in case anything goes wrong as the result of this PR. If revert is needed a reversion of "Use Rvalue::ShallowInitBox for box expression" commit followed by a test bless should be sufficient. Experiments in #88700 showed a very slight compile-time perf regression due to (supposedly) slightly more time spent in LLVM. We could omit unwind edge generation (in non-`oom=panic` case) in box expression MIR construction to restore perf; but I don't think it's necessary since runtime perf isn't affected and perf difference is rather small.
Diffstat (limited to 'compiler/rustc_codegen_llvm/src')
0 files changed, 0 insertions, 0 deletions
