Commit graph

5692 commits

Author SHA1 Message Date
Brian Anderson
83219269d5 rustc: Remove broken --depend flag 2011-10-28 12:58:10 -07:00
Brian Anderson
2a2945e5de rustc: -h cleanup 2011-10-28 12:51:46 -07:00
Brian Anderson
d106a336cc rustc: Change --OptLevel to --opt-level 2011-10-28 12:49:19 -07:00
Brian Anderson
bab2b37fd0 rustc: Use consistent error handling in main 2011-10-28 11:57:01 -07:00
Brian Anderson
8da8a4a018 rustc: Extract error reporting from codemap 2011-10-28 11:43:07 -07:00
Brian Anderson
f2a3270b9c Reorder statements in rustc main to avoid bounds check 2011-10-28 11:17:07 -07:00
Haitao Li
a81fdf0a5a rustc: Lift output file name handling out of main 2011-10-28 11:12:10 -07:00
Haitao Li
7bb9a54c73 Produce dyn libraries with proper names
Issue #744
2011-10-28 11:05:43 -07:00
Marijn Haverbeke
7dacccde94 Make shared kind the default only for generic functions
You almost never want a function with pinned type params. For
types, objects, resources, and tags, pinned types are actually often
more sane. For most of these, shared rarely makes sense. Only tricky
case is objs -- you'll have to think about the kinds you want there.

