about summary refs log tree commit diff
path: root/compiler/rustc_middle/src/mir
AgeCommit message (Collapse)AuthorLines
2021-01-08Auto merge of #76896 - spastorino:codegen-inline-fns2, r=davidtwco,wesleywiserbors-22/+18
Do not make local copies of inline fns in debug mode r? `@wesleywiser` cc `@rust-lang/wg-incr-comp` If this is correct it supersedes https://github.com/rust-lang/rust/pull/76889 Related to #54089
2021-01-04Simplify the `optimize_mir` queryoli-1/+1
2021-01-04Differentiate between the availability of ctfe MIR and runtime MIRoli-1/+1
2021-01-04Keep an unoptimized duplicate of `const fn` aroundoli-0/+9
This allows CTFE to reliably detect UB, as otherwise optimizations may hide UB.
2021-01-03use PlaceRef more consistently instead of loosely coupled local+projectionRalf Jung-9/+12
2020-12-29don't redundantly repeat field namesMatthias Krüger-2/+2
2020-12-28Auto merge of #80439 - Dylan-DPC:rollup-rdxcvon, r=Dylan-DPCbors-8/+2
Rollup of 11 pull requests Successful merges: - #79662 (Move some more code out of CodegenBackend::{codegen_crate,link}) - #79815 (Update RELEASES.md for 1.49.0) - #80284 (Suggest fn ptr rather than fn item and suggest to use `Fn` trait bounds rather than the unique closure type in E0121) - #80331 (Add more comments to trait queries) - #80344 (use matches!() macro in more places) - #80353 (BTreeMap: test split_off (and append) more thoroughly) - #80362 (Document rustc_macros on nightly-rustc) - #80399 (Remove FIXME in rustc_privacy) - #80408 (Sync rustc_codegen_cranelift) - #80411 (rustc_span: Remove `Symbol::with`) - #80434 (bootstrap: put the component name in the tarball temp dir path) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2020-12-24use matches!() macro in more placesMatthias Krüger-8/+2
2020-12-20Cache result ofDániel Buga-3/+73
2020-12-18Improve comment and move code upWesley Wiser-10/+11
2020-12-17Auto merge of #79840 - dvtkrlbs:issue-79667, r=oli-obkbors-1/+0
Remove memoization leftovers from constant evaluation machine Closes #79667
2020-12-15Auto merge of #78068 - RalfJung:union-safe-assign, r=nikomatsakisbors-3/+27
consider assignments of union field of ManuallyDrop type safe Assigning to `Copy` union fields is safe because that assignment will never drop anything. However, with https://github.com/rust-lang/rust/pull/77547, unions may also have `ManuallyDrop` fields, and their assignments are currently still unsafe. That seems unnecessary though, as assigning `ManuallyDrop` does not drop anything either, and is thus safe even for union fields. I assume this will at least require FCP.
2020-12-09Extra assertions in eval_body_using_ecx to disallow queries forTunahan Karlibas-1/+0
functions that does allocations
2020-12-06Do not make local copies of inline fns in debug modeSantiago Pastorino-12/+7
2020-12-06[mir-opt] Allow debuginfo to be generated for a constant or a PlaceWesley Wiser-9/+28
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-28expand iter_projections commentRalf Jung-0/+4
2020-11-26Fix new 'unnecessary trailing semicolon' warningsAaron Hill-3/+3
2020-11-26Rollup merge of #79365 - richkadel:llvm-cov-map-version-4, r=wesleywiserJonas Schievink-3/+3
Upgrades the coverage map to Version 4 Changes the coverage map injected into binaries compiled with `-Zinstrument-coverage` to LLVM Coverage Mapping Format, Version 4 (from Version 3). Note, binaries compiled with this version will require LLVM tools from at least LLVM Version 11. r? ``@wesleywiser``
2020-11-25fix URLs in doc commentRich Kadel-3/+3
The angle brackets were confusing my IDE and I thought they were unnecessary. I was wrong.
2020-11-25Auto merge of #79336 - camelid:rename-feature-oibit-to-auto, r=oli-obkbors-1/+1
Rename `optin_builtin_traits` to `auto_traits` They were originally called "opt-in, built-in traits" (OIBITs), but people realized that the name was too confusing and a mouthful, and so they were renamed to just "auto traits". The feature flag's name wasn't updated, though, so that's what this PR does. There are some other spots in the compiler that still refer to OIBITs, but I don't think changing those now is worth it since they are internal and not particularly relevant to this PR. Also see <https://rust-lang.zulipchat.com/#narrow/stream/131828-t-compiler/topic/opt-in.2C.20built-in.20traits.20(auto.20traits).20feature.20name>. r? `@oli-obk` (feel free to re-assign if you're not the right reviewer for this)
2020-11-24Use the name "auto traits" everywhere in the compilerCamelid-1/+1
Goodbye, OIBIT!
2020-11-23Updated links to LLVM 11 docs and typesRich Kadel-3/+3
2020-11-23Rollup merge of #79080 - camelid:mir-visit-debuginfo-project, r=jonas-schievinkJonas Schievink-5/+8
MIR visitor: Don't treat debuginfo field access as a use of the struct Fixes #77454. r? `@jonas-schievink`
2020-11-22Add comment and remove obsolete special caseCamelid-0/+1
2020-11-22refactor unsafety checking of placesRalf Jung-1/+3
2020-11-21add function to iterate through all sub-places, and add PlaceRef::tyRalf Jung-0/+18
2020-11-20needs -> might needRalf Jung-1/+1
2020-11-20consider assignments of union field of ManuallyDrop type safeRalf Jung-3/+3
2020-11-18Rollup merge of #79079 - camelid:mir-visit-docs, r=matthewjasperMara Bos-62/+62
Turn top-level comments into module docs in MIR visitor
2020-11-17Auto merge of #78779 - LeSeulArtichaut:ty-visitor-return, r=oli-obkbors-12/+18
Introduce `TypeVisitor::BreakTy` Implements MCP rust-lang/compiler-team#383. r? `@ghost` cc `@lcnr` `@oli-obk` ~~Blocked on FCP in rust-lang/compiler-team#383.~~
2020-11-17Rollup merge of #79027 - tmiasko:inline-always-live-locals, r=oli-obkMara Bos-1/+3
Limit storage duration of inlined always live locals Closes #76375.
2020-11-16wordslcnr-30/+14
2020-11-16compiler: fold by valueBastian Kauschke-49/+45
2020-11-15MIR visitor: Don't treat debuginfo field access as a use of the structCamelid-5/+7
2020-11-15Turn top-level comments into module docs in MIR visitorCamelid-62/+62
2020-11-15Limit storage duration of inlined always live localsTomasz Miąsko-1/+3
2020-11-14Introduce `TypeVisitor::BreakTy`LeSeulArtichaut-12/+18
2020-11-12review commentsVishnunarayan K I-1/+1
2020-11-12add error_occured field to ConstQualifs, fix #76064Vishnunarayan K I-2/+3
2020-11-07fix `super_visit_with` for `Terminator`Bastian Kauschke-17/+14
2020-11-06Auto merge of #78267 - richkadel:llvm-coverage-counters-2.0.3r1, r=tmandrybors-25/+70
Working expression optimization, and some improvements to branch-level source coverage This replaces PR #78040 after reorganizing the original commits (by request) into a more logical sequence of major changes. Most of the work is in the MIR `transform/coverage/` directory (originally, `transform/instrument_coverage.rs`). Note this PR includes some significant additional debugging capabilities, to help myself and any future developer working on coverage improvements or issues. In particular, there's a new Graphviz (.dot file) output for the coverage graph (the `BasicCoverageBlock` control flow graph) that provides ways to get some very good insight into the relationships between the MIR, the coverage graph BCBs, coverage spans, and counters. (There are also some cool debugging options, available via environment variable, to alter how some data in the graph appears.) And the code for this Graphviz view is actually generic... it can be used by any implementation of the Rust `Graph` traits. Finally (for now), I also now output information from `llvm-cov` that shows the actual counters and spans it found in the coverage map, and their counts (from the `--debug` flag). I found this to be enormously helpful in debugging some coverage issues, so I kept it in the test results as well for additional context. `@tmandry` `@wesleywiser` r? `@tmandry` Here's an example of the new coverage graph: * Within each `BasicCoverageBlock` (BCB), you can see each `CoverageSpan` and its contributing statements (MIR `Statement`s and/or `Terminator`s) * Each `CoverageSpan` has a `Counter` or and `Expression`, and `Expression`s show their Add/Subtract operation with nested operations. (This can be changed to show the Counter and Expression IDs instead, or in addition to, the BCB.) * The terminators of all MIR `BasicBlock`s in the BCB, including one final `Terminator` * If an "edge counter" is required (because we need to count an edge between blocks, in some cases) the edge's Counter or Expression is shown next to its label. (Not shown in the example below.) (FYI, Edge Counters are converted into a new MIR `BasicBlock` with `Goto`) <img width="1116" alt="Screen Shot 2020-10-17 at 12 23 29 AM" src="https://user-images.githubusercontent.com/3827298/96331095-616cb480-100f-11eb-8212-60f2d433e2d8.png"> r? `@tmandry` FYI: `@wesleywiser`
2020-11-06Auto merge of #77856 - GuillaumeGomez:automatic-links-lint, r=jyn514,ollie27bors-4/+4
Add non_autolinks lint Part of #77501. r? `@jyn514`
2020-11-05Addressed all feedback to dateRich Kadel-14/+0
2020-11-05Rust coverage before splitting instrument_coverage.rsRich Kadel-25/+84
2020-11-05Fix even more URLsGuillaume Gomez-4/+4
2020-11-05Rollup merge of #78742 - vn-ki:fix-issue-78655, r=oli-obkMara Bos-3/+9
make intern_const_alloc_recursive return error fix #78655 r? ``@oli-obk``
2020-11-05Rollup merge of #78733 - matthiaskrgr:cl11ppy, r=jyn514Mara Bos-1/+1
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-04make intern_const_alloc_recursive return error fix #78655Vishnunarayan K I-3/+9
2020-11-04`u128` truncation and sign extension are not just interpreter relatedoli-37/+4
2020-11-04fix a couple of clippy warnings:Matthias Krüger-1/+1
filter_next manual_strip redundant_static_lifetimes single_char_pattern unnecessary_cast unused_unit op_ref redundant_closure useless_conversion