about summary refs log tree commit diff
path: root/src/librustc_mir/transform/inline.rs
AgeCommit message (Collapse)AuthorLines
2020-08-30mv compiler to compiler/mark-804/+0
2020-08-13merge `as_local_hir_id` with `local_def_id_to_hir_id`Bastian Kauschke-3/+3
2020-07-22Normalize opaque types when converting `ParamEnv` to `Reveal::All`Aaron Hill-1/+1
Fixes #65918
2020-06-29add spans to injected coverage countersRich Kadel-1/+8
added regions with counter expressions and counters. Added codegen_llvm/coverageinfo mod for upcoming coverage map Move coverage region collection to CodegenCx finalization Moved from `query coverageinfo` (renamed from `query coverage_data`), as discussed in the PR at: https://github.com/rust-lang/rust/pull/73684#issuecomment-649882503 Address merge conflict in MIR instrument_coverage test The MIR test output format changed for int types. moved debug messages out of block.rs This makes the block.rs calls to add coverage mapping data to the CodegenCx much more concise and readable. move coverage intrinsic handling into llvm impl I realized that having half of the coverage intrinsic handling in `rustc_codegen_ssa` and half in `rustc_codegen_llvm` meant that any non-llvm backend would be bound to the same decisions about how the coverage-related MIR terminators should be handled. To fix this, I moved the non-codegen portion of coverage intrinsic handling into its own trait, and implemented it in `rustc_codegen_llvm` alongside `codegen_intrinsic_call`. I also added the (required?) stubs for the new intrinsics to `IntrepretCx::emulate_intrinsic()`, to ensure calls to this function do not fail if called with these new but known intrinsics. address PR Feedback on 28 June 2020 2:48pm PDT
2020-06-19Rollup merge of #73347 - tmiasko:incompatible-sanitizers, r=nikicManish Goregaokar-19/+2
Diagnose use of incompatible sanitizers Emit an error when incompatible sanitizer are configured through command line options. Previously the last one configured prevailed and others were silently ignored. Additionally use a set to represent configured sanitizers, making it possible to enable multiple sanitizers at once. At least in principle, since currently all of them are considered to be incompatible with others.
2020-06-16rename location field of Drop terminators to placeRalf Jung-4/+4
2020-06-16remove visit_terminator_kind from MIR visitorRalf Jung-6/+6
2020-06-14Diagnose use of incompatible sanitizersTomasz Miąsko-19/+2
Emit an error when incompatible sanitizer are configured through command line options. Previously the last one configured prevailed and others were silently ignored. Additionally use a set to represent configured sanitizers, making it possible to enable multiple sanitizers at once. At least in principle, since currently all of them are considered to be incompatible with others.
2020-06-07rename FalseEdges -> FalseEdgeRalf Jung-1/+1
2020-05-18Add asm! to MIRAmanieu d'Antras-0/+5
2020-05-09Visit move out of `_0` when visiting `return`Jonas Schievink-1/+5
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-04-24Auto merge of #70820 - spastorino:replace-fragile-erroneous-const-sys, r=oli-obkbors-1/+11
Replace fragile erroneous const sys Closes #67191 r? @oli-obk
2020-04-23Modify `as_local_hir_id` to return a bare `HirId`marmeladema-9/+5
2020-04-23Modify `as_local_hir_id` to accept a `LocalDefId` instead of a `DefId`marmeladema-3/+7
2020-04-23Rename uneval_consts to required_constsSantiago Pastorino-6/+8
2020-04-23Make inlining carry over unevaluated constsSantiago Pastorino-1/+9
2020-04-22Use `Body` everywhereDylan MacKenzie-6/+6
2020-04-22Don't use `*` for deref-coercionDylan MacKenzie-3/+3
2020-04-22Rollup merge of #70970 - eddyb:trait-vs-impl-mismatch, r=oli-obkDylan DPC-1/+2
Detect mistyped associated consts in `Instance::resolve`. *Based on #71049 to prevent redundant/misleading downstream errors.* Fixes #70942 by refusing to resolve an associated `const` if it doesn't have the same type in the `impl` that it does in the `trait` (which we assume had errored, and `delay_span_bug` guards against bugs).
2020-04-19MIR: use span instead of NodeId to determine if optimized_mir should be runljedrz-7/+5
2020-04-18Detect mistyped associated consts in `Instance::resolve`.Eduard-Mihai Burtescu-1/+2
2020-04-16don't clone types that are copy (clippy::clone_on_copy)Matthias Krüger-1/+1
2020-04-11Pass the `PlaceElem::Index` local to `visit_local`Jonas Schievink-12/+0
2020-03-31Use Place directly, it's Copy even more use casesSantiago Pastorino-2/+2
2020-03-30rustc -> rustc_middle part 3 (rustfmt)Mazdak Farrokhzad-4/+4
2020-03-30rustc -> rustc_middle part 2Mazdak Farrokhzad-5/+5
2020-03-21Use Reveal::All in MIR inlinerWesley Wiser-10/+3
2020-03-21Rollup merge of #69934 - andjo403:inlinecost, r=wesleywiserMazdak Farrokhzad-2/+17
Update the mir inline costs handle that when mir is lowered to llvm-ir more code is generated. Landingpads generates 10 llvm-ir instructions and resume 9 llvm-ir instructions. r? @wesleywiser
2020-03-16use direct imports for `rustc::{lint, session}`.Mazdak Farrokhzad-9/+6
2020-03-11Update the mir inline costsAndreas Jonson-2/+17
handle that when mir is lowered to llvm-ir more code is generated. landingpads generates 10 llvm-ir instructions and resume 9 llvm-ir instructions.
2020-02-05Selectively disable sanitizer instrumentationTomasz Miąsko-0/+23
Add `no_sanitize` attribute that allows to opt out from sanitizer instrumentation in an annotated function.
2020-02-01Move builtin attribute logic to new rustc_attr crate.Mazdak Farrokhzad-1/+1
For now, this is all the crate contains, but more attribute logic & types will be moved there over time.
2020-01-28make_integrate_local takes Local by valueSantiago Pastorino-4/+4
2020-01-27don't clone types that are copy, round two.Matthias Krüger-2/+2
2020-01-10Remove PlaceBase enum and make Place base field be local: LocalSantiago Pastorino-18/+10
2020-01-10Remove Static from PlaceBaseSantiago Pastorino-5/+0
2020-01-05Remove rustc_hir reexports in rustc::hir.Mazdak Farrokhzad-1/+1
2020-01-04extract rustc::middle::codegen_fn_attrsMazdak Farrokhzad-1/+1
2020-01-01Ensure that we process projections during MIR inliningAaron Hill-8/+4
Fixes #67710 Previously, we were not calling `super_place`, which resulted in us failing to update any local references that occur in ProjectionElem::Index. This caused the post-inlining MIR to contain a reference to a local ID from the inlined callee, leading to an ICE due to a type mismatch.
2019-12-27Fix `Instance::resolve()` incorrectly returning specialized instancesWesley Wiser-3/+10
We only want to return specializations when `Reveal::All` is passed, not when `Reveal::UserFacing` is. Resolving this fixes several issues with the `ConstProp`, `SimplifyBranches`, and `Inline` MIR optimization passes. Fixes #66901
2019-12-22Format the worldMark Rousskov-128/+92
2019-12-20[mir-opt] Fix `Inline` pass to handle inlining into `box` expressionsWesley Wiser-10/+20
2019-12-08Rollup merge of #66991 - Nashenas88:body_cache_cleanup, r=eddybMazdak Farrokhzad-6/+6
Cleanup BodyCache After this PR: - `BodyCache` is renamed to `BodyAndCache` - `ReadOnlyBodyCache` is renamed to `ReadOnlyBodyAndCache` - `ReadOnlyBodyAndCache::body` fn is removed and all calls to it are replaced by a deref (possible due to fix of its `Deref` imp in #65947) cc @eddyb @oli-obk
2019-12-05`#[track_caller]` suppresses MIR inlining.Adam Perry-0/+5
2019-12-05rustc: Apply clearer naming to BodyAndCache, fix Deref impl, remove unneeded ↵Paul Daniel Faria-6/+6
Index impl, remove body fn rustc_codegen_ssa: Fix BodyAndCache reborrow to Body and change instances of body() call to derefence rustc_mir: Fix BodyAndCache reborrow to Body and change intances of body() call to derefence
2019-12-02Remove HasLocalDecls impl from BodyCache's, properly reborrow to Body, ↵Paul Daniel Faria-31/+31
rename all body_cache back to body
2019-12-02Remove BodyCache.body and rely on Deref as much as possible for ↵Paul Daniel Faria-3/+3
ReadOnlyBodyCache
2019-12-02Fix tidy errorsPaul Daniel Faria-4/+9
2019-12-02Fix remaining compilation issuesPaul Daniel Faria-11/+11