Issue #1076
2011-10-28 17:00:14 +02:00
Marijn Haverbeke
6fe7aa4aff Move to blocks, rather than fn@s, in parser.rs 2011-10-28 16:41:56 +02:00
Marijn Haverbeke
7a0aee74bf Move to short type parameter keywords
Issue #1076
2011-10-28 15:25:33 +02:00
Marijn Haverbeke
8e65dffc30 Register snapshot 2011-10-28 15:25:29 +02:00
Marijn Haverbeke
3397fa4701 Move to short kind kinds words in test suite
Issue #1076
2011-10-28 14:57:49 +02:00
Marijn Haverbeke
cba4ddc6a4 Start accepting short keywords for parameter kinds
This is a pre-snapshot commit to be able to implement #1076 without
the bootstrap compiler getting in my way.
2011-10-28 14:57:35 +02:00
Brian Anderson
4bb5a2c43a Remove whitespace 2011-10-27 21:35:08 -07:00
Brian Anderson
d96c419b14 Add std::vec::foldr 2011-10-27 21:34:16 -07:00
Brian Anderson
8ad857f453 Add a test for std::vec::iter2 2011-10-27 21:17:51 -07:00
Brian Anderson
7a7940daca Add reverse iterators to std::vec 2011-10-27 21:09:02 -07:00
Brian Anderson
f1f0e6c06c Remove std::vec::eachi. Same function as iter2. 2011-10-27 20:50:10 -07:00
Brian Anderson
1a89e589a4 Implement vec::foldl without recursion 2011-10-27 20:47:06 -07:00
Brian Anderson
b5ed1c46c0 Add std::vec::iter 2011-10-27 20:30:06 -07:00
Brian Anderson
9c097d19e4 Remove std::int::eq_alias
This is the exact same function as int::eq
2011-10-27 18:23:06 -07:00
Brian Anderson
b16d9019a8 Make option::is_some option::is_none pure 2011-10-27 18:15:58 -07:00
Brian Anderson
91997e79aa Make vec::reversed take [mutable? T] 2011-10-27 17:49:13 -07:00
Brian Anderson
74a1e054eb Make std:vec::grow_fn take an init_op type 2011-10-27 17:06:49 -07:00
Brian Anderson
506ae934f8 Reorder std::vec so the documentation renders better
Put all types first, then predicates, then functions
2011-10-27 17:03:38 -07:00
Brian Anderson
2b85817af8 Convert various functions in std to take lambda blocks 2011-10-27 16:27:47 -07:00
Brian Anderson
cf2624106c Document std::bitv 2011-10-27 15:35:56 -07:00
Brian Anderson
e0715380dc Add more std docs 2011-10-27 14:54:18 -07:00
Brian Anderson
8222fa4e27 Use the std::term color constants in the codemap
Exported constants work now. Woo!
2011-10-27 13:52:00 -07:00
Matt Brubeck
5d6fe1a533 Remove uint::max/min in favor if math::max/min 2011-10-27 13:37:53 -07:00
Matt Brubeck
50d99ec32c Add documentation to std::uint 2011-10-27 13:37:53 -07:00
Matt Brubeck
a9f9227a1c Add std documentation for float and u8 functions 2011-10-27 13:37:53 -07:00
Matt Brubeck
9e4c2b6bc6 Mark uint add/sub/mul/div/rem functions as pure 2011-10-27 13:37:53 -07:00
Matt Brubeck
8dba51b87c Add function aliases for float operators 2011-10-27 13:37:53 -07:00
Matt Brubeck
361adf9f86 Add tests for the 'as' (cast) operator 2011-10-27 13:37:35 -07:00
Brian Anderson
26d839216b Add more std docs 2011-10-27 13:25:20 -07:00
Brian Anderson
00404ebe62 Cleanup in std::task 2011-10-27 11:29:04 -07:00
Brian Anderson
20e4f793e2 More std docs 2011-10-27 11:17:23 -07:00
Brian Anderson
17c651b3b0 Remove task::join_id
This is the old, racy way of joining to a task. It is no longer used.
2011-10-26 20:43:47 -07:00
Brian Anderson
4d669036f3 Add more std documentation 2011-10-26 18:32:34 -07:00
Brian Anderson
197c8543fe Add more std documentation 2011-10-26 11:47:42 -07:00
Brian Anderson
7ae757583a Begin documenting std and add doc generation using naturaldocs
Naturaldocs isn't really that great but it seems easier to get
something working than with doxygen, for which we would need to
convert rust code to something C++ish. We probably want to just
write a rustdoc utility at some point.
2011-10-25 18:01:52 -07:00
Marijn Haverbeke
013107a25c Properly take mutable object fields into account during alias analysis
Closes #1055
2011-10-25 17:57:26 +02:00
Marijn Haverbeke
cfdf193c46 Update our code to new type parameter kind syntax
Closes #1067
2011-10-25 15:56:55 +02:00
Marijn Haverbeke
58c82a8da2 Remove support for @/~-style type param kind annotation
Issue #1067
2011-10-25 15:50:45 +02:00
Marijn Haverbeke
8e7f4a3760 Register new snapshot 2011-10-25 15:23:57 +02:00
Marijn Haverbeke
2884c722fe Step one towards new type param kind syntax
Issue #1067

Needs a snapshot to finalize.
2011-10-25 14:31:56 +02:00
Brian Anderson
ea740a8bb0 Fix long lines 2011-10-24 17:23:34 -07:00
Niko Matsakis
c78b1639b4 fix c-stack-cdecl when used w/ i64 2011-10-24 17:03:18 -07:00
Niko Matsakis
d41385a69b kill errant log_err 2011-10-24 16:06:18 -07:00
Niko Matsakis
a5cbf4b13b remove (unused) fn rust_list_files from win32_fs; that is
defined in fs.rs
2011-10-24 16:06:18 -07:00
Niko Matsakis
8f2d75d53c switch over sqrt from llvm to c-stack-cdecl, exposing a bug in
the supported return types of upcall_c_stack
2011-10-24 16:06:18 -07:00
Niko Matsakis
d69a83b021 add implicit ctx 2011-10-24 16:06:18 -07:00
Niko Matsakis
e308f3346b remove unused task ptr arg 2011-10-24 16:06:18 -07:00
Niko Matsakis
c81808a9f7 update intrinsics file 2011-10-24 16:06:18 -07:00
Niko Matsakis
973a285371 move uses of rust ABI in tests to cdecl or c-stack-cdecl as appr
Note: I found a bug in c-stack-cdecl which codes not permit such
native functions to be used as values.  I added an xfail-test
(c-stack-as-value) documenting it.
2011-10-24 16:06:18 -07:00
Niko Matsakis
f8de679c1e move remaining task natives to cdecl ABI (run on rust stack) 2011-10-24 16:06:18 -07:00
Niko Matsakis
e838edc0b3 isolate those funcs in task that can run on the c stack 2011-10-24 16:06:17 -07:00
Niko Matsakis
fb48817ade work around bug when calling c-stack-cdecl fns from outside crate
In the main test, I call the wrapper instead of the native fn, as intended.
I also added an xfail-test that exercises the broken code path.  Will
file a bug.

