Commit Graph

282 Commits

Author SHA1 Message Date
bjorn3
89666d9818 Implement CastKind::ClosureFnPointer 2019-03-02 20:25:08 +01:00
bjorn3
25f3ef5ff9 Implement ProjectionElem::Subslice 2019-03-02 20:11:31 +01:00
bjorn3
99eb418f19 Rustup to rustc 1.34.0-nightly (c1d2d83ca 2019-03-01) 2019-03-02 12:18:41 +01:00
bjorn3
f02490d960 Rustfmt 2019-02-21 15:06:09 +01:00
bjorn3
ea10842d95 Update cranelift 2019-02-18 18:26:59 +01:00
bjorn3
bab8113954 Fix discriminant_value intrinsic
Fixes #349
2019-02-16 17:18:51 +01:00
bjorn3
ccf07adbfb Implement isize -> raw-ptr cast 2019-02-16 16:37:30 +01:00
bjorn3
4ecbee2f09 Implement float -> int/uint cast 2019-02-16 16:24:38 +01:00
bjorn3
5721542164 Fix BinOp::Offset
fixes #341
2019-02-16 14:02:15 +01:00
bjorn3
4c94251f95 Several fixes 2019-02-16 13:49:42 +01:00
bjorn3
06dd020446 Rustup to rustc 1.34.0-nightly (a9410cd1a 2019-02-15) 2019-02-16 12:35:56 +01:00
bjorn3
c68e76c33b Implement variadic function calling 2019-02-11 19:18:52 +01:00
bjorn3
1eba7e5f5e Implement drop for trait objects 2019-02-08 17:20:24 +01:00
bjorn3
feec354d65 Introduce CPlace::Stack 2019-02-04 19:32:32 +01:00
bjorn3
3e24c1212f Refactor CPlace address handling 2019-02-04 19:32:29 +01:00
bjorn3
0d16dcfce1 Don't try to store func_addr for FnDef in trans_const_value
This would crash, because the place provides 0 bytes of space for FnDef
2019-02-03 14:11:24 +01:00
bjorn3
a12eef4d86 Use IndexSet and keep full source info in set_debug_loc 2019-01-26 11:59:57 +01:00
bjorn3
09c4569c87 Implement line debuginfo 2019-01-26 11:59:57 +01:00
bjorn3
a15af1ccba Rename load_value to load_scalar and make it support all Abi::Scalar types 2019-01-02 13:39:02 +01:00
bjorn3
8561349ece Only build clif comments in debug mode 2018-12-28 17:09:38 +01:00
bjorn3
3d05ff922c Use the linkage and visibility produced by tcx.collect_and_partition_mono_itemscc #209 2018-12-23 19:41:35 +01:00
bjorn3
9882576497 Improve debug messages in generated clif files 2018-12-22 18:21:30 +01:00
bjorn3
64d4257387 Rustup to rustc 1.33.0-nightly (09d6ab90e 2018-12-20) 2018-12-21 13:45:06 +01:00
bjorn3
6fa3140222 Introduce CodegenCx 2018-12-18 18:28:02 +01:00
bjorn3
bd4b307b42 Support dylibs 2018-12-10 15:10:12 +01:00
bjorn3
a8d52d13f4 Some small changes 2018-12-01 11:49:44 +01:00
bjorn3
3f423c0933 Implement cast C enum -> int 2018-11-30 18:28:33 +01:00
bjorn3
d447f77f03 Rustup to rustc 1.32.0-nightly (6acbb5b65 2018-11-25) 2018-11-26 17:51:28 +01:00
bjorn3
95539518ec Rustfmt 2018-11-24 12:47:53 +01:00
bjorn3
f4ae9a4dbb Rustup to rustc 1.32.0-nightly (1f57e4841 2018-11-23) 2018-11-24 11:23:49 +01:00
bjorn3
06202c007c Fix some 2018 edition idioms 2018-11-17 18:23:52 +01:00
bjorn3
16334be18e Remove a workaround for icmp.i8/i16 not having an encoding 2018-11-17 15:02:57 +01:00
bjorn3
2c38313403 Move unimpl! macro to unimpl.rs 2018-11-16 19:53:27 +01:00
bjorn3
e83da7533c Move trapping to trap_code.rs 2018-11-16 17:35:47 +01:00
bjorn3
faf974b2e6 Rustup to rustc 1.32.0-nightly (6b9b97bd9 2018-11-15) 2018-11-16 17:20:00 +01:00
bjorn3
0fa5c0f4fa Rustup to rustc 1.32.0-nightly (9fefb6766 2018-11-13) 2018-11-14 14:31:42 +01:00
bjorn3
72c34be975 Implement raw ptr -> int of native pointer size cast 2018-11-13 18:57:59 +01:00
bjorn3
b906adfffe Implement some missing CastKind::Misc casts 2018-11-13 18:38:10 +01:00
bjorn3
127e080f62 Implement ProjectionElem::ConstantIndex 2018-11-13 18:28:10 +01:00
bjorn3
a3263bafe0 Change some unimplemented! to unimpl! 2018-11-13 17:58:42 +01:00
Dan Gohman
7b5f4894f1 Change "cton" to "clif". 2018-11-12 07:20:42 -08:00
Dan Gohman
27d90ab1d5 Change "cretonne" to "cranelift". 2018-11-12 07:20:32 -08:00
bjorn3
0b76af2095 Remove should_codegen 2018-11-07 13:35:10 +01:00
bjorn3
29b4c34c54 Rustfmt 2018-11-07 13:32:02 +01:00
bjorn3
648f491977 Enable feature gate extern_crate_item_prelude 2018-11-07 13:29:38 +01:00
bjorn3
438bee5fb1 Rustup to rustc 1.32.0-nightly (e6c5cf923 2018-11-04) 2018-11-05 18:03:47 +01:00
bjorn3
fc8a6c343a Update Cargo.lock
Also update for cranelift changes.
2018-11-03 13:14:28 +01:00
bjorn3
23e0b0bd9c Rustup to rustc 1.32.0-nightly (8b096314a 2018-11-02) 2018-11-03 12:49:55 +01:00
bjorn3
172e705b27 Rustup to rustc 1.31.0-nightly (cae6efc37 2018-10-27) 2018-10-28 18:23:03 +01:00
bjorn3
52ab6583dc Better clif file writing 2018-10-27 18:23:37 +02:00
bjorn3
0195181363 Fix some warnings 2018-10-10 19:08:52 +02:00
bjorn3
b5dffe9765 Rustfmt 2018-10-10 19:07:13 +02:00
bjorn3
0fa547ac98 Use absolute compile time paths for some log files 2018-10-06 14:48:34 +02:00
bjorn3
f4e544894a Implement Rvalue::Len for arrays 2018-10-06 13:50:31 +02:00
bjorn3
cd4bcb7a2c Rustup to rustc 1.31.0-nightly (8c4ad4e9e 2018-10-04) 2018-10-05 19:24:39 +02:00
bjorn3
69fe4d6f92 Workaround some missing encodings in cranelift 2018-09-30 16:33:55 +02:00
bjorn3
ed996759f1 Rustup 2018-09-28 18:21:11 +02:00
bjorn3
742a795c78 Use FunctionBuilder::call_mem{cpy,move} 2018-09-26 15:42:07 +02:00
bjorn3
16e936b93f Rustfmt 2018-09-26 15:40:11 +02:00
bjorn3
889150a4f9 Implement binop eq and ne for fat ptr's 2018-09-25 18:35:13 +02:00
bjorn3
b11cb572dc Use cranelift_frontend::Switch for switchInt 2018-09-25 18:04:30 +02:00
bjorn3
5b721a2940 Rustup to rustc 1.30.0-nightly (4591a245c 2018-09-22) 2018-09-23 10:16:26 +02:00
bjorn3
a1b8e02a88 Rustup to rustc 1.30.0-nightly (cb6d2dfa8 2018-09-16) 2018-09-17 18:49:10 +02:00
bjorn3
0fb7c4d1b9 Implement some intrinsics and fix a codegen error
* intrinsic size_of_val for sized types
* intrinsic needs_drop
* incorrect codegen for UnOp::Not for bools
2018-09-14 19:49:33 +02:00
bjorn3
59518987ed Implement drop support (fixes #11) 2018-09-12 14:40:06 +02:00
bjorn3
29c8fcfc24 Rustup to rustc 1.30.0-nightly (2f1547c0a 2018-09-11) 2018-09-12 14:16:28 +02:00
bjorn3
6196146ac4 Implement trait objects (cc #14) 2018-09-08 18:00:06 +02:00
bjorn3
62a0203a5a Rustfmt 2018-09-08 17:24:52 +02:00
bjorn3
252607ae41 Don't use write_mir_pretty for non local mir 2018-09-08 17:23:03 +02:00
bjorn3
9ede386054 Don't call seal_all_blocks and finalize twice 2018-09-08 14:18:08 +02:00
bjorn3
4c0a2ff59b Don't print Storage{Live,Dead} as comment in debug clif 2018-09-06 17:39:01 +02:00
bjorn3
8adc744645 Implement Box rvalue 2018-09-04 19:04:25 +02:00
bjorn3
42066522fb Perform some optimizations 2018-09-02 13:36:45 +02:00
bjorn3
fa4a37759b Rvalue::Len 2018-08-30 20:22:25 +02:00
bjorn3
12282a8ebc Implement unsize array -> slice and trait object -> trait object 2018-08-30 20:21:58 +02:00
bjorn3
b5082f7da8 Support unsized types 2018-08-30 20:21:21 +02:00
bjorn3
8111eee37a Rustup to rustc 1.30.0-nightly (02cb8f2a4 2018-08-29) 2018-08-30 20:14:56 +02:00
bjorn3
6f58f94cdb Add Caches to FunctionCx 2018-08-26 17:14:12 +02:00
bjorn3
42887dfdd9 Remove CodegenCx 2018-08-26 16:58:52 +02:00
bjorn3
9dbc727b72 Rustfmt 2018-08-24 14:54:22 +02:00
bjorn3
0d15d9e5dd Rustup to rustc 1.30.0-nightly (63d66494a 2018-08-23) 2018-08-24 14:51:02 +02:00
bjorn3
d348f5b473 Codegen all instance types 2018-08-22 18:53:57 +02:00
bjorn3
d87edae73b Add CValue variant ByValPair 2018-08-22 12:35:07 +02:00
bjorn3
954d1e7bf2 Don't hardcode usize being 64 bit (fixes #8) 2018-08-22 10:54:32 +02:00
bjorn3
69834cafd3 Use instance_mir instead of optimized_mir 2018-08-18 16:09:49 +02:00
bjorn3
7a3ba963e1 Rustfmt 2018-08-17 13:01:56 +02:00
bjorn3
f27dfc3ac9 Make CodegenCx generic over Backend 2018-08-17 12:57:41 +02:00
bjorn3
eb89830f21 Rustfmt 2018-08-16 20:09:26 +02:00
bjorn3
ca59e4405e Reduce verbosity of output 2018-08-15 16:17:59 +02:00
bjorn3
a3760040b2 Disable some prinln!'s 2018-08-15 15:28:08 +02:00
bjorn3
bd7031afb1 Fix codegen of SwitchInt 2018-08-15 14:36:45 +02:00
bjorn3
e6fb515406 Craneliftup 2018-08-15 12:36:13 +02:00
bjorn3
a8ca0f02fc Support emitting object files (fixes #5) 2018-08-14 22:01:18 +02:00
bjorn3
0f26781a86 Support simplejit and faerie at the same time 2018-08-14 20:58:24 +02:00
bjorn3
178aa32b0c Make FunctionCx generic over Backend 2018-08-14 20:31:16 +02:00
bjorn3
f67ad9c120 Refactoring 2018-08-14 19:42:22 +02:00
bjorn3
0978710ffd Codegen minicore 2018-08-14 12:13:07 +02:00
bjorn3
4b10e6e613 Workaround missing encoding for icmp.i8 2018-08-14 11:58:39 +02:00
bjorn3
b9d7164eff Fix and test checked binops 2018-08-13 19:14:55 +02:00
bjorn3
1031c659e0 Refactoring of constant.rs in preparation for static codegen 2018-08-13 12:13:43 +02:00
bjorn3
5859b9b65d Rustfmt 2018-08-12 18:56:05 +02:00
bjorn3
8e2394874e Group drop glue instances in unimpl log 2018-08-11 15:36:08 +02:00
bjorn3
46ebc2bc5c Make the hello world example runnable 2018-08-11 15:05:57 +02:00
bjorn3
af69258971 Use tcx.symbol_name 2018-08-11 14:30:05 +02:00
bjorn3
2e0d6d49bf Deduplicate function name generation 2018-08-11 13:59:08 +02:00
bjorn3
dc323d7ffa Don't call finalize_all and then finalize_function 2018-08-11 12:07:42 +02:00
bjorn3
b391524b4f Move return codegen to abi.rs 2018-08-11 11:01:48 +02:00
bjorn3
5ebcea23e4 Extract codegen_intrinsic_call 2018-08-10 19:20:13 +02:00
bjorn3
e1ac09a3f0 Implement bool -> int cast 2018-08-09 15:44:01 +02:00
bjorn3
4c312faf90 brz <-> brnz 2018-08-09 15:36:02 +02:00
bjorn3
48701d758d Crash on some less code and fix a bug in discriminant read 2018-08-09 15:08:54 +02:00
bjorn3
e9422fd4d4 Implement Rvalue::Aggregate(AggregateKind::Array, ...) 2018-08-09 11:42:35 +02:00
bjorn3
2fd0d52834 Rustfmt 2018-08-09 11:25:14 +02:00
bjorn3
566803f288 Implement raw ptr -> usize, fn ptr -> usize, usize -> raw ptr casts 2018-08-09 11:23:04 +02:00
bjorn3
9a2b1d4ac3 Implement float -> float and int -> float casts 2018-08-09 11:16:46 +02:00
bjorn3
6c86274943 Implement raw ptr -> usize cast 2018-08-09 11:07:10 +02:00
bjorn3
5b85e0fec8 Rustfmt 2018-08-08 19:33:37 +02:00
bjorn3
7f2e68e38e Better unimplemented stuff handling 2018-08-08 15:38:03 +02:00
bjorn3
c4705af4e2 Implement intrinsics {ctlz,cttz}{,_nonzero} and ctpop 2018-08-08 14:39:46 +02:00
bjorn3
d4b6bce39c Workaround two bugs 2018-08-08 12:53:09 +02:00
bjorn3
21c52c70b3 Rustfmt 2018-08-08 12:45:34 +02:00
bjorn3
822a181c87 Implement NullOp::SizeOf 2018-08-08 12:44:41 +02:00
bjorn3
1305d1ef23 Implement Rvalue::Repeat 2018-08-08 12:30:25 +02:00
bjorn3
efd203aa0b Implement indexing for arrays 2018-08-08 12:22:16 +02:00
bjorn3
ece497cc84 Some misc changes 2018-08-08 10:39:10 +02:00
bjorn3
018612cf22 Implement overflowing_* and *_with_overflowing 2018-08-08 09:49:42 +02:00
bjorn3
376ec8c258 Don't crash on checked binops (treated like unchecked ones atm) 2018-08-08 09:35:35 +02:00
bjorn3
f001808249 Run rustfmt 0.9.0-nightly (69ad879 2018-07-27) 2018-07-31 12:25:16 +02:00
bjorn3
82dbd07806 Add support for calling C abi functions 2018-07-30 18:20:37 +02:00
bjorn3
37b61e0ca6 Rustup to rustc 1.29.0-nightly (866a71325 2018-07-29) 2018-07-30 16:57:40 +02:00
bjorn3
75a45965bb Add support for binop rem on floats 2018-07-30 15:34:34 +02:00
bjorn3
9b06ec8f1d Implement intrinsic discriminant_value and fix bug in discriminant reading 2018-07-30 14:36:32 +02:00
bjorn3
812fd6daca Implement some intrinsics 2018-07-29 17:22:40 +02:00
bjorn3
dc4f234115 Implement float binops 2018-07-29 17:09:17 +02:00
bjorn3
3a0f5dc9ec Fix a bug when the same function is called with different signatures 2018-07-27 19:01:38 +02:00
bjorn3
ab00acfb55 Add binop impls for TyBool 2018-07-26 10:59:57 +02:00
bjorn3
7862e2ea1c Implement some intrinsics 2018-07-26 10:48:50 +02:00
bjorn3
eb077f67ac Support metadata writing 2018-07-23 11:17:39 +02:00
bjorn3
0350f2faa9 Don't panic on intrinsics 2018-07-20 14:20:37 +02:00
bjorn3
a3b53eb451 Better comment handling 2018-07-20 13:51:34 +02:00
bjorn3
2b5e55fb17 Refactor fn sig handling in preparation for supporting closures 2018-07-20 13:36:53 +02:00
bjorn3
12e129579d Fix a bug 2018-07-19 19:42:07 +02:00
bjorn3
bf2c35f05d Implement char to uint cast 2018-07-19 19:37:34 +02:00
bjorn3
1138d38d87 Extract abi handling to abi.rs 2018-07-19 19:33:42 +02:00
bjorn3
85eaa2c0c9 Better libcore building instructions and rustup 2018-07-19 18:41:37 +02:00
bjorn3
5951efb748 Implement int casts 2018-07-18 16:22:29 +02:00
bjorn3
f52727b8e6 Implement some binops for TyRawPtr 2018-07-18 15:17:22 +02:00
bjorn3
fdc625e18a Implement casting between TyRef and TyRawPtr 2018-07-18 14:21:13 +02:00
bjorn3
9a9054ad23 Disable define_function to prevent crashing on things cranelift doesn't yet support 2018-07-18 13:43:17 +02:00
bjorn3
d0ef7f455c Add docs and expand some wildcard patterns 2018-07-18 11:55:52 +02:00