Commit Graph

5213 Commits

Author SHA1 Message Date
Brian Anderson
895674b6eb Add a test for assignment of unique boxes of generics
Closes #976

Issue #409
2011-09-24 21:31:28 -07:00
Brian Anderson
4f7ecce7d1 Support non-immediates in trans_uniq::copy_val
Issue #409
2011-09-24 21:28:58 -07:00
Jesse Ruderman
2b15aefffe Fuzzer: ignore more bugs 2011-09-24 21:01:39 -07:00
Lindsey Kuper
822ed2c6d3 Small refactors.
Factor out some shared code from the start of process_fwding_mthd and
process_bkwding_mthd; get rid of unneeded temp variable.
2011-09-24 23:38:47 -04:00
Jesse Ruderman
3b5b29c7ec Reduce and clarify abuse of 'pure' in interner 2011-09-24 16:33:26 -07:00
Jesse Ruderman
0125532106 Don't iloop (future-proof test against improved reachability computations) 2011-09-24 16:13:32 -07:00
Jesse Ruderman
c29f1af17e Remove irrelevant parts of test 2011-09-24 16:11:50 -07:00
Jesse Ruderman
064f52fa96 Mark some fns as pure so type_is_unique_box doesn't need to be unchecked 2011-09-24 15:36:09 -07:00
Jesse Ruderman
48c2c9b3a7 Mark vec::len as pure 2011-09-24 15:10:03 -07:00
Brian Anderson
9029416e28 Tweak random thing to make windows build succeed. Awesome.
So, a recent commit made syntax-extension-fmt fail under check-fast.
This commit disables lots-a-fail under check-fast and voila! *grumble*
2011-09-24 14:44:42 -07:00
Brian Anderson
e804352de4 Move a previous run-pass test for kind-lowered unique boxes to compile-fail
This test tries to swap unique boxes containing resources, which is not
allowed.

Issue #409
2011-09-24 12:36:51 -07:00
Brian Anderson
c5877450e6 Tweak the type allocated for unique pointers
Seems to be more correctish...

Issue #409
2011-09-24 12:36:51 -07:00
Brian Anderson
777a536313 Support non-immediates in unique-box type glue
Issue #409
2011-09-24 12:36:51 -07:00
Brian Anderson
856acbf66d Vectors containing pinned kinds become pinned
Otherwise they could be copied
2011-09-24 12:36:51 -07:00
Brian Anderson
e5d5682065 Unique pointers containing pinned kinds become pinned
Issue #409
2011-09-24 12:36:51 -07:00
Brian Anderson
97629727b1 Add tests for swapping unique boxes
Issue #409
2011-09-24 12:36:50 -07:00
Jesse Ruderman
fbe00fc236 Add rand_util.rs 2011-09-23 23:24:43 -07:00
Jesse Ruderman
3bac3378ae Fuzzer: use different exclusions when testing pretty-printer than when testing compiler 2011-09-23 23:23:04 -07:00
Jesse Ruderman
3a7a2943dd Add vec::filter 2011-09-23 19:10:48 -07:00
Patrick Walton
7979bbbf51 rt: Sweep in cycle collection 2011-09-23 17:57:25 -07:00
Patrick Walton
41082c6b83 rt: Whitespace police 2011-09-23 17:57:25 -07:00
Patrick Walton
b995028c47 rt: Turn off some debug code 2011-09-23 17:57:25 -07:00
Patrick Walton
0c4e0fdfae rt: Get rid of the hack that looks for captured type descriptors adjacent to the root one for functions and objects 2011-09-23 17:57:25 -07:00
Erick Tryzelaar
6164de90e2 Add libuv upgrade instructions to src/etc/gyp-uv 2011-09-23 16:53:07 -07:00
Erick Tryzelaar
5f066e06b9 Update to libuv commit 3ca382.
This patch changes libuv's gyp build system to
make it's own makefiles. To generate them for rust,
run these commands. They requires python 2.x to
work:

