Mazdak Farrokhzad
1ccb0b4a02
rustc -> rustc_middle part 3 (rustfmt)
2020-03-30 07:19:55 +02:00
Mazdak Farrokhzad
0cb9e36090
rustc -> rustc_middle part 2
2020-03-30 07:16:56 +02:00
Wesley Wiser
61d3be8de7
Use Reveal::All in MIR inliner
2020-03-21 23:08:32 -04:00
Mazdak Farrokhzad
426a4cc930
Rollup merge of #69934 - andjo403:inlinecost, r=wesleywiser
...
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-21 08:51:12 +01:00
Mazdak Farrokhzad
4392a8b73c
use direct imports for rustc::{lint, session}
.
2020-03-16 02:52:06 +01:00
Andreas Jonson
afa940b900
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.
2020-03-11 19:18:22 +01:00
Tomasz Miąsko
b846b42c8d
Selectively disable sanitizer instrumentation
...
Add `no_sanitize` attribute that allows to opt out from sanitizer
instrumentation in an annotated function.
2020-02-05 23:30:38 +01:00
Mazdak Farrokhzad
93a8283614
Move builtin attribute logic to new rustc_attr crate.
...
For now, this is all the crate contains, but more
attribute logic & types will be moved there over time.
2020-02-01 18:54:56 +01:00
Santiago Pastorino
10b19f6dee
make_integrate_local takes Local by value
2020-01-28 10:12:53 -03:00
Matthias Krüger
ec61761e46
don't clone types that are copy, round two.
2020-01-27 01:18:18 +01:00
Santiago Pastorino
5d9b399044
Remove PlaceBase enum and make Place base field be local: Local
2020-01-10 09:08:25 +01:00
Santiago Pastorino
fd5aa32c35
Remove Static from PlaceBase
2020-01-10 09:08:24 +01:00
Mazdak Farrokhzad
ebfd8673a7
Remove rustc_hir reexports in rustc::hir.
2020-01-05 12:49:22 +01:00
Mazdak Farrokhzad
66f5bf1b8b
extract rustc::middle::codegen_fn_attrs
2020-01-04 18:43:06 +01:00
Aaron Hill
e8e53b56df
Ensure that we process projections during MIR inlining
...
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.
2020-01-01 20:10:55 -05:00
Wesley Wiser
25a8b5d58e
Fix Instance::resolve()
incorrectly returning specialized instances
...
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-27 13:04:32 -05:00
Mark Rousskov
a06baa56b9
Format the world
2019-12-22 17:42:47 -05:00
Wesley Wiser
bec4fc175a
[mir-opt] Fix Inline
pass to handle inlining into box
expressions
2019-12-20 20:39:47 -05:00
Mazdak Farrokhzad
56c0bea390
Rollup merge of #66991 - Nashenas88:body_cache_cleanup, r=eddyb
...
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-08 03:39:45 +01:00
Adam Perry
cc574be985
#[track_caller]
suppresses MIR inlining.
2019-12-05 21:12:34 -08:00
Paul Daniel Faria
756aa1e46c
rustc: Apply clearer naming to BodyAndCache, fix Deref impl, remove unneeded 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-05 22:58:41 -05:00
Paul Daniel Faria
b2fe254c98
Remove HasLocalDecls impl from BodyCache's, properly reborrow to Body, rename all body_cache back to body
2019-12-02 08:40:56 -05:00
Paul Daniel Faria
595d161d36
Remove BodyCache.body and rely on Deref as much as possible for ReadOnlyBodyCache
2019-12-02 08:38:16 -05:00
Paul Daniel Faria
67b7a78231
Fix tidy errors
2019-12-02 08:38:16 -05:00
Paul Daniel Faria
4de31b26d1
Fix remaining compilation issues
2019-12-02 08:37:04 -05:00
Paul Daniel Faria
fc6b58d0a8
Simplify BodyCache impl and fix all remaining type errors in librustc_mir (lifetime errors still exist)
2019-12-02 08:35:08 -05:00
Paul Daniel Faria
52cc85f008
Address nits and remove unneeded pass
2019-12-02 08:30:30 -05:00
Paul Daniel Faria
ad734680af
Move predecessors cache invalidation back to basic_blocks_mut, add a couple more ensure_predecessors to prevent panics
2019-12-02 08:30:30 -05:00
Paul Daniel Faria
f534d9f8c4
Stop invalidating predecessors cache when accessing unique basic block, invalidate cache when accessing unique terminator
2019-12-02 08:30:30 -05:00
Eduard-Mihai Burtescu
a9976d89ed
rustc: move mir::SourceScopeLocalData to a field of SourceScopeData.
2019-11-30 01:37:42 +02:00
Eduard-Mihai Burtescu
78d85fcf52
rustc_mir: fix inliner to also copy over source_scope_local_data.
2019-11-30 01:36:51 +02:00
Eduard-Mihai Burtescu
563ed27c01
rustc: move debug info from LocalDecl and UpvarDecl into a dedicated VarDebugInfo.
2019-11-27 19:22:03 +02:00
Santiago Pastorino
180fc413fb
Move Place::elem methods and friends to TyCtxt
2019-10-22 10:33:36 -03:00
Santiago Pastorino
d32c2865d6
Intern place projection
2019-10-22 10:33:36 -03:00
Santiago Pastorino
190802cfca
Pattern match over PlaceRef rather than Place
...
This prepares the code base for when projection is interned. Place's
projection field is going to be `&List<PlaceElem<'tcx>>` so we won't be
able to pattern match against it.
2019-10-22 10:33:30 -03:00
Santiago Pastorino
48349960e6
Use Cow to handle modifications of projection in preparation for interning
2019-10-18 10:06:13 -04:00
Santiago Pastorino
d53fc9cae5
Add process_* place hooks to improve code reutilization
2019-10-17 22:06:56 -04:00
Santiago Pastorino
e3e9951673
Prepare inline MutVisitor to have projections interned
2019-10-17 22:06:55 -04:00
csmoe
64f61c7888
remove indexed_vec re-export from rustc_data_structures
2019-09-29 16:48:31 +00:00
csmoe
d20183dbbf
remove bit_set re-export from rustc_data_structures
2019-09-29 16:11:30 +00:00
varkor
e2e0f9af85
Rename sty
to kind
2019-09-25 15:50:04 +01:00
Santiago Pastorino
87420cd1bc
Make Place Boxed on Statement to reduce size from 64 bytes to 32 bytes
2019-09-11 16:28:06 -03:00
Santiago Pastorino
e9c41148c0
Convert Place's projection to a boxed slice
2019-09-09 18:16:49 -03:00
Wesley Wiser
84556502e6
Handle statics in Subst::subst()
by implementing TypeFoldable
2019-08-22 06:36:31 -04:00
Wesley Wiser
4d62545687
Move def_id out add substsref
2019-08-22 06:36:30 -04:00
Wesley Wiser
73814654b2
Move promoted out of mir::Body
2019-08-22 06:36:30 -04:00
Wesley Wiser
666180c324
Move 'tcx lifetime on MirPass
2019-08-22 06:36:30 -04:00
Eduard-Mihai Burtescu
b565ece5d8
Remove redundant ty
fields from mir::Constant
and hair::pattern::PatternRange
.
2019-08-16 15:20:27 +03:00
Mazdak Farrokhzad
632ce7402f
Rollup merge of #62801 - bjorn3:remove_lower_128bit_ops, r=alexcrichton
...
Remove support for -Zlower-128bit-ops
It is broken and unused
cc https://github.com/rust-lang/rust/issues/58969
blocked https://github.com/rust-lang-nursery/compiler-builtins/pull/302 (removes definitions of the lang items removed in this PR)
r? @alexcrichton
2019-07-26 18:56:43 +02:00
Santiago Pastorino
d0accade3e
Migrate from Place enum to Place struct
2019-07-20 05:08:38 +02:00