Commit graph

5325 commits

Author SHA1 Message Date
Marijn Haverbeke
6e56ec0066 Move trans_call to destination_passing style
Issue #667

The retptr passed to a function will now often be the actual
destination of the returned value (as in `{field1: func1()}`).
2011-10-04 17:41:34 +02:00
Patrick Walton
53c9b9a5dd rt: Switch the libuv bindings over to not using explicit task pointers 2011-10-03 18:23:30 -07:00
Patrick Walton
3ad4fa00ac rt: Fix comment typo in rust_uv.cpp 2011-10-03 18:23:30 -07:00
Patrick Walton
a7b44e847a rt: Make the builtins no longer take an explicit task parameter 2011-10-03 18:23:30 -07:00
Brian Anderson
b5bb42acfb XFAIL run-fail/linked-failure4. Deadlocks on mac 2011-10-03 14:46:52 -07:00
Patrick Walton
968b66ad40 rustc: Implement C stack stdcall 2011-10-03 13:59:38 -07:00
Brian Anderson
3a6f3cf275 Move compiletest to src/ and cleanup build rules 2011-10-02 17:28:59 -07:00
Haitao Li
e50371060b rustc: Fix link error on Ubuntu Oneiric. Issue #903 2011-10-02 21:29:16 +08:00
Patrick Walton
42287d0fd3 rustc: Call LLVM on the C stack 2011-09-30 18:50:07 -07:00
Patrick Walton
4793a02376 rt: Omit leading underscore on symbol names on Linux 2011-09-30 18:50:05 -07:00
Patrick Walton
e9287e55cc rustc: Stub a --stack-growth option; it's behind a flag for now because it requires patches to LLVM. 2011-09-30 18:21:39 -07:00
Brian Anderson
f525f6e94c Register new snapshots 2011-09-30 18:03:54 -07:00
Brian Anderson
821dd6c02c Change the directory for target libs
This pushes them down from stageN/lib/rustc/$(target) to
stageN/lib/rustc/$(target)/lib in order to make room for a target bin dir
2011-09-30 17:19:24 -07:00
Patrick Walton
c065280a0b rustc: Remove some debug code 2011-09-30 14:26:06 -07:00
Patrick Walton
7ab0897ac6 rustc: Track link_args attributes on C stack cdecl natives as well 2011-09-30 14:25:10 -07:00
Patrick Walton
dcf0e807fb trans: Use inttoptr as appropriate when casting return values of C stack functions 2011-09-30 12:07:50 -07:00
Brian Anderson
de6d07abf9 Register snapshots and finish filesystem reorg 2011-09-29 23:33:44 -07:00
Brian Anderson
80829af872 Remove legacy library search paths 2011-09-29 23:12:31 -07:00
Brian Anderson
b569e9c657 Update snapshot scripts for the new regime 2011-09-29 22:58:34 -07:00
Brian Anderson
196cc6de2e Teach compiletest to construct the PATH variable correctly on win32 2011-09-29 22:58:34 -07:00
Brian Anderson
ab8338fb5a Make rustc's host triple agree with the build system's 2011-09-29 22:58:33 -07:00
Brian Anderson
0148daa058 Reorganize structure of build directory
Each stage is organized more according to Unix standards and to
accommodate multiple target architectures.

