Commit graph

3279 commits

Author SHA1 Message Date
Marijn Haverbeke
31ec26d46a Make calling resource destructors work cross-crate
Tydescs are currently re-created for each compilation unit (and I
guess for structural types, they have to be, though the duplication
still bothers me). This means a destructor can not be inlined in the
drop glue for a resource type, since other crates don't have access to
the destructor body.

Destructors are now compiled as separate functions with an external
symbol that can be looked up in the crate (under the resource type's
def_id), and called from the drop glue.
2011-06-30 18:36:12 +02:00
Graydon Hoare
8c36a76626 More fiddling with fast-check, now works on at least one windows machine. 2011-06-30 09:26:17 -07:00
Rafael Ávila de Espíndola
5b7ce80ffa Second try to remove -lssp. 2011-06-30 08:55:25 -04:00
Eric Holk
b3e5b5bd05 Added inheritance for task pinning. Closes #598 for real. 2011-06-29 18:56:34 -07:00
Eric Holk
63dcd325b9 Adding support for pinning tasks to the currently running thread. Closes #598. 2011-06-29 18:47:47 -07:00
Graydon Hoare
afabde19dc More fixes to fast-check. 2011-06-29 17:54:05 -07:00
Brian Anderson
a82aeb7af6 Register new snapshots
Also finish transition of snapshot scripts for new glue.o location
2011-06-29 17:45:54 -07:00
Brian Anderson
865534978f Change snapshot logic to archive glue.o from the lib directory 2011-06-29 15:39:30 -07:00
Graydon Hoare
4e5d32e1c4 Add fast-check target that combines the stage2 run-pass suite into a single executable. 2011-06-29 15:14:55 -07:00
Graydon Hoare
c796a8f24d Re-enable tidy (it was broken) and fix various non-tidy things. 2011-06-29 15:14:55 -07:00
Brian Anderson
190644063e Be more strategic about linking to rust crates
Instead of linking directly to the rust crate, try to figure out the location
and name of the library from the file name, then call gcc with appropriate -L,
-l flags. This will allow dynamic linking to be more forgiving about where it
loads the library from at runtime - currently a stage3 compiler can't run
correctly from the stage0 directory. Only tested on Linux. Fingers crossed.
2011-06-29 14:35:39 -07:00
Brian Anderson
e130e7b598 Display an error when linking fails 2011-06-29 14:35:39 -07:00
Brian Anderson
e60cb9197f Add session.note method 2011-06-29 14:35:39 -07:00
Brian Anderson
4ffa5ddf76 session.err shouldn't take a span 2011-06-29 14:35:39 -07:00
Tim Chevalier
76b755f9ad Remove workaround for a compiler bug that, I guess, got fixed 2011-06-29 14:28:03 -07:00
Tim Chevalier
88447a47c0 Eliminate the --check-claims compiler flag
The option can only be toggled at runtime now.
2011-06-29 14:28:02 -07:00
Tim Chevalier
1ba85932b1 Add a runtime flag to enable/disable claims en masse
Now, if the environment variable CHECK_CLAIMS is set, then all
claims turn into checks. Otherwise, claims are no-ops.
2011-06-29 14:28:02 -07:00
Brian Anderson
d4b5b48e0a Correctly locate the crate's version from the link attribute 2011-06-29 14:21:39 -07:00
Brian Anderson
29afe1a518 Write metadata for sythesized name/vers items to the crate's link attr
If the crate doesn't specify it's name or version, the defaults need to be
exported in the crate metadata
2011-06-29 14:21:39 -07:00
Brian Anderson
308bc31f24 Encapsulate more crate meta calculations 2011-06-29 14:21:39 -07:00
Brian Anderson
325f46da06 Move the calculation of the crate name, vers and cmh to a single function 2011-06-29 14:21:39 -07:00
Rafael Ávila de Espíndola
8c535d4aba Don't enable ssp everywhere. 2011-06-29 16:25:54 -04:00
Graydon Hoare
5b2c17fba5 Fix resource encoding bugs. 2011-06-29 12:14:29 -07:00
Graydon Hoare
750dcc05e4 Make tests a little more friendly to combine. 2011-06-29 12:14:29 -07:00
Patrick Walton
b18cefdfd7 rustc: Fix a leak that resulted from copying a structural interior type containing interior vectors. Add a test case. 2011-06-29 12:16:07 -07:00
Patrick Walton
a2ce532337 rt: Remove the lock around upcall_vec_append. Add a test case. Closes #156. 2011-06-29 10:33:51 -07:00
Rafael Ávila de Espíndola
54f618128e Revert ""Try" push without -lssp on windows to see what needs it."
This reverts commit 47b3e087e9.
2011-06-29 13:25:52 -04:00
Patrick Walton
bbd0d58955 rustc: Unbreak self assignment 2011-06-29 10:22:53 -07:00
Rafael Ávila de Espíndola
47b3e087e9 "Try" push without -lssp on windows to see what needs it. 2011-06-29 12:56:54 -04:00
Michael Sullivan
1d05718c2d Extend visit to use visit_fn to visit fn expressions. 2011-06-29 09:04:00 -07:00
Brian Anderson
bc47804473 Revert "Register new snapshots"
This reverts commit b29886cdeb.
2011-06-28 22:50:20 -07:00
Brian Anderson
b29886cdeb Register new snapshots 2011-06-28 22:24:33 -07:00
Brian Anderson
7c500fc0a0 Replace common::new_seq_hash with an adapter around std::smallintmap
It would be better to either convert ast_map to use smallintmap or make
smallintmap and hashmap follow the same interface, but I don't feel up to
it just now. Closes #585.
2011-06-28 19:48:33 -07:00
Lindsey Kuper
7b5d34aa9a Comments and cleanup. 2011-06-28 19:06:44 -07:00
Lindsey Kuper
57e5cde3a2 Comments and cleanup. 2011-06-28 18:54:56 -07:00
Lindsey Kuper
684c0dc494 Comments and cleanup. 2011-06-28 18:54:56 -07:00
Lindsey Kuper
9155544a5a Comments. 2011-06-28 18:54:56 -07:00
Brian Anderson
6832f75f0b Support attaching attributes to modules via the crate file. Issue #487 2011-06-28 18:39:34 -07:00
Patrick Walton
74f8eb51ae rustc: Move duplicate_heap_parts to copy glue; add a test case 2011-06-28 17:59:30 -07:00
Tim Chevalier
db478ed4de Remove outdated comments 2011-06-28 17:50:07 -07:00
Graydon Hoare
5059c5f8fd Actually notice xfail-stage2 as different from xfail-stage2. Fix affected tests. 2011-06-28 17:36:51 -07:00
Michael Sullivan
b944d8d72e Require that both sides of a swap be lvals. 2011-06-28 17:28:06 -07:00
Graydon Hoare
d79330de26 Fix logic bug in std::fs::dirname. 2011-06-28 17:24:30 -07:00
Brian Anderson
83b7215366 Cleanup attribute code. Issue #487 2011-06-28 16:55:07 -07:00
Brian Anderson
82a74fcb3f Remove the last traces of the distinction between export / local meta items
Issue #487
2011-06-28 16:55:07 -07:00
Patrick Walton
dfcfef41df rustc: Rename take glue to copy glue 2011-06-28 16:52:59 -07:00
Tim Chevalier
9f1444c701 Implement "claim"
Implement "claim" (issue #14), which is a version of "check" that
doesn't really do the check at runtime. It's an unsafe feature.

The new flag --check-claims turns claims into checks automatically --
but it's off by default, so by default, the assertion in a claim
doesn't execute at runtime.
2011-06-28 16:41:06 -07:00
Eric Holk
866ee6ecb4 Re-enabling some tests. 2011-06-28 16:12:34 -07:00
Eric Holk
f6f8a06d6b Resurrecting the runtime unit tests, and modifying them so they compile under the latest refactoring changes. 2011-06-28 16:12:34 -07:00
Eric Holk
657e5a2bd5 Renamed what's left of rust_dom to rust_scheduler 2011-06-28 16:12:33 -07:00
Eric Holk
02f6645fca Moved win32_require to the kernel. 2011-06-28 16:12:33 -07:00
Eric Holk
2f84987a48 Fixed Win32 compile errors. 2011-06-28 16:12:33 -07:00
Eric Holk
49a8cb34d2 Removed dom_owned, splitting things between task_owned and kernel_owned. Had to re-xfail a few tests brson recently un-xfailed. 2011-06-28 16:12:33 -07:00
Eric Holk
f6f945fed5 Moved thread management to rust_kernel. 2011-06-28 16:12:33 -07:00
Eric Holk
c6d8324830 There is only one domain per kernel now. 2011-06-28 16:12:33 -07:00
Eric Holk
1c852ac9c0 Removing runtime tests. The runtime is tested well enough by the standard library tests, so we might as well have less code to fix during refactoring. 2011-06-28 16:12:33 -07:00
Eric Holk
64596e6583 Teach the parser and typechecker to understand port[int](). Closes #588 2011-06-28 16:11:04 -07:00
Brian Anderson
1c6ae8cadf Use span_fatal for failure to find crates 2011-06-28 16:04:09 -07:00
Brian Anderson
46b83a92d6 Add test case for non-matching crate metadata in use statements 2011-06-28 15:58:22 -07:00
Brian Anderson
8ac60e99ea Extract meta_item sorting from back::link to middle::attr 2011-06-28 15:46:09 -07:00
Brian Anderson
aecc5e6e0f Add comments to middle::attr. Issue #487 2011-06-28 15:34:27 -07:00
Brian Anderson
a83b64d15d Rework how linkage attributes are determined
The meta items within a crate's link attribute are used in linkage:

 #[link(name = "std",
        vers = "1.0",
        custom = "whatever")];