$ mkdir -p src/rt/libuv/build
$ svn co http://gyp.googlecode.com/svn src/rt/libuv/build/gyp
$ ./etc/src/gyp_uv
2011-09-23 16:53:06 -07:00
Brian Anderson
d8f6e9f237 Add let destructuring for unique boxes
Issue #409
2011-09-23 16:12:04 -07:00
Brian Anderson
122f714fde Add missing case for pat_uniq to syntax::visit
Issue #409
2011-09-23 16:03:35 -07:00
Brian Anderson
27972a6def Add two tests for sending unique boxes across channels
Issue #409
2011-09-23 15:32:31 -07:00
Brian Anderson
68512f2d9d Actually use unique boxes in run-fail/unwind-unique 2011-09-23 15:23:44 -07:00
Brian Anderson
18b01d5cfe Create a bunch of test cases for unique boxes by copying box tests
XFAIL the ones that don't work

Issue #409
2011-09-23 15:15:30 -07:00
Brian Anderson
2082f67765 Begin to support pattern matching on unique boxes
Issue #409
2011-09-23 15:15:30 -07:00
Patrick Walton
87700adb2f rt: Add missing <stdint.h> in rust_abi.h 2011-09-23 15:14:44 -07:00
Patrick Walton
e036c9d8d2 rt: Add missing const on the Windows path 2011-09-23 15:08:37 -07:00
Patrick Walton
557d641175 rt: Get RUST_TRACK_ORIGINS working. You can now call 'debug::dump_origin' in gdb and get a backtrace saying where a box came from. 2011-09-23 15:06:28 -07:00
Jesse Ruderman
7b1a3bb8e6 Add more unreachable-code tests. Closes #935 2011-09-23 15:01:19 -07:00
Marijn Haverbeke
2c7f21c524 Properly mark unreachable alt bodies as unreachable 2011-09-23 23:37:15 +02:00
Marijn Haverbeke
572a4b71d5 Make AddIncomingToPhi take single values rather than arrays 2011-09-23 23:20:19 +02:00
Marijn Haverbeke
64c69aa7b8 Start on a piecemeal conversion to DPS
Issue #667

Wires in a basic framework for destination-passing style, with
backwards-compatibility to the old approach, so that expression types
can be moved over to it one at a time (by moving them from trans_expr
to trans_expr_dps).
2011-09-23 22:49:37 +02:00
Marijn Haverbeke
d114dedf9a Don't return unused values from zero_alloca and trans_stmt 2011-09-23 22:28:05 +02:00
Marijn Haverbeke
abf002ad60 Fix bug where the type of a function's top-level block wasn't fixed up 2011-09-23 22:28:05 +02:00
Patrick Walton
aabff480c9 rt: Factor out stack walking into rust_abi.cpp 2011-09-23 12:49:20 -07:00
Brian Anderson
d10d23f0ad xfail-win32 linked-failure and send-iloop 2011-09-23 12:30:36 -07:00
Patrick Walton
82935c2d17 rt: Fix message formatting issues in rust_debug 2011-09-23 12:27:13 -07:00
Patrick Walton
03f0932a6d rt: ifdef out backtrace() on Windows 2011-09-23 12:26:41 -07:00
Patrick Walton
9226ac9ec5 rt: Fix build bustage due to gcc's format string warnings 2011-09-23 12:09:52 -07:00
Patrick Walton
61afef29a1 rt: Add a RUST_TRACK_ORIGINS debug flag to help track down memory corruption 2011-09-23 11:42:20 -07:00
Patrick Walton
dbdeff659f rt: Factor out the logic that handles the various magic debug environment variables 2011-09-23 11:04:14 -07:00
Patrick Walton
f8007b5535 rt: Remove the problematic min()/max()/align()/abs() macros from isaac/standard.h, as they're unused 2011-09-23 11:04:14 -07:00
Graydon Hoare
18c6cc6371 More steps to arch-specific target libs (#474) 2011-09-23 10:50:16 -07:00
Marijn Haverbeke
5310cf4f30 xfail-pretty unreachable-code.rs 2011-09-23 11:33:27 +02:00
Marijn Haverbeke
348cd86d87 Properly check types of do-while condition expr
Closes #956
2011-09-23 11:19:15 +02:00
Marijn Haverbeke
0bbde048a4 Make sure no dynamic allocas are used before they are allocated
Closes #965
2011-09-23 11:11:37 +02:00
Marijn Haverbeke
49813cffb1 Use a slightly nicer hack to get zero-length strings in trans_build
Wrapping calls in str::by_ref(, ...) heap-allocated an empty string
every time (and looked really bad).
2011-09-23 11:11:37 +02:00
Marijn Haverbeke
420484579d Better handling of unreachable code in trans
The builder functions in trans_build now look at an 'unreachable' flag
in the block context and don't generate code (returning undefined
placeholder values) when this flag is set. Threading the unreachable
flag through context still requires some care, but this seems a more
sane approach than re-checking for terminated blocks throughout the
compiler.

