Commit Graph

5323 Commits

Author SHA1 Message Date
Marijn Haverbeke
9a69ee79e0 Clean up trans_obj.rs a bit
As a preparation to adding an arg to type_of_fn_full
2011-09-14 13:49:22 +02:00
Marijn Haverbeke
6cd24173d4 Add a ret_style field to fn_ctxt in trans 2011-09-14 13:48:51 +02:00
Marijn Haverbeke
2aac43d809 Simplify trans::new_fn_ctxt_w_id
It was still living in the pre-decent-type-inference era.
2011-09-14 13:26:39 +02:00
Marijn Haverbeke
0699acb6f7 Rudimentary checking of safe alias returns 2011-09-14 13:09:45 +02:00
Marijn Haverbeke
63519d9006 Rename restrict to binding in alias.rs
Its role gradually changed to the point where the old name doesn't
really make sense anymore.
2011-09-14 12:06:51 +02:00
Marijn Haverbeke
44df041799 Stop needlessly boxing vectors in alias.rs 2011-09-14 11:37:52 +02:00
Marijn Haverbeke
51dae63c44 Make most of the compiler aware of return-by-reference
tyencode/tydecode still don't know about it. return_ref will be extended to take
arguments anyway.
2011-09-14 11:31:05 +02:00
Marijn Haverbeke
c1c083cd66 Refactor parse_ret_ty, start parsing by-alias return specs 2011-09-14 10:46:40 +02:00
Marijn Haverbeke
6eb9738a66 Rename ast::controlflow to ast::ret_style
It will include information about returning by alias.
2011-09-14 10:38:23 +02:00
Josh Matthews
f6fe07d1f3 Add support for negative literals. 2011-09-14 00:47:14 -04:00
Graydon Hoare
c0ffd2ea26 Print perf measurement outputs on completion of 'perf' target. 2011-09-13 17:32:25 -07:00
Brian Anderson
6d3dd0e48c Try harder still to generate fewer landing pads
Scopes that don't have cleanups don't need their own landing pads

This takes the optimized rustc bin from 4.7MB to 4.4
2011-09-13 16:52:12 -07:00
Brian Anderson
b8e31ac469 Try a little harder to avoid creating new landing pads
It's only when we add or revoke cleanups involving immediates that we need a
new landing pad for the scope.

Trims 5K off the optimized rustc bin
2011-09-13 16:52:12 -07:00
Brian Anderson
74c39469be Reuse landing pads when possible
Cuts the optimized rustc bin from 5.2 to 4.7MB
2011-09-13 16:52:12 -07:00
Graydon Hoare
e45c91135a Add a compile-stage2-under-perf step to "make perf" target. 2011-09-13 16:05:53 -07:00
Graydon Hoare
d5b2d62b20 Add build-system mechanisms for running benchmarks under 'perf'. 2011-09-13 15:06:41 -07:00
Michael Sullivan
c84b8e90b8 Print something when we can't figure out a tag name. Mitigates #876. 2011-09-13 13:14:49 -04:00
Marijn Haverbeke
b9267e8fbc Add missing cases for machine floats in shape.rs 2011-09-13 17:46:28 +02:00
Marijn Haverbeke
577d6dd602 Improve lexing of float literals
Closes #575
2011-09-13 17:43:01 +02:00
Marijn Haverbeke
f72573cce8 Properly pretty-print 10.x
Closes #890
2011-09-13 17:08:59 +02:00
Marijn Haverbeke
e64e9792ab Make pretty-printer wrap fail/ret/put in parens in call/index/field pos
Closes #764
Closes #891
2011-09-13 17:02:36 +02:00
Marijn Haverbeke
bc62b17543 Ensure that the declared type and actual type of a constant agree
Closes #899
2011-09-13 16:29:23 +02:00
Marijn Haverbeke
be5537e95f Be more strict about what constitutes a block expression
Blocks (or statements involving blocks) that end in a semicolon are no
longer considered the block-expression of their outer block. This used
to be an expression block, but now is a statement block:

    { if foo { ret 1; } else { ret 10; } }

