about summary refs log tree commit diff
path: root/compiler/rustc_mir/src
AgeCommit message (Collapse)AuthorLines
2020-11-05Addressed all feedback to dateRich Kadel-14/+23
2020-11-05Injecting expressions in place of counters where helpfulRich Kadel-47/+1431
Implementing the Graph traits for the BasicCoverageBlock graph. optimized replacement of counters with expressions plus new BCB graphviz * Avoid adding coverage to unreachable blocks. * Special case for Goto at the end of the body. Make it non-reportable. Improved debugging and formatting options (from env) Don't automatically add counters to BCBs without CoverageSpans. They may still get counters but only if there are dependencies from other BCBs that have spans, I think. Make CodeRegions optional for Counters too. It is possible to inject counters (`llvm.instrprof.increment` intrinsic calls without corresponding code regions in the coverage map. An expression can still uses these counter values. Refactored instrument_coverage.rs -> instrument_coverage/mod.rs, and then broke up the mod into multiple files. Compiling with coverage, with the expression optimization, works on the json5format crate and its dependencies. Refactored debug features from mod.rs to debug.rs
2020-11-05Adds coverage graphvizRich Kadel-10/+620
2020-11-05Implemented CoverageGraph of BasicCoverageBlocksRich Kadel-199/+347
2020-11-05Splitting transform/instrument_coverage.rs into transform/coverage/...Rich Kadel-730/+766
2020-11-05Rust coverage before splitting instrument_coverage.rsRich Kadel-321/+528
2020-11-06inliner: Use substs_for_mir_bodyTomasz Miąsko-24/+16
Changes from 68965 extended the kind of instances that are being inlined. For some of those, the `instance_mir` returns a MIR body that is already expressed in terms of the types found in substitution array, and doesn't need further substitution. Use `substs_for_mir_body` to take that into account.
2020-11-05Fix even more URLsGuillaume Gomez-2/+2
2020-11-05Rollup merge of #78742 - vn-ki:fix-issue-78655, r=oli-obkMara Bos-8/+15
make intern_const_alloc_recursive return error fix #78655 r? ``@oli-obk``
2020-11-05Rollup merge of #78733 - matthiaskrgr:cl11ppy, r=jyn514Mara Bos-2/+2
fix a couple of clippy warnings: filter_next manual_strip redundant_static_lifetimes single_char_pattern unnecessary_cast unused_unit op_ref redundant_closure useless_conversion
2020-11-05inliner: Copy unevaluated constants only after successful inliningTomasz Miąsko-8/+10
Inliner copies the unevaluated constants from the callee body to the caller at the point where decision to inline is yet to be made. The constants will be unnecessary if inlining were to fail. Organize the code moving items from callee to the caller together in one place to avoid the issue.
2020-11-04make intern_const_alloc_recursive return error fix #78655Vishnunarayan K I-8/+15
2020-11-04`u128` truncation and sign extension are not just interpreter relatedoli-17/+13
2020-11-04fix a couple of clippy warnings:Matthias Krüger-2/+2
filter_next manual_strip redundant_static_lifetimes single_char_pattern unnecessary_cast unused_unit op_ref redundant_closure useless_conversion
2020-11-04Add helper for getting an `int` out of a `Scalar`oli-4/+1
2020-11-04Add `is_null` helperoli-2/+2
This is cheaper than creating a null-`ScalarInt` and comparing and then just throwing it away.
2020-11-04Replace `Scalar::zst` with a `Scalar::ZST` constantoli-4/+4
2020-11-04s/Scalar::Raw/Scalar::Intoli-11/+11
2020-11-0432 bit platforms don't have 64 bit pointersOliver Scherer-2/+3
2020-11-04Split the "raw integer bytes" part out of `Scalar`Oliver Scherer-29/+27
2020-11-03Auto merge of #78711 - m-ou-se:rollup-pxqnny7, r=m-ou-sebors-18/+36
Rollup of 7 pull requests Successful merges: - #77950 (Add support for SHA256 source file hashing) - #78624 (Sync rustc_codegen_cranelift) - #78626 (Improve errors about #[deprecated] attribute) - #78659 (Corrected suggestion for generic parameters in `function_item_references` lint) - #78687 (Suggest library/std when running all stage 0 tests) - #78699 (Show more error information in lldb_batchmode) - #78709 (Fix panic in bootstrap for non-workspace path dependencies.) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2020-11-03Rollup merge of #78659 - ayrtonm:fn-ref-lint-fix, r=oli-obkMara Bos-18/+36
Corrected suggestion for generic parameters in `function_item_references` lint This commit handles functions with generic type parameters like you pointed out as well as const generics. Also this is probably a minor thing, but the type alias you used in the example doesn't show up so the suggestion right now would be `size_of::<[u8; 16]> as fn() ->`. This is because the lint checker works with MIR instead of HIR. I don't think we can get the alias at that point, but let me know if I'm wrong and there's a way to fix this. Also I put you as the reviewer, but I'm not sure if you want to review it or if it makes more sense to ask one of the original reviewers of this lint. closes #78571
2020-11-03Auto merge of #76931 - oli-obk:const_prop_inline_lint_madness, r=wesleywiserbors-0/+13
Properly handle lint spans after MIR inlining The first commit shows what happens when we apply mir inlining and then cause lints on the inlined MIR. The second commit fixes that. r? `@wesleywiser`
2020-11-03Auto merge of #78597 - RalfJung:raw-retag, r=oli-obkbors-6/+20
Retagging: do not retag 'raw reborrows' When doing `&raw const (*raw_ptr).field`, we do not want any retagging; the original provenance should be fully preserved. Fixes https://github.com/rust-lang/miri/issues/1608 Test added by https://github.com/rust-lang/miri/pull/1614 Not sure whom to ask for review on this... `@oli-obk` can you have a look? Or maybe highfive makes a good choice.^^
2020-11-02revert #75443 update mir validatorBastian Kauschke-75/+21
2020-11-01Corrected suggestion for generic parameters in `function_item_references` lintAyrton-18/+36
This lint was incorrectly suggesting casting a function to a pointer without specifying generic type parameters or const generics. This would cause a compiler error since the missing parameters couldn't be inferred. This commit fixed the suggestion and added a few tests with generics.
2020-11-02inliner: Remove redundant loopTomasz Miąsko-77/+60
No functional changes intended.
2020-11-02Auto merge of #78592 - fpoli:nll-facts-dir, r=matthewjasperbors-2/+2
Add option to customize the nll-facts' folder location This PR adds a `nll-facts-dir` option to specify the location of the directory in which NLL facts are dumped into. It works the same way `dump-mir-dir` controls the location used by the `dump-mir` option.
2020-10-31Assert that locals have storage when usedTomasz Miąsko-12/+21
The validator in visit_local asserts that local has a stroage when used, but visit_local is never called so validation is ineffective. Use super_statement and super_terminator to ensure that locals are visited.
2020-10-31Retagging: do not retag 'raw reborrows'Ralf Jung-6/+20
2020-10-31Rollup merge of #78577 - tmiasko:validate-aliasing, r=jonas-schievinkMara Bos-5/+40
validator: Extend aliasing check to a call terminator
2020-10-30Auto merge of #78182 - LeSeulArtichaut:ty-visitor-contolflow, r=lcnr,oli-obkbors-31/+41
TypeVisitor: use `std::ops::ControlFlow` instead of `bool` Implements MCP rust-lang/compiler-team#374. Blocked on FCP in rust-lang/compiler-team#374. r? `@lcnr` cc `@jonas-schievink`
2020-10-30Add option to customize the nll-facts' folder locationFederico Poli-2/+2
2020-10-30Remove implicit `Continue` typeLeSeulArtichaut-7/+7
2020-10-30Use `ControlFlow::is{break,continue}`LeSeulArtichaut-2/+2
2020-10-30TypeVisitor: use `ControlFlow` in rustc_{mir,privacy,traits,typeck}LeSeulArtichaut-31/+41
2020-10-29Link to pass docs from NRVO module docsCamelid-0/+2
2020-10-30validator: Extend aliasing check to a call terminatorTomasz Miąsko-5/+40
2020-10-29Rollup merge of #78494 - bugadani:typo2, r=jonas-schievinkYuki Okushi-3/+3
Fix typos
2020-10-29Rollup merge of #78475 - RalfJung:validity-comment, r=oli-obkYuki Okushi-2/+1
fix a comment in validity check A few things changed since that comment was written; update it to the current reality. r? @oli-obk
2020-10-28Fix typosDániel Buga-3/+3
2020-10-28fix a comment in validity checkRalf Jung-2/+1
2020-10-28Rollup merge of #78351 - RalfJung:validity-unsafe-cell, r=oli-obkDylan DPC-123/+119
Move "mutable thing in const" check from interning to validity This moves the check for mutable things (such as `UnsafeCell` or `&mut`) in a`const` from interning to validity. That means we can give more targeted error messages (pointing out *where* the problem lies), and we can simplify interning a bit. Also fix the interning mode used for promoteds in statics. r? @oli-obk
2020-10-28Rollup merge of #78152 - spastorino:separate-unsized-locals, r=oli-obkDylan DPC-6/+11
Separate unsized locals Closes #71694 Takes over again #72029 and #74971 cc @RalfJung @oli-obk @pnkfelix @eddyb as they've participated in previous reviews of this PR.
2020-10-27Use unsized_feature_enabled helper functionSantiago Pastorino-6/+9
2020-10-27is -> are bothSantiago Pastorino-1/+1
2020-10-27or -> andSantiago Pastorino-1/+1
2020-10-27Add unsized_fn_params featureSantiago Pastorino-6/+8
2020-10-27Auto merge of #76269 - ayrtonm:function-reference-lint, r=oli-obkbors-0/+207
added a lint against function references this lint suggests casting function references to `*const ()` closes #75239 r? `@RalfJung`
2020-10-27Added suggestion to `function_item_references` lint and fixed warning messageAyrton-10/+17
Also updated tests accordingly and tweaked some wording in the lint declaration.