| Age | Commit message (Collapse) | Author | Lines |
|
|
|
interpret: rename Tag/PointerTag to Prov/Provenance
We were pretty inconsistent with calling this the "tag" vs the "provenance" of the pointer; I think we should consistently call it "provenance".
r? `@oli-obk`
|
|
|
|
This reverts commit 6f8fb911ad504b77549cf3256a09465621beab9d, reversing
changes made to 7210e46dc69a4b197a313d093fe145722c248b7d.
|
|
Let's avoid using two different terms for the same thing -- let's just call it "provenance" everywhere.
In Miri, provenance consists of an AllocId and an SbTag (Stacked Borrows tag), which made this even more confusing.
|
|
|
|
|
|
interpret: get rid of MemPlaceMeta::Poison
This is achieved by refactoring the projection code (`{mplace,place,operand}_{downcast,field,index,...}`) so that we no longer need to call `assert_mem_place` in the operand handling.
|
|
Rename `debugging_opts` to `unstable_opts`
This is no longer used only for debugging options (e.g. `-Zoutput-width`, `-Zallow-features`).
Rename it to be more clear.
cc https://rust-lang.zulipchat.com/#narrow/stream/131828-t-compiler/topic/Codegen.20options.20.2F.20debugging.20options
r? `@Amanieu` cc `@nikic` `@joshtriplett`
|
|
This is no longer used only for debugging options (e.g. `-Zoutput-width`, `-Zallow-features`).
Rename it to be more clear.
|
|
|
|
Pull Derefer before ElaborateDrops
_Follow up work to #97025 #96549 #96116 #95887 #95649_
This moves `Derefer` before `ElaborateDrops` and creates a new `Rvalue` called `VirtualRef` that allows us to bypass many constraints for `DerefTemp`.
r? `@oli-obk`
|
|
MPlaceTy::dangling still exists, but now it is only called in places that
actually conceptually allocate something new, so that's fine.
|
|
|
|
I added this function in 53481a5a8fde83ed1a5d7e8302be028a4c7d8da5
|
|
Avoid some `&str` to `String` conversions
This patch removes some `&str` to `String` conversions.
|
|
|
|
don't allow ZST in ScalarInt
There are several indications that we should not ZST as a ScalarInt:
- We had two ways to have ZST valtrees, either an empty `Branch` or a `Leaf` with a ZST in it.
`ValTree::zst()` used the former, but the latter could possibly arise as well.
- Likewise, the interpreter had `Immediate::Uninit` and `Immediate::Scalar(Scalar::ZST)`.
- LLVM codegen already had to special-case ZST ScalarInt.
So I propose we stop using ScalarInt to represent ZST (which are clearly not integers). Instead, we can add new ZST variants to those types that did not have other variants which could be used for this purpose.
Based on https://github.com/rust-lang/rust/pull/98831. Only the commits starting from "don't allow ZST in ScalarInt" are new.
r? `@oli-obk`
|
|
|
|
|
|
There are several indications that we should not ZST as a ScalarInt:
- We had two ways to have ZST valtrees, either an empty `Branch` or a `Leaf` with a ZST in it.
`ValTree::zst()` used the former, but the latter could possibly arise as well.
- Likewise, the interpreter had `Immediate::Uninit` and `Immediate::Scalar(Scalar::ZST)`.
- LLVM codegen already had to special-case ZST ScalarInt.
So instead add new ZST variants to those types that did not have other variants
which could be used for this purpose.
|
|
Clarify MIR semantics of storage statements
Seems worthwhile to start closing out some of the less controversial open questions about MIR semantics. Hopefully this is fairly non-controversial - it's what we implement already, and I see no reason to do anything more restrictive. cc ``@tmiasko`` who commented on this when it was discussed in the original PR that added these docs.
|
|
|
|
|
|
Add doc comments in `rustc_middle::mir`
|
|
interpret: use AllocRange in UninitByteAccess
also use nice new format string syntax in `interpret/error.rs`, and use the `#` flag to add `0x` prefixes where applicable.
r? ``@oli-obk``
|
|
|
|
|
|
|
|
|
|
|
|
This makes it possible to mutably borrow different fields of the MIR
body without resorting to methods like `basic_blocks_local_decls_mut_and_var_debug_info`.
To preserve validity of control flow graph caches in the presence of
modifications, a new struct `BasicBlocks` wraps together basic blocks
and control flow graph caches.
The `BasicBlocks` dereferences to `IndexVec<BasicBlock, BasicBlockData>`.
On the other hand a mutable access requires explicit `as_mut()` call.
|
|
Remove erroneous doc comment
Fixes the formatting issue shown here:
<img width="803" alt="Screen Shot 2022-07-06 at 12 50 56 PM" src="https://user-images.githubusercontent.com/19642016/177612734-2d881c6a-2850-4c1b-8f1a-08339ad5bfbc.png">
|
|
|
|
|
|
also use nice new format string syntax in interpret/error.rs
|
|
Split TypeVisitable from TypeFoldable
Impl of rust-lang/compiler-team#520 following MCP approval.
r? `@ghost`
|
|
|
|
|
|
|
|
|
|
interpret: fix CheckedBinOp behavior when overflow checking is disabled
Adjusts the interpreter to https://github.com/rust-lang/rust/pull/98738.
r? `@oli-obk`
|
|
|
|
|
|
Rollup of 6 pull requests
Successful merges:
- #97300 (Implement `FusedIterator` for `std::net::[Into]Incoming`)
- #98761 (more `need_type_info` improvements)
- #98811 (Interpret: AllocRange Debug impl, and use it more consistently)
- #98847 (fix interpreter validity check on Box)
- #98854 (clean up the borrowing in rustc_hir_pretty)
- #98873 (Suggest `#[derive(Default)]` to enums with `#[default]`)
Failed merges:
r? `@ghost`
`@rustbot` modify labels: rollup
|
|
Interpret: AllocRange Debug impl, and use it more consistently
The two commits are pretty independent but it did not seem worth having two PRs for them.
r? ``@oli-obk``
|
|
Add method to mutate MIR body without invalidating CFG caches.
In addition to adding this method, a handful of passes are updated to use it. There's still quite a few passes that could in principle make use of this as well, but do not at the moment because they use `VisitorMut` or `MirPatch`, which needs additional support for this.
The method name is slightly unwieldy, but I don't expect anyone to be writing it a lot, and at least it says what it does. If anyone has a suggestion for a better name though, would be happy to rename.
r? rust-lang/mir-opt
|
|
add more `rustc_pass_by_value`
r? ```@oli-obk``` cc #98766
|
|
Clarify MIR semantics of checked binary operations
|
|
|