Commit Graph

5149 Commits

Author SHA1 Message Date
Tim Chevalier
9f7ed2f054 Add a total version of vec::last that has a precondition 2011-08-30 17:17:42 -07:00
Tim Chevalier
4fc72c2130 XFAIL zip-same-length -- that's ok, since it's a new test 2011-08-30 16:43:12 -07:00
Tim Chevalier
819b00079c Library test cases for vec::zip 2011-08-30 16:42:32 -07:00
Tim Chevalier
268533a920 Add a precondition on vec::zip
vec::zip now has the precondition that the two argument vectors
are the same length. Changed uses of it to reflect that.

Also added a few vector-enumerating utilities to vec.rs, which
necessitated in making some functions in u8 declared-pure.
2011-08-30 16:39:22 -07:00
Tim Chevalier
d37e8cfc67 Test that fn preconditions get typechecked 2011-08-30 16:39:17 -07:00
Tim Chevalier
2e53da5126 Typecheck function preconditions
It turned out that function preconditions weren't getting checked
at all, so you could write a constraint on a fn decl that was total
nonsense. Fixed now.
2011-08-30 16:20:16 -07:00
Tim Chevalier
f62add95da Eliminate an unchecked use of map::get in ppaux 2011-08-30 16:19:52 -07:00
Patrick Walton
b722dc36a5 rt: Fix logging of type-parametric resources 2011-08-30 15:56:42 -07:00
Patrick Walton
05d96f155f rustc: Allow non-type-parametric resources to be logged 2011-08-30 13:50:48 -07:00
Marijn Haverbeke
7bbe8d2e8c Stop relying on klunky hack in alias.rs
It assumed node_ids increased monotonically for locals, but macros
make this no longer the case, and it was a dubious assumption anyway.
It now numbers locals itself and uses that to determine which precede
which.
2011-08-30 17:03:00 +02:00
Marijn Haverbeke
61392f9f82 Clean up trans_build, factor repeated code into function 2011-08-30 14:02:20 +02:00
Marijn Haverbeke
e17e6af4f0 Change a number of result-returning functions to return @block_ctxt
The uniformity doesn't seem to be worth the extra noise and pointless
code being generated. If something doesn't produce a value, don't make
it return one. (For now, trans_[exprtype] things are left in the result-
returning form, even when they never return anything useful, since in
that case uniformity is arguably helpful.)
2011-08-30 13:50:58 +02:00
Marijn Haverbeke
adec3ecfe0 Remove compiler-bug-workaround that's no longer needed 2011-08-30 13:10:10 +02:00
Marijn Haverbeke
c1ba28c777 Glob-import trans_build in other trans files
The capitalization already prevents name clashes. Being able to refer to the
bitcode-construction primitives directly makes the code cleaner.
2011-08-30 13:04:57 +02:00
Graydon Hoare
41fb042def Stab-in-the-dark error fix for the crashing windows tinderboxes. Helps win2 anyways. 2011-08-29 17:35:24 -07:00
Patrick Walton
f1ed03dfa5 rt: Have data::walk_fn be defensive regarding whether the derived implementation of walk_fn moves the data pointer 2011-08-29 16:50:06 -07:00
Patrick Walton
0a4d43379e rt: Move to a custom alignof since __alignof__ returns the "preferred" alignment rather than the one that gets used in structs 2011-08-29 16:24:03 -07:00
Patrick Walton
b16a9a984a rt: Don't dereference a null pointer when traversing a function with no environment 2011-08-29 15:27:55 -07:00
Marijn Haverbeke
b623ddfb7e Warn for exports that refer to non-existent items
Closes #865
2011-08-29 23:46:58 +02:00
Marijn Haverbeke
4db388ea6c Remove obsolete exports 2011-08-29 23:46:38 +02:00
Brian Anderson
3d26665e60 Rename upcall_istr_push to rust_istr_push in rustrt.def.in 2011-08-29 14:18:46 -07:00
Marijn Haverbeke
b099b1e3f7 Make std::istr::push_byte efficient
It used to allocate two (!) heap values per pushed byte. It now goes through
a runtime function that simply grows the istr and writes the byte.
2011-08-29 22:46:49 +02:00
Marijn Haverbeke
14567c5eb0 Factor vector reserve code in runtime into its own function 2011-08-29 22:35:29 +02:00
Marijn Haverbeke
eb4661fc52 Factor vector-allocation code, always allocate space for at least 4 elts
(This prevents the first few reallocs when growing a vector.)
2011-08-29 22:30:18 +02:00
Brian Anderson
5483b910d6 Convert a block to a fn in trans_ivec::trans_add
The block was not valgrind-clean
2011-08-29 11:07:42 -07:00
Marijn Haverbeke
9f41bc854d Don't duplicate ivec-iterating loop code
trans_ivec is starting to look almost pleasant
2011-08-29 16:14:24 +02:00
Marijn Haverbeke
9084a3ca1b Register snapshot
The win snapshot is not on s3 yet, because of tinderbox breakage. The file
can be gotten at [1] in the meantime.

