Commit Graph

16105 Commits

Author SHA1 Message Date
ILyoan
cc76cb02fb mk: cleanup - minor fixes for android check 2013-03-08 14:45:16 +09:00
bors
88f0a10578 auto merge of #5277 : bstrie/rust/deimpselfstd, r=brson 2013-03-07 19:51:36 -08:00
bors
cfba0c7f99 auto merge of #5276 : ILyoan/rust/master, r=brson
Patch for libuv android
r? @brson
2013-03-07 19:00:38 -08:00
Brian Anderson
dd4d45062d Make debug!, etc. macros not require a format string
The one thing `log` can still do is polymorphically log anything,
but debug!, etc. require a format string. With this patch
you can equivalently write `debug!(foo)` or `debug!("%?", foo)`
2013-03-07 18:45:22 -08:00
Ben Striegel
0fed29cfb7 De-implicit-self libstd 2013-03-07 21:11:09 -05:00
ILyoan
7b2285f88c Update uv submodule 2013-03-08 11:02:12 +09:00
bors
c391600760 auto merge of #5273 : jbclements/rust/a040b8005f37b94f3394cc3c6ab7058717830661, r=brson
Replace the custom eq with #[deriving_eq].
2013-03-07 16:36:37 -08:00
John Clements
a040b8005f add deriving_eq for tokens 2013-03-07 14:46:46 -08:00
bors
7140d7c52b auto merge of #5227 : jdm/rust/newconst, r=pcwalton
All comments from previous pull requests addressed.
2013-03-07 12:42:35 -08:00
Josh Matthews
27668fbfab Allow casting integers to unsafe pointers in constant expressions. 2013-03-07 15:36:55 -05:00
Josh Matthews
7bb03345cf Inline constants across crates. 2013-03-07 15:34:52 -05:00
Josh Matthews
50277ec555 Permit casting region pointers to unsafe ones. 2013-03-07 14:48:28 -05:00
bors
2bc301fd68 auto merge of #5264 : brson/rust/cross7, r=brson
Follow up to #5242. All credit to @yichoi.
2013-03-06 23:57:39 -08:00
Brian Anderson
81e370285f Merge remote-tracking branch 'brson/cross7'
Conflicts:
	configure
	mk/rt.mk
