about summary refs log tree commit diff
path: root/src/librustc_mir/interpret
AgeCommit message (Collapse)AuthorLines
2018-11-03Implement rotate using funnel shift on LLVM >= 7Nikita Popov-0/+18
Implement the rotate_left and rotate_right operations using llvm.fshl and llvm.fshr if they are available (LLVM >= 7). Originally I wanted to expose the funnel_shift_left and funnel_shift_right intrinsics and implement rotate_left and rotate_right on top of them. However, emulation of funnel shifts requires emitting a conditional to check for zero shift amount, which is not necessary for rotates. I was uncomfortable doing that here, as I don't want to rely on LLVM to optimize away that conditional (and for variable rotates, I'm not sure it can). We should revisit that question when we raise our minimum version requirement to LLVM 7 and don't need emulation code anymore.
2018-11-02Rebase falloutOliver Scherer-2/+2
2018-11-02Rename `Value` to `Immediate` in docsRalf Jung-1/+1
Co-Authored-By: oli-obk <github35764891676564198441@oli-obk.de>
2018-11-02Satsify tidyOliver S̶c̶h̶n̶e̶i̶d̶e̶r Scherer-1/+5
2018-11-02Rename `Value` to `Immediate` for miriOliver Scherer-171/+174
2018-11-02Auto merge of #55316 - RalfJung:retagging, r=oli-obkbors-37/+38
Add Retagging statements This adds a `Retag` statement kind to MIR, used to perform the retagging operation from [Stacked Borrows](https://www.ralfj.de/blog/2018/08/07/stacked-borrows.html). It also kills the old `Validate` statements that I added last year. NOTE: This includes https://github.com/rust-lang/rust/pull/55270. Only [these commits are new](https://github.com/RalfJung/rust/compare/stacked-borrows-ng...RalfJung:retagging).
2018-10-31use String::from() instead of format!() macro to construct Strings.Matthias Krüger-1/+1
2018-10-29Add a comment explaining the two checksOliver S̶c̶h̶n̶e̶i̶d̶e̶r Scherer-0/+1
2018-10-29the memory_deallocated hook can make good use of knowing the sizeRalf Jung-1/+3
2018-10-29provide mutable borrows when hooking memory write accessRalf Jung-18/+16
2018-10-29Fix wrong validation clasisfication of `Option<&T>::Some` valuesOliver Scherer-1/+1
2018-10-29Turn ICE for dangling pointers into errorOliver Scherer-0/+5
2018-10-29let create_ref take a mutability, and leave it to step.rs to interpret ↵Ralf Jung-10/+12
mir::BorrowKind
2018-10-29Emit Retag statements, kill Validate statementsRalf Jung-8/+7
Also "rename" -Zmir-emit-validate to -Zmir-emit-retag, which is just a boolean (yes or no).
2018-10-28don't be too perf-greedyRalf Jung-1/+1
2018-10-28don't tag new memory inside memory.rs; add machine hook to tag new memoryRalf Jung-22/+33
2018-10-28make memory private; that's what we have `memory_mut` forRalf Jung-1/+1
2018-10-28validity in non-const mode relies on ref_to_mplace checking bounds; ↵Ralf Jung-96/+116
(de)reference hooks work on places
2018-10-28make (de)reference hooks more consistentRalf Jung-17/+41
2018-10-27Auto merge of #54183 - qnighy:by-value-object-safety, r=oli-obkbors-0/+1
Implement by-value object safety This PR implements **by-value object safety**, which is part of unsized rvalues #48055. That means, with `#![feature(unsized_locals)]`, you can call a method `fn foo(self, ...)` on trait objects. One aim of this is to enable `Box<FnOnce>` in the near future. The difficulty here is this: when constructing a vtable for a trait `Foo`, we can't just put the function `<T as Foo>::foo` into the table. If `T` is no larger than `usize`, `self` is usually passed directly. However, as the caller of the vtable doesn't know the concrete `Self` type, we want a variant of `<T as Foo>::foo` where `self` is always passed by reference. Therefore, when the compiler encounters such a method to be generated as a vtable entry, it produces a newly introduced instance called `InstanceDef::VtableShim(def_id)` (that wraps the original instance). the shim just derefs the receiver and calls the original method. We give different symbol names for the shims by appending `::{{vtable-shim}}` to the symbol path (and also adding vtable-shimness as an ingredient to the symbol hash). r? @eddyb
2018-10-26Auto merge of #55382 - kennytm:rollup, r=kennytmbors-71/+30
Rollup of 21 pull requests Successful merges: - #54816 (Don't try to promote already promoted out temporaries) - #54824 (Cleanup rustdoc tests with `@!has` and `@!matches`) - #54921 (Add line numbers option to rustdoc) - #55167 (Add a "cheap" mode for `compute_missing_ctors`.) - #55258 (Fix Rustdoc ICE when checking blanket impls) - #55264 (Compile the libstd we distribute with -Ccodegen-unit=1) - #55271 (Unimplement ExactSizeIterator for MIR traversing iterators) - #55292 (Macro diagnostics tweaks) - #55298 (Point at macro definition when no rules expect token) - #55301 (List allowed tokens after macro fragments) - #55302 (Extend the impl_stable_hash_for! macro for miri.) - #55325 (Fix link to macros chapter) - #55343 (rustbuild: fix remap-debuginfo when building a release) - #55346 (Shrink `Statement`.) - #55358 (Remove redundant clone (2)) - #55370 (Update mailmap for estebank) - #55375 (Typo fixes in configure_cmake comments) - #55378 (rustbuild: use configured linker to build boostrap) - #55379 (validity: assert that unions are non-empty) - #55383 (Use `SmallVec` for the queue in `coerce_unsized`.) - #55391 (bootstrap: clean up a few clippy findings)
2018-10-26Rollup merge of #55379 - RalfJung:no-empty-union, r=oli-obkkennytm-1/+5
validity: assert that unions are non-empty
2018-10-26Rollup merge of #55302 - goffrie:impl-stable-hash, r=varkorkennytm-70/+25
Extend the impl_stable_hash_for! macro for miri. Fixes #54075.
2018-10-26Auto merge of #53821 - oli-obk:sanity_query, r=RalfJungbors-14/+35
Report const eval error inside the query Functional changes: We no longer warn about bad constants embedded in unused types. This relied on being able to report just a warning, not a hard error on that case, which we cannot do any more now that error reporting is consistently centralized. r? @RalfJung fixes #53561
2018-10-26validity: assert that unions are non-emptyRalf Jung-1/+5
2018-10-26Extend the impl_stable_hash_for! macro for miri.Geoffry Song-70/+25
2018-10-25for now, just use NULL ptr for unsized localsRalf Jung-8/+12
2018-10-25Prepare miri for unsized localsOliver Schneider-3/+10
2018-10-25Fix rebase falloutOliver Schneider-3/+6
2018-10-25Forward `TooGeneric` errorsOliver Schneider-2/+6
2018-10-25Report const eval error inside the queryOliver Schneider-6/+9
2018-10-24Add InstanceDef::VtableShim.Masaki Hara-0/+1
2018-10-23fix typos in various placesMatthias Krüger-8/+8
2018-10-21Address review commentsbjorn3-0/+3
2018-10-21Rename read_local_of_frame to access_localbjorn3-2/+2
2018-10-21Rename alloc_map_ref to alloc_mapbjorn3-1/+1
2018-10-21Add alloc_map accessorbjorn3-0/+5
2018-10-21Use `read_local_of_frame` in `eval_place_to_op`bjorn3-31/+23
Also make `layout_of_local` accept any `Frame`
2018-10-21Fix errorsbjorn3-4/+6
2018-10-21Add method to get OpTy for local from arbitrary framebjorn3-1/+11
2018-10-21Make OpTy field op public for prirodabjorn3-1/+1
2018-10-21Auto merge of #55125 - RalfJung:stacked-borrows, r=oli-obkbors-132/+266
miri engine: Hooks for basic stacked borrows r? @oli-obk
2018-10-20Auto merge of #55014 - ljedrz:lazyboye_unwraps, r=matthewjasperbors-2/+2
Prefer unwrap_or_else to unwrap_or in case of function calls/allocations The contents of `unwrap_or` are evaluated eagerly, so it's not a good pick in case of function calls and allocations. This PR also changes a few `unwrap_or`s with `unwrap_or_default`. An added bonus is that in some cases this change also reveals if the object it's called on is an `Option` or a `Result` (based on whether the closure takes an argument).
2018-10-19Deprecate the `FxHashMap()` and `FxHashSet()` constructor function hackOliver Scherer-1/+1
2018-10-19Prefer unwrap_or_else to unwrap_or in case of function calls/allocationsljedrz-2/+2
2018-10-18turn casts-to-raw into a proper raw-reborrow; that is just cleanerRalf Jung-14/+12
2018-10-18don't do any work towards ptr provenance in const modeRalf Jung-5/+12
2018-10-18the tidy strikes againRalf Jung-2/+2
2018-10-18add 'raw reference' to the machine hook, and use that in ptr-to-raw castsRalf Jung-9/+23
2018-10-18miri: debug! print when we are leaving/entering a functionRalf Jung-0/+14
With a hack to exclude the topmost function for now, because that triggers an ICE...