about summary refs log tree commit diff
path: root/src/librustc_mir/util
AgeCommit message (Collapse)AuthorLines
2020-08-30mv compiler to compiler/mark-3270/+0
2020-08-26Auto merge of #75893 - Dylan-DPC:fix/offset-to-u64, r=oli-obkbors-10/+3
change offset from u32 to u64 References #71696 r? @oli-obk (closed the earlier pr because the rebase got messed up)
2020-08-25tidyDPC-1/+1
2020-08-25cleanupDPC-5/+1
2020-08-25removed not-needed conversionDPC-2/+1
2020-08-24hir: consistent use and naming of lang itemsDavid Wood-3/+3
This commit adjusts the naming of various lang items so that they are consistent and don't include prefixes containing the target or "LangItem". In addition, lang item variants are no longer exported from the `lang_items` module. Signed-off-by: David Wood <david@davidtw.co>
2020-08-23 change offset from u32 to u64DPC-6/+4
2020-08-20Suppress ty::Float in MIR comments of ty::ConstLzu Tao-1/+1
Already covered by MIR constant comments
2020-08-20Suppress MIR comments of Unit typeLzu Tao-0/+4
2020-08-20Suppress MIR comments for FnDef in ty::ConstLzu Tao-0/+1
2020-08-17Suppress verbose MIR comments for trivial typesAustin Lasher-8/+18
2020-08-08Miri: Renamed "undef" to "uninit"Philippe Nadon-3/+3
Renamed remaining references to "undef" to "uninit" when referring to Miri. Impacted directories are: - src/librustc_codegen_llvm/consts.rs - src/librustc_middle/mir/interpret/ - src/librustc_middle/ty/print/pretty.rs - src/librustc_mir/ - src/tools/clippy/clippy_lints/src/consts.rs Upon building Miri based on the new changes it was verified that no changes needed to be made with the Miri project. Related issue #71193
2020-07-30Auto merge of #74876 - oli-obk:lumberjack_disable, r=RalfJungbors-19/+31
Replace all uses of `log::log_enabled` with `Debug` printers cc @RalfJung this touches a bunch of logging in the miri engine. There are some visual changes, mainly that in several cases we stop prepending lines with the module path and just have a newline.
2020-07-29Move mir-opt tests to toplevelXavier Denis-2/+9
2020-07-29add crate name to mir dumpsXavier Denis-1/+2
2020-07-28Replace write-to-vec hack by introducing a display renderer for allocationsOliver Scherer-19/+31
2020-07-15WithOptConstParam::dummy -> WithOptConstParam::unknownBastian Kauschke-1/+1
2020-07-15improve namingBastian Kauschke-1/+1
2020-07-15InstanceDef::ItemBastian Kauschke-1/+4
2020-07-05Shrink ParamEnv to 16 bytesMark Rousskov-1/+1
2020-06-24Improve GeneratorLayout debug outputTyler Mandry-1/+1
2020-06-16rename location field of Drop terminators to placeRalf Jung-3/+3
2020-06-11Rollup merge of #73182 - Aaron1011:feature/call-fn-span, r=matthewjasperDylan DPC-0/+2
Track span of function in method calls, and use this in #[track_caller] 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-10Track span of function in method calls, and use this in #[track_caller]Aaron Hill-0/+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-08Show `SyntaxContext` in formatted `Span` debug outputAaron Hill-6/+16
This is only really useful in debug messages, so I've switched to calling `span_to_string` in any place that causes a `Span` to end up in user-visible output.
2020-06-07Rollup merge of #72989 - pnkfelix:revert-pr-71840, r=matthewjasperDylan DPC-19/+38
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-04Revert "Defer creating drop trees in MIR lowering until leaving that scope"Felix S. Klock II-8/+3
This reverts commit 611988551fba1bcbb33ae2e1e0171cb8d2e70d5a.
2020-06-04Revert "Reduce the number of drop-flag assignments in unwind paths"Felix S. Klock II-11/+35
This reverts commit 54aa418a6082b364b90feee70b07381ea266c4d5.
2020-06-02Rename the crates in source codeVadim Petrochenkov-0/+1
2020-06-02Make things build againVadim Petrochenkov-1/+1
2020-05-16Improve documentation for drop elaborationJonas Schievink-8/+87
2020-05-13use `require_lang_item` over `unwrap`.Bastian Kauschke-4/+3
2020-05-10Rollup merge of #71840 - matthewjasper:drop-trees, r=oli-obkRalf Jung-38/+19
Rework MIR drop tree lowering This PR changes how drops are generated in MIR construction. This is the first half of the fix for #47949. Rather than generating the drops for a given unwind/break/continue/return/generator drop path as soon as they are needed, the required drops are recorded and get generated later. The motivation for this is * It simplifies the caching scheme, because it's now possible to walk up the currently scheduled drop tree to recover state. * The basic block order for MIR more closely resembles execution order. This PR also: * Highlights cleanup blocks in the graphviz MIR output. * Removes some unnecessary drop flag assignments.
2020-05-09Rollup merge of #71508 - oli-obk:alloc_map_unlock, r=RalfJungRalf Jung-2/+1
Simplify the `tcx.alloc_map` API This PR changes all functions that require manually locking the `alloc_map` to functions on `TyCtxt` that lock the map internally. In the same step we make the `TyCtxt::alloc_map` field private. r? @RalfJung
2020-05-09Reduce the number of drop-flag assignments in unwind pathsMatthew Jasper-35/+11
2020-05-09Defer creating drop trees in MIR lowering until leaving that scopeMatthew Jasper-3/+8
2020-05-09Auto merge of #72036 - Dylan-DPC:rollup-ca8b0ql, r=Dylan-DPCbors-5/+7
Rollup of 8 pull requests Successful merges: - #70834 (Add core::future::{pending,ready}) - #71839 (Make BTreeMap::new and BTreeSet::new const) - #71890 (Simplify the error Registry methods a little) - #71942 (Shrink `LocalDecl`) - #71947 (Dead-code pass highlights too much of impl functions) - #71981 (Fix `strip-priv-imports` pass name in the rustdoc documentation) - #72018 (Fix canonicalization links) - #72031 (Better documentation for io::Read::read() return value) Failed merges: r? @ghost
2020-05-09Rollup merge of #71942 - nnethercote:shrink-LocalDecl, r=matthewjasperDylan DPC-5/+7
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-08Auto merge of #71418 - hbina:rename_miri_undef, r=RalfJungbors-1/+1
Renamed "undef" -> "uninit" 1. InvalidUndefBytes -> InvalidUninitBytes 2. ScalarMaybeUndef -> ScalarMaybeUninit 3. UndefMask -> InitMask Related issue #71193
2020-05-08Simplify the `tcx.alloc_map` APIOliver Scherer-2/+1
2020-05-07Remove old `util/liveness.rs` moduleDylan MacKenzie-327/+0
The liveness dataflow analysis now lives in `librustc_mir/dataflow/impls/liveness.rs`. The borrow-checker has an abstraction around of "defs" and "uses" that I've made module private. I would have moved it to `util/def_use.rs`, but there's a slightly different abstraction used for copy propagation with that name.
2020-05-07Renamed "undef" stuff to "uninit"Hanif Bin Ariffin-1/+1
1. InvalidUndefBytes -> InvalidUninitBytes 2. ScalarMaybeUndef -> ScalarMaybeUninit 3. UndefMask -> InitMask Related issue #71193
2020-05-06Shrink `LocalDecl` by 16 bytes.Nicholas Nethercote-2/+4
By boxing `user_ty`.
2020-05-06Improve `LocalDecl` creation.Nicholas Nethercote-2/+2
This commit adds some new `LocalDecl` methods: - `with_source_info`, a most general constructor. - `new`, a variant of `with_source_info` which represents the most common use case. - `internal` a modifying method (like the already present `immutable`). It removes some old `LocalDecl` methods: - `new_internal` and `new_local`, because they're subsumed by the new methods. - `new_return_place`, because it was identical to `new_temp`. Finally, it cleans up all the use sites.
2020-05-06Add `SourceInfo::outermost`.Nicholas Nethercote-1/+1
2020-05-03Add `MutatingUseContext::Yield`Dylan MacKenzie-0/+1
...emulating `MutatingUseContext::Call`
2020-04-30Rollup merge of #71590 - RalfJung:mir-dump-pointers, r=oli-obkTyler Mandry-11/+18
MIR dump: print pointers consistently with Miri output This makes MIR allocation dump pointer printing consistent with Miri output: both use hexadecimal offsets with a `0x` prefix. To save some space, MIR dump replaces the `alloc` prefix by `a` when necessary. I also made AllocId/Pointer printing more consistent in their Debug/Display handling, and adjusted Display printing for Scalar a bit to avoid using decimal printing when we do not know the sign with which to interpret the value (IMO using decimal then is misleading).
2020-04-28Rollup merge of #71585 - tshepang:obsolete-comment, r=Dylan-DPCDylan DPC-7/+0
remove obsolete comment Not sure if it's better to have an outdated comment or no comment at all (made obsolete by 2b9fea1300b515e0f8929bb3a09d4fb6fef3f0ea).
2020-04-28Auto merge of #71292 - marmeladema:queries-local-def-id, r=eddybbors-1/+5
Convert more queries to use `LocalDefId` This PR is based on commits in https://github.com/rust-lang/rust/pull/71215 and should partially solve #70853
2020-04-27Return a `FxHashSet<LocalDefId>` from `mir_keys` querymarmeladema-1/+5