stageN/
  bin - rustc lives here
  lib - libraries that rustc needs
  lib/rustc/$(target_triple/ - target libraries
2011-09-29 22:58:33 -07:00
Patrick Walton
79e4961c7f rustc: Remove some debug code 2011-09-29 18:53:00 -07:00
Patrick Walton
f9e3a604a6 rustc: Make the generic C stack function signature include a usable return value 2011-09-29 18:52:23 -07:00
Patrick Walton
5b6dbcb030 stdlib: Un-export str::buf; add a comment 2011-09-29 18:36:27 -07:00
Patrick Walton
3be6cf7ab2 vim: Add pure to the list of keywords 2011-09-29 18:18:37 -07:00
Patrick Walton
dd7ff8dee4 stdlib: Export str::buf 2011-09-29 17:58:51 -07:00
Patrick Walton
a5b422fe6b rustc: Translate calls on the C stack 2011-09-29 17:34:49 -07:00
Patrick Walton
f22601321f rustc: Fix call signature for call_c_stack 2011-09-29 17:34:49 -07:00
Patrick Walton
e31849fb79 rt: Fix assembler for C calls to work more like a regular function call 2011-09-29 17:34:49 -07:00
Patrick Walton
6dece91ed3 stdlib: Add vec::eachi to the standard library 2011-09-29 17:34:49 -07:00
Patrick Walton
c04efec87f rustc: Add upcall stubs for the new C stack upcalls 2011-09-29 17:34:49 -07:00
Patrick Walton
41ab324539 rustc: Generate types in trans for the C-stack native ABI 2011-09-29 17:34:49 -07:00
Marijn Haverbeke
e4436c3a5d Don't build up results for ignored expressions.
Issue #667
2011-09-29 12:02:37 +02:00
Marijn Haverbeke
d74a7a83d7 Fail with an informative error when trying to bind a method
Issue #435
2011-09-29 11:55:29 +02:00
Marijn Haverbeke
d243ea57f5 Move last remaining expression types out of trans_expr
Issue #667
2011-09-29 11:41:45 +02:00
Marijn Haverbeke
f089f533e8 Move expr_cast and expr_copy to DPS style
Issue #667
2011-09-29 10:46:49 +02:00
Marijn Haverbeke
d946e09a72 Move closure construction over to DPS style
Issue #667
2011-09-29 10:36:40 +02:00
Marijn Haverbeke
508c48ce10 Reduce move ops to a construct-in-place when possible 2011-09-29 10:36:40 +02:00
Brian Anderson
15e34deba3 Eliminate glue.o. Closes #990 2011-09-28 15:35:21 -07:00
Brian Anderson
e1ba559c03 Test cases for #985
Other restrictions on pinned kinds happened to fix this

Closes #985
2011-09-28 15:35:21 -07:00
Brian Anderson
cb4e99b688 Don't allow vectors of pinned kinds
Vectors of pinned kinds can't be safe because most interesting uses of vector
perform copies
2011-09-28 15:35:21 -07:00
Brian Anderson
14bac217b0 Make error patterns in some kind tests more specific 2011-09-28 15:35:21 -07:00
Patrick Walton
f7d0c1cec3 rustc: Add a new "C stack cdecl" native ABI 2011-09-28 12:58:33 -07:00
Brian Anderson
657e3ffaf5 xfail-fast run-pass/alt-range.rs 2011-09-28 12:46:29 -07:00
Brian Anderson
381205b747 Revert "Revert "Implement pattern ranges for all numeric types.""
This reverts commit a034f87146.

Conflicts:

	src/comp/middle/check_alt.rs
	src/comp/middle/trans_alt.rs
	src/comp/syntax/ast.rs
	src/comp/syntax/ast_util.rs
	src/comp/syntax/fold.rs
	src/comp/syntax/print/pprust.rs

Conflicts:

	src/comp/middle/trans_alt.rs
2011-09-28 12:46:29 -07:00
Patrick Walton
5fac684af8 vim: const is a keyword 2011-09-28 12:40:34 -07:00
Patrick Walton
d8a80cb31f rt: Add a call stub that switches to the C stack, untested as of yet 2011-09-28 12:26:36 -07:00
Patrick Walton
1eaaae860f rt: Add an upcall to allocate space on the C stack. This will be used for native calls on the C stack. 2011-09-28 11:31:44 -07:00
Patrick Walton
e8757ea01f rt: Expose the C stack inside the Rust scheduler so that C calls can switch to it 2011-09-28 10:22:02 -07:00
Patrick Walton
dbf472b0df rustc: Switch to cdecl for all calls. This is needed to make stack growth efficient, as I need to use eax and ecx in the function prologue and can't afford to stomp on incoming arguments. 2011-09-28 10:22:02 -07:00
Marijn Haverbeke
512cfb4b83 Remove a few kludges that worked around issue #913 2011-09-28 12:59:44 +02:00
Marijn Haverbeke
c94159652a Register new snapshot
It had been a while. I mostly wanted a fix for #913 in stage0.
2011-09-28 12:56:54 +02:00
Marijn Haverbeke
a3a27374bd Don't descend into functions from relax_precond_block
Closes #913
2011-09-28 12:37:28 +02:00
Marijn Haverbeke
759fc101fb Get rid of might_not_init kludge in init_local.
Initializing something is now safe wrt to cleanups (so the cleanup for the
local is only registered after the initialization.)
2011-09-28 11:12:35 +02:00
Marijn Haverbeke
16d5aaa962 Wait with registering cleanups for locals until after the init code ran
Fixes a double-cleanup that was breaking unwind-tup.rs under valgrind.
2011-09-28 10:41:19 +02:00
Marijn Haverbeke
e3626c9405 Use DPS for assignment and local initialization
Issue #667
2011-09-28 09:42:04 +02:00
Wade Mealing
f375391cb6 Patch to error instead of crashing when parsing unmatched double quotes
Patch to error and fail instead of using all available memory
then crashing to detect the error condition of an unmatched
double quote before the end of a file.

I couldn't get it to show nice error messages, so this may not be
the ideal fix.

A test case for this situation has also been added.
2011-09-27 23:20:31 -07:00
Brian Anderson
a96b16e8c3 Make it again possible to initialize resource locals via assignment
Some special cases allow both 'let a <- my_resource(x)' and
'let a = my_resource(x)' to work as expected despite ostensibly being
copies and moves.
2011-09-27 23:20:27 -07:00
Brian Anderson
459353e107 Prevent copies of resources into various things 2011-09-27 21:50:07 -07:00
Patrick Walton
9ba86178ef rt: Store the task in TLS 2011-09-27 18:12:03 -07:00
Brian Anderson
888e22aacc Add more comments about kind checking on local move initializers 2011-09-27 16:03:10 -07:00
Brian Anderson
8217e4bd38 Add xfailed tests that resources can't be copied into various things 2011-09-27 16:03:10 -07:00
Brian Anderson
b8bb663df7 Don't ever raise unique kinds of pinned kinds to shared (again)
So *resource, ~resource, [resource] are all pinned. This is counter to the
design of the kind system, but this way is a much clearer path to type safety.
Once we've established a good baseline with lots of tests, then we can try to
make raising pinned kinds work.
2011-09-27 16:03:10 -07:00
Brian Anderson
e50580aa66 Revert "Use DPS for assignment and local initialization"
This reverts commit b1b202d302.
2011-09-27 16:03:09 -07:00
Brian Anderson
1097463d96 Add an xfailed test for bogus deep copying of things containing resources 2011-09-27 14:28:20 -07:00
Brian Anderson
4bffa5e13a Add an xfailed test for bogus vector addition of typarams 2011-09-27 14:24:28 -07:00
Marijn Haverbeke
04f062f9d4 Fix lurking bug in matching of nil
Which was somehow made visible by the DPS changes.
2011-09-27 22:49:33 +02:00
Marijn Haverbeke
b1b202d302 Use DPS for assignment and local initialization
Issue #667
2011-09-27 20:33:09 +02:00
Marijn Haverbeke
e42f3b8481 Safeguard against self-assignment for unique types 2011-09-27 20:33:09 +02:00
Jesse Ruderman
923aa4744e Test for #924 2011-09-27 11:05:16 -07:00
Marijn Haverbeke
94db38a530 Move expr_unary to DPS style
Issue #667
2011-09-27 17:31:15 +02:00
Marijn Haverbeke
92d63ffa65 Make trans_rec and trans_tup understand overwrite dests
Issue #667
2011-09-27 17:31:15 +02:00
Marijn Haverbeke
8282f7fe80 Move expr_binary into trans_expr_dps
Issue #667
2011-09-27 17:30:54 +02:00
Marijn Haverbeke
806e74fbf5 Move expr_lit and expr_vec into trans_expr_dps
Issue #667
2011-09-27 17:30:45 +02:00
Marijn Haverbeke
8ea72fae99 Move more non-value-returning things to trans_expr_dps.
Issue #667
2011-09-27 17:30:45 +02:00
Brian Anderson
b49f4689f5 Add two xfailed tests for invalid copies into vectors 2011-09-26 23:45:51 -07:00
Brian Anderson
1796abc3ef xfail-win32 -> xfail-fast 2011-09-26 23:34:54 -07:00
Brian Anderson
4f2a0117c7 Try to appease windows by xfail-win32'ing a random test 2011-09-26 23:34:12 -07:00
Brian Anderson
df19b7a13a Test for issue #980 2011-09-26 23:24:53 -07:00
Brian Anderson
6b42ad5ea0 Enforce copy restrictions on let initializers 2011-09-26 22:00:15 -07:00
Brian Anderson
07e13fe447 Make some nocopy tests a bit more futureproof
Turn the let assignment initializers into move initializers since
that assignment is going to become illegal
2011-09-26 22:00:15 -07:00
Jesse Ruderman
20c2d2a999 Distinguish #924 2011-09-26 20:44:57 -07:00
Jesse Ruderman
4ff46a1502 Add a cycle-collection fuzzer 2011-09-26 20:34:07 -07:00
Brian Anderson
3778b6c6a8 Prevent copying of uncopyable things via the copy op 2011-09-26 20:03:30 -07:00
Brian Anderson
755001725a Prevent copying of uncopyable things via compound assignment ops 2011-09-26 20:03:24 -07:00
Brian Anderson
99cbea51a1 Don't allow vectors of pinned kinds to be copied 2011-09-26 19:57:00 -07:00
Brian Anderson
4bee452221 Don't allow copying of unique boxes of pinned kinds
Issue #409
2011-09-26 18:43:49 -07:00
Brian Anderson
2d5e085eb9 Add a test that unique boxes in vectors are copied when the vector is
Issue #409
2011-09-26 17:59:58 -07:00
Patrick Walton
a88d9effbc rt: Don't run arbitrary destructors on cycle collection; that's just broken. 2011-09-26 17:41:22 -07:00
Patrick Walton
5c973142df rt: Turn on cycle collection at task death; add a test case 2011-09-26 16:59:15 -07:00
Patrick Walton
ad19ab4c6f rt: Make the logic that moves environments between tasks update the GC alloc chain correctly 2011-09-26 16:59:15 -07:00
Patrick Walton
47e5ab093a stdlib: Fix typos in comments in lib/test.rs 2011-09-26 16:59:15 -07:00
Brian Anderson
389852b5c0 Fix tags of unique boxes
Issue #409
2011-09-26 14:44:08 -07:00
Brian Anderson
223f5be166 Unique vectors and boxes of pinned are unique kinds. Closes #977 2011-09-26 13:38:46 -07:00
Marijn Haverbeke
8c0918ac18 Construct records and tuples in-place
Issue #667

Now, {a: {b: 10, c: 20}, d: @30} will simply write the values in the right
places, rather than creating intermediary records and then memmoving them.
Cuts about a megabyte off the unoptimized compiler size.
2011-09-26 22:13:08 +02:00
Marijn Haverbeke
5837975f95 Convert more expression types to use DPS
expr_rec, expr_tup, most of the exprs that don't return anything. Make
trans_ret almost trivial by using destination adaptors (trans_save_in,
trans_by_ref).

Issue #667
2011-09-26 21:34:10 +02:00
Marijn Haverbeke
345b5a47bd Add a workaround hack for issue #913
I can't figure out what the real cause of this bug is, but I want
to be able to use blocks inside loops again.
2011-09-26 21:34:10 +02:00
Patrick Walton
37cf7b92c8 test: Fix more typos in weird-exprs.rs. 2011-09-26 10:26:30 -07:00
Patrick Walton
2348858995 test: wierd-exprs -> weird-exprs 2011-09-26 10:24:46 -07:00