about summary refs log tree commit diff
path: root/compiler/rustc_mir/src/util/pretty.rs
AgeCommit message (Collapse)AuthorLines
2021-09-07Move the dataflow framework to its own crate.Camille GILLOT-1046/+0
2021-09-07Move rustc_mir::transform to rustc_mir_transform.Camille GILLOT-1/+1
2021-09-07Move rustc_mir::borrow_check to new crate rustc_borrowck.Camille GILLOT-1/+1
2021-08-26make unevaluated const substs optionallcnr-3/+5
2021-08-26require a `tcx` for `TypeVisitor`lcnr-0/+4
2021-07-25clippy::useless_formatMatthias Krüger-1/+1
2021-07-14consistently treat None-tagged pointers as ints; get rid of some deprecated ↵Ralf Jung-1/+1
Scalar methods
2021-07-14CTFE/Miri engine Pointer type overhaul: make Scalar-to-Pointer conversion ↵Ralf Jung-9/+9
infallible This resolves all the problems we had around "normalizing" the representation of a Scalar in case it carries a Pointer value: we can just use Pointer if we want to have a value taht we are sure is already normalized.
2021-07-01Auto merge of #86304 - klensy:hex-length, r=jackh726bors-1/+21
rustc_mir: calc hex number length without string allocation
2021-07-01rustc_mir: calc hex number length without string allocationklensy-1/+21
2021-06-23Use `use_verbose` for mir::ConstantDeadbeef-27/+19
2021-06-01Allow whitespace in dump_mir filterPaul Trojahn-1/+4
2021-05-17remove size field from AllocationRalf Jung-6/+6
2021-05-17Auto merge of #85178 - cjgillot:local-crate, r=oli-obkbors-2/+2
Remove CrateNum parameter for queries that only work on local crate The pervasive `CrateNum` parameter is a remnant of the multi-crate rustc idea. Using `()` as query key in those cases avoids having to worry about the validity of the query key.
2021-05-12Use () for mir_keys.Camille GILLOT-2/+2
2021-05-11Split span_to_string into span_to_diagnostic/embeddable_stringAndy Wang-4/+7
2021-03-31Add a new normalization query just for mir constantsOli Scherer-1/+5
2021-03-31Make unevaluated DefId rendering deterministicOli Scherer-1/+15
2021-03-15s/ConstantSource/ConstantKind/Oli Scherer-2/+2
2021-03-12Prepare mir::Constant for ty::Const only supporting valtreesOli Scherer-2/+7
2021-03-01Box generator-related Body fieldsDániel Buga-2/+2
2021-02-13Fix MIR pretty printer for non-local DefIdsÖmer Sinan Ağacan-13/+13
2021-01-11--emit=mir now emits both `mir_for_ctfe` and `optimized_mir` for `const fn`oli-11/+21
2021-01-05Remove a FIXME and explain the decisionoli-1/+2
2021-01-04Keep an unoptimized duplicate of `const fn` aroundoli-1/+5
This allows CTFE to reliably detect UB, as otherwise optimizations may hide UB.
2020-12-25Rollup merge of #79999 - hencrice:yenlinc/79799, r=oli-obkDylan DPC-11/+17
Refactored verbose print into a function Also handle Tuple and Array separately, which was not explicitly checked. Fixes #79799.
2020-12-23Fixed formattingYenlin Chen-3/+1
2020-12-23Addressed feedbacksYenlin Chen-17/+3
Also updated the mir-opt test output files.
2020-12-13Refactored verbose print into a functionYenlin Chen-11/+33
Also handle Tuple and Array separately, which was not explicitly checked. Fixes #79799.
2020-12-06[mir-opt] Allow debuginfo to be generated for a constant or a PlaceWesley Wiser-1/+1
Prior to this commit, debuginfo was always generated by mapping a name to a Place. This has the side-effect that `SimplifyLocals` cannot remove locals that are only used for debuginfo because their other uses have been const-propagated. To allow these locals to be removed, we now allow debuginfo to point to a constant value. The `ConstProp` pass detects when debuginfo points to a local with a known constant value and replaces it with the value. This allows the later `SimplifyLocals` pass to remove the local.
2020-11-14Introduce `TypeVisitor::BreakTy`LeSeulArtichaut-1/+1
2020-11-04s/Scalar::Raw/Scalar::Intoli-1/+1
2020-10-30Remove implicit `Continue` typeLeSeulArtichaut-1/+1
2020-10-30TypeVisitor: use `ControlFlow` in rustc_{mir,privacy,traits,typeck}LeSeulArtichaut-1/+2
2020-10-21rustc_mir: support MIR-inlining #[track_caller] functions.Eduard-Mihai Burtescu-5/+18
2020-10-21rustc_mir: track inlined callees in SourceScopeData.Eduard-Mihai Burtescu-2/+17
2020-10-06Rollup merge of #77559 - camelid:fix-rustdoc-warnings-invalid-rust-syntax, ↵Yuki Okushi-1/+2
r=lcnr Fix rustdoc warnings about invalid Rust syntax
2020-10-05Renamed tests to avoid exceeding Windows max path limitRich Kadel-7/+1
2020-10-05Updates to experimental coverage counter injectionRich Kadel-28/+53
This is a combination of 18 commits. Commit #2: Additional examples and some small improvements. Commit #3: fixed mir-opt non-mir extensions and spanview title elements Corrected a fairly recent assumption in runtest.rs that all MIR dump files end in .mir. (It was appending .mir to the graphviz .dot and spanview .html file names when generating blessed output files. That also left outdated files in the baseline alongside the files with the incorrect names, which I've now removed.) Updated spanview HTML title elements to match their content, replacing a hardcoded and incorrect name that was left in accidentally when originally submitted. Commit #4: added more test examples also improved Makefiles with support for non-zero exit status and to force validation of tests unless a specific test overrides it with a specific comment. Commit #5: Fixed rare issues after testing on real-world crate Commit #6: Addressed PR feedback, and removed temporary -Zexperimental-coverage -Zinstrument-coverage once again supports the latest capabilities of LLVM instrprof coverage instrumentation. Also fixed a bug in spanview. Commit #7: Fix closure handling, add tests for closures and inner items And cleaned up other tests for consistency, and to make it more clear where spans start/end by breaking up lines. Commit #8: renamed "typical" test results "expected" Now that the `llvm-cov show` tests are improved to normally expect matching actuals, and to allow individual tests to override that expectation. Commit #9: test coverage of inline generic struct function Commit #10: Addressed review feedback * Removed unnecessary Unreachable filter. * Replaced a match wildcard with remining variants. * Added more comments to help clarify the role of successors() in the CFG traversal Commit #11: refactoring based on feedback * refactored `fn coverage_spans()`. * changed the way I expand an empty coverage span to improve performance * fixed a typo that I had accidently left in, in visit.rs Commit #12: Optimized use of SourceMap and SourceFile Commit #13: Fixed a regression, and synched with upstream Some generated test file names changed due to some new change upstream. Commit #14: Stripping out crate disambiguators from demangled names These can vary depending on the test platform. Commit #15: Ignore llvm-cov show diff on test with generics, expand IO error message Tests with generics produce llvm-cov show results with demangled names that can include an unstable "crate disambiguator" (hex value). The value changes when run in the Rust CI Windows environment. I added a sed filter to strip them out (in a prior commit), but sed also appears to fail in the same environment. Until I can figure out a workaround, I'm just going to ignore this specific test result. I added a FIXME to follow up later, but it's not that critical. I also saw an error with Windows GNU, but the IO error did not specify a path for the directory or file that triggered the error. I updated the error messages to provide more info for next, time but also noticed some other tests with similar steps did not fail. Looks spurious. Commit #16: Modify rust-demangler to strip disambiguators by default Commit #17: Remove std::process::exit from coverage tests Due to Issue #77553, programs that call std::process::exit() do not generate coverage results on Windows MSVC. Commit #18: fix: test file paths exceeding Windows max path len
2020-10-04Fix rustdoc warnings about invalid Rust syntaxCamelid-1/+2
2020-10-04Replace `(Body, DefId)` with `Body` where possibleDylan MacKenzie-1/+1
A `Body` now contains its `MirSource`, which in turn contains the `DefId` of the item associated with the `Body`.
2020-10-04Remember the `MirSource` for each `Body`Dylan MacKenzie-37/+26
2020-09-19Stop using the `const_eval` query for initializers of staticsOliver Scherer-5/+2
As a side effect, we now represent most promoteds as `ConstValue::Scalar` again. This is useful because all implict promoteds are just references anyway and most explicit promoteds are numeric arguments to `asm!` or SIMD instructions.
2020-09-10use push(char) instead of push_str(&str) to add single chars to stringsMatthias Krüger-1/+1
clippy::single-char-push-str
2020-09-04Change ty.kind to a methodLeSeulArtichaut-2/+2
2020-08-31Add new `-Z dump-mir-spanview` optionRich Kadel-0/+11
Similar to `-Z dump-mir-graphviz`, this adds the option to write HTML+CSS files that allow users to analyze the spans associated with MIR elements (by individual statement, just terminator, or overall basic block). This PR was split out from PR #76004, and exposes an API for spanview HTML+CSS files that is also used to analyze code regions chosen for coverage instrumentation (in a follow-on PR). Rust compiler MCP rust-lang/compiler-team#278 Relevant issue: #34701 - Implement support for LLVMs code coverage instrumentation
2020-08-30mv compiler to compiler/mark-0/+932