rust/compiler/rustc_codegen_ssa/src/traits
Nicholas Nethercote 4852291417 Introduce ConstAllocation.
Currently some `Allocation`s are interned, some are not, and it's very
hard to tell at a use point which is which.

This commit introduces `ConstAllocation` for the known-interned ones,
which makes the division much clearer. `ConstAllocation::inner()` is
used to get the underlying `Allocation`.

In some places it's natural to use an `Allocation`, in some it's natural
to use a `ConstAllocation`, and in some places there's no clear choice.
I've tried to make things look as nice as possible, while generally
favouring `ConstAllocation`, which is the type that embodies more
information. This does require quite a few calls to `inner()`.

The commit also tweaks how `PartialOrd` works for `Interned`. The
previous code was too clever by half, building on `T: Ord` to make the
code shorter. That caused problems with deriving `PartialOrd` and `Ord`
for `ConstAllocation`, so I changed it to build on `T: PartialOrd`,
which is slightly more verbose but much more standard and avoided the
problems.
2022-03-07 08:25:50 +11:00
..
abi.rs Feat: make cg_ssa get_param borrow the builder mutable 2021-11-23 22:30:20 -05:00
asm.rs Remove deprecated LLVM-style inline assembly 2022-01-12 18:51:31 +01:00
backend.rs rename ErrorReported -> ErrorGuaranteed 2022-03-02 09:45:25 -06:00
builder.rs Revert "Auto merge of #92419 - erikdesjardins:coldland, r=nagisa" 2022-02-27 23:11:03 -05:00
consts.rs Introduce ConstAllocation. 2022-03-07 08:25:50 +11:00
coverageinfo.rs Stabilize -Z instrument-coverage as -C instrument-coverage 2022-01-01 15:57:35 -08:00
debuginfo.rs Create more accurate debuginfo for vtables. 2021-10-08 10:33:47 +02:00
declare.rs Remove DeclareMethods 2020-09-18 13:11:59 +02:00
intrinsic.rs Remove workaround for the forward progress handling in LLVM 2021-11-14 16:35:09 +01:00
misc.rs Always use llvm.used for coverage symbols 2021-08-21 10:08:05 +02:00
mod.rs Add support for const operands and options to global_asm! 2021-05-13 22:31:57 +01:00
statics.rs Always use llvm.used for coverage symbols 2021-08-21 10:08:05 +02:00
type_.rs Remove in_band_lifetimes from rustc_codegen_ssa 2021-12-15 00:41:41 -05:00
write.rs Support -C passes in NewPM 2021-05-08 10:58:08 +02:00