summary refs log tree commit diff
path: root/src/librustc_metadata/encoder.rs
AgeCommit message (Collapse)AuthorLines
2016-02-14Rename hir::Pat_ and its variantsVadim Petrochenkov-2/+2
2016-02-12Autoderef in librustc_metadataJonas Schievink-10/+10
2016-02-11[breaking-change] don't glob export ast::MetaItem_Oliver 'ker' Schneider-3/+3
2016-02-11[breaking-change] don't pub export ast::Lit_ variantsOliver Schneider-1/+1
2016-02-11[breaking-change] don't glob import/export syntax::abi enum variantsOliver Schneider-3/+3
2016-02-09make `MirMap` a struct instead of a type alias for `NodeMap`Oliver Schneider-5/+5
2016-02-04Synthesize calls to box_free language itemSimonas Kazlauskas-1/+1
This gets rid of Drop(Free, _) MIR construct by synthesizing a call to language item which takes care of dropping instead.
2016-02-01Implemented macro referencing for save analysisDaniel Campbell-0/+5
2016-01-20Refactor definitions of ADTs in rustc::middle::defVadim Petrochenkov-3/+8
2016-01-15Preserve struct/variant kinds in metadataVadim Petrochenkov-3/+8
Add tests for use of empty structs in cross-crate scenarios
2016-01-08Also store MIR of closures in crate metadata.Michael Woerister-6/+9
2015-12-31Rollup merge of #30565 - michaelwoerister:opaque_encoder, r=brsonSimonas Kazlauskas-78/+24
This PR changes the `emit_opaque` and `read_opaque` methods in the RBML library to use a space-efficient binary encoder that does not emit any tags and uses the LEB128 variable-length integer format for all numbers it emits. The space savings are nice, albeit a bit underwhelming, especially for dynamic libraries where metadata is already compressed. | RLIBs | NEW | OLD | |--------------|--------|-----------| |libstd | 8.8 MB | 10.5 MB | |libcore |15.6 MB | 19.7 MB | |libcollections| 3.7 MB | 4.8 MB | |librustc |34.0 MB | 37.8 MB | |libsyntax |28.3 MB | 32.1 MB | | SOs | NEW | OLD | |---------------|-----------|--------| | libstd | 4.8 MB | 5.1 MB | | librustc | 8.6 MB | 9.2 MB | | libsyntax | 7.8 MB | 8.4 MB | At least this should make up for the size increase caused recently by also storing MIR in crate metadata. Can this be a breaking change for anyone? cc @rust-lang/compiler
2015-12-28Use a more efficient encoding for opaque data in RBML.Michael Woerister-78/+24
2015-12-28Rename ExplicitSelfCategory's variants and stop re-exporting them.Ms2ger-7/+7
2015-12-17move error handling from libsyntax/diagnostics.rs to libsyntax/errors/*Nick Cameron-5/+4
Also split out emitters into their own module.
2015-12-12Implement `#[deprecated]` attribute (RFC 1270)Vadim Petrochenkov-11/+49
2015-12-10Make MIR encodable and store it in crate metadata.Michael Woerister-1/+23
2015-12-09Auto merge of #30140 - michaelwoerister:tls-encoding, r=nikomatsakisbors-48/+53
With this commit, metadata encoding and decoding can make use of thread-local encoding and decoding contexts. These allow implementers of `serialize::Encodable` and `Decodable` to access information and datastructures that would otherwise not be available to them. For example, we can automatically translate def-id and span information during decoding because the decoding context knows which crate the data is decoded from. Or it allows to make `ty::Ty` decodable because the context has access to the `ty::ctxt` that is needed for creating `ty::Ty` instances. Some notes: - `tls::with_encoding_context()` and `tls::with_decoding_context()` (as opposed to their unsafe versions) try to prevent the TLS data getting out-of-sync by making sure that the encoder/decoder passed in is actually the same as the one stored in the context. This should prevent accidentally reading from the wrong decoder. - There are no real tests in this PR. I had a unit tests for some of the core aspects of the TLS implementation but it was kind of brittle, a lot of code for mocking `ty::ctxt`, `crate_metadata`, etc and did actually test not so much. The code will soon be tested by the first incremental compilation auto-tests that rely on MIR being properly serialized. However, if people think that some tests should be added before this can land, I'll try to provide some that make sense. r? @nikomatsakis
2015-12-09Add scoped thread-local encoding and decoding contexts to cstore.Michael Woerister-48/+53
With this commit, metadata encoding and decoding can make use of thread-local encoding and decoding contexts. These allow implementers of serialize::Encodable and Decodable to access information and datastructures that would otherwise not be available to them. For example, we can automatically translate def-id and span information during decoding because the decoding context knows which crate the data is decoded from. Or it allows to make ty::Ty decodable because the context has access to the ty::ctxt that is needed for creating ty::Ty instances.
2015-12-07Remove some unnecessary indirection from HIR structuresVadim Petrochenkov-2/+2
2015-11-26split the metadata code into rustc_metadataAriel Ben-Yehuda-0/+2078
tests & rustdoc still broken