| Age | Commit message (Collapse) | Author | Lines |
|
|
|
|
|
`ByRef` const values have no identity beyond their value, we should not treat them as having identity. The `AllocId` often differed between equal constants, because of the way that the miri-engine evaluates constants.
|
|
|
|
Refactor C FFI variadics to more closely match their C counterparts, and add Clone implementation
We had to make some changes to expose `va_copy` and `va_end` directly to users (mainly for C2Rust, but not exclusively):
- redefine the Rust variadic structures to more closely correspond to C: `VaList` now matches `va_list`, and `VaListImpl` matches `__va_list_tag`
- add `Clone` for `VaListImpl`
- add explicit `as_va_list()` conversion function from `VaListImpl` to `VaList`
- add deref coercion from `VaList` to `VaListImpl`
- add support for the `asmjs` target
All these changes were needed for use cases like:
```Rust
let mut ap2 = va_copy(ap);
vprintf(fmt, ap2);
va_end(&mut ap2);
```
|
|
|
|
|
|
Clone for it.
|
|
is_fp and is_floating_point do the same thing, remove the former
also consistently mark all these `is_*` methods for inlining
|
|
also consistently mark all these is_* methods for inlining
|
|
|
|
|
|
This reverts commit 0cfaa28bc5edda198571fca9410cbc9f71b8d17a.
|
|
Make visitors iterate
r? @oli-obk
The second commit is not completely equivalent, unsure if the code is wrong or not. Tests pass though, otherwise we would need to iterate in the opposite direction as it happened in other parts of the code.
|
|
|
|
|
|
This combines multiple `HygieneData::with` calls on a hot path.
|
|
|
|
|
|
|
|
|
|
light refactoring of global AllocMap
* rename AllocKind -> GlobalAlloc. This stores the allocation itself, not just its kind.
* rename the methods that allocate stuff to have consistent names.
Cc @oli-obk
|
|
Make the `type_name` intrinsic deterministic
cc @eddyb for the printing infrastructure
cc @Centril for the deterministic (coherent?) output
r? @sfackler
|
|
Avoid `hygiene_data` lookups
These commits mostly introduce compound operations that allow two close adjacent `hygiene_data` lookups to be combined.
r? @petrochenkov
|
|
* rename AllocKind -> GlobalAlloc. This stores the allocation itself, not just its kind.
* rename the methods that allocate stuff to have consistent names.
|
|
|
|
Avoid unneeded bug!() call
r? @oli-obk
|
|
It reduces two `hygiene_data` accesses to one on some hot paths.
|
|
|
|
The commit should have changed comments as well.
At the time of writting, it passes the tidy and check tool.
Revisions asked by eddyb :
- Renamed of all the occurences of {visit/super}_mir
- Renamed test structures `CachedMir` to `Cached`
Fixing the missing import on `AggregateKind`
|
|
|
|
|
|
Simplify use of keyword symbols
They mirror non-keyword symbols now (see https://github.com/rust-lang/rust/pull/60630).
`keywords::MyKeyword.name()` -> `kw::MyKeyword`
`keywords::MyKeyword.ident()` -> `Ident::with_empty_ctxt(kw::MyKeyword)` (not common)
`keywords::Invalid.ident()` -> `Ident::invalid()` (more common)
Keywords are simply `Symbol` constants now, the `Keyword` struct is eliminated.
This means `kw::MyKeyword` can now be used in `match` in particular.
|
|
|
|
|
|
`LocalInternedString::intern(x)` is preferable to
`Symbol::intern(x).as_str()`, because the former involves one call to
`with_interner` while the latter involves two.
|
|
Get ty from local_decls instead of using Place
r? @oli-obk This is from one of your review on Place 2.0
|
|
refactor some `FnType` stuff to `rustc::ty::layout`
Does work in the direction of #56166.
|
|
|
|
|
|
|
|
Multi-variant layouts for generators
This allows generators to overlap fields using variants, but doesn't do any such overlapping yet. It creates one variant for every state of the generator (unresumed, returned, panicked, plus one for every yield), and puts every stored local in each of the yield-point variants.
Required for optimizing generator layouts (#52924).
There was quite a lot of refactoring needed for this change. I've done my best in later commits to eliminate assumptions in the code that only certain kinds of types are multi-variant, and to centralize knowledge of the inner mechanics of generators in as few places as possible.
This change also emits debuginfo about the fields contained in each variant, as well as preserving debuginfo about stored locals while running in the generator.
Also, fixes #59972.
Future work:
- Use this change for an optimization pass that actually overlaps locals within the generator struct (#52924)
- In the type layout fields, don't include locals that are uninitialized for a particular variant, so miri and UB sanitizers can check our memory (see https://github.com/rust-lang/rust/issues/59972#issuecomment-483058172)
- Preserve debuginfo scopes across generator yield points
|
|
|
|
|
|
Split `CommonTypes` into `CommonTypes` and `CommonLifetimes`
The so-called "`CommonTypes`" contains more than just types.
r? @eddyb
|
|
|
|
|
|
|
|
Unfortunately, this didn't have quite the effect I was hoping for.
Locals still appear visible at every point in the function, regardless
of scopes. I suspect all the rewriting of the MIR we do for the
generator transform makes these scopes less useful.
I didn't observe any regressions in behavior, but it's possible that
this change is wrong without additional changes to the MIR.
|
|
|