Description of the broken code path:

The code path is that when we look up the external identifier we go through
trans_external_path() ->  type_of_ty_param_kinds_and_ty() ->
type_of_fn_from_ty() -> type_of_fn(), and type_of_fn() adds a lot of external
parameters. Problem is, I guess, that we don't pass the native ABI (or even the
fact that it's a native function!), just the types and kinds of the parameters.
2011-10-24 16:06:17 -07:00
Niko Matsakis
02d7a1e781 move sys fns into c-stack-cdecl and get_type_desc() into rusti
there is one test failure, stdtest/sys.rs, which inexplicably
(thus far) fails to compile because it invokes
sys::rustrt::last_os_error() instead of invoking
sys::last_os_error().  If stdtest/sys.rs is updated to invoke
the wrapper, it passes.  Still tracing the source of this error.
2011-10-24 16:06:17 -07:00
Niko Matsakis
0598635bdc migrate leak 2011-10-24 16:06:17 -07:00
Niko Matsakis
8eb336a705 migrate rust_run_program 2011-10-24 16:06:17 -07:00
Niko Matsakis
5ddc15e42e migrate debugging funcs 2011-10-24 16:06:17 -07:00
Niko Matsakis
c04f42e2c7 migrate sched_threads call 2011-10-24 16:06:17 -07:00
Niko Matsakis
6910552698 convert str methods to c-stack-cdecl 2011-10-24 16:06:17 -07:00
Niko Matsakis
12ab0d66f5 make time module use c-stack-cdecl 2011-10-24 16:06:17 -07:00
Niko Matsakis
96629d5c21 move rand functions into c-stack-cdecl mode 2011-10-24 16:06:17 -07:00
Niko Matsakis
35e01e0137 remove unnecessary && from various file routines 2011-10-24 16:06:17 -07:00
Niko Matsakis
af99b4b0dc move more native "rust" to native "c-stack-cdecl" 2011-10-24 16:06:16 -07:00
Niko Matsakis
910f7c6dd3 move io.rs natives from "rust" to "c-stack-stdlib" 2011-10-24 16:06:16 -07:00
Niko Matsakis
b13e7e0f3d move fs routines to c-stack-stdlib 2011-10-24 16:06:16 -07:00
Niko Matsakis
4880065429 rip out unused task pointers 2011-10-24 16:06:16 -07:00
Niko Matsakis
d9b23cb022 move comm functions out of rust abi 2011-10-24 16:06:16 -07:00
Niko Matsakis
44697a4293 purge log_err 2011-10-24 16:06:16 -07:00
Niko Matsakis
e590869c8f update vec libs to use c-stack-cdecl calling convention 2011-10-24 16:06:16 -07:00
Brian Anderson
548c92df9c Register snapshots 2011-10-24 13:10:41 -07:00
Brian Anderson
ff669cf5ad Revert "Register snapshots"
This reverts commit 6e40f705c1.
2011-10-23 20:40:42 -07:00
Brian Anderson
3571061bcc Revert "Register snapshots"
This reverts commit 24a6d334b7.
2011-10-23 20:40:33 -07:00
Brian Anderson
24a6d334b7 Register snapshots 2011-10-23 20:11:07 -07:00
Brian Anderson
6e40f705c1 Register snapshots 2011-10-23 19:41:55 -07:00
Austin Seipp
1703e9ec89 Fix an insane rt build error running 'make check -j3' 2011-10-23 19:04:49 -07:00
Brian Anderson
4c95c52016 Remove a test binary that shouldn't exist 2011-10-23 14:23:09 -07:00
Brian Anderson
b916c57021 Update src/etc/gyp-uv
Make instructions more accurate. Make the sed commands work on linux.
2011-10-22 17:38:27 -07:00
Brian Anderson
bdbeb75bfb Upgrade libuv to 179f475b2ad64729feb0422f06ce133cb364482a 2011-10-22 17:37:18 -07:00
Brian Anderson
81a44ccacf Remove hack to break the AST fold cycle. Closes #998 2011-10-21 17:47:31 -07:00
Brian Anderson
160c56e768 Get 'make tidy' to work rustllvm and rt again 2011-10-21 17:35:52 -07:00
Brian Anderson
93d940de54 Register snapshots 2011-10-21 17:27:17 -07:00
Brian Anderson
739b1b5b53 Cycle-collect objects 2011-10-21 17:21:59 -07:00
Niko Matsakis
020726c981 update trans_c_stack_native_call() to use type_of_explicit_args()
currently trans_c_stack_native_call() had some ad-hoc code for
determining the type of the arguments. this code was not in
agreement with the rest of trans. now it uses the same code path.
2011-10-21 16:19:28 -07:00
Niko Matsakis
67d3d9308f add get_type_desc to list of exported funcs 2011-10-21 16:19:27 -07:00
Niko Matsakis
cdf91bbf9a add get_type_desc function to library 2011-10-21 16:19:27 -07:00
Niko Matsakis
80102c9d24 avoid extra load for by_mutable_ref parameters 2011-10-21 16:19:27 -07:00
Brian Anderson
7ab6315f5f Free vectors during cc sweep 2011-10-21 16:07:40 -07:00
Brian Anderson
2d713215a8 Record the internal reference count of environment boxes. Closes #981 2011-10-21 14:05:16 -07:00
Marijn Haverbeke
6c4c33e009 Clean up character pattern in float.rs
This is actually a test to see if I fixed the bot.
2011-10-21 21:06:54 +02:00
Marijn Haverbeke
b0a72ee06a Be more careful when parsing block calls
Previously, the parser would try to interpret this as a block call:

    if true {} // No semicolon
    {|i, am, a, block|};