When creating a block, if you use its closest dominator as parent, the
flag will be automatically passed through. If you can't do that,
because the dominator is a scope block that you're trying to get out
of, you'll have to do something like this to explicitly pass on the
flag:

    if bcx.unreachable { Unreachable(next_cx); }

Closes #949. Closes #946. Closes #942. Closes #895. Closes #894.
Closes #892. Closes #957. Closes #958.
2011-09-23 11:09:57 +02:00
Marijn Haverbeke
b029789f02 Remove backward-compatible support for 'mutable' before type.
Closes #966
2011-09-23 09:58:51 +02:00
Brian Anderson
93b9574d32 Remove deprecated mutable type constructor from run-pass/issue-511
This was triggering a warning that was making the pretty-print test fail
2011-09-22 23:08:59 -07:00
Brian Anderson
cee7b4caee Add test for issue #511. Closes #511 2011-09-22 22:50:12 -07:00
Brian Anderson
dbd2ee015a Remove is_stateful flag from tydesc. Closes #136 2011-09-22 22:15:25 -07:00
Brian Anderson
33dd7cc854 Add a test for negative constants. Closes #358 2011-09-22 21:59:09 -07:00
Brian Anderson
0e5f76a718 Fix ty_uniq case in maybe_auto_unbox
Closes #961
Issue #409
2011-09-22 18:14:18 -07:00
Brian Anderson
1a48023a79 Add take glue for unique boxes
Closes #962
Issue #409
2011-09-22 18:05:36 -07:00
Brian Anderson
77fcab043e Remove nonsensical load and store from trans_uniq::copy_val
Issue #409
2011-09-22 17:50:27 -07:00
Brian Anderson
f628003da6 Adda test for returning unique boxes
Issue #409
2011-09-22 17:00:53 -07:00
Brian Anderson
7a76323459 Allow vectors to contain unique boxes. Closes #952
Issue #409
2011-09-22 17:00:53 -07:00
Patrick Walton
e372f943e2 rustc: Write raw type parameters instead of linearized type parameters in object body shapes 2011-09-22 16:13:03 -07:00
Brian Anderson
dfa5bd1114 XFAIL task-comm 2011-09-22 16:09:10 -07:00
Brian Anderson
30a4eab380 Autoderef indexes and fields of unique boxes
Issue #409
2011-09-22 16:06:25 -07:00
Brian Anderson
dff4986f9e Add tests for moving unique boxes
Issue #409
2011-09-22 15:43:08 -07:00
Brian Anderson
d174d917e2 Calculate the correct kind for unique boxes
Issue #409
2011-09-22 15:28:49 -07:00
Brian Anderson
61a14f3df0 Add a test for mutable references to unique boxes as function arguments
Issue #409
2011-09-22 15:03:44 -07:00
Brian Anderson
1367f2b63e Add a test for unique boxes as fn args
Issue #409
2011-09-22 14:55:08 -07:00
Brian Anderson
3bb7035914 Add a test for unique boxes containing shared boxes
Issue #409
2011-09-22 14:39:57 -07:00
Brian Anderson
3f41563cc9 Drop the previous value when copying one unique box local to another
Issue #409
2011-09-22 13:53:34 -07:00
Brian Anderson
7c4fe10f02 Add a test that assignment of unique boxes to locals does a copy
Issue #409
2011-09-22 13:53:34 -07:00
Brian Anderson
67bac873e0 Add assignment to unique box locals
Issue #409
2011-09-22 13:53:33 -07:00
Brian Anderson
268a9fe5fb Initialize unique box locals from other locals
Issue #409
2011-09-22 13:53:33 -07:00
Brian Anderson
5d5136df9f Convert trans_uniq asserts to preconditions
Issue #409
2011-09-22 13:53:33 -07:00
Brian Anderson
c4f02a7925 Sprinkle some asserts through trans_uniq 2011-09-22 13:53:33 -07:00
Brian Anderson
8492eed137 Move uniq trans code to trans_uniq module
Issue #409
2011-09-22 13:53:30 -07:00
Brian Anderson
0f0ba33d82 Factor alloc_uniq from trans_uniq
Issue #409
2011-09-22 13:52:30 -07:00
Brian Anderson
f6ab12a3b1 Don't unify unique boxes with different mutability
Issue #409
2011-09-22 11:10:48 -07:00
Brian Anderson
5ab0840353 XFAIL spawnfail and task-comm-15 2011-09-22 11:06:26 -07:00
Brian Anderson
ea67099234 Add support for mutable unique boxes
Issue #409
2011-09-22 10:26:34 -07:00
Brian Anderson
1b3023e4d0 Convert ty::ty_uniq to contain a mutable type
Issue #409
2011-09-22 10:26:34 -07:00
Brian Anderson
4d088bd528 Call drop glue on the thing in a unique box
Issue #409
2011-09-22 10:26:34 -07:00
Marijn Haverbeke
aad1342e13 Fix long line 2011-09-22 09:23:07 +02:00
Marijn Haverbeke
5e3d0e304f Fix missing cast in do_cc
Apparently not needed on Mac (clang?), but breaking the win and linux boxes.
2011-09-22 09:17:26 +02:00
Patrick Walton
8c02adc630 rustc: Port the fn and obj traversal logic over from the GC branch. Doesn't actually do anything yet due to lack of support in trans. 2011-09-21 19:08:26 -07:00
Patrick Walton
ad3b9c41b4 rt: Implement cycle collection marking. Simple cycles can now be detected. 2011-09-21 18:14:23 -07:00
Brian Anderson
a993621e43 Log and compare unique boxes
Issue #409
2011-09-21 17:08:40 -07:00
Brian Anderson
42fd2a9d89 Remove unused arg from revoke_clean 2011-09-21 15:39:46 -07:00
Brian Anderson
92af552956 Add an unwind test for failure during unique box construction 2011-09-21 14:45:08 -07:00
Brian Anderson
2cc01e2ca2 Add ability to deref unique boxes. Make unique boxes immediates.
Issue #409
2011-09-21 14:40:55 -07:00
Brian Anderson
956bc69330 Add more unwind tests for failure during construction of allocated things 2011-09-21 14:14:17 -07:00
Marijn Haverbeke
80778f642f Revert "rustc: Make bottom types immediates. Add a |log ret| testcase. Closes #935."
This reverts commit f19ab1ff3c.
2011-09-21 21:39:31 +02:00
Patrick Walton
f19ab1ff3c rustc: Make bottom types immediates. Add a |log ret| testcase. Closes #935. 2011-09-21 10:55:28 -07:00
Patrick Walton
fcd17731cf rustc: Don't try to spill bottom types, since we can't make any assumptions about the type of the ValueRef 2011-09-21 10:55:27 -07:00
Marijn Haverbeke
a034f87146 Revert "Implement pattern ranges for all numeric types."
This reverts commit ce0f054f9d.
2011-09-21 18:42:09 +02:00
Marijn Haverbeke
410f73fdb2 Don't write to retptr when returning nil, pass undef for unused params 2011-09-21 17:57:19 +02:00
Graydon Hoare
68d50b5928 Add target_triple to session::options. Use host triple by default, accept --target on command line. 2011-09-21 08:46:44 -07:00