Commit graph

1109 commits

Author SHA1 Message Date
Patrick Walton
ac8eb20224 rustc: Stub support for Rust intrinsics 2011-05-03 18:03:59 -07:00
Patrick Walton
2bc17adc29 Revert "Rename the "llvm" API to "llvm-intrinsic"" due to tinderbox bustage
This reverts commit 6871c245a6.
2011-05-03 17:50:37 -07:00
Graydon Hoare
b453c3c728 Start sketching --depend support in rustc. 2011-05-03 15:56:00 -07:00
Patrick Walton
6871c245a6 Rename the "llvm" API to "llvm-intrinsic" 2011-05-03 15:55:01 -07:00
Patrick Walton
e43729ccf2 rustc: Refactor metadata.Encode.* to not require a type abbreviation table if abbreviation isn't enabled 2011-05-03 14:41:05 -07:00
Patrick Walton
3f317ede41 rustc: Name type glue properly 2011-05-03 14:41:05 -07:00
Brian Anderson
ed40c85af5 Extract ast.is_exported from the resolve module 2011-05-02 22:07:36 -04:00
Patrick Walton
ebc236e91c rustc: Time the Rust translation and LLVM passes separately 2011-05-02 17:50:46 -07:00
Patrick Walton
a833f152ba rustc: Remove the artificial block in ty.rs. Fixes self-hosting. Add a test case for this, XFAIL'd. 2011-05-02 17:50:46 -07:00
Patrick Walton
147a2d655f Un-revert "Use different syntax for checks that matter to typestate", fixing the problem.
This reverts commit d08b443fff.
2011-05-02 17:50:46 -07:00
Graydon Hoare
d08b443fff Revert "Use different syntax for checks that matter to typestate"
This reverts commit aa25f22f19. It broke stage2, not sure why yet.
2011-05-02 17:35:33 -07:00
Patrick Walton
9d21cf3b61 rustc: Allocate tydescs on the stack when it's safe to do so. 60% compile speed increase. 2011-05-02 15:28:59 -07:00
Tim Chevalier
aa25f22f19 Use different syntax for checks that matter to typestate
This giant commit changes the syntax of Rust to use "assert" for
"check" expressions that didn't mean anything to the typestate
system, and continue using "check" for checks that are used as
part of typestate checking.

Most of the changes are just replacing "check" with "assert" in test
cases and rustc.
2011-05-02 12:16:29 -07:00
Patrick Walton
870435caf5 rustc: Add a "fat tydesc" LLVM type to trans 2011-05-02 12:05:21 -07:00
Brian Anderson
1dd63ff42d Remove the search direction from resolve's fold environment
It's not actually involved in the fold so it can just be passed between the
functions that need it.
2011-05-01 16:57:36 -04:00
Brian Anderson
a697210234 Hide unexported tag variants 2011-05-01 16:57:36 -04:00
Brian Anderson
459b0ec833 Implement simple module export 2011-05-01 16:57:36 -04:00
Brian Anderson
d88776726a rustc: Preserve dots in input path when using an implicit output path
This avoids outputing, e.g. /test.bc for ../test.rs
2011-05-01 14:42:45 -04:00
Ralph Giles
46fd8dfe21 Fix a typo in the documentation. 2011-05-01 00:16:00 -07:00
Patrick Walton
b101e26d92 rustc: Run scope cleanups in the implicit block created by log statements. Fixes a leak. 2011-04-29 19:19:54 -07:00
Patrick Walton
64a5afadf3 rustc: Add constants for LLVM function attributes 2011-04-29 16:58:49 -07:00
Patrick Walton
f6c472d816 rustc: Emit pure native glue; we don't call it yet 2011-04-29 16:40:30 -07:00
Patrick Walton
593fb195a4 rustc: Start threading a purity flag through upcalls 2011-04-29 15:39:48 -07:00
Graydon Hoare
b9babe47da Temporarily disable dtors; they broke self-hosting. 2011-04-29 15:06:53 -07:00
Patrick Walton
1acf404361 rustc: First steps to determine whether tydescs escape 2011-04-29 15:01:07 -07:00
Graydon Hoare
7b95b5c033 Don't emit metadata unless compiling -shared. 2011-04-29 19:20:20 +00:00
Marijn Haverbeke
c39a95da90 Implement destructors in rustc
Unlike rustboot, rustc keeps it destructors in vtables. Entry 0 holds
either the destructor for the obj or a NULL pointer. The method
offsets start at 1.
2011-04-29 21:19:50 +02:00
Patrick Walton
9aeb67987c rustc: Temporarily add a switch and a corresponding makefile variable to disable typestate 2011-04-29 12:16:14 -07:00
Patrick Walton
adfacc5031 rustc: Add a --time-passes option 2011-04-29 11:55:20 -07:00
Patrick Walton
f0d24ff49e rustc: Handle alias parameters in native functions properly 2011-04-29 11:54:41 -07:00
Patrick Walton
c52fb52fbc rustc: Remove the wrong-compiler warning; we're self-hosting now. 2011-04-29 10:23:53 -07:00
Graydon Hoare
a2f68b2d58 Intern metadata while writing, shrink stage1 from 12mb to 5.7mb. 2011-04-29 15:26:28 +00:00
Patrick Walton
6daf440037 rustc: Fix vec append glue for strings. Add a test case. 2011-04-28 20:16:32 -07:00
Patrick Walton
3e08609ed7 rustc: Add some value names to the vec append glue function. Un-XFAIL vec-growth.rs. 2011-04-28 18:45:56 -07:00
Graydon Hoare
1f44887761 More attempts at fixing broken vec-append glue. 2011-04-28 18:39:12 -07:00
Graydon Hoare
cd8cf44d1d Make the no-growth path (previously never exercised) in rustc *work*. 2011-04-28 18:11:00 -07:00
Graydon Hoare
bcad52451c Actually hit the no-growth path on vec-append. 2011-04-28 17:45:35 -07:00
Graydon Hoare
e300b8047f Consider unop deref as an lval. Un-XFAIL vec-push. 2011-04-28 16:37:18 -07:00
Patrick Walton
171883f437 rustc: Only use color if it's supported 2011-04-28 14:59:16 -07:00
Graydon Hoare
c9e601b31d Drop args in native stubs too. 2011-04-28 14:35:12 -07:00
Tim Chevalier
2c3808b511 Enable typestate_check
This was supposed to be in a previous commit. I don't know what happened.
2011-04-28 13:26:19 -07:00
Tim Chevalier
34dae82b48 Add a session field to ty_ctxt and change an err to span_err
I changed instantiate to print out a more helpful error message,
which required passing it a session argument. To avoid
threading extra arguments through a lot of functions,
I added a session field to ty_ctxt.
2011-04-28 13:26:19 -07:00
Tim Chevalier
f61e77e745 Reindented things and removed superfluous comments, nothing to see here 2011-04-28 13:26:19 -07:00
Tim Chevalier
844fe20720 Fix some nested patterns in rustc
In rustc, nested patterns were potentially matching when they shouldn't
match, because a loop index wasn't being incremented. Fixed it and added
one test case.
2011-04-28 13:26:19 -07:00
Tim Chevalier
25694582d9 Fix bug in handling of expr_alt (postcond for alts was being intersected with postcond for scrutinee) 2011-04-28 13:26:19 -07:00
Tim Chevalier
707cd0281d Fixed bug in typeck that wasn't filling in anns for stmts
(needed for typestate_check).