Which, though unlikely, might come up in practice.
2011-10-21 14:55:54 +02:00
Marijn Haverbeke
3b5b93221e Remove some semicolons after block calls
The remaining ones can be removed after the next snapshot. (Or
we can let the next pretty-print pass take care of them.)
2011-10-21 14:24:42 +02:00
Marijn Haverbeke
7114702496 Change the way block calls are parsed, mark them as block-calls.
This makes it possible to omit the semicolon after the block, and will
cause the pretty-printer to properly print such calls (if
pretty-printing of blocks wasn't so broken). Block calls (with the
block outside of the parentheses) can now only occur at statement
level, and their value can not be used. When calling a block-style
function that returns a useful value, the block must be put insde the
parentheses.

Issue #1054
2011-10-21 14:24:14 +02:00
Marijn Haverbeke
0ce40f60e7 Drop support for iter, put, and for-each
Closes #1056
2011-10-21 13:47:24 +02:00
Marijn Haverbeke
050170d2af Remove remaining uses of iter and for-each
Issue #1056
2011-10-21 13:34:35 +02:00
Marijn Haverbeke
fd5a08384d Move ast_util::pat_bindings over to new iter system.
Issue #1056
2011-10-21 12:41:42 +02:00
Marijn Haverbeke
6bcb4a426c Remove last uses of iterators from stdlib
Issue #1056
2011-10-21 12:31:48 +02:00
Marijn Haverbeke
4ebbbe597e Move hash table iteration over to block-taking functions
Issue #1056
2011-10-21 12:21:27 +02:00
Marijn Haverbeke
9bb4595c53 Register new snapshot
(For block argument syntax.)
2011-10-21 11:56:39 +02:00
Marijn Haverbeke
f134261ae6 Support Ruby-style block argument syntax
Issue #1054
2011-10-21 11:32:26 +02:00
Brian Anderson
0b791f5143 Restore broken tests in stdtest::test 2011-10-20 21:00:50 -07:00
Brian Anderson
d24894e181 Remove unused empty_fn_ty from rustc::front::test 2011-10-20 20:54:12 -07:00
Brian Anderson
4ef2c37059 Give native functions proto_bare 2011-10-20 20:53:52 -07:00
Brian Anderson
ebc61e39d7 Remove temporary fn# syntax 2011-10-20 20:34:04 -07:00
Brian Anderson
6fb9d4f83b Remove typeck::proto_to_ty_proto 2011-10-20 20:30:20 -07:00
Brian Anderson
f64d47a61e Register snapshots 2011-10-20 19:54:57 -07:00
Brian Anderson
c10eb221da Get windows working under the bare function regime
Had to ignore some task failure tests due to the current implementation
of spawn which guarantees that there's always something in the spawned
task that needs to be unwound.

