Commit graph

341 commits

Author SHA1 Message Date
Patrick Walton
deca79f372 Merge pull request #634 from robarnold/upstream-stable
Allocate ivecs out of the kernel pool
2011-07-07 15:18:07 -07:00
Marijn Haverbeke
3bdbf74d47 Make moving of temporaries do the right thing, use it to optimize
This adds support for dropping cleanups for temporary values when they
are moved somewhere else. It then adds wraps most copy operations
(return, put in data structure, box, etc) in a way that will fall back
to a move when it is safe.

This saves a lot of taking/dropping, shaving over a megabyte off the
stage2/rustc binary size.

In some cases, most notably function returns, we could detect that the
returned value is a local variable, and can thus be safely moved even
though it is not a temporary. This will require putting some more
information in lvals.

I did not yet handle function arguments, since the logic for passing
them looked too convoluted to touch. I'll probably try that in the
near future, since it's bound to be a big win.
2011-07-07 15:54:01 +02:00
Rob Arnold
f6117173c9 Allocate rust_ivec buffers out of the kernel pool
The duplication of upcalls is due to the fact that the runtime is
shared between stage0/rustc and stage1/rustc. Once snapshots are
updated, they should be de-duplicated.
2011-07-06 20:41:24 -07:00
Patrick Walton
1bba585044 stdlib: Implement ivec::foldl 2011-07-05 18:29:47 -07:00
Patrick Walton
8261d2e6fb stdlib: Add filter_map to ivec 2011-07-05 17:22:02 -07:00
Patrick Walton
ee5d7bbc86 stdlib: Don't have ivec::map take a mutable alias 2011-07-05 16:28:07 -07:00
Patrick Walton
1980a2db53 stdlib: Add str::connect_ivec() temporarily 2011-07-05 16:02:02 -07:00
Patrick Walton
219cd4b21f stdlib: Change ivec::rustrt::ivec_on_heap() to use a 32-bit return value 2011-07-05 15:34:50 -07:00
Marijn Haverbeke
6fd6fdea93 Move everything syntax-related to syntax/, break deps on rest of compiler
src/comp/syntax is currently just a sub-module of rustc, but it will,
in the near future, be its own crate. This includes:

 - The AST data structure
 - The parser
 - The pretty-printer
 - Visit, walk, and fold
 - The syntax extension system
 - Some utility stuff that should be in the stdlib*

*) Stdlib extensions currently require a snapshot before they can be
   used, and the win build is very broken right now. This is temporary
   and will be cleaned up when one of those problems goes away.

A lot of code was moved by this patch, mostly towards a more organized
layout. Some package paths did get longer, and I guess the new layout
will take some getting used to. Sorry about that!

Please try not to re-introduce any dependencies in syntax/ on any of
the other src/comp/ subdirs.
2011-07-05 15:57:21 +02:00
Patrick Walton
001397da3c stdlib: Add ivec::any() and ivec::all(); put out burning tinderbox 2011-07-04 23:52:47 -07:00
Patrick Walton
f71c8dd918 stdlib: Implement interior vector map 2011-07-04 22:48:42 -07:00
Patrick Walton
d3a4102bc1 stdlib: Add an inefficient implementation of ivec::pop 2011-07-04 21:20:18 -07:00
Patrick Walton
b4465aca5a stdlib: Fix long line in sort.rs 2011-06-30 22:21:30 -07:00
Patrick Walton
4c76bfdc1f stdlib: Add an interior vector version of sort and a test case 2011-06-30 19:09:52 -07:00
Brian Anderson
64d6081429 Use attributes for conditional compilation in std.rc 2011-06-30 14:13:49 -07:00
Tim Chevalier
a0cdb23892 Get rid of an unused variable 2011-06-30 12:37:30 -07:00
Eric Holk
b4a145e60f Added a nanosecond timer to time.rs, support for some floating point casts, and a commandline-driven mode for pfib.rs 2011-06-30 11:32:10 -07:00
Eric Holk
63dcd325b9 Adding support for pinning tasks to the currently running thread. Closes #598. 2011-06-29 18:47:47 -07:00
Lindsey Kuper
9155544a5a Comments. 2011-06-28 18:54:56 -07:00
Graydon Hoare
d79330de26 Fix logic bug in std::fs::dirname. 2011-06-28 17:24:30 -07:00
Brian Anderson
a83b64d15d Rework how linkage attributes are determined
The meta items within a crate's link attribute are used in linkage:

 #[link(name = "std",
        vers = "1.0",
        custom = "whatever")];

Name and vers are treated specially, and everything else is hashed together
into the crate meta hash.

