about summary refs log tree commit diff
path: root/src/librustc_codegen_ssa/mir
AgeCommit message (Collapse)AuthorLines
2019-06-25Implement From<Local> for Place and PlaceBaseSantiago Pastorino-1/+1
2019-06-19Change `ByRef` to a struct variant to clarify its fields via namesOliver Scherer-2/+2
2019-06-19Remove the `AllocId` from `ByRef` valuesOliver Scherer-4/+4
`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.
2019-06-19Weave the alignment through `ByRef`Oliver Scherer-4/+4
2019-06-18Auto merge of #59625 - immunant:copy_variadics_typealias, r=eddybbors-25/+14
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); ```
2019-06-18Run `rustfmt --file-lines ...` for changes from previous commits.Eduard-Mihai Burtescu-8/+10
2019-06-18rustc: remove 'x: 'y bounds (except from comments/strings).Eduard-Mihai Burtescu-23/+23
2019-06-17Expose `VaListImpl` as the Rust equivalent of `__va_list_tag` and implement ↵Andrei Homescu-25/+14
Clone for it.
2019-06-12Rollup merge of #61688 - RalfJung:is-floating-point, r=cramertjMazdak Farrokhzad-2/+2
is_fp and is_floating_point do the same thing, remove the former also consistently mark all these `is_*` methods for inlining
2019-06-11is_fp and is_floating_point do the same thing, remove the formerRalf Jung-2/+2
also consistently mark all these is_* methods for inlining
2019-06-11Run `rustfmt --file-lines ...` for changes from previous commits.Eduard-Mihai Burtescu-4/+1
2019-06-11rustc_codegen_*: deny(unused_lifetimes).Eduard-Mihai Burtescu-2/+2
2019-06-07Revert "Make LocalAnalizer visitor iterate instead of recurse"Santiago Pastorino-48/+37
This reverts commit 0cfaa28bc5edda198571fca9410cbc9f71b8d17a.
2019-06-06Rollup merge of #61559 - spastorino:make-visitors-iterate, r=oli-obkMazdak Farrokhzad-37/+48
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.
2019-06-06Make LocalAnalizer visitor iterate instead of recurseSantiago Pastorino-37/+48
2019-06-05Aggregation of drive-by cosmetic changes.Alexander Regueiro-33/+34
2019-06-05Add `walk_chain`.Nicholas Nethercote-8/+1
This combines multiple `HygieneData::with` calls on a hot path.
2019-06-02query-ify const_fieldMark Mansi-7/+2
2019-06-02remove unneeded depsMark Mansi-2/+0
2019-06-02deduplicate ty::Instance constructorsMark Mansi-4/+4
2019-06-02remove reexport of rustc::ty::InstanceMark Mansi-2/+1
2019-06-01Auto merge of #61350 - RalfJung:alloc, r=oli-obkbors-1/+1
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
2019-05-31Auto merge of #60166 - oli-obk:type_name, r=eddybbors-6/+6
Make the `type_name` intrinsic deterministic cc @eddyb for the printing infrastructure cc @Centril for the deterministic (coherent?) output r? @sfackler
2019-05-30Auto merge of #61253 - nnethercote:avoid-hygiene_data-lookups, r=petrochenkovbors-1/+1
Avoid `hygiene_data` lookups These commits mostly introduce compound operations that allow two close adjacent `hygiene_data` lookups to be combined. r? @petrochenkov
2019-05-30light refactoring of global AllocMapRalf Jung-1/+1
* rename AllocKind -> GlobalAlloc. This stores the allocation itself, not just its kind. * rename the methods that allocate stuff to have consistent names.
2019-05-30Make the `type_name` intrinsic's output deterministicOliver Scherer-6/+6
2019-05-29Rollup merge of #61291 - spastorino:avoid-unneeded-bug-call, r=estebankMazdak Farrokhzad-14/+12
Avoid unneeded bug!() call r? @oli-obk
2019-05-29Introduce and use `SyntaxContext::outer_expn_info()`.Nicholas Nethercote-1/+1
It reduces two `hygiene_data` accesses to one on some hot paths.
2019-05-28Avoid unneeded bug!() callSantiago Pastorino-14/+12
2019-05-28Changes the type `mir::Mir` into `mir::Body`Claude-Alban RANÉLY-VERGÉ-DÉPRÉ-8/+8
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`
2019-05-25Make `ConstValue::Slice` solely take `[u8]` and `str`Oliver Scherer-4/+8
2019-05-25Don't use `ty::Const` without immediately interningOliver Scherer-4/+4
2019-05-23Auto merge of #60740 - petrochenkov:kw, r=nnethercotebors-3/+3
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.
2019-05-22Simplify use of keyword symbolsVadim Petrochenkov-3/+3
2019-05-22Make maybe_codegen_consume_direct iterate instead of doing recursionSantiago Pastorino-34/+36
2019-05-20Introduce `LocalInternedString::intern`.Nicholas Nethercote-5/+5
`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.
2019-05-17Rollup merge of #60862 - spastorino:get-ty-from-local_decls, r=oli-obkMazdak Farrokhzad-3/+2
Get ty from local_decls instead of using Place r? @oli-obk This is from one of your review on Place 2.0
2019-05-16Auto merge of #60693 - saleemjaffer:refactor_fntype_stuff, r=eddybbors-9/+9
refactor some `FnType` stuff to `rustc::ty::layout` Does work in the direction of #56166.
2019-05-15Get ty from local_decls instead of using PlaceSantiago Pastorino-3/+2
2019-05-14removes `AbiMethods`Saleem Jaffer-9/+9
2019-05-13Pass a `Symbol` to `check_name`, `emit_feature_err`, and related functions.Nicholas Nethercote-3/+3
2019-05-04Auto merge of #59897 - tmandry:variantful-generators, r=eddybbors-23/+49
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
2019-05-03Split out debuginfo from type info in MIR GeneratorLayoutTyler Mandry-3/+5
2019-05-01Add `ConstValue::Placeholder`varkor-0/+1
2019-05-01Auto merge of #60195 - varkor:commontypes-to-common, r=eddybbors-1/+1
Split `CommonTypes` into `CommonTypes` and `CommonLifetimes` The so-called "`CommonTypes`" contains more than just types. r? @eddyb
2019-04-26Remove region from borrow place contextsMatthew Jasper-6/+6
2019-04-26Remove BasicBlock parameter from mir visitor methodsMatthew Jasper-4/+2
2019-04-25Update existing usagesvarkor-1/+1
2019-04-25Preserve visibility scopes in stored generator localsTyler Mandry-9/+17
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.
2019-04-25Generalize discriminant info calls for generators and ADTsTyler Mandry-18/+9