Tim Chevalier
ccc7651b48
In reachability, don't ignore nested items
...
Reachability was considering nested items to be unreachable, which
was causing the bug in #2383 . Once I fixed that, I also had to make
impl::make_impl_vtable instantiate methods where necessary, before
calling monomorphic_fn.
Closes #2383
2012-05-29 14:40:35 -07:00
Eric Holk
aa2efc05ea
Adding shared_arc to hide some of the tedium of sharing an arc between tasks.
...
Also added some asserts and logging to trans.
Modified graph500 to use the shared_arc, but this unfortunately doesn't work due to #2444 .
2012-05-29 10:43:19 -07:00
Graydon Hoare
e0f0c5c1ab
Remove bad Load in make_visit_glue, un-xfail reflect-visit-type.rs.
2012-05-28 13:19:31 -07:00
Brian Anderson
432c6cbde9
core: Make range follow the for loop protocol
2012-05-26 02:28:00 -07:00
Niko Matsakis
269bc6fb5c
fix warning
2012-05-25 17:14:17 -07:00
Michael Sullivan
8668d06400
Get rid of many implicit copies as a preliminary to Issue #2448 .
2012-05-25 16:39:35 -07:00
Michael Sullivan
174f789e0b
Add hack to silence the annoying liveness warning in trans/base.rs.
2012-05-25 15:34:09 -07:00
Niko Matsakis
9e6a068034
replace last_use with liveness info
2012-05-25 14:37:30 -07:00
Niko Matsakis
ccd8d5573e
remove dead assignments
2012-05-24 13:35:57 -07:00
Brian Anderson
f9d0cde19a
syntax: Remove one of the two def_id hashers
2012-05-23 00:45:18 -07:00
Brian Anderson
4756556748
rustc: Move new_def_hash to ast_util
2012-05-23 00:43:02 -07:00
Tim Chevalier
ed357af980
Convert more resource tests to use classes with dtors
...
And monomorphize dtors correctly.
2012-05-22 22:12:18 -04:00
Michael Sullivan
15cef374b9
Get rid of the >>> operator and make >> logical or arithmetic depending on the signedness. Closes #2417 .
2012-05-22 14:59:15 -07:00
Niko Matsakis
073f90cdc4
introduce some copies so we are not alting into mut state
2012-05-22 05:21:13 -07:00
Brian Anderson
9aa18c2852
rustc: Move ast_map to the syntax crate
2012-05-21 23:39:27 -07:00
Brian Anderson
85d67723ee
rustc: Move path_to_ident to ast_util
2012-05-21 22:41:59 -07:00
Niko Matsakis
34b42eeb65
change list so that it must be used in a purely boxed fashion
...
The old way was inconsistent---the head was unboxed but the
tail was boxed. This resulted in numerous needless copies and
also made the borrow check unhappy, because the head tended to be
stored in mutable memory.
2012-05-21 09:37:34 -07:00
Niko Matsakis
774ea145ec
make more code use dvec
2012-05-18 20:00:51 -07:00
Niko Matsakis
c9edc0f0a1
introduce a few copies here and there
2012-05-18 20:00:50 -07:00
Niko Matsakis
19ec5a41ed
allow region ptrs to be cast to uints
2012-05-18 19:07:19 -07:00
Niko Matsakis
f1a46914c4
add a new debugging aid--tracing
2012-05-18 19:07:19 -07:00
Eric Holk
0eed37da29
Using const vector slices for more vec functions.
2012-05-18 16:55:42 -07:00
Niko Matsakis
67ca37ac61
workaround a horribly obscure resolve bug
2012-05-18 14:32:37 -07:00
Niko Matsakis
a559329692
test that we preserve boxes in patterns---still one bug
2012-05-18 14:32:37 -07:00
Niko Matsakis
5be8bf1de7
use -Z to distinguish internal debugging options
2012-05-18 10:38:18 -07:00
Tim Chevalier
cf2fc2c34e
Annotate or fix FIXMEs in LLVM bindings and metadata code
...
Fixed up a few FIXMEs in lib/llvm to use more descriptive data
types. Covered FIXMEs in metadata::{creader, csearch, decoder} and
one in encoder.
2012-05-17 20:39:17 -07:00
Brian Anderson
322b20d14d
rustc: Break another dependency between metadata and resolve
2012-05-16 22:28:17 -07:00
Brian Anderson
6a41eb0192
rustc: Break a dependency between metadata and resolve
2012-05-16 21:50:34 -07:00
Graydon Hoare
9752523f3a
Include intrinsic module in all crates, emit visit glue, fn intrinsic::visit_ty. Not yet working.
2012-05-16 18:24:00 -07:00
Tim Chevalier
e2d18c9a8a
Remove an assertion from trans::base::iter_structural_ty
...
I had put in an assertion that if the ty is a class, it doesn't have a dtor,
but that doesn't make sense, since this gets used to make take glue and
not just drop glue.
2012-05-15 20:35:57 -07:00
Tim Chevalier
fa5cc5bcd0
Generate drop glue correctly for classes with destructors
2012-05-15 18:00:41 -07:00
Niko Matsakis
adb61e3e99
get preservation of boxes working, at least in simple cases
2012-05-15 13:38:16 -07:00
Niko Matsakis
4c7be32606
add node_ids to blocks
2012-05-15 11:49:11 -07:00
Niko Matsakis
e139793313
purge unused loop_cont field
2012-05-15 11:49:11 -07:00
Lindsey Kuper
b8880e3254
Remove be
keyword.
...
Closes #2227 .
2012-05-15 10:41:14 -07:00
Brian Anderson
452fc46ffc
rustc: Break some of metadata's dependencies on session
2012-05-14 20:41:33 -07:00
Brian Anderson
0f49928c2d
rustc: Break metadata's dependency on link
2012-05-14 19:04:32 -07:00
Brian Anderson
fce6a474b1
rustc: Eliminate metadata's dependency on astencode
2012-05-14 19:04:32 -07:00
Brian Anderson
5c864e9de0
rustc: Eliminate encoder's dependency on astencode
2012-05-14 19:04:32 -07:00
Graydon Hoare
e12b16cde7
Instantiate per-type iface-based visit_glue when intrinsic ifaces present.
2012-05-14 17:57:48 -07:00
Graydon Hoare
d899c3a579
More work on reflection, now calls iface visitors back as well.
2012-05-14 15:49:10 -07:00
Tim Chevalier
5428a22b95
First cut at dtors for classes
...
Classes with dtors should compile now. Haven't yet tested
whether they actually run correctly.
Beginnings of support for #2295 , though that won't be done until
there's more test cases and resources are removed.
2012-05-14 14:26:10 -07:00
Brian Anderson
a2572fe77e
rustc: Eliminate metadata's dependency on trans
2012-05-13 17:08:35 -07:00
Graydon Hoare
2585384c97
First working monomorphic type-reflection.
2012-05-11 13:10:07 -07:00
Niko Matsakis
b4d1f1b2c1
replace mutbl pass with borrowck
2012-05-10 21:14:43 -07:00
Graydon Hoare
c23d6a50d7
Preliminary groundwork for intrinsic module, reflection interface.
2012-05-10 17:18:04 -07:00
Paul Stansifer
13c924c049
Remove do { ... } while ...
from the language.
2012-05-10 15:09:33 -07:00
Niko Matsakis
50a3dd40ae
implement new borrow ck (disabled by default)
2012-05-09 17:00:19 -07:00
Niko Matsakis
5e7229b72c
reduce self type to a special type parameter
2012-05-09 07:11:59 -07:00
Brian Anderson
b99038c2bf
rustc: Put all boxes into addrspace 1
2012-05-07 15:24:32 -07:00
Niko Matsakis
50ec6bd2c3
new cap clause syntax
2012-05-04 12:33:08 -07:00
Tim Chevalier
8affc78e8a
Turn constants in back::abi into uints, and propagate types
...
This means GEPi now takes a list of uints. Apologies in advance
if this is hard to rebase against, but it gets rid of many a cast :-)
Also modernized some for loops here and there.
2012-05-03 22:31:38 -07:00
Graydon Hoare
11a5d10bf2
Implement better shape code for evec, estr.
2012-05-03 13:09:02 -07:00
Brian Anderson
74096a79d8
rustc: Fix comment about ABI in trans::native
2012-05-03 12:07:43 -07:00
Brian Anderson
af263e43c2
rustc: Link to original Clay x86 classification code
2012-05-03 11:42:25 -07:00
Jyun-Yan You
bdebe92400
add forgotten index and fix array type
2012-05-03 09:43:00 -07:00
Brian Anderson
11354963b3
rustc: Hack around some FFI bustage. Unbreak servo
2012-05-02 18:35:29 -07:00
Brian Anderson
0be41ce02b
rustc: Remove old align_of intrinsic
2012-04-27 15:40:43 -07:00
Brian Anderson
582c71731d
rustc: Clean up some enum code
2012-04-27 11:24:43 -07:00
Brian Anderson
e4277472d2
core: Split sys::align_of into min_align_of, pref_align_of
2012-04-27 00:12:42 -07:00
Brian Anderson
f4f909b8b5
rustc: Add min_align_of, pref_align_of intrinsic, deprecate align_of
2012-04-27 00:12:39 -07:00
Brian Anderson
1c46ee34be
rustc: Add llalign_of_min
2012-04-26 21:59:59 -07:00
Brian Anderson
43751e45d9
rustc: Rename llalign_of_real to llalign_of_pref
...
This alignment is the "preferred" alignment of a type, which is not
necessarily the alignment the compiler will use when packing the
type into structures - that is the "ABI" alignment (in LLVM terms).
On x86, 64-bit ints have 8-byte preferred alignment, but 4-byte
ABI alignment.
2012-04-26 21:44:29 -07:00
Niko Matsakis
825fd1808e
lots of work to make iface/impls parameterized by regions
...
- paths can now take region parameters, replacing the dirty hack
I was doing before of abusing vstores. vstores are now a bit
of a hack though.
- fix various small bugs:
- we never checked that iface types were compatible when casting
to an iface with `as`
- we allowed nonsense like int<int>
- and more! (actually that may be it)
2012-04-25 19:26:56 -07:00
Graydon Hoare
458d2ff067
Be a bit more cautious about marking things no-throw.
2012-04-25 18:53:54 -07:00
Graydon Hoare
90c1b4645f
Set no-unwind on glue functions that don't drop resources.
2012-04-25 17:19:36 -07:00
Graydon Hoare
fa6c68a025
Set no-unwind attribute on all upcalls other than fail.
2012-04-25 17:19:36 -07:00
Brian Anderson
df0ef528b9
rustc: Use LLVM named structs for enum types
2012-04-25 15:49:25 -07:00
Marijn Haverbeke
9f99c3263b
Rewrite exhaustiveness checker
...
Issue #2111
2012-04-25 09:15:17 +02:00
Brian Anderson
5a0c564817
Revert "rustc: Use LLVM named structs for enum types"
...
This reverts commit 6e909e387d
.
2012-04-24 20:47:06 -07:00
Brian Anderson
6e909e387d
rustc: Use LLVM named structs for enum types
2012-04-24 18:24:35 -07:00
Graydon Hoare
929c3dd710
Workarounds for bug #2280 : add some temporaries for borrowing.
2012-04-24 15:19:01 -07:00
Brian Anderson
5437a045fc
rustc: Remove a bitcast. Issue #2276
2012-04-24 14:00:50 -07:00
Tim Chevalier
f7641286b2
Allow classes to be cast to ifaces that are in the same crate
...
I had to xfail one existing test case (class-implements-int) because,
I think, of the same bug described in #2272 .
2012-04-23 21:15:03 -07:00
Tim Chevalier
1c39fda0ea
Rename option::get_or_default to get_default, for consistency
2012-04-23 20:52:50 -07:00
Tim Chevalier
7d05bea7b9
Fix bug with * patterns in trans_alt
...
enter_opt was handling the (*) case wrong and causing a bounds check
failure. Fixed it (the test case is one of the extracted ones from
the reference manual)
2012-04-23 15:50:51 -07:00
Marijn Haverbeke
68f8812511
Guard against infinitely expanding generic/inline functions
...
Closes #2220
Test case disabled until a memory-leak issue is resolved.
2012-04-23 16:44:52 +02:00
Marijn Haverbeke
9053f54498
Move map iface over to more for
-friendly iteration methods
2012-04-23 15:18:19 +02:00
Marijn Haverbeke
dfdca5d538
Fix broken determination of external method type param count
...
Closes #2185
2012-04-23 09:25:14 +02:00
Brian Anderson
734494a04d
rustc: Cache constant C strings. Closes #2264
2012-04-21 14:26:13 -07:00
Graydon Hoare
90f82e171d
Get borrowing working on fixed evecs.
2012-04-20 12:11:55 -07:00
Tim Chevalier
37b0549730
Add new syntax for patterns that match the head constructor only
...
Adds a new kind of pattern C(*) where C is a constructor that may
have any number of fields. This pattern matches any value
constructed with C, without binding names for any of the fields.
Closes #1701 .
2012-04-20 00:56:46 -07:00
Niko Matsakis
3c995fb8f3
make nominal types optionally parameterized by a self region.
...
Issue #2201 .
2012-04-19 21:01:11 -07:00
Graydon Hoare
f641dce852
Get evec slices and unique-evec slice-borrowing working.
2012-04-19 16:51:37 -07:00
Tim Chevalier
b0074c5a92
Disallow rebinding / matching against consts in alts
...
As per Issue #1193 . Closes #1193 .
I had to rename a few variables ("info" and "epsilon") to avoid
clashing with in-scope constants, which is responsible for all the
changes other than resolve and issue-1193.rs.
2012-04-19 16:21:15 -07:00
Graydon Hoare
1e51196f33
Get fixed-size evecs working.
2012-04-19 15:52:50 -07:00
Graydon Hoare
956bc773c6
Fix [] on str to exclude the trailing null.
2012-04-18 17:50:58 -07:00
Marijn Haverbeke
fda7bb6721
Fix oversight in type_use.rs
...
Closes #2053
2012-04-18 17:21:39 +02:00
Marijn Haverbeke
054a312a33
Stop duplicating non-generic resource destructors
...
Closes #2177
2012-04-18 17:21:39 +02:00
Marijn Haverbeke
a0fa099469
Add a needs_drop intrinsic
...
Closes #2055
2012-04-18 13:15:02 +02:00
Marijn Haverbeke
35b8f87b89
Fix use of wrong block context in return-from-loop code
...
Closes #2142
2012-04-18 13:00:18 +02:00
Graydon Hoare
70a9ce626d
Implement slice-borrowing on estr-uniq and str values.
2012-04-17 15:15:20 -07:00
Niko Matsakis
4c26d70a0a
new debug flag, new test
2012-04-17 12:02:36 -07:00
Graydon Hoare
82727b926f
Get explicit unique estrs working.
2012-04-16 16:17:51 -07:00
Brian Anderson
4f576275be
syntax: Cleanup attr module. Closes #1545
2012-04-15 01:43:38 -07:00
Niko Matsakis
cc16165e40
implement evec/estr subtyping/lub/glb/etc
2012-04-14 18:48:58 -07:00
Niko Matsakis
247db704a9
integrate simple notion of borrowing into trans
2012-04-13 21:06:57 -07:00
Tim Chevalier
5c12cd72f4
Allow classes to implement ifaces
...
Introduce syntax like:
iface animal { ... }
class cat implements animal { ... }
to allow classes to implement ifaces. Casting classes to ifaces
is *not* yet supported. ifaces that a class implements are not
yet included in metadata.
The syntax is subject to change, and may go away completely if we
decide to use duck typing to relate classes with ifaces (see
http://smallcultfollowing.com/babysteps/blog/2012/04/10/declared-vs-duckish-typing/ )
2012-04-11 16:20:01 -07:00
Graydon Hoare
f34eae8802
Translate slice-strings and make fixed-strings carry their null.
2012-04-11 12:07:19 -07:00
Graydon Hoare
7a3b290245
Add vstore/evec/estr to compiler.
2012-04-11 11:08:40 -07:00