Commit Graph

28 Commits

Author SHA1 Message Date
Ariel Ben-Yehuda
ca9b5664c3 rustc: move closure upvar types to the closure substs
This moves closures to the (DefId, Substs) scheme like all other items,
and saves a word from the size of TyS now that Substs is 2 words.
2016-11-12 19:00:50 +02:00
Luqman Aden
34f8e62c6b Remove outdated FIXME: #10604 was fixed by #11717. 2016-11-10 16:12:43 -05:00
Seo Sanghyeon
07c8a25f42 Remove unused type aliases 2016-10-31 23:14:27 +09:00
Tim Neumann
f1356975a4 trans: pad const structs to aligned size 2016-10-20 22:27:06 +02:00
Austin Hicks
9482bce56e Replace offset_after_field with offsets 2016-10-02 13:13:40 -04:00
Austin Hicks
467454b0d2 Incorporate review comments. 2016-09-25 20:14:34 -04:00
Austin Hicks
12ff05fc50 Clean up matches that determine integers for specific alignment requirements 2016-09-24 18:21:16 -04:00
Austin Hicks
4038189688 Optimize struct_field_ptr 2016-09-24 18:21:12 -04:00
Austin Hicks
f16068e577 Completely kill represent_type and the adt::Repr type that goes with it. 2016-09-24 18:21:10 -04:00
bors
1cf592fa40 Auto merge of #36551 - eddyb:meta-games, r=nikomatsakis
Refactor away RBML from rustc_metadata.

RBML and `ty{en,de}code` have had their long-overdue purge. Summary of changes:
* Metadata is now a tree encoded in post-order and with relative backward references pointing to children nodes. With auto-deriving and type safety, this makes maintenance and adding new information to metadata painless and bug-free by default. It's also more compact and cache-friendly (cache misses should be proportional to the depth of the node being accessed, not the number of siblings as in EBML/RBML).
* Metadata sizes have been reduced, for `libcore` it went down 16% (`8.38MB` -> `7.05MB`) and for `libstd` 14% (`3.53MB` -> `3.03MB`), while encoding more or less the same information
* Specialization is used in the bundled `libserialize` (crates.io `rustc_serialize` remains unaffected) to customize the encoding (and more importantly, decoding) of various types, most notably those interned in the `TyCtxt`. Some of this abuses a soundness hole pending a fix (cc @aturon), but when that fix arrives, we'll move to macros 1.1 `#[derive]` and custom `TyCtxt`-aware serialization traits.
* Enumerating children of modules from other crates is now orthogonal to describing those items via `Def` - this is a step towards bridging crate-local HIR and cross-crate metadata
* `CrateNum` has been moved to `rustc` and both it and `NodeId` are now newtypes instead of `u32` aliases, for specializing their decoding. This is `[syntax-breaking]` (cc @Manishearth ).

cc @rust-lang/compiler
2016-09-21 19:17:24 -07:00
Eduard Burtescu
fc363cb482 rustc_metadata: go only through rustc_serialize in astencode. 2016-09-20 20:07:54 +03:00
Felix S. Klock II
c41a806e4e Workaround #34427 by using memset of 0 on ARM to set the discriminant. 2016-09-20 15:58:46 +02:00
Vadim Petrochenkov
4b6c4c08df Remove some ancient code providing special support for newtypes 2016-09-13 23:33:50 +03:00
Vadim Petrochenkov
f2b672d556 Refactor TyStruct/TyEnum/TyUnion into TyAdt 2016-09-08 22:17:53 +03:00
Vadim Petrochenkov
e05e74ac83 Replace _, _ with .. 2016-09-04 12:30:33 +03:00
Vadim Petrochenkov
e67c2282af Fix rebase, fix some tests 2016-09-03 13:39:35 +03:00
Vadim Petrochenkov
d9b332bd69 Translate union constants
Fix alignment for packed unions
Add some missing privacy test
Get rid of `unimplemented_unions` macro
2016-09-03 13:39:35 +03:00
Vadim Petrochenkov
957971b63a Implement layout calculation and add more trans stubs 2016-09-03 13:39:34 +03:00
Vadim Petrochenkov
641d8e9e4c Some better support for unions through the compiler 2016-09-03 13:39:34 +03:00
Eduard Burtescu
119508cdb4 Remove drop flags from structs and enums implementing Drop. 2016-08-24 13:23:37 +03:00
Eduard Burtescu
d0654ae5e5 rustc_trans: remove the bulk of old trans and most of its support code. 2016-08-24 13:23:37 +03:00
Eduard Burtescu
4158673ad7 rustc: reduce Substs and Generics to a simple immutable API. 2016-08-17 05:50:57 +03:00
Zack M. Davis
d37edef9dd prefer if let to match with None => {} arm in some places
This is a spiritual succesor to #34268/8531d581, in which we replaced a
number of matches of None to the unit value with `if let` conditionals
where it was judged that this made for clearer/simpler code (as would be
recommended by Manishearth/rust-clippy's `single_match` lint). The same
rationale applies to matches of None to the empty block.
2016-07-03 16:27:02 -07:00
Luqman Aden
f3e1d57bc2 Allow repr attribute on single variant enum. 2016-05-13 12:36:57 -04:00
Eduard Burtescu
76affa5d6f rustc: Split 'tcx into 'gcx and 'tcx for InferCtxt and its users. 2016-05-11 04:14:58 +03:00
Eduard Burtescu
513d392f7e rustc: Replace &'a TyCtxt<'tcx> with a TyCtxt<'a, 'tcx> wrapper. 2016-05-11 04:14:58 +03:00
Benjamin Herr
c59ea491ea librustc_trans: use bug!(), span_bug!() 2016-03-31 22:06:52 +02:00
Eduard Burtescu
035a645e64 rustc_trans: move the contents of the trans module to top-level. 2016-03-27 01:23:28 +02:00