This helps clear up some ambiguities in our grammar.
2011-09-13 15:50:03 +02:00
Marijn Haverbeke
e945164879 Always warn when implicitly copying a generic type 2011-09-13 13:40:38 +02:00
Marijn Haverbeke
38e86d708b Properly alias-check bindings in for-each loops 2011-09-13 13:34:08 +02:00
Marijn Haverbeke
45bdff01b2 Clean up copy bookkeeping in alias.rs 2011-09-13 13:23:32 +02:00
Marijn Haverbeke
2f402343c9 Make for loop alias-safe 2011-09-13 13:05:59 +02:00
Marijn Haverbeke
3e92f90952 Apply implicit copying for unsafe references to alt patterns 2011-09-13 12:23:36 +02:00
Graydon Hoare
7f94957721 Kill trailing whitespace. 2011-09-12 16:33:43 -07:00
Graydon Hoare
a4815b6742 Factor imports mindlessly. 2011-09-12 16:13:28 -07:00
Graydon Hoare
71297a5e17 Remove redundant line. 2011-09-12 14:17:32 -07:00
Brian Anderson
393deeb06f Merge branch 'unwind'
Conflicts:
	src/comp/middle/trans.rs
	src/comp/middle/trans_build.rs
	src/lib/run_program.rs
	src/test/compiletest/runtest.rs
2011-09-12 09:36:51 -07:00
Marijn Haverbeke
edde2e0c45 Undo some pretty-printer damage in ty.rs 2011-09-12 14:43:41 +02:00
Marijn Haverbeke
982a1a4783 Rename alias to reference in docs and error messages
Update docs to reflect new approach to aliases
2011-09-12 14:24:46 +02:00
Marijn Haverbeke
bcf60c6600 Warn when inserting an implicit copy that may be expensive 2011-09-12 13:54:02 +02:00
Marijn Haverbeke
8dd46d4384 Properly implement copy expressions
(And use them in some places that were doing {expr} before.)
2011-09-12 13:13:20 +02:00
Marijn Haverbeke
f4b6264f8c Remove backwards-compatibility with old arg-mode syntax 2011-09-12 12:49:00 +02:00
Marijn Haverbeke
ca1df2b111 Pretty-print for new arg-mode syntax 2011-09-12 12:49:00 +02:00
Marijn Haverbeke
5bc424e4ea Register second snapshot for argument-mode transition 2011-09-12 12:49:00 +02:00
Marijn Haverbeke
bfa021de0d Switch pretty-printer to new arg-mode syntax 2011-09-12 12:48:59 +02:00
Marijn Haverbeke
3667137a41 Accept {|| ... } for argument-less block syntax
Closes #880
2011-09-12 12:04:41 +02:00
Marijn Haverbeke
fc6b7c8b38 Reformat for new mode syntax, step 1
Long lines were fixed in a very crude way, as I'll be following up
with another reformat in a bit.
2011-09-12 12:04:14 +02:00
Marijn Haverbeke
64a6376da5 Register new snapshot 2011-09-12 11:25:19 +02:00
Marijn Haverbeke
8b7909afd7 Fix tests for new argument-passing convention 2011-09-12 11:07:20 +02:00
Marijn Haverbeke
0e6e56ca60 Make the names of the arg mode tag reflect their (revised) meaning 2011-09-12 11:07:17 +02:00
Marijn Haverbeke
4be7e1e5cd Pass all arguments by reference, make immut alias mode equiv to value
Arguments that can't be safely referenced will be implicitly copied.

(Warnings for expensive copies will be forthcoming.)

This will allow us to get rid of most of the ampersands in function
signatures. See [1].

[1] https://mail.mozilla.org/pipermail/rust-dev/2011-September/000759.html
2011-09-12 11:06:54 +02:00
Brian Anderson
6ffcfba6b9 XFAIL bench/shootout-nbody
This is the only file in the whole codebase that depends on the (broken) llvm
native ABI.
2011-09-11 23:19:05 -07:00
Brian Anderson
cb50e4329a Add an XFAILed test for native "llvm" modules
This functionality is completely broken
2011-09-11 23:14:42 -07:00
Brian Anderson
fda196769a Actually fail the process when compiletest has a test failure
We previously failed by coincidence because of memory leaks.
2011-09-11 21:13:59 -07:00
Brian Anderson
69d6e0d208 Add some more unwind tests
They worked without modifications, but I wrote them so we're keeping them.

Issue #236
2011-09-11 17:31:41 -07:00