Commit graph

5929 commits

Author SHA1 Message Date
Patrick Walton
e6c3c4e48c rt: More work on morestack 2011-11-17 10:52:59 -08:00
Haitao Li
388eed383f rustc: Add a flag '--warn-unused-imports'
Followup of issue #889
2011-11-17 09:28:30 +01:00
Haitao Li
fe6484d3e6 rustc: Fix warn on unused import bug
rustc generates incorrect warning for cascaded import declarations like:

  use std;
  import std::io;
  import io::println;
  fn main() { println("hello"); }

  warning: unused import io

A followup of issue #889
2011-11-17 09:27:17 +01:00
Niko Matsakis
bfc81352aa remove unused flag (thanks lht) 2011-11-16 21:52:01 -08:00
Stefan Plantikow
99c421f01d Removed --no-typestate flag from rutsc
Fixes issue #1139
2011-11-16 18:52:46 -08:00
Brian Anderson
02cebbb9f1 Revert "rt: More work on morestack"
This reverts commit 68aff2ad6d.
2011-11-16 18:49:19 -08:00
Brian Anderson
5559e149e4 Revert "rt: Make stack growth code build on Linux"
This reverts commit da4b7da4e1.
2011-11-16 18:49:07 -08:00
Brian Anderson
55f89dbed9 rustc: Fix help text for --sysroot 2011-11-16 18:35:30 -08:00
Brian Anderson
da4b7da4e1 rt: Make stack growth code build on Linux 2011-11-16 18:33:00 -08:00
Patrick Walton
68aff2ad6d rt: More work on morestack 2011-11-16 18:00:57 -08:00
Brian Anderson
8199558443 rt: Remove an unnecessary check from rust_task::yield 2011-11-16 17:55:04 -08:00
Brian Anderson
bae817efe6 rt: Remove rust_task::notify_tasks_wating_to_join 2011-11-16 17:22:14 -08:00
Brian Anderson
342dc21d2c Disconnect ports before draining them. Issue #1155 2011-11-16 17:22:14 -08:00
Niko Matsakis
809ca13bfa fix minor merge errors 2011-11-16 16:13:43 -08:00
Niko Matsakis
c22ad0752f wrap long line 2011-11-16 15:27:49 -08:00
Niko Matsakis
2b8cf89ba2 correct signed-ness and long line 2011-11-16 15:27:49 -08:00
Niko Matsakis
037a1de405 apply calling convention at call site too 2011-11-16 15:27:09 -08:00
Niko Matsakis
834b6879ea temp workaround for failure to pass ulonglong successfully 2011-11-16 15:27:09 -08:00
Niko Matsakis
62b298ee13 missed merges 2011-11-16 15:27:08 -08:00
Niko Matsakis
cbcdeb80d9 remove wrappers from intrinsics 2011-11-16 15:27:08 -08:00
Niko Matsakis
23bb158acb fix win32 types, make close() use i32 as return type 2011-11-16 15:27:08 -08:00
Niko Matsakis
e3699a2636 make stdcall use shim 2011-11-16 15:24:56 -08:00
Brian Anderson
d2199e8716 Various fixes for x86_64 on linux
Configure LLVM correctly, use the right data layout, add the readlink
function back, fix C constants, etc.
2011-11-16 15:24:56 -08:00
Niko Matsakis
319f3b02f3 fix natives with user-specified link names, remove unused imports 2011-11-16 15:24:38 -08:00
Niko Matsakis
c572b793fe fix mismatched types---make check passes on x86_64! 2011-11-16 15:24:37 -08:00
Niko Matsakis
25bc37cef9 refactor all unix types 2011-11-16 15:24:08 -08:00
Niko Matsakis
b27a88e99c fix bug in shape where s_int/s_uint were not customized to platform 2011-11-16 15:16:43 -08:00
Niko Matsakis
9043bd9778 wrap long line; 2011-11-16 15:16:43 -08:00
Niko Matsakis
b3ae63c9d9 temporarily disable these tests b/c they crash rustc 2011-11-16 15:16:43 -08:00
Niko Matsakis
5aaafa704f adjust alignment, size of tag variant id and make it easy to
adjust in the future
2011-11-16 15:16:43 -08:00
Niko Matsakis
cb9675259f enable comments in generated asm, ll 2011-11-16 15:16:42 -08:00
Niko Matsakis
96cdfa11db correct translation of neg. numbers in 64-bit architectures 2011-11-16 15:16:42 -08:00
Niko Matsakis
5cabfb3a39 remove fixed FIXME 2011-11-16 15:16:42 -08:00
Niko Matsakis
26b0662fb8 fix alignment for chan_handle structs; rust equiv is translated
to char[16], not struct{long,long}
2011-11-16 15:16:42 -08:00
Niko Matsakis
69911c2bc1 temp. disable cycle coll. on x86_64 2011-11-16 15:16:41 -08:00
Niko Matsakis
b78c096ebc enum does not have a size consistent with a tag, so use unsigned long instead 2011-11-16 15:16:41 -08:00
Niko Matsakis
0cea1095b1 change u32 to uint. maybe we want an intptr_t built-in type. 2011-11-16 15:16:41 -08:00
Niko Matsakis
59e2a0a9c1 add shim upcall func 2011-11-16 15:16:40 -08:00
Niko Matsakis
4fc34e23fa wrap long line 2011-11-16 15:16:40 -08:00
Niko Matsakis
d77968dd7c finish up the shim approach 2011-11-16 15:16:40 -08:00
Niko Matsakis
4f28419d0c add back call to zero_and_revoke 2011-11-16 15:16:40 -08:00
Niko Matsakis
3617f0377f correct alignment 2011-11-16 15:16:40 -08:00
Niko Matsakis
85083ec51b begin efforts to use shim functions for c-stack calls 2011-11-16 15:16:40 -08:00
Brian Anderson
b655fb9ea7 Replace 'mutable?' with 'const' 2011-11-16 14:41:32 -08:00
Brian Anderson
1d361f6806 Register snapshots 2011-11-16 14:38:15 -08:00
Brian Anderson
045a437556 rustc: Accept 'const' as synonym for 'mutable?' 2011-11-16 13:52:08 -08:00
Brian Anderson
f157d0b32c Fix S_IRUSR/S_IWUSR constants on mac. Closes #726 2011-11-16 12:18:15 -08:00
Brian Anderson
a362d85329 Add a test that native mods don't need to declare an ABI 2011-11-16 11:36:46 -08:00
Haitao Li
88f29aab27 Use attributes for native module ABI and link name
This patch changes how to specify ABI and link name of a native module.