[1] marijnhaverbeke.nl/upload/rust-stage0-2011-08-29-c9c5ee2-winnt-i386-bed0aeb9cdf7831a7c1d9337a2b351699f0d25cd.tar.bz2
2011-08-29 14:45:09 +02:00
Marijn Haverbeke
49e59e4ba7 Remove makefile CFG_USE_SNAP_LIBS_FOR_STAGE1 hack
It didn't work as intended, due to my lack of Makefile-fu
2011-08-29 14:31:32 +02:00
Marijn Haverbeke
c9c5ee252a Implement non-internal ivecs
Vectors are now similar to our old, pre-internal vectors, except that
they are uniquely owned, not refcounted.

Their name should probably change too, then. I've renamed them to vec
in the runtime, will do so throughout the compiler later.
2011-08-29 09:07:53 +02:00
Marijn Haverbeke
855e0a4713 Fix bug in mutable-local-marking
Locals passed by mutable alias weren't being marked as mutated
2011-08-29 09:01:27 +02:00
Marijn Haverbeke
9db4d9c6fd Add CFG_USE_SNAP_LIBS_FOR_STAGE1 hack to makefiles 2011-08-29 09:01:27 +02:00
Graydon Hoare
4eb86d4978 Merge pull request #870 from marijnh/llvm-update
Follow LLVM header file shuffling
2011-08-28 17:14:46 -07:00
Marijn Haverbeke
5751acee92 Register new snapshot
I'll need to do a snapshot that builds stage1 with the stage0 libs,
so this one is to sync the stage0 libs with the current codebase.
2011-08-28 21:40:34 +02:00
Marijn Haverbeke
58110b1b13 Follow LLVM header file shuffling
This allows us to compile against revision 138708. I need this, because
the version we currently use is causing mysterious corruption of object
files during linking on win, apparently triggered by my vec-representation
patch.
2011-08-28 20:59:05 +02:00
Brian Anderson
5f57a508af Convert misc compiler bits to istrs. Issue #855 2011-08-27 18:05:59 -07:00
Brian Anderson
cffd9b8044 Convert rustc driver to istrs. Issue #855 2011-08-27 17:47:06 -07:00
Brian Anderson
7efbfea8d0 Convert rustc::syntax::ext::base to istrs. Issue #855 2011-08-27 16:55:48 -07:00
Brian Anderson
9857048929 Convert rustc::driver::session to istrs. Issue #855 2011-08-27 16:47:50 -07:00
Brian Anderson
3dc2419443 Convert rustc::syntax::codemap to istrs. Issue #855 2011-08-27 15:58:17 -07:00
Brian Anderson
9fb085560d Convert rustc::syntax::ast_util to istrs. Issue #855 2011-08-27 15:54:46 -07:00
Brian Anderson
cbad23a747 Convert pretty-printer to istrs. Issue #855 2011-08-27 15:54:46 -07:00
Brian Anderson
675073c266 Convert parser to istrs. Issue #855 2011-08-27 15:54:46 -07:00
Brian Anderson
427d42228f Convert rustc::syntax::eval to istrs. Issue #855 2011-08-27 15:54:45 -07:00
Brian Anderson
26516dc8d2 Convert rustc::syntax::token to istrs. Issue #855 2011-08-27 15:54:45 -07:00
Brian Anderson
58dedcd090 Convert lexer to istrs. Issue #855 2011-08-27 15:54:45 -07:00
Brian Anderson
d2ae28fc99 Convert rustc::util to istrs. Issue #855 2011-08-27 15:54:45 -07:00
Brian Anderson
54691f9a6c Convert rustc::metadata to istrs. Issue #855 2011-08-27 15:54:45 -07:00
Brian Anderson
7d70685eef Convert the rest of rustc::middle to istrs. Issue #855 2011-08-27 15:54:45 -07:00
Brian Anderson
9e01e05f3b Convert rustc::middle::trans to istrs. Issue #855 2011-08-27 15:54:45 -07:00
Brian Anderson
f09ef6ec66 Convert rest of the AST to istrs. Issue #855 2011-08-27 15:54:45 -07:00