Commit Graph

2053 Commits

Author SHA1 Message Date
Graydon Hoare
35573144c5 Remove silly legacy glue-offset encoding, predicate runtime adjustments by ABI. LLVM should inline most glue now. 2011-04-09 00:54:46 +00:00
Graydon Hoare
19ebc0f376 Actually disable optimize in --disable-optimize case, duh. 2011-04-08 17:28:14 -07:00
Marijn Haverbeke
c0d0b717ee Fix codemap.lookup_pos
Previously, it would place every single location in the first
file of the crate that was parsed.
2011-04-09 01:57:48 +02:00
Patrick Walton
129c8392af rustc: Rename "demand" to "pushdown" in the typechecker and explain more clearly what it's for 2011-04-08 16:22:03 -07:00
Marijn Haverbeke
1af3174fe3 Move to single-uint file-position representation.
This makes passing them around cheaper. There is now a table (see
front/codemap.rs) that is needed to transform such an uint into an
actual filename/line/col location.

Also cleans up the span building in the parser a bit.
2011-04-09 01:05:18 +02:00
Marijn Haverbeke
094d31f5e4 Make lexer buffer the whole file
This way, it won't have to go through a bunch of calls for each
byte fetched.
2011-04-09 01:05:18 +02:00
Graydon Hoare
cae703c0b1 Add support for --disable-optimize 2011-04-08 15:49:14 -07:00
Patrick Walton
573bc5ad01 rustc: Resolve ty_locals 2011-04-08 15:41:08 -07:00
Patrick Walton
5355811859 rustc: Add the ability to fold over annotations 2011-04-08 15:21:49 -07:00
Rafael Ávila de Espíndola
ad7aff8203 Remove unused function. 2011-04-08 16:03:35 -04:00
Rafael Ávila de Espíndola
70bc63a3af Remove unused function. 2011-04-08 15:14:26 -04:00
Rafael Ávila de Espíndola
2cbe2bcb5e Link with -lm now that it is not included with --whole-archive when
building rustllvm.
2011-04-08 14:51:47 -04:00
Rafael Ávila de Espíndola
f8e22cdff3 Gold is more strict about --whole-archive and will report duplicated
symbols because of an Object.o in a .a and one outside. A similar
problem happens for the non-shared part of libpthread.

