about summary refs log tree commit diff
path: root/src/librustc_mir/util/pretty.rs
AgeCommit message (Collapse)AuthorLines
2020-08-30mv compiler to compiler/mark-932/+0
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-06-24Improve GeneratorLayout debug outputTyler Mandry-1/+1
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-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-09Auto merge of #72036 - Dylan-DPC:rollup-ca8b0ql, r=Dylan-DPCbors-2/+4
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-08Simplify the `tcx.alloc_map` APIOliver Scherer-2/+1
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-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-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
2020-04-27Emit basic block ids for statements and terminators in MIR only in -Zverbose ↵Oliver Scherer-5/+5
mode
2020-04-26fmtRalf Jung-1/+1
2020-04-26print pointers more compactly when they are too bigRalf Jung-0/+4
2020-04-26sync alloc dump and pointer printingRalf Jung-11/+14
2020-04-24Remove `Option` from the return type of `def_kind`.Eduard-Mihai Burtescu-4/+4
2020-04-24add a few more DefKindsmark-1/+1
make Map::def_kind take LocalDefId Co-Authored-By: Vadim Petrochenkov <vadim.petrochenkov@gmail.com> crates are DefKind::Mod
2020-04-19Dogfood more or_patterns in the compilerJosh Stone-2/+2
2020-04-17Minor fix and addition to doc commentsJOE1994-0/+1
1. Fixed doc comment of struct 'rustc_middle::mir::Location' Currently, the general explanation of the struct appears at the field explanation section. I moved and changed the doc comments slightly, so that the general explanation would appear in the proper location in docs. 2. Added doc comment explaining 'rustc_mir::util::pretty::write_mir_fn' Unlike other counterparts, brief explanation for this function was missing, so I added one. Thank you for reviewing this PR :)
2020-04-04share more alloc printing code between Miri and MIR dumpingRalf Jung-26/+44
2020-04-02nix rustc_target::abi::* reexport in ty::layoutMazdak Farrokhzad-1/+2
2020-04-01Rollup merge of #70511 - ecstatic-morse:mir-dataflow-graphviz, r=davidtwcoMazdak Farrokhzad-3/+3
Add `-Z dump-mir-dataflow` flag for dumping dataflow results visualization Previously, to visualize the results of a MIR dataflow pass, one had to add a `#[rustc_mir(borrowck_graphviz_postflow)]` attribute to functions of interest. However, there is no way to specify this attribute on closures and generators, so it was impossible to view results for these MIR bodies. This PR adds a flag, `-Z dump-mir-dataflow`, which will output the dataflow results for any functions specified in `-Z dump-mir` to the output directory specified by `-Z dump-mir-dir`. This behavior is modeled on the `-Z dump-mir-graphviz` flag.
2020-03-30Use if let instead of match when only matching a single variant ↵Matthias Krüger-5/+3
(clippy::single_match) Makes code more compact and reduces nestig.
2020-03-30rustc -> rustc_middle part 3 (rustfmt)Mazdak Farrokhzad-4/+6
2020-03-30rustc -> rustc_middle part 2Mazdak Farrokhzad-4/+4
2020-03-28`dump_enabled` takes a `DefId` instead of `MirSource`Dylan MacKenzie-3/+3
2020-03-26Enable `--bless`ing of MIR dumpsOliver Scherer-20/+262
2020-03-23Rollup merge of #70080 - anyska:mir-double-space, r=oli-obkMazdak Farrokhzad-1/+1
rustc_mir: remove extra space when pretty-printing MIR.
2020-03-17rustc_mir: remove extra space when pretty-printing MIR.Ana-Maria Mihalache-1/+1
2020-03-14Rollup merge of #69802 - matthiaskrgr:cl1ppy, r=Dylan-DPCYuki Okushi-5/+5
fix more clippy findings * reduce references on match patterns (clippy::match_ref_pats) * Use writeln!(fmt, "word") instead of write!(fmt, "word\n") (clippy::write_with_newline) * libtest: remove redundant argument to writeln!() (clippy::writeln_empty_string) * remove unneeded mutable references (cippy::unnecessary_mut_passed) * libtest: declare variables as floats instead of casting them (clippy::unnecessary_cast) * rustdoc: remove redundant static lifetimes (clippy::redundant_static_lifetimes) * call .as_deref() instead of .as_ref().map(Deref::deref) (clippy::option_as_ref_deref) * iterate over a maps values directly. (clippy::for_kv_map) * rustdoc: simplify boolean condition (clippy::nonminimal_bool) * Use ?-operator in more places (clippy::question_mark, had some false negatives fixed recently) * rustdoc: Use .any(p) instead of find(p).is_some(). (clippy::search_is_some) * rustdoc: don't call into_iter() on iterator. (clippy::identity_conversion)
2020-03-12Rollup merge of #69674 - mark-i-m:assoc-fn, r=matthewjasperMazdak Farrokhzad-1/+1
Rename DefKind::Method and TraitItemKind::Method r? @eddyb, @Centril, or @matthewjasper cc #69498 #60163
2020-03-07libtest: remove redundant argument to writeln!() (clippy::writeln_empty_string)Matthias Krüger-5/+5
2020-03-07Rollup merge of #69773 - matthiaskrgr:typos, r=petrochenkovMazdak Farrokhzad-1/+1
fix various typos
2020-03-06Don't redundantly repeat field names (clippy::redundant_field_names)Matthias Krüger-1/+1
2020-03-06fix various typosMatthias Krüger-1/+1
2020-03-03DefKind::Method -> DefKind::AssocFnMark Mansi-1/+1
2020-02-29use .to_string() instead of format!() macro to create stringsMatthias Krüger-1/+1
2020-01-05Remove rustc_hir reexports in rustc::hir.Mazdak Farrokhzad-2/+2