about summary refs log tree commit diff
path: root/src/librustc_mir/dataflow
AgeCommit message (Collapse)AuthorLines
2020-08-30mv compiler to compiler/mark-6324/+0
2020-08-23 change offset from u32 to u64DPC-1/+1
2020-08-18Moved coverage counter injection from BasicBlock to Statement.Rich Kadel-0/+4
2020-08-17rust_ast::ast => rustc_astUjjwal Sharma-2/+2
2020-08-09rustc_mir: use IndexMap in BorrowSetJosh Stone-7/+7
2020-08-08Eliminate the `SessionGlobals` from `librustc_ast`.Nicholas Nethercote-3/+8
By moving `{known,used}_attrs` from `SessionGlobals` to `Session`. This means they are accessed via the `Session`, rather than via TLS. A few `Attr` methods and `librustc_ast` functions are now methods of `Session`. All of this required passing a `Session` to lots of functions that didn't already have one. Some of these functions also had arguments removed, because those arguments could be accessed directly via the `Session` argument. `contains_feature_attr()` was dead, and is removed. Some functions were moved from `librustc_ast` elsewhere because they now need to access `Session`, which isn't available in that crate. - `entry_point_type()` --> `librustc_builtin_macros` - `global_allocator_spans()` --> `librustc_metadata` - `is_proc_macro_attr()` --> `Session`
2020-08-04rustc_ast: `(Nested)MetaItem::check_name` -> `has_name`Vadim Petrochenkov-3/+3
For consistency with `Attribute::has_name` which doesn't mark the attribute as used either. Replace all uses of `check_name` with `has_name` outside of rustc
2020-07-08Stop adding unreachable basic blocks to dataflow work queueDylan MacKenzie-9/+15
Also adds some debug assertions to prevent API consumers from visiting those basic blocks by accident.
2020-07-08Add `reachable` and friends to `mir::traversal` moduleDylan MacKenzie-0/+9
2020-06-30Handle inactive enum variants in `MaybeUninitializedPlaces`Dylan MacKenzie-23/+88
2020-06-26Handle stores to projections correctly in liveness analysisDylan MacKenzie-2/+25
Previously, we were too conservative and `x.field = 4` was treated as a "use" of `x`.
2020-06-21Make is_freeze and is_copy_modulo_regions take TyCtxtAtRalf Jung-1/+1
2020-06-16rename location field of Drop terminators to placeRalf Jung-9/+9
2020-06-12Rollup merge of #73033 - Amanieu:asm-tls, r=oli-obkDylan DPC-1/+1
Fix #[thread_local] statics as asm! sym operands The `asm!` RFC specifies that `#[thread_local]` statics may be used as `sym` operands for inline assembly. This also fixes a regression in the handling of `#[thread_local]` during monomorphization which caused link-time errors with multiple codegen units, most likely introduced by #71192. r? @oli-obk
2020-06-10Fix testAaron Hill-0/+2
2020-06-10Track span of function in method calls, and use this in #[track_caller]Aaron Hill-1/+2
Fixes #69977 When we parse a chain of method calls like `foo.a().b().c()`, each `MethodCallExpr` gets assigned a span that starts at the beginning of the call chain (`foo`). While this is useful for diagnostics, it means that `Location::caller` will return the same location for every call in a call chain. This PR makes us separately record the span of the function name and arguments for a method call (e.g. `b()` in `foo.a().b().c()`). This `Span` is passed through HIR lowering and MIR building to `TerminatorKind::Call`, where it is used in preference to `Terminator.source_info.span` when determining `Location::caller`. This new span is also useful for diagnostics where we want to emphasize a particular method call - for an example, see https://github.com/rust-lang/rust/pull/72389#discussion_r436035990
2020-06-08Revert #71956Dylan MacKenzie-8/+234
2020-06-07rename FalseEdges -> FalseEdgeRalf Jung-3/+3
2020-06-07Rollup merge of #72989 - pnkfelix:revert-pr-71840, r=matthewjasperDylan DPC-8/+7
Revert pr 71840 Revert7 PR #71840 to fix issue #72470 This will need a backport to beta if we do not want #72470 to hit stable.
2020-06-06Fix #[thread_local] statics as asm! sym operandsAmanieu d'Antras-1/+1
2020-06-04placate tidy.Felix S. Klock II-1/+1
2020-06-04Revert "Reduce the number of drop-flag assignments in unwind paths"Felix S. Klock II-1/+4
This reverts commit 54aa418a6082b364b90feee70b07381ea266c4d5.
2020-06-04Revert "Address review comments"Felix S. Klock II-6/+2
This reverts commit b998497bd41d6de71ec035433247dee856d1f3a5.
2020-06-02Rename the crates in source codeVadim Petrochenkov-0/+2
2020-06-01Auto merge of #71192 - oli-obk:eager_alloc_id_canonicalization, r=wesleywiserbors-0/+2
Make TLS accesses explicit in MIR r? @rust-lang/wg-mir-opt cc @RalfJung @vakaras for miri thread locals cc @bjorn3 for cranelift fixes #70685
2020-05-30Make TLS accesses explicit in MIROliver Scherer-0/+2
2020-05-29Improve inline asm error diagnosticsAmanieu d'Antras-2/+8
2020-05-23take mir::PlaceElem by valueBastian Kauschke-5/+5
2020-05-23iterate List by valueBastian Kauschke-1/+1
2020-05-19Document assumptions made in generator transform for analysesDylan MacKenzie-0/+6
The generator transform needs to inspect all possible dataflow states. This can be done with half the number of bitset union operations if we can assume that the relevant analyses do not use "before" effects.
2020-05-19Remove `MaybeRequiresStorage`Dylan MacKenzie-234/+2
2020-05-19Add `MaybeInitializedLocals` dataflow analysisDylan MacKenzie-0/+117
2020-05-18Add asm! to MIRAmanieu d'Antras-3/+62
2020-05-09Address review commentsMatthew Jasper-2/+6
2020-05-09Reduce the number of drop-flag assignments in unwind pathsMatthew Jasper-4/+1
2020-05-09Rollup merge of #71942 - nnethercote:shrink-LocalDecl, r=matthewjasperDylan DPC-1/+1
Shrink `LocalDecl` `LocalDecl` contributes 4-8% of peak heap memory usage on a range of benchmarks. This PR reduces its size from 128 bytes to 56 bytes on 64-bit, and does some clean-ups as well. r? @matthewjasper
2020-05-08Rollup merge of #71993 - ecstatic-morse:cleanup-old-liveness, r=jonas-schievinkDylan DPC-0/+7
Remove old `util/liveness.rs` module The liveness dataflow analysis now lives in the `dataflow` module, so this one is no longer necessary. I've copied the relevant bits of the module docs for `util::liveness` to `MaybeLiveLocals`. The example in the docs is now a `mir-dataflow` test: https://github.com/rust-lang/rust/blob/a08c47310c7d49cbdc5d7afb38408ba519967ecd/src/test/ui/mir-dataflow/liveness-ptr.rs#L6-L26 The borrow-checker used the same notion of "defs" and "uses", so I've moved it into a submodule. I would have moved it to `util/def_use.rs`, since it seems generally useful, but there's already a slightly [different version](https://github.com/rust-lang/rust/blob/master/src/librustc_mir/util/def_use.rs) of the same abstraction needed for copy propagation.
2020-05-07Incorporate old module docs into `MaybeLiveLocals` docsDylan MacKenzie-0/+7
2020-05-06Add `SourceInfo::outermost`.Nicholas Nethercote-1/+1
2020-05-04Import dataflow impls via the `impls` submoduleDylan MacKenzie-6/+1
2020-05-04Export dataflow impls by nameDylan MacKenzie-4/+4
2020-05-03Use agreed upon terminology in cursor docsDylan MacKenzie-5/+5
2020-05-03Live variable analysisDylan MacKenzie-2/+141
2020-05-03Initialize the cursor with an empty stateDylan MacKenzie-4/+10
2020-05-03Support backward dataflow analysesDylan MacKenzie-639/+1075
2020-04-22Use `Body` everywhereDylan MacKenzie-2/+2
2020-04-16don't clone types that are copy (clippy::clone_on_copy)Matthias Krüger-4/+3
2020-04-09Make `MaybeStorageLive` correct for all kinds of MIR bodiesDylan MacKenzie-5/+17
Before, it ignored the first argument and marked all variables without `Storage*` annotations as dead.
2020-04-03Rollup merge of #70707 - ecstatic-morse:dataflow-graphviz-cleanup, ↵Mazdak Farrokhzad-277/+0
r=nikomatsakis Remove unused graphviz emitter This was only used by the old dataflow framework that was removed in #69644.
2020-04-02Remove unused graphviz visualizationDylan MacKenzie-277/+0
This was used by the old framework that was removed in #69644.