This patch moves the -whole-archive/-no-whole-archive to include just the
llvm libs.
2011-04-08 14:25:18 -04:00
Tim Chevalier
97d0f76c63 fix long lines 2011-04-08 17:46:46 +00:00
Tim Chevalier
9c001af07c Implemented computing prestates and poststates for a few expression forms.
The typestate checker (if it's uncommented) now correctly rejects a
trivial example program that has an uninitialized variable.
2011-04-08 17:46:46 +00:00
Marijn Haverbeke
6109dba305 Disable effect checking in rustboot 2011-04-08 18:44:58 +02:00
Brian Anderson
b883ec4c9d Avoid some gotchas with logging macros
I think this is sufficient to eliminate multiple evaluation and the
possibility of accidental miscompilation from the logging macros.
2011-04-07 22:53:16 -04:00
Brian Anderson
0abccc6370 Add a test case for calling generic functions taking alias args with box types 2011-04-07 22:23:07 -04:00
Brian Anderson
a4f8de382a Add an XFAILed test for blocks that result in functions 2011-04-07 22:13:39 -04:00
Brian Anderson
d2d42fd4c7 Make block results work for generic types
I think just about every type can be used as a block result now. There's quite
a proliferation of tests here, but they all test slightly different things and
some are split out to remain XFAILed. The tests of generic vectors are still
XFAILed because generic aliased boxes still don't work in general.
2011-04-07 21:58:36 -04:00
Patrick Walton
ed14ea1d3f build: Use -O0 on Darwin. Seems that Darwin's GCC optimizations break rustrt. 2011-04-07 18:14:13 -07:00
Patrick Walton
afa6d85d61 stdlib: Add a simple union-find data structure 2011-04-07 18:02:01 -07:00
Patrick Walton
f28a9d8f52 rustc: Pointer cast when crossing a box boundary for statically-sized elements in trans_index() 2011-04-07 18:02:01 -07:00
Marijn Haverbeke
009e01dbe7 add FIXME related to the -fno-strict-aliasing workaround 2011-04-08 02:23:33 +02:00
Marijn Haverbeke
53cc673db1 Re-add a read_byte() method to buf_reader objs
This was removed because of the repetition, but doing single-byte
reads in terms of read_bytes (which allocates a vec) is needlessly
slow. This change speeds up parsing by 22%.

(Eventually, we won't be able to escape handling the buffering in the
stdlib itself.)
2011-04-08 02:23:14 +02:00
Marijn Haverbeke
bb56253015 Initialize two more variables to keep darwin tinderbox happy 2011-04-08 00:59:45 +02:00
Marijn Haverbeke
32e62d0151 add a -parse-only option to rustc
(undocumented, only used for profiling the parser)
2011-04-08 00:46:41 +02:00
Marijn Haverbeke
973023030e add -O2 when compiling rt, fix warnings triggered by optimizer 2011-04-08 00:41:52 +02:00
Lindsey Kuper
21b31a350a Updated test to use 'check' rather than just logging results. 2011-04-07 15:22:34 -07:00
Marijn Haverbeke
9a7576fe2c Move to macro-based logging checks in the C++ code
No functions should be called for log statements that turn out to be
inactive.
2011-04-07 15:15:30 -07:00
Patrick Walton
6dcf6218b1 rustc: Pointer cast when autodereferencing boxed tag types 2011-04-07 15:12:48 -07:00
Patrick Walton
9b35051143 rustc: Use the name "opaque_tag", not "tag", for opaque tags 2011-04-07 15:12:48 -07:00
Lindsey Kuper
1092bbfff0 Support for self-calls that take arguments.
Nicer parsing of self-calls (expr_self_method nodes inside expr_call
nodes, rather than a separate expr_call_self) makes typechecking
tractable.  We can now write self-calls that take arguments and return
values (see: test/run-pass/obj-self-*.rs).
2011-04-07 14:26:34 -07:00
Marijn Haverbeke
39774e88b4 Add a very basic crate-dump utility
'rustc -ls [cratelib]' will now dump out a list of symbols defined by
the crate, as well as a short description of what they are.
2011-04-07 14:19:19 -07:00
Marijn Haverbeke
d678dad434 Fix problem in metadata writer
It was creating non-multiple-of-four section sizes, which, for some
reason, presumably by LLVM, were clipped, rather than padded, to be a
multiple of four.
2011-04-07 14:19:17 -07:00
Marijn Haverbeke
ac3026412b Revise EBML reader API
New one is less stateful, easier to work with.
2011-04-07 14:19:16 -07:00
Patrick Walton
0f5f467dc0 rustc: Remove useless call to type_of() in trans_rec() 2011-04-07 13:55:02 -07:00
Patrick Walton
08bf4d1f19 "xfail-stage0", not "XFAIL-stage0" 2011-04-07 13:53:11 -07:00
Patrick Walton
3236e6008c XFAIL lib-option.rs in stage0 due to crash on Darwin on tinderbox 2011-04-07 13:44:20 -07:00
Patrick Walton
a97a200413 Fix effect on deref-lval 2011-04-07 13:30:50 -07:00
Patrick Walton
015c0d0d59 rustc: Allow dereference expressions to be used as lvalues. Add a test case. 2011-04-07 12:51:27 -07:00
Rafael Ávila de Espíndola
b4422cca21 Add a -O option and change the Makefile to use it. 2011-04-07 15:42:06 -04:00
Patrick Walton
ddf96ac3a8 rustc: Reindent line. Puts out burning tinderbox. 2011-04-07 12:01:48 -07:00
Patrick Walton
cd6962f29d rustc: Link to external tag discriminants. Un-XFAIL test/run-pass/lib-option.rs. 2011-04-07 11:42:40 -07:00
Patrick Walton
2a894cabc2 Merge branch 'master' of github.com:graydon/rust 2011-04-07 10:14:25 -07:00
Rafael Ávila de Espíndola
25320da099 Run optimizations.
It is always on for now just to make sure the bots are happy. If they
are, I will add a -O option and update the makefile.
2011-04-07 12:12:21 -04:00
Tim Chevalier
2e90bd94de Continued sketching out code for checking states against preconditions.
It's still sketchy. I added a typestate annotation field to statements
tagged stmt_decl or stmt_expr, because a stmt_decl statement has a typestate
that's different from that of its child node. This necessitated trivial
changes to a bunch of other files all over to the compiler. I also added a
few small standard library functions, some of which I didn't actually end
up using but which I thought might be useful anyway.
2011-04-06 17:58:18 -07:00
Patrick Walton
d9da43984b Merge branch 'master' of github.com:graydon/rust 2011-04-06 10:25:32 -07:00
Graydon Hoare
36d75d6391 Minimal testcase for next bootstrap blocker. 2011-04-06 08:33:24 -07:00
Graydon Hoare
5e98cd9472 Remove reference to nonexistent ast.module from typestate_check.rs, stage1 doesn't like it. 2011-04-06 04:18:12 +00:00