about summary refs log tree commit diff
path: root/src/librustc_mir/const_eval.rs
AgeCommit message (Collapse)AuthorLines
2019-11-11Add hooks for Miri panic unwindingAaron Hill-4/+7
This commits adds in some additional hooks to allow Miri to properly handle panic unwinding. None of this should have any impact on CTFE mode
2019-11-08miri: Rename to_{u,i}size to to_machine_{u,i}sizeRalf Jung-1/+1
Having a function `to_usize` that does not return a usize is somewhat confusing
2019-10-27Always use consteval to codegen caller_location.Adam Perry-6/+2
2019-10-27Implementation of const caller_location.Adam Perry-1/+2
2019-10-27Implement core::intrinsics::caller_location.Adam Perry-0/+23
Returns a `&core::panic::Location` corresponding to where it was called, also making `Location` a lang item.
2019-09-27Introduce a `ConstPropMachine`Wesley Wiser-5/+5
This allows us to avoid changing things directly in the miri engine just for const prop.
2019-09-25Fix rebasevarkor-1/+1
2019-09-25Rename `sty` to `kind`varkor-2/+2
2019-09-17Get rid of special const intrinsic query in favour of `const_eval`Oliver Scherer-0/+18
2019-09-15drop redundant ParamEnv, and avoid constructing InternVisitor without visitingRalf Jung-4/+2
2019-09-14Rollup merge of #64116 - ZeGentzy:patch-1, r=oli-obkMazdak Farrokhzad-1/+1
Fix minor typo in docs. This comment is prolly refering to the comment in [const_eval_raw_provider](https://github.com/rust-lang/rust/pull/64116/files#diff-e0b58bb6712edaa8595ad7237542c958R616), not itself.
2019-09-11Avoid two `Symbol::as_str()` calls.Nicholas Nethercote-1/+1
2019-09-06Fixed grammar/style in error messages and reblessed tests.Alexander Regueiro-2/+2
2019-09-03Fix minor typo in docs.Hal Gentz-1/+1
2019-08-27const_prop: only call error_to_const_error if we are actually showing somethingRalf Jung-0/+3
2019-08-22Remove eval_promoted const-prop hackWesley Wiser-20/+3
2019-08-22Move promoted out of mir::BodyWesley Wiser-1/+1
2019-08-17make both unary_op and binary_op fully typed, including a return typeRalf Jung-3/+2
2019-08-14Rollup merge of #62760 - chansuke:dedupe-error-messages, r=zackmdavisMazdak Farrokhzad-4/+7
Deduplicate error messages in `librsctc_mir` Deduplicated the error messages in `librustc_mir`. #62022
2019-08-05Auto merge of #63079 - RalfJung:ctfe-no-align, r=oli-obkbors-4/+7
CTFE: simplify ConstValue by not checking for alignment I hope the test suite actually covers the problematic cases here? r? @oli-obk Fixes https://github.com/rust-lang/rust/issues/61952
2019-08-03Auto merge of #63234 - Centril:rollup-h9t731z, r=Centrilbors-8/+8
Rollup of 5 pull requests Successful merges: - #62954 (Fix typo in Delimited::open_tt) - #63146 (Cleanup syntax::attr) - #63218 (rustbuild: RISC-V is no longer an experimental LLVM target) - #63227 (dead_code: Properly inspect fields in struct patterns with type relative paths) - #63229 (A bit of Miri error cleanup) Failed merges: r? @ghost
2019-08-02dedup free-form Unsupported errors; add macros for free-form UB and ↵Ralf Jung-8/+8
Unsupported cases
2019-08-02CTFE: simplify Value type by not checking for alignmentRalf Jung-4/+7
2019-08-02improve error when CTFE does ptr-int-cast; update testsRalf Jung-2/+11
2019-08-02operator: implement binary_op strictly by first checking the type, then ↵Ralf Jung-1/+1
dispatching further; call ptr_op machine hook only for pointer types
2019-07-31code review fixesSaleem Jaffer-6/+5
2019-07-31Deduplicate some error messageschansuke-4/+7
2019-07-30renaming throw_err_* to throw_*Saleem Jaffer-4/+2
2019-07-30renaming err to err_unsupSaleem Jaffer-2/+4
2019-07-30adding throw_ and err_ macros for InterpErrorSaleem Jaffer-2/+2
2019-07-29code review fixesSaleem Jaffer-1/+1
2019-07-29code review fixesSaleem Jaffer-4/+4
2019-07-29adding a err macro for each of the InterpError variantsSaleem Jaffer-4/+2
2019-07-29fixing fallout due to InterpError refactorSaleem Jaffer-6/+9
2019-07-16Auto merge of #62322 - wesleywiser:promoted_query, r=oli-obkbors-1/+1
Add a query to get the `promoted`s for a `mir::Body` This is a builidng block toward removing a lot of duplicated code between miri and the cosnt-propagator pass. See this thread for more info: https://rust-lang.zulipchat.com/#narrow/stream/189540-t-compiler.2Fwg-mir-opt/topic/Using.20.60InterpCx.60.20more/near/169030661 r? @spastorino but feel free to hand it off to somebody else
2019-07-06remove some no-longer-needed methodsRalf Jung-1/+1
2019-07-06Add check_mplace_ptr convenience method; provide ptr-normalization methods ↵Ralf Jung-1/+1
for mplace and op to avoid repeated int-to-ptr casting during validation. Also change Memory::copy to work on `Pointer` instead of `Scalar`. Also rename some methods from to_* to assert_* that will panic if their precondition is not met.
2019-07-06Rollup merge of #62264 - RalfJung:inline-forcing, r=zackmdavisMazdak Farrokhzad-5/+5
Fix perf regression from Miri Machine trait changes Maybe this fixes the perf regression that https://github.com/rust-lang/rust/pull/62003 seemingly introduced? Cc @nnethercote
2019-07-06Rollup merge of #62245 - RalfJung:miri-extra-fn, r=eddyb,zackmdavisMazdak Farrokhzad-0/+11
Miri engine: support extra function (pointer) values We want to add basic support for `dlsym` in Miri (needed to run the latest version of `getrandom`). For that to work, `dlsym` needs to return *something* that can be stored in a function pointer and later called. So we add a new `ExtraFnVal` type to the `Machine` trait, and enable Miri's memory to associate allocation IDs with such values, so that `create_fn_alloc` and `get_fn` can work on *both* `Instance` (this is used for "normal" function pointers) and `ExtraFnVal`. Cc @oli-obk
2019-07-04use get_size_and_align to test if an allocation is liveRalf Jung-1/+1
2019-07-04add machine hook to handle calls to 'extra' function valuesRalf Jung-0/+10
2019-07-04Add basic support for "other" kinds of values for function pointers, ↵Ralf Jung-0/+1
determined by the machine instance. So far, however, calling such a function will fail.
2019-07-04Go back to just passing MemoryExtra to the machine-level allocation hooksRalf Jung-3/+3
This is needed to avoid doing unnecessary global alloc_map lookups
2019-07-04Machine: make self-like parameters come firstRalf Jung-4/+4
2019-07-04Fix merge conflictsChristian Poveda-14/+14
2019-07-02Add a query to get the `promoted`s for a `mir::Body`Wesley Wiser-1/+1
This is a builidng block toward removing a lot of duplicated code between miri and the cosnt-propagator pass. See this thread for more info: https://rust-lang.zulipchat.com/#narrow/stream/189540-t-compiler.2Fwg-mir-opt/topic/Using.20.60InterpCx.60.20more/near/169030661
2019-06-29Remove default bound for Machine::MemoryExtraChristian Poveda-1/+2
2019-06-29Add MemoryExtra in InterpretCx constructor paramsChristian Poveda-2/+6
2019-06-27rename InterpretCx -> InterpCxRalf Jung-14/+14
That's more consistent with InterpResult and InterpError.
2019-06-25Rollup merge of #62055 - matthewjasper:fix-error-counting, r=pnkfelixMazdak Farrokhzad-14/+6
Fix error counting Count duplicate errors for `track_errors` and other error counting checks. Add FIXMEs to make it clear that we should be moving away from this kind of logic. Closes #61663