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
David Rajchenbach-Teller
7bfe4dba80
[Test] rope.rs: testing concat
2011-11-06 18:10:23 +01:00
David Rajchenbach-Teller
bc1316aaf4
[Stdlib] rope.rs: concat, now attempts to preserve balance
2011-11-06 18:10:22 +01:00
David Rajchenbach-Teller
cefa97dc2e
[Stdlib doc] char.rs: documented to_digit, cmp
2011-11-06 18:10:22 +01:00
David Rajchenbach-Teller
2dedcc8aa2
[stdlib optim] rope::node improved balancing strategy
2011-11-06 18:10:22 +01:00
Brian Anderson
7d741d69cb
Add an LLVM git submodule
2011-11-05 13:23:10 -07:00
David Rajchenbach-Teller
1087f4b7b0
[Docfix] lib/str.rs: Applied review suggestions, took the opportunity to improve doc of my new functions.
2011-11-05 13:04:35 -07:00
David Rajchenbach-Teller
b17847b232
[Docfixes + feature] lib/uint.rs: Applied review suggesions, took the opportunity to add function loop
2011-11-05 13:04:34 -07:00
David Rajchenbach-Teller
57425b575c
[Docfix + Renaming] lib/rope.rs: Applied review suggestions, mostly docfixes.
2011-11-05 13:04:34 -07:00
David Rajchenbach-Teller
f9a0d03c7a
Fixup: forgotten stdtest/rope.rs
2011-11-05 13:04:34 -07:00
David Rajchenbach-Teller
a5dcf66ad3
stdlib: Added a small rope library
2011-11-05 13:04:34 -07:00
David Rajchenbach-Teller
07574363ef
char.rs: Added a function cmp
2011-11-05 13:04:34 -07:00
David Rajchenbach-Teller
07ffe68ad9
uint.rs: added functions div_ceil, div_floor, div_round
2011-11-05 13:04:34 -07:00
David Rajchenbach-Teller
f4399063fc
str.rs: Added functions loop_chars, loop_chars_sub, char_len_range, byte_len_range.
2011-11-05 13:04:34 -07:00
Elly Jones
b0278f5315
vec: take [mutable? T] instead of [T]
2011-11-04 17:30:03 -07:00
Marijn Haverbeke
5945667b99
Update some more tests for 1a68a9882
2011-11-03 11:14:48 +01:00
Marijn Haverbeke
1a68a98824
Disallow writing to function arguments again
...
Remove implicit copying hack.
Closes #1118
2011-11-03 10:57:54 +01:00
Matt Brubeck
5970e9c117
Add vec::permute to the standard library ( #1013 )
2011-11-02 15:35:10 -07:00
Niko Matsakis
b578ed9b2a
add required symbols
2011-11-02 14:14:20 -07:00
Niko Matsakis
0982c7f78c
hastily port so we don't fail to build
2011-11-02 14:14:20 -07:00
Niko Matsakis
8385d77b32
fix line too long
2011-11-02 14:14:20 -07:00
Niko Matsakis
ec77144713
add -m64 to gcc args if appropriate
2011-11-02 14:14:20 -07:00
Niko Matsakis
e012fd03f3
correct more i32 vs int mismatches
2011-11-02 14:14:19 -07:00
Niko Matsakis
602ae9139c
convert various ints to i32 and vice versa
2011-11-02 14:14:19 -07:00
Niko Matsakis
4bd05e5be2
convert GEP to i32
2011-11-02 14:14:19 -07:00
Niko Matsakis
f1bc9307d8
get things checking on ia32
2011-11-02 14:14:19 -07:00
Niko Matsakis
c0e9c42bd2
thread the context through so that int can be 64 bits on x86_64
2011-11-02 14:14:19 -07:00
Niko Matsakis
2521cda1ec
work on making the size of ints depend on the target arch
2011-11-02 14:14:19 -07:00
Niko Matsakis
9146bb09a1
work on making the size of ints depend on the target arch
2011-11-02 14:14:19 -07:00
Niko Matsakis
f05761ddb3
enable intrinsics for multiple arch
2011-11-02 14:13:22 -07:00
Niko Matsakis
20946e6970
start going back to an i386 build
2011-11-02 14:13:22 -07:00
Niko Matsakis
8011e3fabb
hack around on makefiles trying to get a 64 bit build
...
right now there are many temporary hacks, search for NDM to find them
2011-11-02 14:13:22 -07:00
Niko Matsakis
020cd360e1
modify x64 assembly and so forth
2011-11-02 14:13:22 -07:00
Niko Matsakis
d3e865438f
do not preserve caller-saved registers
2011-11-02 14:13:22 -07:00
Niko Matsakis
6a0d86c754
copy over x86-specific code
2011-11-02 14:13:22 -07:00
Niko Matsakis
5b3bddcd87
start to isolate target strings so that they can be configured for
...
x64 or other targets
2011-11-02 14:13:22 -07:00
Marijn Haverbeke
eef9a0bd39
Evaluate alt expressions in their own block context
...
Closes #785
2011-11-02 14:30:51 +01:00
Marijn Haverbeke
d8d35e7c40
Rename car/cdr to head/tail in std::list
...
Closes #1086
2011-11-02 14:23:49 +01:00
Marijn Haverbeke
5b0c103b39
Make it possible to cast unsafe pointers with the 'as' operator
2011-11-02 12:20:12 +01:00
Marijn Haverbeke
0a20eed2db
Make ptr::addr_of return an immutable vec, add mut_addr_of
2011-11-02 12:20:12 +01:00
Marijn Haverbeke
eaf9e05611
Make 'lambda(...) -> ...' parse as a type
2011-11-02 12:20:11 +01:00
Marijn Haverbeke
4e9b8a28f7
Make resolving of imports behave more sanely
...
An import now ignores itself when resolving its target. This gets rid of
the previously existing (problematic) behaviour where the import would start
looking one scope up when its name was the same as its target's first
component.
Closes #1114
2011-11-02 12:20:11 +01:00
Marijn Haverbeke
7ed7e7fa79
Fix printing of parameterized tag types in ppaux
...
It was printing option::t[int] instead of option::t<int>
2011-11-02 12:20:11 +01:00
Brian Anderson
74e4b3b5c1
Register snapshots
2011-11-01 21:22:42 -07:00
Brian Anderson
4b01d11f92
Organize std.rc and make exports explicit
2011-11-01 20:48:44 -07:00
Brian Anderson
35affdfa61
Ignore another test involving failure on windows
2011-11-01 17:35:32 -07:00
Brian Anderson
eb8995e2fa
Ignore should_fail tests on windows
2011-11-01 17:22:32 -07:00
Matt Brubeck
76077a9fb7
Add should_fail annotation for unit tests
...
This allows test cases to assert that a function is expected to fail.
Tests annotated with "should_fail" will succeed only if the function
fails.
2011-11-01 16:55:39 -07:00
Brian Anderson
61b604580b
Fix alignment of interior pointers of dynamic-size types. Closes #1112
...
GEP_tup_like finds interior pointers by creating a tuple of all the types
preceding the element it wants a pointer to, then asks for the size of that
tuple. This results in incorrect pointers when the alignment of that tuple
is not the alignment of the interior type you're getting a pointer to.
2011-11-01 12:13:00 -07:00
Patrick Walton
587c118cac
rt: Fix long lines
2011-10-31 15:50:15 -07:00
Patrick Walton
956812bda5
rt: Have __morestack conform to the calling convention that LLVM generates on x86
2011-10-31 15:41:19 -07:00
Brian Anderson
df12749b36
Register snapshots
2011-10-31 15:19:01 -07:00
Brian Anderson
bd33951b1c
Update snapshot scripts for new stdlib name
2011-10-31 14:43:43 -07:00
Haitao Li
16dad84f7b
rustc: Find crates by matching the name metadata
2011-10-31 14:43:43 -07:00
Patrick Walton
329f045d4c
rustc: Enable segmented stacks in LLVM when --stack-growth is on
2011-10-31 14:42:44 -07:00
Patrick Walton
c9003d301f
Stub a __morestack implementation and stack segment allocation. Untested.
2011-10-31 14:20:56 -07:00
Brian Anderson
8207506bbc
Fix the filenames used in some IO tests
...
These tests are relying on not being able to open certain files, but did not
work correctly when run as root.
2011-10-31 12:50:45 -07:00
Matt Brubeck
80c926c5e2
Add a char::to_digit function
2011-10-31 16:15:36 +01:00
Matt Brubeck
4739942e74
Correct handling of non-numeric chars in parse_buf
...
Without this fix, int::parse_buf and uint::parse_buf return incorrect results
for any strings that contain non-numeric characters. Fixes #1102 .
2011-10-31 16:15:32 +01:00
Marijn Haverbeke
6f37accb29
Rename std::str::chars to iter_chars
2011-10-31 15:41:52 +01:00
Marijn Haverbeke
b0d60a7108
Add a way to iterate over a str's chars to std::str
2011-10-31 14:52:08 +01:00
Matt Brubeck
7080ac15fb
Fix int::parse_buf for negative numbers ( #1102 )
2011-10-30 13:40:59 -07:00
Matt Brubeck
8c51d4b002
Make float::from_str ignore whitespace ( #1089 )
...
Discard leading and trailing whitespace, for consistency with C/JS/Java/etc.
Also, don't allow floating point numbers that start or end with 'e'.
2011-10-30 13:40:59 -07:00
Matt Brubeck
0bf10d84e2
Update keyword list in vim/syntax/rust.vim
...
Removed: iter, each, put, macro, meta, syntax, port, spawn
Added: block, copy
2011-10-29 20:50:17 -07:00
Brian Anderson
8befdd08a3
stdlib: Fix type in docs for result::chan
2011-10-29 20:16:44 -07:00
Brian Anderson
ce1be4d9a9
Cleanup the existing platform-specific ignored tests
2011-10-29 18:30:36 -07:00
Brian Anderson
f7ebe23ae1
Add the ability to ignore tests by compiler config
...
[test]
[ignore(cfg(target_os = "win32"))]
2011-10-29 18:30:32 -07:00
Brian Anderson
2e0593d999
stdlib: Add vec::concat to concatenate a vector of vectors
...
Compare to str::concat
2011-10-29 18:14:08 -07:00
Brian Anderson
da064ef884
Add more logging to crate resolution
2011-10-29 15:04:44 -07:00
Brian Anderson
e0f44730e8
rustc: Support 'companion mod's for crates and directory mods
...
Under this scheme when parsing foo.rc the parser will also look for
foo.rs to fill in the crate-level module, and when evaluating a
directory module directive it will look for a .rs file with the
same name as the directory.
2011-10-29 01:40:20 -07:00
Brian Anderson
2cebef095e
stdlib: Make io failures recoverable by returning a result
2011-10-29 01:25:11 -07:00
Brian Anderson
2b62a80202
stdlib: Add result::chain for composing results
2011-10-29 01:25:11 -07:00
Brian Anderson
c1092fb6d8
stdlib: Add result module
...
This contains a result tag with ok(T) and error(U) variants. I expect
to use it for error handling on functions that can recover from errors,
like in the io module.
2011-10-29 01:25:06 -07:00
Brian Anderson
802deac323
stdlib: Add fs::splitext
...
Splits a path into the filename + extension
2011-10-28 23:34:01 -07:00
Brian Anderson
a2377ccf91
stdlib: Add vec::init. Returns all but the last element.
...
Per haskell, to go with head/tail, and last.
2011-10-28 22:42:38 -07:00
Matt Brubeck
b510a74a36
Cleanup: Remove uneccesary generic_cmp function.
2011-10-28 14:44:39 -07:00
Matt Brubeck
9c5c108d5b
Add more isNaN tests
2011-10-28 14:44:39 -07:00
Matt Brubeck
45d7777991
Change behavior of float::nonpositive/nonnegative
...
Rather than being defined as !positive and !negative, these should act the
same as negative and positive (respectively). The only effect of this change
should be that all four functions will now return false for NaN.
2011-10-28 14:44:39 -07:00
Matt Brubeck
000b2fe9a6
Use IEEE 754 semantics for NaN (Issue #1084 )
2011-10-28 14:44:39 -07:00
Matt Brubeck
7e064deacf
+0.0 should be positive and -0.0 should be negative.
2011-10-28 14:44:39 -07:00
Brian Anderson
54ddb553c2
stdlib: Replace an unsafe cast with ptr::null
2011-10-28 14:25:40 -07:00
Brian Anderson
f96ad30dfc
stdlib: Make reinterpret_cast and leak unsafe
2011-10-28 14:19:17 -07:00
Brian Anderson
ad66d72e6c
stdlib: Make merge_sort take [mutable? T]
2011-10-28 13:56:01 -07:00
Brian Anderson
39b729e36f
stdlib: Fix the list::foldl implementation
2011-10-28 13:45:32 -07:00
Brian Anderson
49e8ffa34f
stdlib: Rename list::length to list::len to match vec::len
2011-10-28 13:37:19 -07:00
Brian Anderson
2e8a8390d5
stdlib: Rename the 'ls_' param in list functions to 'ls'
2011-10-28 13:34:17 -07:00
Brian Anderson
1da99cdf68
stdlib: Make list::from_vec more efficient
2011-10-28 13:32:11 -07:00
Brian Anderson
d53a253dca
stdlib: make list::from_vec take [mutable? T]
2011-10-28 13:24:39 -07:00
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
Brian Anderson
314c011d71
Immutable and mutable? are covariant on their inner types
...
Whereas [mutable T] is invariant with respect to T, [T] and [mutable? T]
are covariant with respect to T.
2011-10-18 10:37:04 -07:00
Marijn Haverbeke
71a4a66135
Add a math module to the standard lib
...
I need some rudimentary stdlib stuff for the tutorial.
Closes #1042
2011-10-18 13:54:35 +02:00
Marijn Haverbeke
d9d0782b5f
Don't try to build an LLVM switch on floats
...
Closes #1046
2011-10-18 13:54:35 +02:00
Marijn Haverbeke
3cabe7429f
Add a print and println to std::io
2011-10-18 13:06:47 +02:00
Brian Anderson
0f0fa26c72
Enforce variance rules for mutable types
2011-10-17 20:51:34 -07:00
Brian Anderson
48d351b21e
Add a variance transform for calculation of recursive variance
2011-10-17 19:37:34 -07:00
Brian Anderson
d6613384fd
Introduce covariance, contravariance and invariance to the type unifier
...
This will be used to resolve some problems with mutable? covariance and also
to implement function subtyping
2011-10-17 19:34:12 -07:00
Brian Anderson
b61578e1cd
Don't unify from mutable? to immutable
...
Immutable is supposed to be a subtype of mutable-huh.
2011-10-17 16:36:49 -07:00
Brian Anderson
f7a825c614
Split record_var_binding into methods for expected and actual
...
This allows unify to maintain the same subtype relationship between
expected and actual throughout unify, which we are going to need
for mutable? and for function types.
2011-10-17 16:36:49 -07:00
Brian Anderson
1a64153b24
Correct two more analyses of mutable? as mutable
...
I can't come up with test cases but this seems correct.
2011-10-17 16:35:33 -07:00
Brian Anderson
4d9d889dbf
Don't allow assignment to mutable-wha?
2011-10-17 16:35:33 -07:00
David Rajchenbach-Teller
454333368c
[Lib] int.rs, uint.rs: added max_value, min_value
2011-10-17 11:22:57 -07:00
David Rajchenbach-Teller
064f9dd93e
[Lib] uint.rs: +min_value
2011-10-17 11:22:57 -07:00
David Rajchenbach-Teller
a85e035038
[Lib] rand.rs: type rng now defines next_float
2011-10-17 11:22:57 -07:00
David Rajchenbach-Teller
eba88ef3ea
[Lib] u32.rs: created
2011-10-17 11:22:57 -07:00
David Rajchenbach-Teller
27ca86a853
[Lib] u8.rs, u64.rs: +min_value, max_value
2011-10-17 11:22:57 -07:00
Brian Anderson
007422cc04
Change the linkage order on linux and add -ldl
...
-lrt and -ldl need to be specified after -lrustrt since they are only used by
rustrt.
2011-10-17 10:41:22 -07:00
Brian Anderson
b42e551285
Only link librt on linux
2011-10-16 02:36:42 -07:00
Haitao Li
ad5014bf4c
Fix link error by explicitly link needed DSOs
...
Building Rust(version 280bc56
) on Ubuntu 11.10 failed with link error,
like:
compile_and_link: stage0/lib/rustc/i686-unknown-linux-gnu/lib/libstd.so
compile_and_link: stage0/lib/rustc/i686-unknown-linux-gnu/bin/rustc
/local/src/rust/build/stage0/lib/rustc/i686-unknown-linux-gnu/lib/librustrt.so:
undefined reference to `clock_gettime'
collect2: ld returned 1 exit status
error: linking with gcc failed with code 1
GCC toolchain released by Ubuntu 11.10 introduced a few compiler flags
that are different with upstream GCC[1]. Flags "-Wl,--as-needed' and
'-Wl,--no-copy-dt-needed-entries' are passed by default.
Function clock_gettime from librt is used by librustrt, indirectly by
rustc. It is necessary to explicitly pass the "-lrt" flags when building
rustc.
Please note since the toolchain changes will be the default in the next
release(2.22) of binutils, this is not actually a Debian/Ubuntu specific
issue.
1. https://wiki.ubuntu.com/OneiricOcelot/ReleaseNotes#GCC_4.6_Toolchain
Signed-off-by: Haitao Li <lihaitao@gmail.com>
2011-10-16 17:12:30 +08:00
Elly Jones
a5dc6a7aa8
Update LinkModules invocation to use new prototype
...
LLVM revision 141606 changes the prototype of llvm::Linker::LinkModules.
Signed-off-by: Elly Jones <elly@leptoquark.net>
2011-10-15 15:53:18 -07:00
Marijn Haverbeke
0a01144797
Use trans_expr_save_in instead of trans_expr when appropriate
...
This guards against passing a save_in destination to nil or bot-typed things.
2011-10-14 11:27:16 +02:00
Marijn Haverbeke
06257d66e7
Don't crash when reporting an unresolved import in the nil scope
...
Closes #1027
2011-10-14 11:25:14 +02:00
Brian Anderson
3808a498cd
Remove an unnecessary visitor from rustc::middle::fn_usage
2011-10-13 14:55:50 -07:00
Brian Anderson
acf9b83e71
Fix a use of visit in rustc::middle::fn_usage
...
This was working by just skipping an AST node instead of doing the advertised
check. I can't find a test case for it, but this is more correct.
2011-10-13 14:55:47 -07:00
Brian Anderson
bc4c3df1bf
Don't allow the value of generic bare functions to be taken
...
Issue #1038
2011-10-13 14:39:30 -07:00
Brian Anderson
89466ffd74
Rename rustc::middle::unsafeck to fn_usage
...
I'm going to add further checks unrelated to unsafe.
Issue #1038
2011-10-13 12:25:57 -07:00
Brian Anderson
60cfa91897
Add a test that generic bare functions can be bound
...
Issue #1022
2011-10-13 12:16:26 -07:00
Marijn Haverbeke
6a7800508b
Make trans_anon_obj properly thread its bcx
...
Closes #893
Unfortunately, anon objs are still so broken as to be useless
(fields don't work).
2011-10-13 18:04:09 +02:00
Marijn Haverbeke
e4c91fdf65
Properly fill single-variant zero-arg tag values.
...
Closes #1034 . Closes #1035 .
2011-10-13 15:14:09 +02:00
Brian Anderson
6e67c4b253
Cleanse usage of some unsafe functions on win32
2011-10-12 16:42:13 -07:00
Niko Matsakis
e8a0e592da
reimplement some of the unsafe stuff which got lost
...
- blocks inherit unsafety
- remove the --check-unsafe flag
- add unsafe annotations where needed to get things to compile
2011-10-12 16:33:07 -07:00
Niko Matsakis
f994871a3d
remove unsafe tags
2011-10-12 16:33:07 -07:00
Niko Matsakis
5b015288b5
new test
2011-10-12 16:33:07 -07:00
Niko Matsakis
215b1ab000
make compiler emit more than 1 error in the case of unsafe
2011-10-12 16:33:07 -07:00
Niko Matsakis
3b66806624
prohibit ptr deref unless in unsafe code
2011-10-12 16:33:07 -07:00
Niko Matsakis
a56698575c
fix error msg
2011-10-12 16:33:07 -07:00
Niko Matsakis
e8a29fbe3c
add some new tests
2011-10-12 16:33:07 -07:00
Niko Matsakis
70164739e8
convert a few tests from unsafe fns to fns with unsafe bodies
2011-10-12 16:33:07 -07:00
Niko Matsakis
9f9deff7af
make a good error msg if you try to use an unsafe fn for a test
2011-10-12 16:33:07 -07:00
Niko Matsakis
b1a9d71218
improve the span used in test generation
2011-10-12 16:33:07 -07:00
Niko Matsakis
81533ff737
add pass to check that unsafe fns cannot be used as values
2011-10-12 16:33:06 -07:00
Niko Matsakis
e39db5a100
all tests pass
2011-10-12 16:33:06 -07:00
Niko Matsakis
db16fce77f
all tests pass
2011-10-12 16:33:06 -07:00
Niko Matsakis
85da98db4a
continue to annotate functions as unsafe where neccessary
2011-10-12 16:33:06 -07:00
Niko Matsakis
f2cd33df72
continue to annotate trans functions as unsafe where neccessary
2011-10-12 16:33:06 -07:00
Niko Matsakis
2094668949
continue to annotate trans functions as unsafe where neccessary
2011-10-12 16:33:06 -07:00
Niko Matsakis
d4d7eb069b
add unsafe tags into various points in the translation chains
...
and so forth
2011-10-12 16:33:06 -07:00
Niko Matsakis
c1cefa52d0
Add unsafe tags to usage of LLVM funcs
2011-10-12 16:33:06 -07:00
Niko Matsakis
8ea1a8eef9
make treatment of unchecked/unsafe blocks more uniform
...
also repair various errors in the parser related to such blocks.
rename checked_blk to default_blk to reflect the fact that it
inherits its purity from the surrounding context.
2011-10-12 16:32:57 -07:00
Brian Anderson
8366f3caa3
Revert "Test for #954 "
...
This reverts commit 7edb043889
.
2011-10-12 15:53:54 -07:00
Brian Anderson
7edb043889
Test for #954
2011-10-12 15:53:15 -07:00
Brian Anderson
a1d046c75c
Register snapshots
2011-10-12 15:44:00 -07:00
Brian Anderson
40fa88febb
Ignore stdtest::os::test_setenv. Fails periodically on mac
2011-10-12 15:27:58 -07:00
Niko Matsakis
212707ce84
make native functions markable as unsafe and incorporate that
...
into the type check
2011-10-12 14:39:34 -07:00
Niko Matsakis
24b201fa48
skip test, remove whitespace
2011-10-12 14:39:34 -07:00
Niko Matsakis
b9a9559c91
correct lines over 78 chars
2011-10-12 14:39:34 -07:00
Niko Matsakis
f3c68e7238
enable unsafe checking but only with a flag --check-unsafe
2011-10-12 14:39:34 -07:00
Niko Matsakis
cbe8da0655
make treatment of unchecked/unsafe blocks more uniform
...
also repair various errors in the parser related to such blocks.
rename checked_blk to default_blk to reflect the fact that it
inherits its purity from the surrounding context.
2011-10-12 14:39:24 -07:00
Niko Matsakis
e9569371f7
add 'u' to one other place it was missing
2011-10-12 14:26:47 -07:00
Niko Matsakis
f304c1bee5
add 'u' to decoder (kinda' important)
2011-10-12 14:26:47 -07:00
Niko Matsakis
8c1231ae5f
fix test to include a main() function
2011-10-12 14:26:47 -07:00
Niko Matsakis
d207bc3a0b
it is also legal to call unsafe functions from other unsafe functions
2011-10-12 14:26:47 -07:00
Niko Matsakis
046ca827dd
Add unsafe blocks, unsafe functions, and two rudimentary tests
...
related to them
2011-10-12 14:26:47 -07:00
Niko Matsakis
29584cc5ac
Extend the unchecked block stuff to allow unsafe blocks as well.
2011-10-12 14:26:47 -07:00
Niko Matsakis
58b8e88356
expand purity to include unsafe
2011-10-12 14:26:47 -07:00
Niko Matsakis
9476692b52
move ctags.rust into src/etc
2011-10-12 13:57:32 -07:00
Brian Anderson
99f876e3a8
Make build_environment and trans_bind_thunk GEP bound arguments the same
...
These functions both use GEP_tup_like to get at the arguments bound to the
environment, but they were starting from a different 'level' of the
environment-box structure. Frighteningly, this was leading to them having
different opinions of how the bound arguments were aligned in some cases.
2011-10-12 12:11:07 -07:00
Marijn Haverbeke
306f7fb25f
Simplify copying of uniques
...
We can call take glue, rather than duplicating it inline.
2011-10-12 11:05:20 +02:00
David Rajchenbach-Teller
75bda422df
[Tests] added float tests
2011-10-12 10:56:05 +02:00
David Rajchenbach-Teller
8c9dd54ded
[Renaming] str_to_float is now float::from_str, float_to_str is now float::to_str
2011-10-12 10:56:05 +02:00
David Rajchenbach-Teller
7faed3d87c
[Fix] float.rs: str_to_float reimplemented
2011-10-12 10:56:05 +02:00
David Rajchenbach-Teller
3219c40e18
[Optim] int.rs: reimplemented pow with fast exponentiation
2011-10-12 10:56:05 +02:00
Lindsey Kuper
0d43e90172
Revert "Merge pull request #1025 from elly/master"
...
This reverts commit e12e76e9ba
, reversing
changes made to f480203fdd
.
2011-10-11 22:23:47 -04:00
Lindsey Kuper
813c2eb369
Revert "Revert "Add a test case for #898 . Closes #898.""
...
This reverts commit e305ab3851
.
Oops again. Reverting a mistaken revert.
2011-10-11 22:03:23 -04:00
Lindsey Kuper
e305ab3851
Revert "Add a test case for #898 . Closes #898."
...
This reverts commit f480203fdd
.
Oops. This patch requires people to bump their LLVM version.
2011-10-11 22:00:17 -04:00
Elly Jones
19eae0bc38
Update LinkModules invocation to use new prototype
...
LLVM revision 141606 changes the prototype of llvm::Linker::LinkModules.
Signed-off-by: Elly Jones <elly@leptoquark.net>
2011-10-11 21:32:34 -04:00
Brian Anderson
f480203fdd
Add a test case for #898 . Closes #898 .
...
Seems to have been fixed.
2011-10-11 16:50:50 -07:00
Brian Anderson
55379a97d4
Use the correct function type for external bare functions
...
Issue #1022
2011-10-11 15:12:49 -07:00
Brian Anderson
d8fb86d2e3
Register snapshots
2011-10-11 15:01:27 -07:00
Brian Anderson
cfa2346086
Use a non-ambiguous character for encoding bare functions
...
I was using 'R' and that was already used for records.
Issue #1022
2011-10-11 14:38:15 -07:00
Brian Anderson
8c77d063a9
Add a test for assignment of bare functions
...
Issue #1022
2011-10-11 13:40:31 -07:00
Brian Anderson
b04f84275a
Add a test that bare functions are word-sized
...
Issue #1022
2011-10-11 13:40:28 -07:00
Brian Anderson
90c2402089
Add a test that uses a hypothetical bare-fn spawn signature
...
Issue #1022
2011-10-11 12:10:56 -07:00
Brian Anderson
1b0f1f0b79
Remove the environment argument from bare functions
...
Issue #1022
2011-10-11 10:51:10 -07:00
Brian Anderson
84e98f4f65
Add a test for higher-order bare functions
...
Issue #1022
2011-10-11 10:51:10 -07:00
Brian Anderson
145feb3298
Add a test for binding bare functions
...
Issue #1022
2011-10-11 10:51:10 -07:00
Brian Anderson
5b0f79b75a
Don't allow bind to produce bare functions
...
Issue #1022
2011-10-11 10:51:10 -07:00
Brian Anderson
b277039325
Introduce ast::proto_bare
...
Issue #1022
2011-10-11 10:51:10 -07:00
Brian Anderson
9c46cc58cb
Add a temporary syntax for bare functions
...
Bare functions will be represented as 'fn#' until they're implemented. Then
we'll switch it over to just 'fn'.
Issue #1022
2011-10-11 10:51:09 -07:00
David Rajchenbach-Teller
2ec85135e2
[Move] Moved str_to_float, float_to_str from compiler to lib
2011-10-11 16:41:34 +02:00
Marijn Haverbeke
33167f7dec
Adjust function signatures to allow for vecs being immediate
...
Some code was relying on vectors being implicitly by-reference (as
non-immediate value). This adds the necessary &&-sigils.
Closes #1021
2011-10-10 16:01:51 +02:00
Marijn Haverbeke
b4bae8fea5
Make vectors and strings immediates again
...
There's no good reason to force them to be spilled anymore. Some
pieces of trans become more elegant this way, and less stack allocs
and load/stores are needed.
Issue #1021
2011-10-10 15:59:16 +02:00
Marijn Haverbeke
5c53959f20
Make bcx_tcx-style accessors return by reference
2011-10-10 12:25:58 +02:00
Marijn Haverbeke
00daeb485c
Move type_is_immediate into ty.rs
2011-10-10 12:23:58 +02:00
Marijn Haverbeke
a35dbf3fd5
Don't spill immediates in order to drop them
...
Issue #1012
2011-10-10 12:20:28 +02:00
Marijn Haverbeke
fa1295343f
Make free glue take a pointer to the heap part (box)
...
This way, it can be used to drop values without first spilling them.
Issue #1012
2011-10-10 10:25:32 +02:00
Brian Anderson
96f6a1861c
Revert "Revert "Stop using (DY)LD_LIBRARY_PATH on Unix""
...
This reverts commit 941d5e737c
.
2011-10-09 15:23:41 -07:00
Brian Anderson
ecfa37d336
Register snapshots
2011-10-09 15:23:34 -07:00
Brian Anderson
941d5e737c
Revert "Stop using (DY)LD_LIBRARY_PATH on Unix"
...
This reverts commit 4b58071f96
.
2011-10-09 15:05:12 -07:00
Marijn Haverbeke
aff536ec0e
Fix bad float-type detection in trans
...
Closes #1017
2011-10-09 10:07:10 +02:00
Brian Anderson
79e9f7a015
Make windows package uninstallable
2011-10-07 14:09:29 -07:00
Brian Anderson
fed56b07ba
Make windows packaging work again
2011-10-07 13:48:20 -07:00
Marijn Haverbeke
1efe5f0577
Fix up test for last commit
2011-10-07 16:58:27 +02:00
Marijn Haverbeke
f26e770745
Make 1-1 parse again
...
Issue #954
This is not a very elegant fix -- we should probably do something with
constant folding to handle negative-int alt patterns in the future.
2011-10-07 16:46:44 +02:00
Marijn Haverbeke
c7eee8fb05
Stop registering cleanups for types that don't need them
2011-10-07 14:46:23 +02:00
Marijn Haverbeke
31586339b1
Make it possible to have locals that don't live on the stack
...
Local values that are not mutated, don't need to be cleaned up, and
are immediate, don't need to be spilled. (All immediate args, and
non-pointer immediate let locals.)
2011-10-07 14:43:19 +02:00
Marijn Haverbeke
7586082bb0
Add tests for programs that are invalid by arg-passing-style
...
Closes #1008
2011-10-07 10:41:40 +02:00
Marijn Haverbeke
8db71530f5
Forbid passing dynamically-sized types by value
...
Issue #1008
2011-10-07 10:41:40 +02:00
Marijn Haverbeke
2ff89469d4
Actually pass parameters specified as by-val by value
...
Issue #1008
2011-10-07 10:41:40 +02:00
Marijn Haverbeke
41528dc543
Add pass-by-ref annotation to the tests to make them typecheck
...
Issue #1008
2011-10-07 10:41:39 +02:00
Marijn Haverbeke
fe916fb9f0
Give up on providing a by-value version of map, convert fold over to
...
passing pointers by ref
Issue #1008
2011-10-07 09:56:12 +02:00
Marijn Haverbeke
f9fbd86f52
Parse and typecheck by-value and by-ref arg specs
...
Add sprinkle && throughout the compiler to make it typecheck again.
Issue #1008
2011-10-07 09:09:50 +02:00
Brian Anderson
ed5a962d6f
Hopefully make test_prefix_rpath_abs work on win32
2011-10-06 16:39:34 -07:00
Brian Anderson
831d861d84
Mac uses @executable_path instead of $ORIGIN
2011-10-06 16:26:32 -07:00
Brian Anderson
5cd6dbd5b9
Always use an absolute path for the backup install prefix rpath
2011-10-06 16:12:45 -07:00
Brian Anderson
04e89af6db
Add std::str::contains
2011-10-06 16:08:44 -07:00
Brian Anderson
4b58071f96
Stop using (DY)LD_LIBRARY_PATH on Unix
2011-10-06 15:23:20 -07:00
Brian Anderson
a1e4ab3e38
Register snapshots
2011-10-06 15:11:30 -07:00
Brian Anderson
e4068f6715
Mac doesn't seem to support rpath $ORIGIN
2011-10-06 14:29:03 -07:00
Brian Anderson
06087e67e1
Configure out rpath tests when not testing
2011-10-06 13:29:36 -07:00
Brian Anderson
4b9e572044
Remove an unnecessary linking flag. Add comments about linking
2011-10-06 13:16:16 -07:00
Brian Anderson
062ba22d99
rpathing is based on the target, not host OS
2011-10-06 13:12:11 -07:00
Brian Anderson
d8a85f0758
Make rpath work on mac
2011-10-06 13:09:00 -07:00
Marijn Haverbeke
9c037d2194
Revert "rustc: Add a workaround for a segfault with --time-passes (issue #1005 )."
...
This reverts commit 100e0264b2
.
2011-10-06 16:12:47 +02:00
Marijn Haverbeke
8ee017add4
Register new snapshot
2011-10-06 10:56:07 +02:00
Marijn Haverbeke
6a4270523e
Ignore && and + before argument names.
...
Issue #1008
2011-10-06 10:16:52 +02:00
Marijn Haverbeke
39b468e17a
Fix problem with polymorphic return value being instantiated as nil
...
Closes #1005
2011-10-06 09:40:56 +02:00
Brian Anderson
e6d7b0cff3
Register snapshots
2011-10-05 18:15:45 -07:00
Patrick Walton
8d8b48a901
rt: Make C stack switching Valgrind-clean by warning Valgrind when we're about to write to the C stack from the Rust stack
2011-10-05 16:33:17 -07:00
Patrick Walton
cf3e7f2f0b
stdlib: Add a void type
2011-10-05 16:33:17 -07:00
Brian Anderson
00a81a22a8
Add more valgrind suppressions for __libc_freeres
...
Somehow these started showing up on the tinderbox
2011-10-05 16:21:56 -07:00
Brian Anderson
8215ffc822
rpath all the things!
2011-10-05 16:21:56 -07:00
Brian Anderson
ee8e058004
Add a FIXME about test exports to rustc: 🔙 :rpath
2011-10-05 16:21:56 -07:00
Brian Anderson
2f340a4d3d
rpath the path to the runtime
...
We don't currently rpath native libs, but we do know where rustrt is
located and everything needs to link to it.
2011-10-05 16:21:55 -07:00
Brian Anderson
3d5471f6ab
Fix some remaining rpath bugs
2011-10-05 16:21:55 -07:00
Brian Anderson
82ef8519c3
Fix some path handling in std::fs on win32
2011-10-05 16:21:55 -07:00
Brian Anderson
8b4601e08e
Figure out the relative path from output to each crate
2011-10-05 16:21:55 -07:00
Brian Anderson
19ba9b4d8d
Begin work on rpath
2011-10-05 16:21:55 -07:00
Niko Matsakis
61c9c46d94
remove pthread_exit() from rust_start()
...
It was causing OS X Lion to hang and (according to Apple) is undefined
in any case
2011-10-05 16:10:36 -07:00
Patrick Walton
100e0264b2
rustc: Add a workaround for a segfault with --time-passes (issue #1005 ).
2011-10-05 14:35:30 -07:00
Marijn Haverbeke
142f63fe78
Tie up the last ends in destination-passing-conversion
...
Closes #667
2011-10-05 12:23:18 +02:00
Marijn Haverbeke
3bc3f96138
Make trans_lval lval-only
...
Call trans_temp_lval if you want the old fallback-to-temporary behaviour.
Issue #667
2011-10-05 11:51:41 +02:00
Marijn Haverbeke
2cc0008ec0
Add trans_temp_expr for what used to be trans_expr, rename t_e_dps to trans_expr
...
Issue #667
2011-10-05 11:26:27 +02:00
Marijn Haverbeke
975ac55b3d
Lose the by_ref destination style
...
It's not needed.
Issue #667
2011-10-05 10:41:30 +02:00
Marijn Haverbeke
babd1ff3c7
Revert "Revert "Reorganize translation of expr_field""
...
This reverts commit 11e407aaa9
.
2011-10-05 10:21:57 +02:00
Marijn Haverbeke
c33e61e75c
Revert "Revert "Get rid of 'overwrite' destination kind""
...
This reverts commit ce9e0fc94f
.
2011-10-05 10:21:48 +02:00
Marijn Haverbeke
062aa3272c
Revert "Revert "Move trans_call to destination_passing style""
...
This reverts commit 276dfc6133
.
2011-10-05 10:21:40 +02:00
Brian Anderson
1f2e999262
Use std::os::get_exe_path to determine sysroot
2011-10-04 21:35:06 -07:00
Brian Anderson
1391154b14
Use util::filesearch to locate intrinsics.bc and main.o
2011-10-04 21:35:06 -07:00
Brian Anderson
ebcc76d68d
Move the library search into util::filesearch
2011-10-04 21:35:06 -07:00
Brian Anderson
b25e78524c
Fix some comment drift
2011-10-04 21:35:06 -07:00
Brian Anderson
33ee73102d
Remove some redundancy in metadata::creader
2011-10-04 21:35:06 -07:00
Brian Anderson
d91b7b61ef
Encapsulate current sysroot and lib path handling into util::filesearch
2011-10-04 21:35:06 -07:00
Brian Anderson
a8ce543dc9
Add std::os::get_exe_path
...
Need this to correctly determine sysroot in rustc
2011-10-04 21:35:06 -07:00
Brian Anderson
a0a4d34e14
Add std::ctypes
2011-10-04 21:35:06 -07:00
Brian Anderson
2124839cd7
Hide unused variable warnings in stdtest::treemap
2011-10-04 21:35:06 -07:00
Brian Anderson
6f5a0c7500
Add std::fs::normalize
2011-10-04 21:22:03 -07:00
Brian Anderson
51ae30287b
Add std::fs::split
2011-10-04 20:18:04 -07:00
Patrick Walton
0e5ea4d64f
Revert "stdlib: Migrate rust_file_is_dir() over to the C stack, and add a void type" due to build bustage on Windows
...
This reverts commit 9698ef89a0
.
2011-10-04 18:24:30 -07:00
Patrick Walton
9698ef89a0
stdlib: Migrate rust_file_is_dir() over to the C stack, and add a void type
2011-10-04 18:20:22 -07:00
Patrick Walton
990233eb3d
rustc: Allow calling native functions on the C stack that take generic arguments. They get turned into i8 pointers.
2011-10-04 17:41:57 -07:00
Patrick Walton
276dfc6133
Revert "Move trans_call to destination_passing style"
...
This reverts commit 6e56ec0066
.
2011-10-04 17:05:35 -07:00
Patrick Walton
ce9e0fc94f
Revert "Get rid of 'overwrite' destination kind"
...
This reverts commit 6e652588bf
.
2011-10-04 17:05:27 -07:00
Patrick Walton
11e407aaa9
Revert "Reorganize translation of expr_field"
...
This reverts commit 007ec666ad
.
2011-10-04 17:05:16 -07:00
Patrick Walton
af60cf407c
rt: Switch the AIO stuff to the C stack
2011-10-04 12:08:06 -07:00
Marijn Haverbeke
007ec666ad
Reorganize translation of expr_field
...
Issue #667
2011-10-04 17:52:23 +02:00
Marijn Haverbeke
6e652588bf
Get rid of 'overwrite' destination kind
...
It wasn't safe (computing the rval might invalidate the lval addr), and needlessly
complicating things (code was already building up intermediary results to work
around other unsafeties).
Issue #667
2011-10-04 17:52:23 +02:00
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