Name and vers are treated specially, and everything else is hashed together
into the crate meta hash.

Issue #487
2011-06-28 15:25:47 -07:00
Brian Anderson
0608e277b6 Add some helper functions for attributes. Issue #487 2011-06-28 15:25:47 -07:00
Patrick Walton
7554423423 stdlib: Remove old botch from ufind 2011-06-28 14:16:09 -07:00
Tim Chevalier
d832f7abec Another test for typestate and expr_fn 2011-06-28 13:14:52 -07:00
Tim Chevalier
28459ca0eb Handle lazy binops properly in typestate
The typestate analysis now reflects that the second operand of a
logical and or or may not be evaluated.
2011-06-28 13:07:52 -07:00
Tim Chevalier
a7c4c19d4b add a predicate that determines whether a binop is lazy (and and or are lazy) 2011-06-28 13:07:52 -07:00
Rafael Ávila de Espíndola
d5fc01caef Move glue.o to stageN/lib. 2011-06-28 15:20:43 -04:00
Tim Chevalier
926049eddd Tests only: more tests with constraints and loops 2011-06-28 11:49:11 -07:00
Patrick Walton
1ca0db5421 rustc: Add a "type-owns-heap-mem" cache. 2x translation speedup. 2011-06-28 11:36:11 -07:00
Patrick Walton
5f5b7e3348 rustc: Don't call cmp glue if the type is a simple scalar 2011-06-28 11:24:34 -07:00
Graydon Hoare
0dc2aa3d09 Bit more work on mingw cross. Pending on other changes now (test combination, build artifact locations) 2011-06-28 11:18:34 -07:00
Brian Anderson
cab73f8897 Write metadata for more meta_item types. Issue #487 2011-06-28 10:12:05 -07:00
Brian Anderson
f53c4f79d7 Write metadata for crate attributes. Issue #487 2011-06-28 10:03:41 -07:00
Brian Anderson
894e2229ac Add emacs variables to encoder.rs 2011-06-28 10:03:40 -07:00
Brian Anderson
d328c7e03e List crate attributes when running rustc with '--ls' 2011-06-28 10:03:40 -07:00
Marijn Haverbeke
9561def209 Use 'resource' rather than 'res' as a keyword
Resources are now defined like...

    resource fd(int n) { close(n); }