Issue #487
2011-06-28 15:25:47 -07:00
Patrick Walton
7554423423 stdlib: Remove old botch from ufind 2011-06-28 14:16:09 -07:00
Paul Stansifer
c3901cdf8e Add simple syntax extension (#simplext) 2011-06-28 15:02:12 +00:00
Rafael Ávila de Espíndola
ecc080ed0b Use "" in the native_name as an indication that no extra options have to
be passed to the "linker". Use that for libc.
2011-06-28 08:21:13 -04:00
Rafael Ávila de Espíndola
ac081c30be Record and link with used native libraries. 2011-06-27 15:24:44 -04:00
Tim Chevalier
582e1f13f0 Invalidate constraints correctly after an assignment expression
Modified typestate to throw away any constraints mentioning a
variable on the LHS of an assignment, recv, assign_op, or on
either side of a swap.

Some code cleanup as well.
2011-06-24 22:36:53 -07:00
Marijn Haverbeke
d507d5fe91 Remove res idents from stdlib 2011-06-24 21:13:26 +02:00
Tim Chevalier
7fb35ecf84 Serialize constraints in types (literal arguments still not supported)
This involved, in part, changing the ast::def type so that a def_fn
has a "purity" field. This lets the typechecker determine whether
functions defined in other crates are pure.

It also required updating some error messages in tests. As a test
for cross-crate constrained functions, I added a safe_slice function
to std::str (slice(), with one of the asserts replaced with a
function precondition) and some test cases (various versions of
fn-constraint.rs) that call it. Also, I changed "fn" to "pred" for
some of the boolean functions in std::uint.
2011-06-21 14:37:33 -07:00
Brian Anderson
200dbe4c4f Remove various rustboot workarounds 2011-06-19 20:48:20 -07:00
Patrick Walton
3f7380ccec rustc: Change smallintmap to use an ivec and use it for the node type table. 3x typechecking speedup. 2011-06-19 18:03:19 -07:00
Brian Anderson
f58de2d687 Replace unexported meta tags with attributes
Issue #487
2011-06-18 20:23:05 -07:00
Patrick Walton
ca2ff9c50d stdlib: Add ivec::grow_set() 2011-06-18 16:41:09 -07:00
Patrick Walton
5d90b1df4b stdlib: Add ivec::grow() and ivec::grow_fn() 2011-06-18 16:29:45 -07:00
Patrick Walton
b2bcafe6fd stdlib: Add some more ivec functions, untested as of yet 2011-06-17 19:16:26 -07:00
unknown
8c6354ceb9 Made sure getcwd and friends work well on Windows. 2011-06-17 15:53:21 -07:00
Eric Holk
a40116b398 stdlib: added getcwd and a convenience function to make relative paths absolute. This will be helpful for #441. 2011-06-17 15:53:19 -07:00
Brian Anderson
6e6bc5076c rustc: Support both meta tags and attributes for crate metadata
This is a transitional patch for converting from 'meta' to attributes.

Issue #487
2011-06-17 15:07:34 -07:00
Patrick Walton
d47101703e stdlib: Sketch out ivec::init_fn, currently segfaulting 2011-06-16 17:48:59 -07:00
Patrick Walton
40746fa447 rustc: Implement conversions from interior vector data to unsafe pointers and vice-versa 2011-06-16 17:07:02 -07:00
Graydon Hoare
b84fffaa4e Reformat a bunch of recent churn. 2011-06-16 16:55:46 -07:00
Patrick Walton
050f62983d stdlib: Introduce an ivec module into the standard library; add a minimal test case 2011-06-16 16:08:26 -07:00
Brian Anderson
0efd7fac8a stdlib: Add option::is_some 2011-06-16 14:21:42 -07:00
Eric Holk
c4f9bd9470 Re-enabled join. 2011-06-15 18:16:59 -07:00
Michael Sullivan
a91d301b31 Add xterm to the term lib's list of supported terms. 2011-06-15 17:33:37 -07:00
Brian Anderson
f50fd6d8ae stdlib: Add color support for GNU screen 2011-06-15 16:38:17 -07:00
Brian Anderson
c19a026f46 stdlib: Add emacs variables to term.rs 2011-06-15 16:28:14 -07:00
Brian Anderson
b8a5440b2d stdlib: Add an either module
Like Haskell's, with left and right tags, various conversion functions
2011-06-15 15:45:41 -07:00
Marijn Haverbeke
b2b8002fd3 Fix unsafe uses of aliases in tail calls 2011-06-15 21:39:27 +02:00
Graydon Hoare
766d54df93 Fix a bunch of compile-command lines to use RBUILD 2011-06-15 12:01:19 -07:00
Graydon Hoare
7e806c5e87 Attempt to put out windows tinderbox. 2011-06-15 11:39:31 -07:00