Fixed some win-specific build problems.
2011-10-20 18:23:48 -07:00
Brian Anderson
5c38f7dfd7 Don't allow fn@ items
fn@ is intended to be caputring but isn't implemented.
2011-10-20 18:23:48 -07:00
Brian Anderson
9efdd0f326 Merge ast::proto_shared and ast::proto_closure
Now they are both just proto_shared and proto_shared takes an
argument indicating that it is sugared as 'lambda'
2011-10-20 18:23:48 -07:00
Brian Anderson
4b30a06abe Rename ast::proto_fn to ast::proto_shared 2011-10-20 18:23:48 -07:00
Brian Anderson
29ad3bdb10 Make fn denote a bare function. Convert fn to fn@ as needed 2011-10-20 18:23:48 -07:00
Brian Anderson
f324704c0a Parse obj methods as proto_bare
I don't know if this is the right thing to do, but it works
and it lets 'fn' always mean proto_bare
2011-10-20 18:23:48 -07:00
Brian Anderson
391e12124b Tweak typecheck to enforce covariance on higher-order function arguments 2011-10-20 18:23:48 -07:00
Brian Anderson
342a400e79 Remove type coercion from fn to block
fn is a proper subtype of block now
2011-10-20 18:23:48 -07:00
Brian Anderson
8136b92ee8 Give subtype relationships to function types 2011-10-20 18:23:48 -07:00
Brian Anderson
ed985b61d5 Bare functions can coerce to blocks 2011-10-20 18:23:48 -07:00
Brian Anderson
354bfc8292 Bare functions can coerce to shared closures 2011-10-20 18:23:48 -07:00
Brian Anderson
3bb020aaf8 Revert "Remove the environment argument from bare functions"
This reverts commit 1b0f1f0b79.
2011-10-20 18:23:48 -07:00
Brian Anderson
070c39ca1d Split parsing of fn proto between types, items and anons
The meaning of various fn incantations is going to get temporarily confusing
2011-10-20 18:23:47 -07:00
Brian Anderson
686d6a485f Drop the 2 from the spawn*2 functions
Issue #1022
2011-10-20 18:23:47 -07:00
Brian Anderson
e0bba33caa Rename std::task::spawn_inner to unsafe_spawn_inner
Delete the rest of the old, unused spawn functions.