2013-03-06 23:54:35 -08:00
Brian Anderson
14e5a6e5f7 mk: Cleanup. Minor fixes 2013-03-06 22:37:52 -08:00
bors
194c27bcd1 auto merge of #5183 : jld/rust/adt-renovation, r=brson
This series of changes moves the representation details of algebraic datatypes (enums, and special cases like structs and tuples and (until they're fully removed) records) from various places around rustc::middle::trans into a single module, to enable future improvements in this area.

r?(@nikomatsakis), and the core developers in general; this seems like a “super-review” kind of change.
2013-03-06 20:57:37 -08:00
Jed Davis
a69ec175f8 GC now-unused imports 2013-03-06 20:41:58 -08:00
Jed Davis
1f9bc64bae adt.rs renaming: "field" rather than "element"; set_discr -> start_init.
This way "field" refers to the abstraction and "element" (as in get_elt,
"get element pointer", etc.) refers to the low-level LLVM operations.
2013-03-06 20:41:58 -08:00
Jed Davis
e13111fc5a Even more comments for ADT-related interfaces 2013-03-06 20:41:58 -08:00
Jed Davis
6840b48074 trans_cast_to_int is hard to explain; make it trans_get_discr instead. 2013-03-06 20:41:58 -08:00
Jed Davis
8dca7be1df A little more cosmetic cleanup 2013-03-06 20:41:58 -08:00
Jed Davis
d6acb96c9c Add lots of comments to adt.rs, and some minor cleanup. 2013-03-06 20:41:58 -08:00
Jed Davis
a9026c7f19 Memoize trans::adt::represent_type 2013-03-06 20:41:58 -08:00
Jed Davis
a8237a46f1 Bonus Fix: typarams are no longer inhabited 2013-03-06 20:41:58 -08:00
Jed Davis
8105da8067 GC the now-unused old layout helpers 2013-03-06 20:41:58 -08:00
Jed Davis
b6bcf1a81f Finish removing struct layout dependencies from glue. 2013-03-06 20:41:58 -08:00
Jed Davis
71b6e945c1 glue::trans_struct_drop -> adt 2013-03-06 20:41:58 -08:00
Jed Davis
5ca4fdfc98 Convert trans_tuple_struct to trans::adt.
Surely this cannot be the best way to get the type.
2013-03-06 20:41:57 -08:00
Jed Davis
29d0430c56 Convert iter_structural_ty to trans::adt 2013-03-06 20:41:57 -08:00
Jed Davis
c0f6909f7e base::iter_structural_ty: structs and records 2013-03-06 20:41:57 -08:00
Jed Davis
68b3f0d8a4 base::iter_structural_ty: tuples 2013-03-06 20:41:57 -08:00
Jed Davis
ca450e345f Move trans_enum_variant to trans::adt.
As a result, trans_enum_variant no longer cares what kind of enum it's
dealing with, so the "degen" parameter goes away in a bunch of places.
2013-03-06 20:41:57 -08:00
Jed Davis
6bb6baba2c Renovate cast-to-int 2013-03-06 20:41:57 -08:00
Jed Davis
075affa50d Convert const field extraction to trans::adt 2013-03-06 20:41:57 -08:00
Jed Davis
59daf76a8d Make functional-update struct consts not an ICE 2013-03-06 20:41:57 -08:00
Jed Davis
f0c6a8ebe9 Test for struct-like variants in consts 2013-03-06 20:41:57 -08:00
Jed Davis
bb689c09f5 Convert const ADT construction to trans::adt.
Also converts const cast-from-enum, because it used the same routine to
get the discriminant as what's renovated to construct the enums.

Also fixes ICE on struct-like variants as consts, and provides a slightly
less bad ICE for functional-update-like struct expressions in consts.
2013-03-06 20:41:57 -08:00
Jed Davis
2a028c5ab8 Convert newtype "dereference" to trans::adt.
Note that in the ByValue case (which can't happen? yet?) we're still
effectively bitcasting, I think.  So this change adds a way to assert
that that's safe.

Note also, for future reference, that LLVM's instcombine pass will turn
a bitcast into a GEP(0, 0, ...) if possible.
2013-03-06 20:41:57 -08:00
Jed Davis
80844f993d Add regression tests for a subtle aspect of expr_struct translation.
The first is reduced from a case in rustdoc (originally involving an
ARC); the other is related.  No committed version has gotten these
wrong, but when I broke them it showed up only in rustdoc; there was
nothing in the test suite (or the compiler!) that failed.

The general issue is that the statics and trans have to agree on order
of evaluation, or else you get use-after-move-out-of errors at runtime.
2013-03-06 20:41:57 -08:00
Jed Davis
c7325c4172 Convert the rest of the adt GEPi's in _match 2013-03-06 20:41:57 -08:00
Jed Davis
3a4714d92e Renovate field projection expressions 2013-03-06 20:41:57 -08:00
Jed Davis
40313fb6b0 Renovate nullary variant construction 2013-03-06 20:41:57 -08:00
Jed Davis
fdd28451f6 Convert expr_struct to use adt, and try to share code with tuples. 2013-03-06 20:41:57 -08:00
Jed Davis
5cbc2571c1 Renovate expr_tup translation 2013-03-06 20:41:57 -08:00
Jed Davis
b673b26f03 Factor out discriminant loading more, for use in casts. 2013-03-06 20:41:57 -08:00
Jed Davis
a5030e7615 Wrap const structs in as many LLVM structs as the non-const case.
This, like the previous change for unit-like enums, is only necessary
until everything is fully converted to use trans::adt.
2013-03-06 20:40:42 -08:00
Jed Davis
e09a843973 Handle unit-like types specially.
This change remains separate from the addition of adt.rs, even though
it's necessary for compatibility with pre-trans::adt representation,
to serve as an example of a change to the representation logic.
2013-03-06 20:37:59 -08:00
Jed Davis
7b2b4faba8 Add a test for enum discriminant range overflow.
It causes an LLVM assertion for every host/target word-size combination
on incoming at the time of this writing.
2013-03-06 20:37:28 -08:00
Jed Davis
04ecab909a Re-add discriminant range annotations 2013-03-06 20:37:28 -08:00
Jed Davis
8a1706610b Avoid unnecessary casts in struct_GEP 2013-03-06 20:37:28 -08:00