rust/compiler/rustc_codegen_cranelift/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
..
abi fix gcc, cranelift build 2023-09-15 10:43:44 +02:00
debuginfo Use Freeze for SourceFile.lines 2023-09-07 13:05:05 +02:00
driver Remove verbose_generic_activity_with_arg 2023-09-10 17:47:16 +02:00
intrinsics cleanup op_to_const a bit; rename ConstValue::ByRef → Indirect 2023-09-14 07:27:30 +02:00
optimize Merge commit '598f0909568a51de8a2d1148f55a644fd8dffad0' into sync_cg_clif-2023-01-24 2023-01-24 18:56:42 +01:00
allocator.rs Generate better function argument names in global_allocator expansion 2023-08-06 07:36:05 -07:00
analyze.rs Split {Idx, IndexVec, IndexSlice} into their own modules 2023-04-24 13:53:35 +00:00
archive.rs Rewrite LLVM's archive writer in Rust 2022-11-26 19:35:32 +00:00
base.rs don't point at const usage site for resolution-time errors 2023-09-14 22:34:05 +02:00
cast.rs Merge commit 'ef07e8e60f994ec014d049a95591426fb92ebb79' into sync_cg_clif-2023-04-29 2023-04-29 12:00:43 +00:00
codegen_i128.rs Move TyCtxt::mk_x to Ty::new_x where applicable 2023-07-05 20:27:07 +01:00
common.rs Don't ICE on layout computation failure 2023-08-28 12:40:39 -07:00
compiler_builtins.rs Merge commit 'dec0daa8f6d0a0e1c702f169abb6bf3eee198c67' into sync_cg_clif-2023-03-15 2023-03-15 14:41:48 +00:00
concurrency_limiter.rs Restrict From<S> for {D,Subd}iagnosticMessage. 2023-05-03 08:44:39 +10:00
config.rs Merge commit '8830dccd1d4c74f1f69b0d3bd982a3f1fcde5807' into sync_cg_clif-2023-06-15 2023-06-15 17:56:01 +00:00
constant.rs Rollup merge of #115972 - RalfJung:const-consistency, r=oli-obk 2023-09-21 13:25:39 +02:00
discriminant.rs Remove from cranelift too. 2023-04-14 16:26:11 +00:00
global_asm.rs refactor(rustc_middle): Substs -> GenericArg 2023-07-14 13:27:35 +01:00
inline_asm.rs rename mir::Constant -> mir::ConstOperand, mir::ConstKind -> mir::Const 2023-09-21 08:12:30 +02:00
lib.rs Merge commit '8f9ac9c22d6594cf059d8e6c71d414cc5ccd7975' into sync_cg_clif-2023-08-09 2023-08-09 18:20:12 +00:00
linkage.rs Sync rustc_codegen_cranelift 'ddd4ce25535cf71203ba3700896131ce55fde795' 2021-04-30 14:49:58 +02:00
main_shim.rs refactor(rustc_middle): Substs -> GenericArg 2023-07-14 13:27:35 +01:00
num.rs Move TyCtxt::mk_x to Ty::new_x where applicable 2023-07-05 20:27:07 +01:00
pointer.rs Merge commit 'dec0daa8f6d0a0e1c702f169abb6bf3eee198c67' into sync_cg_clif-2023-03-15 2023-03-15 14:41:48 +00:00
pretty_clif.rs refactor(rustc_middle): Substs -> GenericArg 2023-07-14 13:27:35 +01:00
toolchain.rs Merge commit 'e9d1a0a7b0b28dd422f1a790ccde532acafbf193' into sync_cg_clif-2022-08-24 2022-08-24 18:40:58 +02:00
trap.rs Merge commit '8830dccd1d4c74f1f69b0d3bd982a3f1fcde5807' into sync_cg_clif-2023-06-15 2023-06-15 17:56:01 +00:00
unsize.rs const_eval and codegen: audit uses of is_zst 2023-08-29 09:03:46 +02:00
value_and_place.rs Merge commit '1eded3619d0e55d57521a259bf27a03906fdfad0' into sync_cg_clif-2023-07-22 2023-07-22 13:32:34 +00:00
vtable.rs add helper method for finding the one non-1-ZST field 2023-09-12 20:52:05 +02:00