Commit Graph

181 Commits

Author SHA1 Message Date
Saleem Jaffer
96205212e5 code review fixes 2019-07-30 12:32:43 +05:30
Saleem Jaffer
9f8b099846 code review fixes 2019-07-29 20:17:52 +05:30
Saleem Jaffer
654519d3c5 use PanicInfo and UnsupportedOpInfo 2019-07-29 13:35:59 +05:30
Saleem Jaffer
8e9d0faff2 adding a err macro for each of the InterpError variants 2019-07-29 13:35:59 +05:30
Saleem Jaffer
aa3d40cd71 tidy fixes 2019-07-29 13:35:10 +05:30
Saleem Jaffer
307798aa38 fixing fallout due to InterpError refactor 2019-07-29 13:35:09 +05:30
Ralf Jung
495f9509fe use PanicMessage type for MIR assertion errors 2019-07-24 10:24:55 +02:00
Ralf Jung
c0420b1a59 do not use InterpError::description outside librustc::mir 2019-07-24 09:12:21 +02:00
Mark Rousskov
52e9e44c7f
Rollup merge of #60951 - saleemjaffer:mir_better_error_enum, r=oli-obk
more specific errors in src/librustc/mir/interpret/error.rs

Implements [this](https://github.com/rust-rfcs/const-eval/issues/4)
2019-07-23 12:51:02 -04:00
Saleem Jaffer
3730ed9e5b renames EvalErrorPanic to PanicMessage 2019-07-23 16:42:46 +05:30
Saleem Jaffer
90426ed642 moving some variants from InterpError to EvalErrorPanic 2019-07-23 13:37:04 +05:30
Santiago Pastorino
d0accade3e Migrate from Place enum to Place struct 2019-07-20 05:08:38 +02:00
Ralf Jung
fc918a395a rename InterpretCx -> InterpCx
That's more consistent with InterpResult and InterpError.
2019-06-27 13:23:34 +02:00
bors
166c49d7a1 Auto merge of #62012 - wesleywiser:const_prop_use_ecx, r=oli-obk
Use ecx for const-prop local storage

r? @oli-obk
2019-06-24 07:48:29 +00:00
Wesley Wiser
c686130a38 Fix nits 2019-06-21 07:46:27 -04:00
Wesley Wiser
164ed087ab [const-prop] Move local storage into a Frame on InterpCx
This moves us closer to just using `InterpCx` for interpretation.
2019-06-20 21:12:10 -04:00
Wesley Wiser
573b61ae26 [const-prop] Introduce getter/setter functions 2019-06-20 21:12:10 -04:00
ljedrz
73cb9ab526 rename hir::map::get_by_hir_id to get 2019-06-20 12:50:06 +02:00
Oliver Scherer
d6fa4070be Fix rebase fallout 2019-06-19 09:52:35 +02:00
Oliver Scherer
4b6f3868b3 Make interning explicitly care about types and the mutability of memory 2019-06-19 09:52:35 +02:00
Eduard-Mihai Burtescu
afc39bbf24 Run rustfmt --file-lines ... for changes from previous commits. 2019-06-14 18:58:32 +03:00
Eduard-Mihai Burtescu
f3f9d6dfd9 Unify all uses of 'gcx and 'tcx. 2019-06-14 18:58:23 +03:00
Eduard-Mihai Burtescu
fff08cb043 Run rustfmt --file-lines ... for changes from previous commits. 2019-06-12 13:38:28 +03:00
Eduard-Mihai Burtescu
21ac960334 rustc: remove some unnecessary lifetimes in -> TyCtxt methods. 2019-06-12 13:38:27 +03:00
Eduard-Mihai Burtescu
17cdd356da rustc: replace TyCtxt<'tcx, 'gcx, 'tcx> with TyCtxt<'gcx, 'tcx>. 2019-06-12 13:38:27 +03:00
Eduard-Mihai Burtescu
2441253508 Fix fallout from deny(unused_lifetimes). 2019-06-12 13:38:27 +03:00
Eduard-Mihai Burtescu
37799a5552 rustc: replace TyCtxt<'a, 'gcx, 'tcx> with TyCtxt<'tcx, 'gcx, 'tcx>. 2019-06-12 13:38:27 +03:00
Jad Ghalayini
80ff07f30d Changed usages of mir in librustc::mir and librustc_mir to body 2019-06-09 16:05:05 -04:00
Ralf Jung
8f05ff3e33 rename EvalResult -> InterpResult and EvalError -> InterpErrorInfo 2019-06-08 11:39:48 +02:00
Wesley Wiser
dee05ab2cc [const-prop] Handle Rvalue::Len 2019-06-06 08:31:54 -04:00
Wesley Wiser
1e50e01bb7 [const-prop] Handle ProjectionElem::Deref 2019-06-06 08:31:54 -04:00
Wesley Wiser
9f4d94b908 [const-prop] Handle Rvalue::Ref 2019-06-06 08:31:54 -04:00
Wesley Wiser
529b94ea6a [const-prop] Fix ICE when casting function pointers
This fixes an ICE when building libcore with `-Z mir-opt-level=3`.
2019-06-06 08:31:28 -04:00
Wesley Wiser
b2536781af Whitespace fixes 2019-06-04 06:30:36 -04:00
Christian Poveda
31ab573052 Add const-eval support for indirects 2019-06-03 23:53:46 -05:00
Mazdak Farrokhzad
ee08261c8c
Rollup merge of #60928 - TheSirC:fix/60229, r=eddyb
Changes the type `mir::Mir` into `mir::Body`

Fixes part 1 of #60229 (previously attempted in #60242).

I stumbled upon the issue and it seems that the previous attempt at solving it was not merged. This is a second try more up-to-date.

The commit should have changed comments as well.
At the time of writting, it passes the tidy and check tool.
2019-05-29 00:19:55 +02:00
Claude-Alban RANÉLY-VERGÉ-DÉPRÉ
6e5e0daff2 Changes the type mir::Mir into mir::Body
The commit should have changed comments as well.
At the time of writting, it passes the tidy and check tool.

Revisions asked by eddyb :
- Renamed of all the occurences of {visit/super}_mir
- Renamed test structures `CachedMir` to `Cached`

Fixing the missing import on `AggregateKind`
2019-05-28 19:17:51 +02:00
Mazdak Farrokhzad
16ef483b79
Rollup merge of #61164 - RalfJung:scalar, r=oli-obk
rename Scalar::Bits to Scalar::Raw and bits field to data

Also use this opportunity to seal some abstraction leaks (other modules constructing `Scalar::Bits` directly instead of using a constructor).

r? @oli-obk
2019-05-28 18:15:39 +02:00
Mazdak Farrokhzad
1dc9bbbffe
Rollup merge of #61247 - spastorino:eval-place-iterate, r=wesleywiser
Make eval_place iterate instead of recurse

r? @oli-obk
2019-05-28 11:49:08 +02:00
Santiago Pastorino
c3e71f210e Make eval_place iterate instead of recurse 2019-05-27 22:52:03 +02:00
Andrew Xu
46b9ed4fa1 Rename "Associated*" to "Assoc*"
We are going to uniform the terminology of all associated items.
Methods that may or may not have `self` are called "associated
functions". Because `AssociatedFn` is a bit long, we rename `Associated`
to `Assoc`.
2019-05-26 17:49:02 +08:00
Ralf Jung
082da0c698 rename Scalar::Bits to Scalar::Raw and bits field to data 2019-05-26 11:08:03 +02:00
Mazdak Farrokhzad
d8b828beea
Rollup merge of #61184 - wesleywiser:const_prop_tracing, r=oli-obk
Add additional trace statements to the const propagator

This makes it easier to figure out when const propagation fails.
2019-05-26 02:13:32 +02:00
Wesley Wiser
9bfbbd2a78 Add additional trace statements to the const propagator
This makes it easier to figure out when const propagation fails.
2019-05-25 11:02:59 -04:00
varkor
e694807650 Fix missing tcx 2019-05-25 10:07:02 +02:00
Oliver Scherer
e694b63cd1 Don't use ty::Const without immediately interning 2019-05-25 10:07:01 +02:00
Wesley Wiser
ec853ba026 [const-prop] Don't const-prop into terminators unless mir-opt-level >= 2 2019-05-19 16:47:03 -04:00
Wesley Wiser
2baab0eaaa [const-prop] Remove catch all match and add FIXME 2019-05-19 16:47:03 -04:00
Wesley Wiser
3f5c743b53 [const-prop] Support propagating into SwitchInt's discr Operand 2019-05-19 16:46:51 -04:00
Wesley Wiser
8e99c76089 [const-prop] Support propagating into Assert's cond Operand 2019-05-19 16:13:08 -04:00