rust/compiler/rustc_codegen_ssa/src
Guillaume Gomez 208f6ed95c
Rollup merge of #115972 - RalfJung:const-consistency, r=oli-obk
rename mir::Constant -> mir::ConstOperand, mir::ConstKind -> mir::Const

Also, be more consistent with the `to/eval_bits` methods... we had some that take a type and some that take a size, and then sometimes the one that takes a type is called `bits_for_ty`.

Turns out that `ty::Const`/`mir::ConstKind` carry their type with them, so we don't need to even pass the type to those `eval_bits` functions at all.

However this is not properly consistent yet: in `ty` we have most of the methods on `ty::Const`, but in `mir` we have them on `mir::ConstKind`. And indeed those two types are the ones that correspond to each other. So `mir::ConstantKind` should actually be renamed to `mir::Const`. But what to do with `mir::Constant`? It carries around a span, that's really more like a constant operand that appears as a MIR operand... it's more suited for `syntax.rs` than `consts.rs`, but the bigger question is, which name should it get if we want to align the `mir` and `ty` types? `ConstOperand`? `ConstOp`? `Literal`? It's not a literal but it has a field called `literal` so it would at least be consistently wrong-ish...

``@oli-obk`` any ideas?
2023-09-21 13:25:39 +02:00
..
back treat host effect params as erased generics in codegen 2023-09-14 07:34:35 +00:00
debuginfo the Const::eval_bits methods don't need to be given the Ty 2023-09-20 07:27:21 +02:00
mir Rollup merge of #115972 - RalfJung:const-consistency, r=oli-obk 2023-09-21 13:25:39 +02:00
traits Deduplicate inlined function debug info, but create a new lexical scope to child subsequent scopes and variables from colliding 2023-09-01 14:27:21 -07:00
base.rs const_eval and codegen: audit uses of is_zst 2023-08-29 09:03:46 +02:00
codegen_attrs.rs Correct typo 2023-09-08 12:46:10 +01:00
common.rs move ConstValue into mir 2023-09-19 11:11:02 +02:00
errors.rs don't point at const usage site for resolution-time errors 2023-09-14 22:34:05 +02:00
glue.rs Use size_of_val instead of manual calculation 2023-03-17 19:55:49 -07:00
lib.rs Remove unnecessary feature gates 2023-08-12 00:21:04 -04:00
meth.rs cg_ssa: remove pointee types and pointercast/bitcast-of-ptr 2023-07-29 13:18:20 -04:00
mono_item.rs inline format!() args up to and including rustc_codegen_llvm 2023-07-30 14:22:50 +02:00
target_features.rs add details for csky-unknown-linux-gnuabiv2 and add docs 2023-08-14 23:02:37 +08:00