Commit graph

8297 commits

Author SHA1 Message Date
Graydon Hoare
b224bcf6e1 Add an LLVM-instruction-counting mode to trans.
Pipe to xdu to see a trans call graph of generated insns.
2012-03-22 13:44:20 -07:00
Niko Matsakis
dc07280b08 make --enforce-mut-vars always on, add mut annotations to remaining files 2012-03-22 09:58:19 -07:00
Niko Matsakis
b653a18416 add mut decls to rustc and make them mandatory 2012-03-21 21:04:14 -07:00
Brian Anderson
d7be4abdae rt: Fix valgrind stack hints 2012-03-21 19:10:32 -07:00
Brian Anderson
9ea3bc614e rt: Shave 16 bytes off the __morestack frame 2012-03-21 19:10:32 -07:00
Brian Anderson
9f89cc9d15 rt: Shave a few instructions off __morestack 2012-03-21 19:10:32 -07:00
Brian Anderson
f5f6135fd0 rt: Stop using large stacks for the main task 2012-03-21 19:10:32 -07:00
Brian Anderson
0639b67290 rt: Use get_task_from_tcb during stack growth calls 2012-03-21 19:10:32 -07:00
Brian Anderson
4ad57f5c39 rt: Add rust_task::get_task_from_tcb 2012-03-21 19:10:32 -07:00
Brian Anderson
08f783ff10 rt: Add a task field to stk_seg and populate it 2012-03-21 19:10:32 -07:00
Brian Anderson
4a0c6c7f41 rt: Add a get_sp_limit function 2012-03-21 19:10:31 -07:00
Brian Anderson
1cb35c9b26 rt: Rename record_sp to record_sp_limit 2012-03-21 19:10:31 -07:00
Brian Anderson
ba322b0a70 rt: Reset the stack limit after catching an exception
This wasn't causing problems but it looked wrong
2012-03-21 19:10:31 -07:00
Brian Anderson
b78af4f7c4 rt: Inline a bunch of stack switching code 2012-03-21 19:10:31 -07:00
Brian Anderson
d5968d9f38 rt: Swap the definition of stk_seg::next and prev 2012-03-21 19:10:31 -07:00
Brian Anderson
6115b13dfc rt: Don't switch to the C stack on the upcall_new_stack fast path 2012-03-21 19:10:31 -07:00
Brian Anderson
8a145a601e rt: Don't swatch stacks during upcall_del_stack 2012-03-21 19:10:31 -07:00
Graydon Hoare
9ba712fb8b Every time you don't use a variable, a kitten scowls. 2012-03-21 19:00:52 -07:00
Graydon Hoare
eba5129978 Quiet unused-result error harder. 2012-03-21 18:53:27 -07:00
Graydon Hoare
d28175b916 Upgrade valgrind headers to 3.7, silencing build breakage on FreeBSD. 2012-03-21 18:40:32 -07:00
Graydon Hoare
a9e7bff731 Remove incorrect uses of NVALGRIND, Close #1435. 2012-03-21 18:21:11 -07:00
Patrick Walton
44bd8da7fd rustc: Use the right "nxt" function in unify_regions 2012-03-21 16:13:34 -07:00
Brian Anderson
75ee4633eb rustc: Long lines 2012-03-21 16:10:39 -07:00
Josh Matthews
5835a4cc8e Merge remote-tracking branch 'mozilla/master' 2012-03-21 19:01:04 -04:00
Patrick Walton
b0f6dad5e3 rustc: Add a function to record region bindings 2012-03-21 15:59:57 -07:00
Josh Matthews
8142438938 Avoid mangling names differently in debug builds to work around a build error. Fix up file name and path debug information, and build one compilation unit for a crate instead of one per source file. 2012-03-21 18:56:36 -04:00
Patrick Walton
c8ab0c1b3b rustc: Replace region parameters in function return values 2012-03-21 15:22:12 -07:00
Patrick Walton
324f57a180 rustc: Check call and bind expressions using a set of region bindings 2012-03-21 14:47:57 -07:00
Patrick Walton
bdf968c9d9 rustc: Add a version of demand that takes in a set of region variable bindings 2012-03-21 14:15:43 -07:00
Tim Chevalier
30c272cb3a methods work
Cross-crate method calls don't work yet. Added
run-pass/class-method-cross-crate to test that, but it's xfailed

