Commit Graph

541 Commits

Author SHA1 Message Date
Oliver Schneider
1bd8e04228
check alignment in various places 2016-07-06 11:12:44 +02:00
Oliver Schneider
50987e3697
some methods to check pointers for correct alignment 2016-07-06 10:58:51 +02:00
Oliver Schneider
7161c72320
abi alignment is the correct one 2016-07-06 10:58:26 +02:00
Oliver Schneider
082effb3ee
align allocations in the worst possible way 2016-07-05 14:27:27 +02:00
Oliver Schneider
4781a6ba54
add attribute to limit the stack size 2016-07-05 13:23:58 +02:00
Oliver Schneider
88d98998e1
add execution time limit 2016-07-05 13:17:40 +02:00
Oliver Schneider
1444cabc08
make the memory limit configurable 2016-07-05 13:04:46 +02:00
Oliver Schneider
756fbcce48
add a memory limit 2016-07-05 10:47:10 +02:00
Oliver Schneider
4b831569f6
implement floats by running the ops on the host architecture 2016-07-05 09:08:24 +02:00
Scott Olson
a7cc77a010 Compare against ZST_ALLOC_ID in points_to_zst. 2016-07-01 16:40:52 -06:00
Oliver Schneider
3d9588332f
address comments 2016-07-01 13:09:40 +02:00
Oliver Schneider
594f1d79da
optimize all ZST allocations into one single allocation 2016-07-01 13:09:17 +02:00
Scott Olson
1720b1f4af Remove AddCallGuards. It's useless for Miri. 2016-06-30 21:39:35 -06:00
Scott Olson
64eca52ad3 Run Mir passes (copied from rustc pre-trans). 2016-06-30 21:33:24 -06:00
Scott Olson
756d73b3ca Remove filling drop to prep for elaborated drops. 2016-06-30 21:30:03 -06:00
Oliver Schneider
b91338b220
things priroda needs to be public or changed 2016-06-30 11:29:25 +02:00
Oliver Schneider
ae3c49a9e5
use the item path printer that prints user friendly textual paths 2016-06-29 17:07:05 +02:00
Oliver Schneider
7d574f7b1c
don't execute the first statement of a constant/static/promoted right away
This might create confusion, because attempting to execute a statement can cause
arbitrary stackframes to be added for the constants/statics/promoteds required by that
statement. Before this commit, the first statement of the last added stackframe was
executed immediately. Thus there was no way to inspect the state before that first
statement.
2016-06-28 15:06:44 +02:00
Oliver 'ker' Schneider
37287d2a5d use free methods instead of traits 2016-06-25 16:50:33 +02:00
Oliver Schneider
e23fdd1f49
fix const -> pointer writing (noticeable on big endian) 2016-06-23 15:40:46 +02:00
Oliver Schneider
0288486b73
use target byte order 2016-06-23 15:16:25 +02:00
Oliver Schneider
86040c0d29
simplify write_ptr 2016-06-23 13:04:05 +02:00
Oliver Schneider
4c7aae73bc
adjust all pointer_size checks to use the method 2016-06-23 10:02:39 +02:00
Oliver Schneider
d13153c424
add a pointer_size method to Memory for easy access 2016-06-23 09:59:16 +02:00
Oliver Schneider
205a988c1b
improve rustdoc rendering 2016-06-23 09:40:01 +02:00
Oliver Schneider
055b6a8d38
store full TargetDataLayout in Memory instead of just pointer size 2016-06-23 09:36:37 +02:00
Scott Olson
0c720f6e6b Split terminator evaluation into a new module. 2016-06-23 01:03:58 -06:00
Scott Olson
d80cf91ef2 Rename stepper module to step. 2016-06-23 00:04:10 -06:00
Scott Olson
7bda9f24d6 Make step an EvalContext method and remove Stepper. 2016-06-23 00:02:47 -06:00
Oliver Schneider
b10fc7a99f
make sure miri never switches over an invalid char value 2016-06-21 09:44:01 +02:00
Oliver Schneider
7a9272c8e1
no need to cast chars as u32 before casting to u64 2016-06-21 09:43:45 +02:00
Oliver Schneider
422e5edd28
error message improvements 2016-06-21 09:43:27 +02:00
Oliver Schneider
2dbd30fa51
implement char handling 2016-06-21 09:35:20 +02:00
Oliver Schneider
65de5dd2d0
simplify even more 2016-06-20 18:15:33 +02:00
Oliver Schneider
c7039dbb2b
simplify the masked rhs computation 2016-06-20 18:01:35 +02:00
Oliver Schneider
001ae69212
remove the bad rhs value error and panic instead. the typechecker prevent this 2016-06-20 17:52:36 +02:00
Oliver Schneider
a088f105aa
add a comment explaining the magic numbers 2016-06-20 17:52:14 +02:00
Oliver Schneider
3e3aeab0ed
implement bit masks as the compiler would translate them 2016-06-20 17:16:45 +02:00
Oliver Schneider
0821a15476
no need for EvalContext::eval_binop 2016-06-20 16:57:36 +02:00
Oliver Schneider
68469be89b
rename function cache member 2016-06-20 16:52:53 +02:00
Oliver Schneider
b9ac85d2a9
rustc does overflow checking for us, don't duplicate it. 2016-06-20 16:52:43 +02:00
Oliver Schneider
a1082b9b1a
Merge remote-tracking branch 'origin/master' into oflo 2016-06-20 12:33:09 +02:00
Oliver Schneider
e90ee1674a
fix comparing of function pointers 2016-06-20 10:35:15 +02:00
Oliver Schneider
874d683bfa
improve method names and add documentation 2016-06-20 10:34:34 +02:00
Scott Olson
f4cf3f3636 Get benchmarks running again and factor out some parts in common with bin/miri.rs. 2016-06-17 21:35:37 -06:00
Scott Olson
51edf7ede6 Rename max indentation constant for clarity. 2016-06-17 19:55:24 -06:00
Scott Olson
5ae4a0f2a9 Only indent trace logs. 2016-06-17 19:48:45 -06:00
Oliver Schneider
00eb198a82
implement fn -> unsafe fn pointer casts 2016-06-17 16:49:06 +02:00
Oliver Schneider
e3a2bf84e2
clippy 2016-06-17 16:03:11 +02:00
Oliver Schneider
3ba4f6db04
remove code repetition and fix overflowing intrinsics 2016-06-17 15:16:41 +02:00
Oliver Schneider
58b4fac1ce
implement overflowing ops 2016-06-17 13:09:20 +02:00
Scott Olson
8db0bc0ce9 Merge pull request #27 from oli-obk/travis
create a miri-pass test that allows us to run miri for arbitrary targets
2016-06-16 14:03:41 -05:00
Oliver Schneider
82dc95c3ad
create a miri-pass test that allows us to run miri for arbitrary targets 2016-06-15 16:01:00 +02:00
Scott Olson
bac37e69d7 Merge branch 'wip' 2016-06-15 05:24:15 -06:00
Scott Olson
b24edd6a23 Merge pull request #24 from oli-obk/typesafe_fn_calls
Typesafe fn calls
2016-06-15 05:05:50 -06:00
Oliver Schneider
d82a79220b
use the logging framework instead of println! 2016-06-15 13:00:51 +02:00
Oliver Schneider
a55ac1fea8
pass arguments to start 2016-06-15 12:55:04 +02:00
Scott Olson
16f778ad20 Rename next_block to block and reorganize Frame fields. 2016-06-14 20:13:59 -06:00
Scott Olson
269f70007f Get the sysroot (like compiletest) in Miri itself. 2016-06-14 19:30:59 -06:00
Oliver Schneider
1bd00e8cb4
run start and main language item if provided 2016-06-14 11:52:45 +02:00
Oliver Schneider
c36dcff005
forbid calling functions through pointers of a different type 2016-06-14 10:34:54 +02:00
Oliver Schneider
55fd060cd8
don't use #[miri_run] anymore, but execute the main function 2016-06-13 15:33:05 +02:00
Oliver Schneider
fe9b455006
comment nit 2016-06-13 15:32:08 +02:00
Oliver Schneider
4d090fa693
report better errors when using a fn ptr as memory and vice versa 2016-06-13 11:39:15 +02:00
Oliver Schneider
3aa585e421
Merge remote-tracking branch 'origin/master' into function_pointers2 2016-06-13 11:24:01 +02:00
Scott Olson
024b3d2b45 Merge remote-tracking branch 'oli/function_pointers2' into fixup-function_pointers2 2016-06-11 16:46:01 -06:00
Scott Olson
1c58b7c2ed Add hacky stub version of CheckedBinaryOp. 2016-06-11 13:10:42 -06:00
Scott Olson
71188ea2df Remove inception test for now. 2016-06-11 13:10:25 -06:00
Scott Olson
947e9a5c31 Fix infinite loop when debug trace is disabled. 2016-06-11 12:38:50 -06:00
Scott Olson
781c3a6660 Update for changes in rustc nightly. 2016-06-11 12:38:28 -06:00
Oliver Schneider
384623daa7
function pointers 2016-06-10 18:06:36 +02:00
Oliver Schneider
67211218f0
display the full path to the function if no MIR is found 2016-06-10 18:04:12 +02:00
Oliver Schneider
9780729104
we already have the constant's type, no need to recompute from the def_id 2016-06-10 18:04:12 +02:00
Oliver Schneider
cea2a8ae9e
adjust lifetimes and bindings to the GlobalEvalContext -> EvalContext rename 2016-06-10 16:56:04 +02:00
Oliver Schneider
9c8f84caf7
style nit 2016-06-10 16:32:39 +02:00
Oliver Schneider
4fa328ef5f
remove unused method 2016-06-10 16:20:25 +02:00
Oliver Schneider
6af821f202
rename GlobalEvalContext to EvalContext 2016-06-10 16:20:17 +02:00
Oliver Schneider
b3c1713b89
expose a minimal API and use it in the binary 2016-06-10 13:01:51 +02:00
Oliver Schneider
3b804942fd
simplify the stepper interface 2016-06-10 12:34:15 +02:00
Oliver Schneider
8c3a066d8d
get rid of the constants cache in the stepper
this is possible due to the removal of `FnEvalContext`
2016-06-09 17:24:42 +02:00
Oliver Schneider
336206cec2
the type_size method's substs argument allows computing the locals before pushing the stack frame 2016-06-09 17:23:58 +02:00
Oliver Schneider
2dbd82d296
inline the call method into interpret_start_points 2016-06-09 16:49:40 +02:00
Oliver Schneider
fc935c10f8
print errors in one central location 2016-06-09 16:13:42 +02:00
Oliver Schneider
ba9e25b2eb
No more terminators 2016-06-09 16:08:34 +02:00
Oliver Schneider
8fec1a7aa7
merge FnEvalContext into GlobalEvalContext 2016-06-09 16:01:53 +02:00
Oliver Schneider
05eaa522a5
rename static_item to global_item 2016-06-09 11:27:12 +02:00
Oliver Schneider
040a501a68
make sure globals that yield function pointers aren't treated like functions 2016-06-09 11:27:02 +02:00
Oliver Schneider
225a6a272d
we already have the constant's type, no need to recompute from the def_id 2016-06-09 11:16:09 +02:00
Oliver Schneider
59d858a0b1
refactor away the closures and Event enum 2016-06-09 10:56:23 +02:00
Oliver Schneider
cbbf58bbaa
the statement/terminator has already been computed, don't do it again 2016-06-08 12:47:24 +02:00
Oliver Schneider
2178961262
improve the docs of ConstantId 2016-06-08 12:35:15 +02:00
Oliver Schneider
240f0c0dd6
improve fn argument naming 2016-06-08 12:30:25 +02:00
Oliver Schneider
3868a62713
put ConstantId's common fields into a struct 2016-06-08 11:46:37 +02:00
Oliver Schneider
3de30e33f5
no more function pointers 2016-06-08 11:34:56 +02:00
Oliver Schneider
8b25bc8a9a
directly push stackframes for constants when they are encountered 2016-06-08 11:11:33 +02:00
Oliver Schneider
6b939bbd79
rebase leftovers 2016-06-08 11:11:08 +02:00
Oliver Schneider
1f27d3f7b3
don't cache the MIR in the Stepper 2016-06-08 10:26:48 +02:00
Oliver Schneider
c881cf10d8
clippy nits 2016-06-08 09:41:28 +02:00
Oliver Schneider
f42be6db54
move load_mir to the global eval context 2016-06-08 09:41:25 +02:00
Oliver Schneider
4d44a970a3
move some methods from FnEvalContext to GlobalEvalContext 2016-06-08 09:38:59 +02:00
Oliver Schneider
4c833a54d2
globally cache statics and promoteds 2016-06-03 17:41:36 +02:00
Oliver Schneider
4743842821
move constants stack to stackframe 2016-06-03 17:08:51 +02:00
Oliver Schneider
02eed64cc0
update documentation 2016-06-03 17:04:08 +02:00
Oliver Schneider
346560b318
factor out the statement index into the stackframe 2016-06-03 16:57:47 +02:00
Oliver Schneider
f995db9ffb
store the current block in the frame 2016-06-03 16:51:51 +02:00
Oliver Schneider
cc1ca73f57
jit interpretation of constants 2016-06-03 15:48:56 +02:00
Oliver Schneider
05f829cc9f
merge the three stacks in the interpreter 2016-06-02 18:21:32 +02:00
Oliver Schneider
38ae3526e5
remove a debug message that snuck into the commit 2016-06-02 18:03:22 +02:00
Oliver Schneider
6ac64f19af
also step through promoteds, constants and statics 2016-06-02 17:05:17 +02:00
Oliver Schneider
5211178377
note that not all literal items are function pointers 2016-06-01 19:20:23 +02:00
Oliver Schneider
0c269a500c
rename iterator module to stepper 2016-06-01 19:17:18 +02:00
Oliver Schneider
77e1ec2b49
style: spaces between functions 2016-06-01 19:01:40 +02:00
Oliver Schneider
2405c81c65
stepwise interpretation 2016-06-01 18:50:20 +02:00
Oliver Schneider
5a8b0ab579
don't clone the MIR Rc in every iteration 2016-06-01 18:50:20 +02:00
Oliver Schneider
8398781132
remove one layer of indirection when interpreting const/static/main functions 2016-06-01 18:50:20 +02:00
Oliver Schneider
e73fa7733d
can't evaluate failed assertions yet 2016-06-01 18:50:20 +02:00
Oliver Schneider
fee3a2c1a7
remove intermediate vars 2016-06-01 18:42:57 +02:00
Oliver Schneider
af41c54301
use format! compile time magics for indentation 2016-06-01 18:33:29 +02:00
Oliver Schneider
c62cce3116
wraparound when reaching indentation lvl 40 2016-06-01 18:18:01 +02:00
Oliver Schneider
b7df4fdc75
use a number for the maximum indentation instead of relying on str::len() 2016-06-01 17:58:50 +02:00
Oliver Schneider
f9a5416135
use MIRI_LOG instead of RUST_LOG, because rustc's output is very verbose 2016-06-01 17:32:57 +02:00
Oliver Schneider
f1e4ef6c6f
re-introduce the module name to the logs and show vertical bars 2016-06-01 11:47:55 +02:00
Oliver Schneider
4f3f2020ed
add the log crate + env_logger to be able to choose the log granularity at runtime 2016-06-01 11:47:41 +02:00
Oliver Schneider
f910019da1
add a note to Memory::new mentioning tcx.data_layout 2016-06-01 11:24:23 +02:00
Oliver Schneider
29516c3129
improve out of bounds error message 2016-06-01 11:22:37 +02:00
Oliver Schneider
12c2e5fab2
4byte pointers 2016-06-01 11:10:43 +02:00
Oliver Schneider
b78ca5f7e1
replace panic!s with Result 2016-06-01 11:10:43 +02:00
Oliver Schneider
cecae8050e
remove unnecessary printlns for benchmarks 2016-05-30 13:40:46 +02:00
Oliver Schneider
c55b3666ea
clippy nit 2016-05-27 16:12:17 +02:00
Scott Olson
8961063c60 Handle some cases of StructWrappedNullablePointer.
... plus a bunch of minor refactorings.
2016-05-25 00:39:12 -06:00
Scott Olson
3ba923701f Update for changes in rustc nightly. 2016-05-13 22:34:50 -06:00
Scott Olson
f63206ed2f Handle discriminant_value intrinsic. 2016-05-09 23:41:57 -06:00
Scott Olson
2d32503409 Support C ABI memcmp function. 2016-05-09 21:53:20 -06:00
Scott Olson
b9c37124be Handle size_of_val for slice types. 2016-05-09 21:01:12 -06:00
Scott Olson
6d9a748858 Handle size_of_val for sized types. 2016-05-09 20:44:42 -06:00
Scott Olson
382dc0ccb2 Update for my github username change. 2016-05-09 20:08:37 -06:00
Scott Olson
ddfbb655e1 Handle statics. 2016-05-09 20:03:13 -06:00
Scott Olson
b859444562 Do or do not. 2016-05-09 18:52:53 -06:00
Scott Olson
753971a4c5 Handle promoted rvalues by recursing with call_nested. 2016-05-09 18:21:52 -06:00
Scott Olson
49b6349577 Update to a new nightly. 2016-05-09 15:32:18 -06:00
Scott Olson
a6b9b165c3 Handle CEnum layouts with signed representations. 2016-05-08 19:49:07 -06:00
Scott Olson
5f07e2ebd3 Merge branch 'new-data-layout' 2016-05-08 19:31:28 -06:00
Scott Olson
d288472b29 Handle CEnum layouts with unsigned representations. 2016-05-08 19:29:07 -06:00
Scott Olson
9e289fa0aa Fully handle RawNullablePointer layout. 2016-04-30 01:04:17 -06:00
Scott Olson
30f07f3d7f Re-implement support for downcast lvalues. 2016-04-29 23:32:15 -06:00
Andre Bogus
7cb6c0dbfe back out similar_names change 2016-04-29 17:47:10 +02:00
Andre Bogus
de64670de0 Fixed some clippy warnings 2016-04-29 06:01:17 +02:00
Scott Olson
3fd2ee9ddc Remove unused eval_operand_and_layout fn. 2016-04-23 20:46:27 -06:00
Scott Olson
500cd25627 Add missing boolean binops. 2016-04-23 20:13:00 -06:00
Scott Olson
2db3597b56 Implement boolean binops. 2016-04-23 00:39:38 -06:00
Scott Olson
6f50289d43 Fix lvalue projections with fat pointer bases. 2016-04-23 00:26:10 -06:00
Scott Olson
4a863c2a6a Replace Repr with the new ty::layout in rustc.
Lvalues still need work (see lvalue_layout).
2016-04-23 00:03:59 -06:00
Oliver Schneider
ef5fc75c35 various testing improvements 2016-04-22 20:09:00 +02:00
Oliver Schneider
211c12a1d0 use compiletest_rs 2016-04-22 10:34:14 +02:00
Scott Olson
e81d88d236 Use 8-byte pointers on 32-bit hosts for now.
This will be target-dependent and host-independent eventually.
2016-04-15 03:28:18 -06:00
Scott Olson
84f21584ea Fix drop fill checking on 32-bit hosts. 2016-04-15 03:16:35 -06:00
Scott Olson
926bbba459 Fix over-long bitshift on 32-bit hosts.
Fixes #4. (Hopefully.)
2016-04-14 17:39:06 -06:00
Pascal Hertleif
6abfa56b20
Update to Rust Nightly 2016-04-11 2016-04-14 00:01:00 +02:00
Scott Olson
a69ad6703f Store AllocIds directly in allocation map. 2016-04-09 19:31:53 -06:00
Scott Olson
910ad2a391 Implement filling drop. 2016-04-07 05:56:07 -06:00
Scott Olson
6be14eab15 Handle missing allocations in Memory::dump. 2016-04-07 03:07:57 -06:00
Scott Olson
1f6583fe06 Implement drop/deallocation for Box. 2016-04-07 03:02:02 -06:00
Scott Olson
bef57b291b Simplify intrinsic/c_abi call argument evaluation. 2016-04-07 02:02:30 -06:00
Scott Olson
f97eb35222 Change debug log format. 2016-04-06 19:28:40 -06:00
Scott Olson
6a99779740 Rename ty_size -> type_size and ty_to_repr -> type_repr. 2016-04-06 19:01:00 -06:00
Scott Olson
c55320a3db Update for changes in rustc master. 2016-04-06 19:00:34 -06:00
Scott Olson
f4dce09c97 Print sizes in allocation dumps. 2016-04-06 17:33:24 -06:00
Scott Olson
f472018fbb Partially implement reallocation (e.g. for growing Vecs). 2016-04-06 17:29:56 -06:00
Scott Olson
284404da06 Fix undef mask initialization and test undef reads. 2016-04-06 04:35:25 -06:00
Scott Olson
dbd8a82643 Add a test for overwriting part of a relocation. 2016-04-06 04:19:56 -06:00
Scott Olson
c08ddaaa48 Implement a naive, slow version of undef mask copying. 2016-04-06 04:08:52 -06:00
Scott Olson
8a0aa9291a Switch to bitmask-based undef mask. 2016-04-06 03:45:06 -06:00
Scott Olson
bdba4641cc Rearrange code in memory.rs. 2016-04-04 20:33:41 -06:00
Scott Olson
682742c223 Print terminator kinds (without spans) when debugging. 2016-04-04 20:07:22 -06:00
Scott Olson
e72d8f8dc6 Update for changes in rustc master. 2016-03-31 22:34:07 -06:00
Scott Olson
d25ddb3130 Add stack traces to error notes. 2016-03-30 22:04:53 -06:00
Scott Olson
17df5cfec3 Move substs stack management into main stack managment fns. 2016-03-29 22:13:31 -06:00
Scott Olson
6a8bb2c1c0 Add initial error reporting via rustc's interface. 2016-03-29 19:09:32 -06:00
Scott Olson
e4dcdcab65 Remove unnecessary Result return in push_stack_frame. 2016-03-29 19:08:45 -06:00
Scott Olson
63fdd46f9a Handle custom discriminant values and detect invalid discriminants. 2016-03-28 21:08:16 -06:00
Scott Olson
1861dbc2ab Update for changes in rustc master. 2016-03-28 17:43:23 -06:00
Scott Olson
62294d0c42 Mark bytes undefined in uninit intrinsic. 2016-03-28 16:37:07 -06:00
Scott Olson
56e118f86c Mark partially-overwritten relocations as undefined. 2016-03-27 00:29:02 -06:00
Scott Olson
62fab9268e Fix bug where &str's lengths were not copied. 2016-03-26 23:57:14 -06:00
Scott Olson
acf2ceb534 Check for undefinedness when reading from memory. 2016-03-26 23:56:49 -06:00
Scott Olson
68ccf3904e Add method for checking if a range is defined in an allocation. 2016-03-26 23:25:35 -06:00
Scott Olson
33e924d383 Add undefined byte tracking. 2016-03-26 22:25:08 -06:00
Scott Olson
5451b6115b Reorganize memory methods. 2016-03-23 21:40:58 -06:00
Scott Olson
87458955dd Refactor memory/allocation handling. 2016-03-23 19:44:05 -06:00
Scott Olson
f96c76e878 Use Box<[u8]> instead of Vec<u8> for allocations. 2016-03-22 00:48:28 -06:00
Scott Olson
e6c58d8277 Assert the absence of fat pointers more often. 2016-03-21 18:51:08 -06:00
Scott Olson
69c41f5372 Write the correct size for PrimVall::IntegerPtr. 2016-03-21 05:42:42 -06:00
Scott Olson
600ff26e65 Refactor handling of relocations. 2016-03-21 05:27:34 -06:00
Scott Olson
59e25cc52c Hide execution traces (they are getting long...) 2016-03-21 04:19:27 -06:00
Scott Olson
3fc9b7dd2c Make more MIR match statements exhaustive. 2016-03-21 04:01:52 -06:00
Scott Olson
69f41facb9 Support intrinsics::overflowing_sub for vec![x; n]. 2016-03-21 03:42:34 -06:00
Scott Olson
dc5fbf17ca Support [x; N] array repeat rvalues. 2016-03-21 03:34:24 -06:00
Scott Olson
6eef7cc01a Make mir::Rvalue handling exhaustive (some still unimplemented). 2016-03-21 03:19:48 -06:00
Scott Olson
877d2d900e Abort miri if the Rust code had compilation errors. 2016-03-21 02:54:20 -06:00
Scott Olson
207463d9a0 Add array indexing for-loop test. 2016-03-21 02:37:31 -06:00
Scott Olson
2994732a81 Remove debug print. 2016-03-21 01:04:50 -06:00
Scott Olson
0de1bbefd5 Refactor isize/usize read/writes. 2016-03-20 23:24:27 -06:00
Scott Olson
95e225d765 Monomorphize lvalue types. 2016-03-20 23:11:06 -06:00
Scott Olson
49e8d3ef5e Simplify handling of Result in eval_assignment. 2016-03-20 23:09:27 -06:00
Scott Olson
f7d0e0423b Support fat pointer reborrowing, length checking. 2016-03-20 22:59:13 -06:00
Scott Olson
dbd01d071a Refactor some names. 2016-03-20 22:07:25 -06:00
Scott Olson
40d0a1f67f Implement length access and indexing for fixed-sized arrays. 2016-03-20 21:30:31 -06:00
Scott Olson
62c5083f30 Reduce duplication for integer reprs. 2016-03-20 20:33:46 -06:00
Scott Olson
c8781e3c01 Support fn pointer type sizes. 2016-03-20 20:16:40 -06:00
Scott Olson
2e12b220be Stop unintentionally clearing source relocations when copying. 2016-03-20 20:15:13 -06:00
Scott Olson
493b5f649c Implement the move_val_init intrinsic. 2016-03-20 19:23:57 -06:00
Scott Olson
28ccc2bf65 Implement the __rust_allocate C ABI function. 2016-03-20 18:41:39 -06:00
Scott Olson
6a000b37cc Simplify Misc casts (still incorrect). 2016-03-19 11:07:19 -06:00
Scott Olson
20f152296a Implement min_align_of and a hacky mul_with_overflow. 2016-03-19 11:01:33 -06:00
Scott Olson
6c6cea28bd Write intrinsic result to correct lvalue. 2016-03-19 10:01:53 -06:00
Scott Olson
1eb66b6701 Handle "offset" intrinsic on integer pointers. 2016-03-19 09:09:13 -06:00
Scott Olson
668f2b6fd4 Implement bytestring literals. 2016-03-18 23:20:59 -06:00
Scott Olson
26c4772f51 Implement string literals. 2016-03-18 23:19:39 -06:00
Scott Olson
5d4a804100 Implement the dummy 'assume' intrinsic. 2016-03-18 23:04:07 -06:00
Scott Olson
dbc9913b7d Implement pointer primvals and comparison ops on them. 2016-03-18 23:03:46 -06:00
Scott Olson
81f49ed1c0 Implement transmute. 2016-03-18 12:42:09 -06:00
Scott Olson
de10839f96 Avoid an integer underflow error. 2016-03-18 12:11:57 -06:00
Scott Olson
e910d40e6a Add error message for missing MIR. 2016-03-18 12:11:39 -06:00
Scott Olson
31b8c17770 Reformat for consistency. 2016-03-18 11:53:24 -06:00
Scott Olson
b1af71e217 Implement more intrinsics. 2016-03-18 11:52:28 -06:00
Scott Olson
ee47ce3978 Normalize associated types when monomorphizing. 2016-03-18 11:52:13 -06:00
Scott Olson
27ff9ab914 Add initial support for closures. 2016-03-18 10:48:31 -06:00
Scott Olson
f8f31ea549 Remove some TODOs. 2016-03-17 08:01:34 -06:00
Scott Olson
12457607c3 Choose pointer size dynamically. 2016-03-17 07:53:26 -06:00
Scott Olson
0b37be71c2 Change invalid pointer read panic into Err. 2016-03-17 07:24:10 -06:00
Scott Olson
6477a5c694 Fix boolean tests and clean up code. 2016-03-17 06:39:29 -06:00
Scott Olson
0a8491b985 Simplify integer reading/writing. 2016-03-17 06:26:37 -06:00
Scott Olson
961137c018 Remove fn_ty argument from call_intrinsic for now. 2016-03-17 06:04:24 -06:00
Scott Olson
36dfde50f4 Extract intrinsic function handling. 2016-03-17 06:00:27 -06:00
Scott Olson
e057a156f2 Shorten ty_to_repr(ty).size() to ty_size(ty). 2016-03-17 05:49:16 -06:00
Scott Olson
49a26b93ca whitespace. 2016-03-17 05:40:56 -06:00
Scott Olson
20da5cacc6 Cached those outputs. 2016-03-17 05:40:27 -06:00
Scott Olson
19bf6eec6b Arena allocate and cache type representations. 2016-03-17 05:32:00 -06:00
Scott Olson
432619ea5e Use total size instead of max variant size in aggregates. 2016-03-17 04:57:50 -06:00
Scott Olson
573c11cef5 Simplify make_aggregate_repr. 2016-03-17 04:55:12 -06:00
Scott Olson
3ebf5063a4 Merge sum and product representations. 2016-03-17 04:38:46 -06:00
Scott Olson
71ed952465 Simplify primitive type reprs. 2016-03-17 03:36:06 -06:00
Scott Olson
c55d4b07fd Fix typo. 2016-03-17 03:20:49 -06:00
Scott Olson
7698a85d01 Simplify Repr::Array's elem size. 2016-03-17 03:19:13 -06:00
Scott Olson
4704bdca8d Simplify PrimVals. 2016-03-17 03:12:15 -06:00
Scott Olson
abd235837a Simplify FieldRepr sizes. 2016-03-17 03:11:40 -06:00
Scott Olson
a1fc284559 Simplify some Repr code. 2016-03-17 02:53:03 -06:00
Scott Olson
aa791a4085 Add fixmes to horrible casting code. 2016-03-17 01:11:06 -06:00
Scott Olson
d3b47c418f WIP: Support array indexing including a get_unchecked test.
Required supporting:
  * Trait method lookup
  * The `offset` intrinsic
  * Fat pointers
  * Unsizing coercions and some raw pointer and integer casts
2016-03-16 23:28:49 -06:00
Scott Olson
59cf49baf4 Create a pointer-only version of eval_operand. Fix pointer offset. 2016-03-16 23:28:09 -06:00