about summary refs log tree commit diff
path: root/compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp
diff options
context:
space:
mode:
authorAaron Hill <aa1ronham@gmail.com>2021-12-22 14:35:17 -0500
committerAaron Hill <aa1ronham@gmail.com>2021-12-22 14:36:34 -0500
commitcac431ba750c4f079690731b976bc67d979cb8e3 (patch)
tree3f58e4c7c63c2d0c55ed31e7736927005aece152 /compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp
parente100ec5bc7cd768ec17d75448b29c9ab4a39272b (diff)
downloadrust-cac431ba750c4f079690731b976bc67d979cb8e3.tar.gz
rust-cac431ba750c4f079690731b976bc67d979cb8e3.zip
Store a `DefId` instead of an `AdtDef` in `AggregateKind::Adt`
The `AggregateKind` enum ends up in the final mir `Body`. Currently,
any changes to `AdtDef` (regardless of how significant they are)
will legitimately cause the overall result of `optimized_mir` to change,
invalidating any codegen re-use involving that mir.

This will get worse once we start hashing the `Span` inside `FieldDef`
(which is itself contained in `AdtDef`).

To try to reduce these kinds of invalidations, this commit changes
`AggregateKind::Adt` to store just the `DefId`, instead of the full
`AdtDef`. This allows the result of `optimized_mir` to be unchanged
if the `AdtDef` changes in a way that doesn't actually affect any
of the MIR we build.
Diffstat (limited to 'compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp')
0 files changed, 0 insertions, 0 deletions