Issue #1022
2011-10-20 18:23:47 -07:00
Brian Anderson
446aea11d0 Stop exporting unsafe spawn functions
Issue #1022
2011-10-20 18:23:47 -07:00
Brian Anderson
3b54dcfa79 Convert the test runners to typesafe spawn
Issue #1022
2011-10-20 18:23:47 -07:00
Brian Anderson
1abebf042a Convert std::aio to new spawn functions
Issue #1022
2011-10-20 18:23:47 -07:00
Brian Anderson
a4956a7cdd XFAIL task-perf-word-count-generic
This can't be done with bare functions.

Issue #1022
2011-10-20 18:23:47 -07:00
Brian Anderson
ac671c3172 Convert tests to use bare-fn spawn
Issue #1022
2011-10-20 18:23:47 -07:00
Brian Anderson
4341e50e3a Add safe versions of spawn using bare functions
Currently they just wrap the unsafe versions. Will need to be rewritten
eventually.

Issue #1022
2011-10-20 18:23:47 -07:00
Brian Anderson
034408c40a Convert DPRINT to LOG in rust_cc.cpp and add more logging 2011-10-20 18:19:06 -07:00
Brian Anderson
dcee98b024 Un-xfail-fast some tests
check-fast is more reliable now.
2011-10-20 16:01:24 -07:00
Brian Anderson
28161fcf3c Change run-pass/lots-a-fail.rs from xfail-fast to xfail-win32
All failing tasks leak on windows now
2011-10-20 16:00:13 -07:00
Brian Anderson
0714bb5f7d Fix the problem with check-fast randomly failing
Trans has been assuming that tag node id's are unique across crates and they
are not so, depending on which way the wind is blowing, it would choose to use
a crate-local tag variant instead of the correct one from std.

No test case since I can't come up with a reliable one that compiles in a
reasonable amount of time.
2011-10-20 15:38:51 -07:00
Marijn Haverbeke
f8f1d950ef Register new snapshots 2011-10-20 17:36:29 +02:00
Marijn Haverbeke
ba1c6fcf38 Remove the last vestiges of main.ll
Closes #992
2011-10-20 17:36:28 +02:00
Marijn Haverbeke
ef63f09dcd Don't rely on main.ll anymore
I'll remove the actual file after I register a snapshot.

Issue #992
2011-10-20 17:18:38 +02:00
Marijn Haverbeke
cff9c67674 Output linker errors, when linking fails 2011-10-20 15:30:27 +02:00
Marijn Haverbeke
8124846b2c Get rid of taskpointer-passing throughout the compiler
Only intrinsics still take a dummy taskptr. We'll have to do some
makefile stunts to snapshot a version without taskptrs-in-intrinsics.

Issue #466
2011-10-20 14:22:17 +02:00
Marijn Haverbeke
457683c7fe Do not pass taskpointers to "rust" native functions
Issue #466
2011-10-20 14:22:17 +02:00
Marijn Haverbeke
6323a012bd Remove taskptr argument from upcalls
Issue #466
2011-10-20 13:15:21 +02:00
Marijn Haverbeke
e927df17f7 Remove spawn_wrap and main_wrap kludges
This isn't needed now that our functions are cdecl (and was apparently
only still working by accident).

Issue #992
2011-10-20 13:15:09 +02:00
Marijn Haverbeke
243c5c3479 Use snap runtime, and the old main.o, for stage1
This is intended to be reverted again after I register the next
snapshot.
2011-10-20 13:14:28 +02:00
Brian Anderson
880b1ec9f5 Fail nicer when the parser doesn't find an expected string literal
Closes #1028
2011-10-19 18:04:44 -07:00
Matt Brubeck
15d33f7957 Fix parse error in constrained-type-missing-check.rs 2011-10-18 16:42:00 -07:00
Brian Anderson
f70a894855 Register snapshots 2011-10-18 12:08:15 -07:00
Brian Anderson
ac276f7016 Introduce fn@ as a synonym for fn 2011-10-18 11:14:02 -07:00