summary refs log tree commit diff
path: root/compiler/rustc_codegen_cranelift/src/constant.rs
AgeCommit message (Collapse)AuthorLines
2024-03-16Merge commit '4cf4ffc6ba514f171b3f52d1c731063e4fc45be3' into ↵bjorn3-13/+29
sync_cg_clif-2024-03-16
2024-03-10add comments explaining where post-mono const eval errors abort compilationRalf Jung-1/+1
2024-03-08Merge commit '54cbb6e7531f95e086d5c3dd0d5e73bfbe3545ba' into ↵bjorn3-1/+7
sync_cg_clif-2024-03-08
2023-12-24Remove `Session` methods that duplicate `DiagCtxt` methods.Nicholas Nethercote-4/+4
Also add some `dcx` methods to types that wrap `TyCtxt`, for easier access.
2023-12-10remove redundant importssurechen-2/+1
detects redundant imports that can be eliminated. for #117772 : In order to facilitate review and modification, split the checking code and removing redundant imports code into two PR.
2023-12-07ctfe interpreter: extend provenance so that it can track whether a pointer ↵Ralf Jung-2/+4
is immutable
2023-11-16Merge commit 'def04540a4e2541b995195c752c751295606a388' into ↵bjorn3-12/+31
sync_cg_clif-2023-11-16
2023-10-20s/Generator/Coroutine/Oli Scherer-1/+1
2023-10-09Merge commit '81dc066758ec150b43822d4a0c84aae20fe10f40' into ↵bjorn3-5/+3
sync_cg_clif-2023-10-09
2023-09-21Rollup merge of #115972 - RalfJung:const-consistency, r=oli-obkGuillaume Gomez-3/+3
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-21rename mir::Constant -> mir::ConstOperand, mir::ConstKind -> mir::ConstRalf Jung-3/+3
2023-09-19adjust constValue::Slice to work for arbitrary slice typesRalf Jung-8/+4
2023-09-19move ConstValue into mirRalf Jung-1/+2
this way we have mir::ConstValue and ty::ValTree as reasonably parallel
2023-09-14move required_consts check to general post-mono-check functionRalf Jung-29/+7
2023-09-14make it more clear which functions create fresh AllocIdRalf Jung-13/+11
2023-09-14cleanup op_to_const a bit; rename ConstValue::ByRef → IndirectRalf Jung-2/+2
2023-09-14use AllocId instead of Allocation in ConstValue::ByRefRalf Jung-5/+9
2023-09-13make the eval() functions on our const types return the resulting valueRalf Jung-26/+4
2023-08-24when terminating during unwinding, show the reason whyRalf Jung-1/+1
2023-08-20give some unwind-related terminators a more clear nameRalf Jung-2/+2
2023-07-14refactor(rustc_middle): Substs -> GenericArgMahdi Dibaiee-1/+1
2023-06-15Merge commit '8830dccd1d4c74f1f69b0d3bd982a3f1fcde5807' into ↵bjorn3-15/+15
sync_cg_clif-2023-06-15
2023-05-03Restrict `From<S>` for `{D,Subd}iagnosticMessage`.Nicholas Nethercote-4/+4
Currently a `{D,Subd}iagnosticMessage` can be created from any type that impls `Into<String>`. That includes `&str`, `String`, and `Cow<'static, str>`, which are reasonable. It also includes `&String`, which is pretty weird, and results in many places making unnecessary allocations for patterns like this: ``` self.fatal(&format!(...)) ``` This creates a string with `format!`, takes a reference, passes the reference to `fatal`, which does an `into()`, which clones the reference, doing a second allocation. Two allocations for a single string, bleh. This commit changes the `From` impls so that you can only create a `{D,Subd}iagnosticMessage` from `&str`, `String`, or `Cow<'static, str>`. This requires changing all the places that currently create one from a `&String`. Most of these are of the `&format!(...)` form described above; each one removes an unnecessary static `&`, plus an allocation when executed. There are also a few places where the existing use of `&String` was more reasonable; these now just use `clone()` at the call site. As well as making the code nicer and more efficient, this is a step towards possibly using `Cow<'static, str>` in `{D,Subd}iagnosticMessage::{Str,Eager}`. That would require changing the `From<&'a str>` impls to `From<&'static str>`, which is doable, but I'm not yet sure if it's worthwhile.
2023-04-29Merge commit 'ef07e8e60f994ec014d049a95591426fb92ebb79' into ↵bjorn3-0/+2
sync_cg_clif-2023-04-29
2023-04-20Remove WithOptconstParam.Camille GILLOT-1/+1
2023-04-06Rename `Abort` terminator to `Terminate`Gary Guo-1/+1
Unify terminology used in unwind action and terminator, and reflect the fact that a nounwind panic is triggered instead of an immediate abort is triggered for this terminator.
2023-03-29Support TLS access into dylibs on WindowsJohn Kåre Alsaker-6/+16
2023-03-15Merge commit 'dec0daa8f6d0a0e1c702f169abb6bf3eee198c67' into ↵bjorn3-2/+2
sync_cg_clif-2023-03-15
2023-03-09Introduce a no-op PlaceMention statement for `let _ =`.Camille GILLOT-0/+1
2023-03-07Remove DropAndReplace terminatorGiacomo Pasini-2/+1
PR 107844 made DropAndReplace unused, let's remove it completely from the codebase.
2023-01-23Update codegen cranelift for ConstEvalCounterBryan Garza-0/+1
2023-01-17Remove double spaces after dots in commentsMaybe Waffle-1/+1
2022-12-14Merge commit '2bb3996244cf1b89878da9e39841e9f6bf061602' into ↵bjorn3-32/+50
sync_cg_clif-2022-12-14
2022-11-23Add `Mutability::{is_mut,is_not}`Maybe Waffle-9/+4
2022-11-19deduplicate constant evaluation in cranelift backendRalf Jung-35/+23
also sync LLVM and cranelift structure a bit
2022-11-16cleanup and dedupe CTFE and Miri error reportingRalf Jung-1/+1
2022-11-15Auto merge of #104054 - RalfJung:byte-provenance, r=oli-obkbors-2/+2
interpret: support for per-byte provenance Also factors the provenance map into its own module. The third commit does the same for the init mask. I can move it in a separate PR if you prefer. Fixes https://github.com/rust-lang/miri/issues/2181 r? `@oli-obk`
2022-11-13add is_sized method on Abi and Layout, and use itRalf Jung-1/+1
2022-11-06fix cranelift and gccRalf Jung-2/+2
2022-10-27Update toolingMaybe Waffle-2/+1
2022-10-23Merge commit '266e96785ab71834b917bf474f130a6d8fdecd4b' into ↵bjorn3-48/+39
sync_cg_clif-2022-10-23
2022-10-06Remove `mir::CastKind::Misc`ouz-a-1/+10
2022-09-23rename Unevaluated to UnevaluatedConstb-naber-1/+1
2022-09-22introduce mir::Unevaluatedb-naber-11/+2
2022-09-15nitsb-naber-11/+1
2022-09-14address review againb-naber-19/+1
2022-09-13cranelift changesb-naber-49/+59
2022-09-13use ty::Unevaluated<'tcx, ()> in type systemb-naber-6/+13
2022-09-06Generalize the Assume intrinsic statement to a general Intrinsic statementOli Scherer-4/+5
2022-09-06Lower the assume intrinsic to a MIR statementOli Scherer-0/+1