Calling fd with an int will then produce a non-copyable value
that, when dropped, will call close on the given int.
2011-06-28 18:00:39 +02:00
Marijn Haverbeke
fb14afd5eb Add test cases for resources 2011-06-28 18:00:38 +02:00
Marijn Haverbeke
07125aa38b Fix bug that prevented boxes-in-resources from being freed 2011-06-28 18:00:05 +02:00
Marijn Haverbeke
e2cb97a2fc Add some missing cases for ty_res in ty.rs 2011-06-28 18:00:05 +02:00
Marijn Haverbeke
d730bb730a Make it possible to use * to dereference a resource 2011-06-28 18:00:05 +02:00
Paul Stansifer
b3443eb049 '#simplext' -> '#macro' 2011-06-28 15:02:12 +00:00
Paul Stansifer
c3901cdf8e Add simple syntax extension (#simplext) 2011-06-28 15:02:12 +00:00
Paul Stansifer
b632681780 Add AST fold. 2011-06-28 15:02:12 +00:00
Marijn Haverbeke
be748fc215 Properly guard resource values against double-drop
Ths involved adding an extra field to their representation, so that there is
something to check for zero.
2011-06-28 16:14:15 +02:00
Rafael Ávila de Espíndola
ecc080ed0b Use "" in the native_name as an indication that no extra options have to
be passed to the "linker". Use that for libc.
2011-06-28 08:21:13 -04:00
Patrick Walton
663aa76635 rustc: Call cmp glue directly if we statically know it 2011-06-27 18:35:01 -07:00
Patrick Walton
dfccd5a138 rustc: Fix stack explosion on -O0 from Alloca() instead of alloca() in cmp glue 2011-06-27 18:27:26 -07:00
Tim Chevalier
85b5b2a8e4 Tests for while loops that may invalidate constraints
Wrote some small test cases that use while loops and moves, to
make sure the poststate for the loop body gets propagated into the
new prestate and deinitialization gets reflected.

Along with that, rewrite the code for intersecting states. I still
find it dodgy, but I guess I'll continue trying to add more tests.
Also, I'll probably feel better about it once I start formalizing
the algorithm.
2011-06-27 18:14:23 -07:00
Tim Chevalier
6d1050b1c7 pure_exp should set the state, not extend it
This fixes a bug where de-initializations were getting masked
(and programs that used a variable that had been de-initialized
snuck through).
2011-06-27 18:14:23 -07:00
Brian Anderson
a72481f90b Rename metadata::defs to metadata::tags 2011-06-27 16:43:50 -07:00
Brian Anderson
55944f4e7f Don't export some of the metadata modules 2011-06-27 16:38:57 -07:00
Brian Anderson
df2cfac07f Move what's left of metadata::cwriter into middle::trans 2011-06-27 16:30:27 -07:00
Brian Anderson
45efb1f02a Cleanup in metadata module 2011-06-27 16:30:27 -07:00
Brian Anderson
119193497e Extract metadata::decoder from metadata::creader 2011-06-27 16:30:27 -07:00
Brian Anderson
a3a2cc3d98 Extract metadata::tydecode from metadata::creader 2011-06-27 16:30:27 -07:00
Brian Anderson
33294c7293 Extract llvm-independent code from cwriter to metadata::encoder 2011-06-27 16:30:27 -07:00
Brian Anderson
279a229414 Move metadata tag definition to metadata::defs 2011-06-27 16:30:27 -07:00
Brian Anderson
6c23e09454 Limit exports from metadata::tyencode 2011-06-27 16:30:27 -07:00
Brian Anderson
5601a6f534 Move metadata::cwriter::encode to metadata::tyencode 2011-06-27 16:30:27 -07:00