References to fields within methods don't work yet. Added
run-pass/class-methods to test that, but it's also xfailed
2012-03-21 13:53:21 -07:00
Patrick Walton
3e47442471 rustc: Add region unification functions 2012-03-21 13:28:50 -07:00
Patrick Walton
68e364b54d rustc: Introduce re_params into the typechecker
This is the first step of the region refactoring I need to do in order to handle named regions properly.
2012-03-21 12:21:53 -07:00
Graydon Hoare
071dedde79 Register snapsnots. 2012-03-21 11:46:46 -07:00
Niko Matsakis
7cc0f554ae add test for commit 9502fb99e0 2012-03-21 08:23:31 -07:00
Marijn Haverbeke
9502fb99e0 Fix bug in vtable resolution 2012-03-21 15:57:23 +01:00
Marijn Haverbeke
bc3f5e7160 rustc: Replace intrinsic vec_len with unsafe Rust code
Preparation for #1981
2012-03-21 15:56:48 +01:00
Niko Matsakis
cce2751461 Adjust arena definition to be compatible with placement new 2012-03-21 05:46:31 -07:00
Niko Matsakis
cfcbec3cc3 Implement an initial version of placement new. 2012-03-20 20:39:40 -07:00
Patrick Walton
ba39e277e2 stdlib: Implement arenas 2012-03-20 19:08:17 -07:00
Brian Anderson
57281f52e5 test: Begin running the language ref examples. Mostly xfailed 2012-03-20 18:59:21 -07:00
Brian Anderson
a0cbf638ee doc: Switch the tutorial to pandoc's method of tagging code blocks
Instead of '## tag', it's '~~~ {.tag}'
2012-03-20 18:59:21 -07:00
Patrick Walton
237cd4455c rustc: Fix a few more instances of node ID stomping, due to AST folding incorrectly passing stuff through unchanged 2012-03-20 18:37:09 -07:00
Graydon Hoare
084fe56ad5 Conditionalize test to only run double/byte/double test on x64 for now. 2012-03-20 17:34:21 -07:00
Patrick Walton
86ebde575c rustc: Make the quasiquote operator stop reusing nodes (and therefore stop reusing node IDs). Should fix issue #1947 for real. 2012-03-20 17:23:46 -07:00
Graydon Hoare
faacbb38f0 Xfail struct-return test. x64 ABI is not quite right yet. 2012-03-20 17:13:48 -07:00
Tim Chevalier
b06dc884e5 Class methods WIP
In particular, use the ast::method type to represent a class method,
and try to reuse as much iface code as possible. (This makes sense now
since I'll be allowing polymorphic class methods.)
2012-03-20 17:07:07 -07:00
Graydon Hoare
855c99ea75 Some tests for passing and returning structures by value on x64. Close #1402. Close #1970. 2012-03-20 16:44:56 -07:00
Brian Anderson
b181ea415e core: Rename unsafe::leak to unsafe::forget. Closes #2031 2012-03-20 15:20:37 -07:00
Graydon Hoare
56828d49fd Remove unused "flav" parameter from function registration paths. 2012-03-20 15:16:12 -07:00
Graydon Hoare
d282481c12 Fix naughty mangling-breakage from stringifying a node ID. Close #1344. 2012-03-20 15:16:12 -07:00
Graydon Hoare
8e911cbd65 Work on fixing name mangling. 2012-03-20 15:16:12 -07:00
Brian Anderson
1695148b5d rustdoc: Refactor reexport_pass 2012-03-20 14:54:40 -07:00
Brian Anderson
651aeea961 rustdoc: Document impl reexports 2012-03-20 14:54:40 -07:00
Brian Anderson
f3ed738399 rustdoc: Run the entire resolve pass 2012-03-20 14:54:40 -07:00
Graydon Hoare
b994b17be8 Remove object file directly rather than running "rm". Close #1778 also. 2012-03-20 12:39:40 -07:00
Graydon Hoare
0973bccfe2 Fail when there's an error starting a process. Close #1778. 2012-03-20 12:38:57 -07:00
Jyun-Yan You
d3712a287d make native and crust functions conform to x86-64 ABI 2012-03-20 11:59:24 -07:00
Graydon Hoare
716dc29ffc Minor io fixlet to account for racing against last_os_error. 2012-03-20 11:59:23 -07:00
Marijn Haverbeke
1a20f8e7cc rustc: Be more careful about spans in 'unexpected token' errors
Closes #2017
2012-03-20 15:05:14 +01:00
Marijn Haverbeke
7a34ac5890 Revert order of arguments to option::maybe and from_maybe
Closes #2019
2012-03-20 14:55:07 +01:00
Marijn Haverbeke
1547c27926 Fix caching bug in resolve, get rid of enumness kludge
Closes #1911
2012-03-20 14:33:04 +01:00
Marijn Haverbeke
928364b98b Only make symbols external when they are actually externally accessible
Closes #2030
2012-03-20 13:19:33 +01:00
Marijn Haverbeke
ade1207ba3 Move external-reachability checker to trans
Preparation for a fix for issue #2020
2012-03-20 12:28:46 +01:00
Brian Anderson
ccaace6587 rt: Remove an unused function 2012-03-19 19:02:54 -07:00
Patrick Walton
bf13fb7921 rustc: Fix handling of the self region in method return types. Also stub some code to allow the regions of simple field access expressions to be determined. 2012-03-19 18:52:18 -07:00
Patrick Walton
b12588a197 rustc: Fix mutability checking when dereferencing a region-annotated pointer 2012-03-19 17:28:00 -07:00
Brian Anderson
4e3e13302d test: Remove pretty/issue-953. Doesn't typecheck 2012-03-19 16:11:46 -07:00
Brian Anderson
20417ebf31 core: Move unsafe conversions to str::unsafe 2012-03-19 15:47:52 -07:00
Brian Anderson
1a40aa0935 core: Make converting from a C string unsafe 2012-03-19 15:47:52 -07:00
Graydon Hoare
869b2d7064 Send string concatenation to specialized upcall, shave 17s off librustc compile time. 2012-03-19 14:29:39 -07:00
Brian Anderson
bbfa08d947 rustc: Stop generating the flag_none #fmt flag. Issue #1993 2012-03-19 14:28:42 -07:00
Brian Anderson
a0c6ad0c51 core: Remove a FIXME. Closes #1992
This is too vague to ever fix
2012-03-19 14:17:59 -07:00
Brian Anderson
009bbadd92 core: Remove a FIXME. Closes #2002
It works for negative integers
2012-03-19 14:14:49 -07:00
Marijn Haverbeke
cec1a9b859 Properly check kinds when instantiating types
Closes #2011
2012-03-19 10:45:29 +01:00
Brian Anderson
4c4ac05f02 rustdoc: Print type params in fn sigs. Closes #2021 2012-03-18 21:41:57 -07:00
Brian Anderson
7dcac31e4d rt: Remove rust_task_thread::dead_tasks 2012-03-18 18:18:18 -07:00
Brian Anderson
6f6650e726 rt: Remove rust_task_thread::newborn_tasks 2012-03-18 18:18:18 -07:00
Brian Anderson
5d4bf75f56 rt: Convert rust_task_list to a typedef 2012-03-18 18:18:18 -07:00
Brian Anderson
47c1895724 rt: Don't store the name of the task state in rust_task_list 2012-03-18 18:18:15 -07:00
Brian Anderson
05466c6138 rt: Use an enum to represent the task state 2012-03-18 17:41:56 -07:00
Brian Anderson
0201a03203 core: Rename vec::*_from to _between to match str mod 2012-03-18 17:40:52 -07:00
Brian Anderson
13bcc73625 core: Rename vec::position_elt to position_elem 2012-03-18 17:40:49 -07:00
Brian Anderson
cab02145ba Merge pull request #2025 from damag/master
Fix typo in error message
2012-03-18 17:05:38 -07:00
Brian Anderson
b247de6458 rt: Remove lock_held_by_current_thread 2012-03-18 17:03:35 -07:00
Brian Anderson
e4af1ca065 core: Add vec::unshift 2012-03-18 16:16:47 -07:00
Brian Anderson
397f33fd35 core: Don't require a copyable T for vec::push 2012-03-18 16:08:37 -07:00
Brian Anderson
b1eb4579c6 core: Improve the docs and signature of vec::iter2 2012-03-18 15:41:03 -07:00
Brian Anderson
d6ded6788d core: vec::filter_map doesn't require a copyable T 2012-03-18 15:26:05 -07:00
Damien Grassart
38ac87f0ff rustc: Fix typo in error message 2012-03-18 04:45:03 +01:00
Brian Anderson
132266b2cb rt: Remove the recursive lock from rust_task_thread 2012-03-17 18:44:41 -07:00
Brian Anderson
3ee4a15e5e core: Don't copy elements in filter_map 2012-03-17 18:17:27 -07:00
Brian Anderson
35e9970e29 rt: Ports don't need to ref their tasks
Port lifetime is always bounded by their owning task
2012-03-17 17:56:15 -07:00
Brian Anderson
5728a69e78 rt: Remove some bogus pthread settings from rust_task_thread
This is all handled by rust_thread, and 'true' isn't even a valid
value to pass to pthread_attr_setdetachestate
2012-03-17 17:18:24 -07:00
Brian Anderson
4debe71785 compiletest: Remove FIXME. Closes #1984 2012-03-17 14:57:13 -07:00
Brian Anderson
c139b348fe core: Fix signature of call_with_retptr. Closes #1987 2012-03-17 14:57:13 -07:00
Brian Anderson
cae2c1611b Register snapshots 2012-03-17 00:49:23 -07:00
Tim Chevalier
e3a1c5c96a Encode both private and public class fields in metadata
This is necessary to calculate the correct offsets for field references.

Simple cross-crate class tests (still with fields only) now pass.
2012-03-16 20:36:07 -07:00
Tim Chevalier
16dd6c4756 Fix encoding of class ctors
Class tests still fail at runtime
2012-03-16 19:20:36 -07:00
Josh Matthews
d958123d8a Don't break -g in the presence of monomorphization. 2012-03-16 20:19:52 -04:00
Brian Anderson
154a3fdf44 rustc: Unify impl self types in the opposite order so variance is correct 2012-03-16 17:06:15 -07:00
Brian Anderson
3445454e79 core: Resolve and remove some FIXMEs 2012-03-16 16:46:32 -07:00
Brian Anderson
9e9f4a6240 core: Remove str::init_elt
This was added based on my FIXME, but I no longer believe it has a place in
core::str, partly because it doesn't follow current naming conventions, and
partly because it can be immitated with a one liner using str::from_chars and
vec::from_elem. I have replaced the existing uses with said one-liner.
2012-03-16 15:31:53 -07:00
Tim Chevalier
1680ccce1e Classes WIP
Cross-crate metadata for classes works well enough that programs with
classes in other crates compile successfully, but output wrong results.
Checking in work so far to avoid merge hassles. (Tests are xfailed.)
2012-03-16 15:28:05 -07:00
Brian Anderson
47d468f08c core: Store reexporting result and either. Closes #1997 2012-03-16 15:14:37 -07:00
Brian Anderson
ddbd02aaf2 rustdoc: Allow elipses to appear in brief descriptions. Closes #2003 2012-03-16 14:50:30 -07:00
Niko Matsakis
e399ddbf17 allow binding of fn~, make result fn@. fixes 1899. 2012-03-16 17:48:53 -04:00
Brian Anderson
f80008f04b core: Add lots of string docs 2012-03-16 14:29:09 -07:00
Patrick Walton
f6a792585b rustc: Give a better error message when references involving the caller region fail to unify 2012-03-16 14:02:02 -07:00
Brian Anderson
3db8ae0bdc core: Remove extra backslashes from docs 2012-03-16 12:20:38 -07:00
Brian Anderson
0b0ecc662b rustdoc: Escape backslashes 2012-03-16 12:20:29 -07:00
Brian Anderson
a7132eeb1e core: Doc cleanup 2012-03-16 12:12:25 -07:00
Brian Anderson
0d88bf7e43 core: Escape some characters in comments 2012-03-16 11:58:39 -07:00
Erick Tryzelaar
67a1c35264 std: Add a a hashmap_from_vecs function 2012-03-16 17:05:29 +01:00
Erick Tryzelaar
2ddd084631 std: Add a function to iterate over a subset of a vec 2012-03-16 17:05:29 +01:00
Erick Tryzelaar
da91b60343 Add loop to the vim keyword list. 2012-03-16 17:05:29 +01:00
Marijn Haverbeke
35fc4a4291 Check kind bounds when calling methods
Closes #1915
2012-03-16 17:05:29 +01:00
Marijn Haverbeke
25c2be0ff4 Forbid boxed ifaces with self types or generic methods in bounded params
They are a soundness hole.

Closes #1994
2012-03-16 15:39:07 +01:00
Marijn Haverbeke
484469c58d Register new snapshot 2012-03-16 15:39:04 +01:00
Marijn Haverbeke
22bef74b55 Remove shared tydescs
All tydescs are static now, there's no need to worry about
marshalling them between threads anymore.
2012-03-16 15:38:42 +01:00
Marijn Haverbeke
15a325f267 Support binding of methods off boxed iface values
Closes #435
2012-03-16 12:58:26 +01:00
Marijn Haverbeke
5f20c94785 Register new snapshots 2012-03-16 12:58:21 +01:00
Tim Chevalier
c86135e80b Comments only: associate core::libc FIXMEs with issue numbers 2012-03-15 23:12:07 -07:00
Tim Chevalier
2ef7d135a9 Comments only: associate core::iter FIXMEs with issue numbers 2012-03-15 23:12:07 -07:00
Tim Chevalier
f5da4881dc Comments only: issue numbers for FIXMEs 2012-03-15 23:12:06 -07:00
Tim Chevalier
c1c84e92dd Put the OS error in the error string in io::mk_file_writer() 2012-03-15 23:12:06 -07:00
Patrick Walton
e464e2ba56 rustc: Describe why regions failed to unify as part of the type error message 2012-03-15 19:19:32 -07:00
Patrick Walton
4ea3b0b89c rustc: Fix the AST map to actually map blocks. Also improve region error messages involving blocks. 2012-03-15 19:06:38 -07:00
Brian Anderson
389f53c6ff core: Docs 2012-03-15 18:58:30 -07:00
Tim Chevalier
07d0981bbb Comments only: associate FIXMEs with issue numbers in int library 2012-03-15 18:50:26 -07:00
Patrick Walton
e0edcfc21c rustc: Index blocks 2012-03-15 18:46:57 -07:00
Tim Chevalier
43b457c5d6 Comments only: associate FIXMEs in float libs with issue numbers 2012-03-15 18:46:17 -07:00
Patrick Walton
0972571cdd test: Add a test case for self regions and typeclass implementations 2012-03-15 18:13:57 -07:00
Tim Chevalier
20ec72830a Address FIXMEs in extfmt / add issue numbers 2012-03-15 17:50:22 -07:00
Tim Chevalier
ce3f369047 Change ctypes::intptr_t to int 2012-03-15 17:50:22 -07:00
Tim Chevalier
e3222e9905 Improve error message for passing mutable argument by reference 2012-03-15 17:50:22 -07:00
Tim Chevalier
48ccb3fbfd Associate FIXME with an issue in compiletest.rs 2012-03-15 17:50:22 -07:00
Tim Chevalier
b3dada0017 cargo FIXMEs 2012-03-15 17:50:21 -07:00
Patrick Walton
95ce42b346 rustc: Instantiate self regions in impls 2012-03-15 17:14:02 -07:00
Brian Anderson
bcf44f8cc1 core: Optimize str::unsafe::slice_bytes. Closes #1995 2012-03-15 17:10:39 -07:00
Patrick Walton
0095e6d85b rustc: Have the typechecker pick up the resolved self region 2012-03-15 16:48:53 -07:00
Marijn Haverbeke
76d07f4056 Remove dynastack support from runtime
Issue #1982
2012-03-16 00:44:06 +01:00
Marijn Haverbeke
146b61189a Get rid of rust_crate_cache in the runtime
We are no longer generating dynamic tydescs or dicts.

Issue #1982
2012-03-16 00:44:06 +01:00
Patrick Walton
bc21a5ddbe rustc: Create self region bindings, and forbid the self region from being used in places it shouldn't be 2012-03-15 16:38:08 -07:00
Brian Anderson
041c9a0863 core: Optimize str::bytes
This compiles down to a memmove. Takes about 1/4 of the time of the old
version.
2012-03-15 15:43:01 -07:00
Tim Chevalier
771177a814 Don't pass Unicode to char::is_upper 2012-03-15 15:40:43 -07:00
Tim Chevalier
26b54cc17e Add asserts to char::is_upper and char::is_lower
Add an assert that the argument char is ASCII, as well as adding
issue numbers to FIXMEs
2012-03-15 15:40:43 -07:00
Tim Chevalier
f67f2388f7 Use str::is_whitespace instead of dup'd is_whitespace function 2012-03-15 15:40:43 -07:00
Tim Chevalier
e697456d52 Associate FIXMEs with issue numbers (comments only) 2012-03-15 15:40:43 -07:00
Niko Matsakis
5f68206a73 register new snapshots 2012-03-15 18:30:10 -04:00
Niko Matsakis
d365ec5c7d kill old serialization code 2012-03-15 18:30:10 -04:00