Also changed a (log; fail) to (log_err; fail) in typestate_check,
and added some more logging funs in util.common.
2011-04-28 13:26:19 -07:00
Tim Chevalier
0190ebfe07 Support all expression forms in typestate
Added support for self_method, cont, chan, port, recv, send, be,
do_while, spawn, and ext; handled break and cont correctly.
(However, there are no non-xfailed test cases for ext or spawn in
stage0 currently.)

Although the standard library compiles and all test cases pass with
typestate enabled, I left typestate checking disabled as rustc
terminates abnormally when building the standard library if so,
even though it does generate code correctly.
2011-04-28 13:26:19 -07:00
Tim Chevalier
7c4f8cb459 Further work on typestate_check
Lots of work on typestate_check, seems to get a lot of the way
through checking the standard library.

* Added for, for_each, assign_op, bind, cast, put, check, break,
and cont. (I'm not sure break and cont are actually handled correctly.)

* Fixed side-effect bug in seq_preconds so that unioning the
preconditions of a sequence of statements or expressions
is handled correctly.

* Pass poststate correctly through a stmt_decl.

* Handle expr_ret and expr_fail properly (after execution of a ret
or fail, everything is true -- this is needed to handle ifs and alts
where one branch is a ret or fail)

* Fixed bug in set_prestate_ann where a thing that needed to be
mutated wasn't getting passed as an alias

* Fixed bug in how expr_alt was treated (zero is not the identity
for intersect, who knew, right?)

* Update logging to reflect log_err vs. log

* Fixed find_locals so as to return all local decls and exclude
function arguments.

* Make union_postconds work on an empty vector (needed to handle
empty blocks correctly)

* Added _vec.cat_options, which takes a list of option[T] to a list
of T, ignoring any Nones

* Added two test cases.
2011-04-28 13:26:19 -07:00
Rafael Ávila de Espíndola
b0980b7d79 Add a very minimal set of .cfi_* statements to get part of backtraces
working (on hello world at least):

~/inst/gdb/bin/gdb --args ./foo
(gdb) b write
...
(gdb) r
...
Breakpoint 1, 0xf7f04270 in write () from /lib32/libc.so.6
(gdb) bt
0  0xf7f04270 in write () from /lib32/libc.so.6
1  0x0804931a in rust_native_cdecl_3 ()
2  0x080487d7 in _rust_wrapper3_ ()
3  0x0804890a in _rust_fn5_main ()
4  0x08049440 in rust_native_cdecl_7 ()
2011-04-28 16:19:20 -04:00
Graydon Hoare
6daca7ea8d Actually perform take/drop on args (oh my!) 2011-04-28 11:24:29 -07:00