about summary refs log tree commit diff
path: root/compiler/rustc_llvm/llvm-wrapper/CoverageMappingWrapper.cpp
diff options
context:
space:
mode:
authorNicholas Nethercote <n.nethercote@gmail.com>2022-03-04 13:46:56 +1100
committerNicholas Nethercote <n.nethercote@gmail.com>2022-03-07 13:41:47 +1100
commitb36924b4ac73c4eab2fd9e4cc2486d5fa1b6bf41 (patch)
tree66a10b5651ffaedb291425cd4613c54457292d18 /compiler/rustc_llvm/llvm-wrapper/CoverageMappingWrapper.cpp
parent96eb1168d177a8e37fb4866051e665e3f1988c25 (diff)
downloadrust-b36924b4ac73c4eab2fd9e4cc2486d5fa1b6bf41.tar.gz
rust-b36924b4ac73c4eab2fd9e4cc2486d5fa1b6bf41.zip
Clarify `Layout` interning.
`Layout` is another type that is sometimes interned, sometimes not, and
we always use references to refer to it so we can't take any advantage
of the uniqueness properties for hashing or equality checks.

This commit renames `Layout` as `LayoutS`, and then introduces a new
`Layout` that is a newtype around an `Interned<LayoutS>`. It also
interns more layouts than before. Previously layouts within layouts
(via the `variants` field) were never interned, but now they are. Hence
the lifetime on the new `Layout` type.

Unlike other interned types, these ones are in `rustc_target` instead of
`rustc_middle`. This reflects the existing structure of the code, which
does layout-specific stuff in `rustc_target` while `TyAndLayout` is
generic over the `Ty`, allowing the type-specific stuff to occur in
`rustc_middle`.

The commit also adds a `HashStable` impl for `Interned`, which was
needed. It hashes the contents, unlike the `Hash` impl which hashes the
pointer.
Diffstat (limited to 'compiler/rustc_llvm/llvm-wrapper/CoverageMappingWrapper.cpp')
0 files changed, 0 insertions, 0 deletions