Before:
  native "cdecl" mod llvm = "rustllvm" {...}

After:
  #[abi = "cdecl"]
  #[link_name = "rustllvm"]
  native mod llvm {...}

The old optional syntax for ABI and link name is no longer supported.

Fixes issue #547
2011-11-16 11:35:13 -08:00
Brian Anderson
7a9b66db63 Register snapshots 2011-11-16 11:35:13 -08:00
Haitao Li
fba0df72d3 Use attributes for native module ABI and link name [temp]
This patch adds support of using attributes to specify native mode ABI
and link name. The old optional syntax like:
  native "cdecl" mod llvm = "rustllvm" { ... }
is still supported.

This is a transitional commit to avoid making a stage1 (backward
imcompatible) snapshot.
2011-11-16 23:45:07 +08:00
Haitao Li
3b683f5205 rustc: Use link_name attribute for native function
Fixes issue #906
2011-11-16 23:45:07 +08:00
Brian Anderson
a7fc5decab stdlib: Turn function calls into constants. Fix win32 breakage 2011-11-15 18:14:13 -08:00
Stefan Plantikow
378652f885 Fixed typo in constant value #1165 2011-11-15 18:02:45 -08:00
Stefan Plantikow
d335d1a169 Replaced constant functions with actual constants in std and updated tests
Fixes issue #1165
2011-11-15 18:02:45 -08:00
Brian Anderson
a7188a6577 rustc: Don't sign extend uints during translation
Doing so produces incorrect results on a 32-bit compiler targeting 64-bits
2011-11-15 17:53:44 -08:00
Brian Anderson
f47f92235a Make run-pass/bitwise 64-bit compatible 2011-11-15 17:01:06 -08:00
Brian Anderson
dd5512ccb0 Support conditional compilation based on architecture
target_os = "x86" or target_os = "x86_64"
2011-11-15 16:33:09 -08:00
Brian Anderson
47d875e002 Make run-pass/native-fn-linkname's main take no args
check-fast doesn't like it.
2011-11-15 10:09:33 -08:00
Haitao Li
eae478cd74 Use native fn's link name attribute if given
Fixes issue #905
2011-11-15 22:31:33 +08:00
Marijn Haverbeke
a09dcd94c5 Fix some indentation and idioms in rope.rs
Sorry for the pedantry. I was handling a compilation bug related to this code,
and it just jumped out at me.
2011-11-15 13:32:35 +01:00
Marijn Haverbeke
9ff6f816ba Fix handling of loops and conditionals in alias.rs
It now threads information about invalidated aliases through the AST
properly. This makes it more permissive for conditionals (invalidating
an alias in one branch doesn't prevent you from using it in another),
and less permissive for loops (it now properly notices when a loop
invalidates an alias that it might still use in another iteration).

Closes #1144
2011-11-15 13:29:57 +01:00
Brian Anderson
81d9717864 xfail-fast run-pass/native-dupe.rs
This test calls the task pin function which has side effects and causes
other tests to lock.
2011-11-14 19:26:43 -08:00
Patrick Walton
b3cf0c4d1b Revert "rt: More work on morestack"
This reverts commit ced0d4f15e.
2011-11-14 16:20:53 -08:00
Patrick Walton
ced0d4f15e rt: More work on morestack 2011-11-14 16:17:08 -08:00
Brian Anderson
5b9f76eb7c stdlib: Run cleanups on data that fails to send 2011-11-14 14:07:52 -08:00
Brian Anderson
c74fd1dc77 Un-xfail-win32 two tests that should actually work 2011-11-14 13:13:44 -08:00
Haitao Li
b8dd148444 rustllvm: Add a GetOrInsertFunction wrapper
Fixes issue #1161

Test-case-by: Brian Anderson <banderson@mozilla.com>
Signed-off-by: Haitao Li <lihaitao@gmail.com>
2011-11-15 00:33:29 +08:00
Brian Anderson
f619d5e9e2 rt: Add locking invariants to rust_port 2011-11-13 16:38:34 -08:00
Brian Anderson
58e923de6e rt: Perform task notification before killing the parent task 2011-11-13 16:36:47 -08:00
Brian Anderson
138d9ca5d5 Drop enqueued elements when a port is destructed. Closes #1155 2011-11-13 15:43:58 -08:00
Brian Anderson
3cc2641fc3 Make various binops not typecheck for unsafe pointers. Closes #1173 2011-11-13 13:55:12 -08:00
Brian Anderson
768306badd Add test for #783. Closes #783 2011-11-11 17:14:30 -08:00
Brian Anderson
9b9fc33663 Rehabilitate run-fail/linked-failure4.rs 2011-11-11 16:52:07 -08:00
Brian Anderson
b2dd5f5cff Rehabilitate run-pass/task-killjoin.rs 2011-11-11 16:52:07 -08:00
Brian Anderson
a6f9f73f06 rt: Make rust_port's ref counting non-atomic
Now that the task lock must be held there's no need for atomicity
2011-11-11 16:12:48 -08:00
Brian Anderson
d645f87c6d Rehabilitate run-pass/task-comm.rs 2011-11-11 16:11:34 -08:00
Brian Anderson
3d9023fa4d rt: Take the task lock when dropping port refcounts
Sucks, but otherwise there are races when one task drops the refcount to zero
followed by another bumping it again
2011-11-11 16:11:31 -08:00
Brian Anderson
07771ec25b Fix run-fail/spawnfail
Catch the case where a parent is killed immediately before it terminates
normally.
2011-11-11 14:20:00 -08:00
Brian Anderson
fcdb313bd5 Give task-perf-word-count default behavior. Closes #1172 2011-11-11 12:35:43 -08:00
Brian Anderson
2385deaa0d rt: Add locking invariants to rust_task 2011-11-11 12:11:21 -08:00
Brian Anderson
5e0e32faac rt: Remove drop_port. Unused 2011-11-11 12:11:21 -08:00
Brian Anderson
5d1e321ecb rt: Remove rust_chan 2011-11-11 12:11:21 -08:00
Haitao Li
39084fb881 Remove unused "--check-unsafe" flag
Fixes issue #1138
2011-11-12 00:01:37 +08:00
Elly Jones
24b6645156 str: add escape()
Signed-off-by: Elly Jones <elly@leptoquark.net>
2011-11-10 19:53:28 -08:00
Haitao Li
7ee8b852fd Cleanup unused imports in tests 2011-11-10 19:19:40 -08:00
Haitao Li
5a7249c935 Cleanup unused imports 2011-11-10 19:19:40 -08:00
Haitao Li
9bc2f1800d rustc: Add support of warning on unused imports
Fixes issue #889
2011-11-10 19:19:10 -08:00
Brian Anderson
f705f68121 rt: Remove rust_aio.cpp. Bitrotted. 2011-11-10 18:02:08 -08:00
Brian Anderson
6c108aade9 stdlib: Remove sio and aio. Bitrotted. 2011-11-10 17:59:26 -08:00
Brian Anderson
793da65a8e rt: Move rust_chan::send to rust_port::send 2011-11-10 17:53:19 -08:00
Brian Anderson
371574f64b rt: Remove rust_token. Unused 2011-11-10 17:35:21 -08:00
Brian Anderson
f5c4ce79a7 rt: Remove del_chan, take_chan, drop_chan. Unused 2011-11-10 17:28:28 -08:00
Brian Anderson
e4f980810b rt: Simplify channel-port association
It turns out that there's only ever a single channel per port these days,
and it always has the same lifetime as the port, so we don't need a list or a
complex association protocol.
2011-11-10 17:26:22 -08:00
Brian Anderson
08d0ff38bc rt: Remove new_chan. Not needed 2011-11-10 15:59:31 -08:00
Brian Anderson
0dc8387995 rt: Remove chan_send. Unused. 2011-11-10 15:36:09 -08:00
Brian Anderson
2e8ebb7c27 stdlib: Update the example in std::comm
Due to a bug in channel destructors this examples fails when logging is off

Issue #1155
2011-11-10 15:18:01 -08:00
Josh Matthews
43cb74b830 Add float support to #fmt. Fix #1014. 2011-11-10 11:40:34 -08:00
Niko Matsakis
7baf68b0bd hack around the problem that x86_64 expects first few args in regs.
call on c-stack expects all data to be delivered on the stack.
2011-11-09 20:05:49 -08:00
Niko Matsakis
fc064f4410 use uint64_t when adjusting stack ptr 2011-11-09 20:05:49 -08:00
Brian Anderson
0d9e32d70d Rename "c-stack-stdcall" ABI to "stdcall" 2011-11-09 18:45:25 -08:00
Brian Anderson
b7ab28b50f Rename "c-stack-cdecl" ABI to "cdecl" 2011-11-09 18:44:12 -08:00
Brian Anderson
2b9b6e3521 Register snapshots 2011-11-09 17:55:12 -08:00
Brian Anderson
d26a96d2bb Add "cdecl" as synonym for "c-stack-cdecl" 2011-11-09 16:47:44 -08:00
Brian Anderson
e96342820d Add "stdcall" as synonym for "c-stack-stdcall" 2011-11-09 16:47:44 -08:00
Brian Anderson
1afc943c91 rustc: Rename native_abi_c_stack_cdecl to native_abi_cdecl 2011-11-09 16:47:44 -08:00
Brian Anderson
10c35959e7 rustc: Rename native_abi_c_stack_stdcall to native_abi_stdcall 2011-11-09 16:47:44 -08:00
Brian Anderson
c7f0ca6063 Remove native "x86stdcall" ABI 2011-11-09 16:47:43 -08:00
Brian Anderson
dec6b53761 Convert last use of "x86stdcall" ABI to "c-stack-stdcall" 2011-11-09 16:47:43 -08:00
Brian Anderson
3204f7e4c3 Register snapshots 2011-11-09 16:46:35 -08:00
Brian Anderson
4a4d31cf0e Make native "c-stack-stdcall" ABI work
The symbol name is based on the number of arguments, so we have to declare
it correctly.

For some reason GetLastError doesn't work now.
2011-11-09 15:29:53 -08:00
Joshua Wise
ae2ce09267 Add test with implemented bits of issue #570. 2011-11-09 14:33:06 -08:00
Joshua Wise
c8fae5dc75 trans: Add binops (except for logic and comparators) and unops to trans_const_expr. Working towards issue #570. 2011-11-09 14:33:06 -08:00
Joshua Wise
e674a7e99f middle: Add a pass to reject bad const expressions earlier. Currently just rejects unimplemented const expressions, but will be needed later. 2011-11-09 14:33:05 -08:00
Niko Matsakis
ff5b319ce5 correct stack alignment 2011-11-08 21:14:09 -08:00
Niko Matsakis
2edd3135ad cleanup, removing comments and dead code 2011-11-08 21:14:09 -08:00
Niko Matsakis
1a28ad4fa4 fix bug in loading argument regs 2011-11-08 21:14:09 -08:00
Niko Matsakis
b30a76ed1b correct calling convention for x86_64 2011-11-08 21:14:09 -08:00
Niko Matsakis
0668eed81e fix alignment of xmm register storage 2011-11-08 21:11:47 -08:00
Niko Matsakis
e24d1dd6f5 rewrite so that memory allocations have 0 overhead by default 2011-11-08 21:11:47 -08:00
Niko Matsakis
75b98a9076 Correct the arithmetic on 64-bit builds. 2011-11-08 21:11:47 -08:00
Erick Tryzelaar
ab265586eb Re-add libuv as a submodule. 2011-11-08 19:01:47 -08:00
Erick Tryzelaar
1c87b9708c Removing the baked in libuv. 2011-11-08 19:01:47 -08:00
Brian Anderson
4f3f04643f Remove native "cdecl" ABI 2011-11-08 17:17:06 -08:00
Brian Anderson
d536bc2c10 Clean up std::task 2011-11-08 17:16:46 -08:00
Brian Anderson
061d2c2f77 Make task_sleep an intrinsic. 2011-11-08 15:58:08 -08:00
Brian Anderson
68f82de817 rt: Remove task_yield builtin
This is just a special case of task_sleep
2011-11-08 14:28:41 -08:00
Brian Anderson
2f8b695344 start_task can run on the C stack 2011-11-08 14:05:42 -08:00
Brian Anderson
0f1af17a60 Remove all uses of native cdecl except for those that yield 2011-11-08 11:29:10 -08:00
Erick Tryzelaar
a727bbaf70 Revert "Removing the baked in libuv."
This reverts commit df30663fdd.
2011-11-07 21:38:33 -08:00
Erick Tryzelaar
e8519b5b2f Revert "Reimporting libuv as a submodule."
This reverts commit cbae254d8a.
2011-11-07 21:38:18 -08:00
Erick Tryzelaar
cbae254d8a Reimporting libuv as a submodule.
Closes #1152.
2011-11-07 21:34:17 -08:00
Erick Tryzelaar
df30663fdd Removing the baked in libuv. 2011-11-07 21:34:17 -08:00
Haitao Li
253242390c Use ".ll" as default suffix of LLVM assembly file
This commit is a follow up of Issue #1147.

Althought there are some inconsistency about this naming convention in
LLVM. For example, `clang' write LLVM assembly to a file with ".s" suffix,
while both `llvm-dis' and `opt' write to files with ".ll" suffices. We
think ".ll" makes more sense.

Also rustc manual page is updated.
2011-11-07 21:12:48 -08:00
Brian Anderson
8857657640 Rename rust_uv.cpp to rust_aio.cpp 2011-11-07 19:35:39 -08:00
Brian Anderson
fdeb5ba304 Upgrade libuv to f1859eb841be2fe48512bc10e64556383f408b01 2011-11-07 19:24:25 -08:00
Brian Anderson
06d14f3a1c Fix long lines 2011-11-07 15:46:00 -08:00
Elly Jones
656a2af989 json: betterify for brson
Signed-off-by: Elly Jones <ellyjones@google.com>
2011-11-07 15:44:43 -08:00
Elly Jones
bd7262624c stdlib: add json.
Add a json serializer and deserializer.

Signed-off-by: Elly Jones <ellyjones@google.com>
2011-11-07 15:44:43 -08:00
Brian Anderson
fcd39b1191 Remove native "llvm" ABI 2011-11-07 15:29:05 -08:00
Brian Anderson
1103fe8ca0 Remove native "rust" ABI 2011-11-07 15:14:10 -08:00
Brian Anderson
b0c2416270 Clean up logging output. Closes #1088 2011-11-07 14:14:36 -08:00
Brian Anderson
9375204461 Add test for if without else cannot return result 2011-11-07 12:20:22 -08:00
Brian Anderson
413d97f8bd Add tests for blocks that must not have results 2011-11-07 12:19:50 -08:00
David Rajchenbach-Teller
16bdb85cb4 [Parser] parser.rs: Made two error messages less ambiguous 2011-11-07 12:04:16 -08:00
Haitao Li
852e789e78 rustc: Set LLVM module identifier as crate name 2011-11-07 22:59:21 +08:00
Haitao Li
b12de98814 rustc: Add support of generating LLVM assembly
rustc generates output files in LLVM bitcode format if "--emit-llvm"
option is given. When used with the "-S" option, rustc generates LLVM
intermediate language assembly files.

Fixes Issue #476
2011-11-07 21:44:40 +08:00
Marijn Haverbeke
f3468d03a2 Fix a long line 2011-11-07 10:10:27 +01:00
Joshua Wise
07bab92970 llvm::mk_object_file should really return an option, since the underlying LLVM function can fail. Fixes a crash on OS X when rust has bad dylibs within eyeshot. 2011-11-07 09:56:30 +01:00
David Rajchenbach-Teller
05c9c73756 [Stdlib] rope.rs: improved doc, code readability 2011-11-06 18:10:23 +01:00