summary refs log tree commit diff
path: root/src/librustc_metadata/encoder.rs
AgeCommit message (Collapse)AuthorLines
2016-07-02add a encoding version to the actual metadataAriel Ben-Yehuda-6/+19
previously, only .so files included a metadata encoding version, *outside* of the zlib compressed area. This adds an encoding version inside the metadata itself, in both .so and .rlib files. Fixes #33778.
2016-07-02make the metadata lock more robust and bump the metadata encoding versionAriel Ben-Yehuda-4/+0
check the metadata lock when loading rather than afterwards Fixes #33733 Fixes #33015
2016-07-01fix RUST_LOG, hopefully for real this timeAriel Ben-Yehuda-0/+1
2016-06-28refactor rustc_metadata to use CamelCase names and IndexVecAriel Ben-Yehuda-2/+2
2016-06-23Move errors from libsyntax to its own crateJonathan Turner-2/+2
2016-05-31make region-param-def encoding more DRYNiko Matsakis-27/+2
we used to have two separate routines, one in tyencode/tydecode, and one in encode/decode.
2016-05-28Separate bindings from other patterns in HIRVadim Petrochenkov-1/+1
2016-05-25trans: remove item_symbols from metadata and CrateContext.Eduard Burtescu-31/+1
2016-05-25trans: move exported_symbol to Instance::symbol_name.Eduard Burtescu-0/+2
2016-05-18change svh to store a u64Niko Matsakis-2/+2
We used to store a u64 converted to a String for some reason. Now we don't.
2016-05-18always encode variant fieldsNiko Matsakis-6/+3
we need them to be able to retrace.
2016-05-18when encoding, push MetaData(foo) task on stackNiko Matsakis-52/+68
This lets us determine what was used to construct the metadata. Conflicts: src/librustc_metadata/encoder.rs
2016-05-16Remove hir::IdentVadim Petrochenkov-1/+1
2016-05-11rustc: Split 'tcx into 'gcx and 'tcx for InferCtxt and its users.Eduard Burtescu-4/+4
2016-05-11rustc: Replace &'a TyCtxt<'tcx> with a TyCtxt<'a, 'tcx> wrapper.Eduard Burtescu-8/+8
2016-05-11rustc: Avoid free functions taking &TyCtxt and &InferCtxt.Eduard Burtescu-23/+22
2016-05-09rustc: Implement custom panic runtimesAlex Crichton-1/+13
This commit is an implementation of [RFC 1513] which allows applications to alter the behavior of panics at compile time. A new compiler flag, `-C panic`, is added and accepts the values `unwind` or `panic`, with the default being `unwind`. This model affects how code is generated for the local crate, skipping generation of landing pads with `-C panic=abort`. [RFC 1513]: https://github.com/rust-lang/rfcs/blob/master/text/1513-less-unwinding.md Panic implementations are then provided by crates tagged with `#![panic_runtime]` and lazily required by crates with `#![needs_panic_runtime]`. The panic strategy (`-C panic` value) of the panic runtime must match the final product, and if the panic strategy is not `abort` then the entire DAG must have the same panic strategy. With the `-C panic=abort` strategy, users can expect a stable method to disable generation of landing pads, improving optimization in niche scenarios, decreasing compile time, and decreasing output binary size. With the `-C panic=unwind` strategy users can expect the existing ability to isolate failure in Rust code from the outside world. Organizationally, this commit dismantles the `sys_common::unwind` module in favor of some bits moving part of it to `libpanic_unwind` and the rest into the `panicking` module in libstd. The custom panic runtime support is pretty similar to the custom allocator support with the only major difference being how the panic runtime is injected (takes the `-C panic` flag into account).
2016-05-03Remove unused trait imports flagged by lintSeo Sanghyeon-2/+1
2016-04-12Do not encode name when encoding DefKeySeo Sanghyeon-11/+11
2016-04-07Make `hir::Visibility` non-copyable and add `ty::Visibility`Jeffrey Seyfried-17/+27
2016-04-06rustc: retire hir::map's paths.Eduard Burtescu-94/+7
2016-04-06rustc: move middle::{def,def_id,pat_util} to hir.Eduard Burtescu-2/+2
2016-04-06rustc: move rustc_front to rustc::hir.Eduard Burtescu-6/+6
2016-03-31librustc_metadata: use bug!(), span_bug!()Benjamin Herr-1/+1
2016-03-27rustc: move cfg, infer, traits and ty from middle to top-level.Eduard Burtescu-4/+4
2016-03-27rustc: move middle::subst into middle::ty.Eduard Burtescu-1/+1
2016-03-25store krate information more uniformlyNiko Matsakis-1/+1
make DefPath store krate and enable uniform access to crate_name/crate_disambiguator
2016-03-25Compute a salt from arguments passed via -Cmetadata.Michael Woerister-0/+5
2016-03-25CrateStore: Allow for custom def_id_to_string mappings in encode_type().Michael Woerister-3/+6
2016-03-17metedata: Remove the unnecessary indirection to astencode.Eduard Burtescu-60/+13
2016-03-14Fixes after a rebaseAaron Turon-0/+1
2016-03-14Move specialization graph walks to iterators; make associated typeAaron Turon-1/+8
projection sensitive to "mode" (most importantly, trans vs middle). This commit introduces several pieces of iteration infrastructure in the specialization graph data structure, as well as various helpers for finding the definition of a given item, given its kind and name. In addition, associated type projection is now *mode-sensitive*, with three possible modes: - **Topmost**. This means that projection is only possible if there is a non-`default` definition of the associated type directly on the selected impl. This mode is a bit of a hack: it's used during early coherence checking before we have built the specialization graph (and therefore before we can walk up the specialization parents to find other definitions). Eventually, this should be replaced with a less "staged" construction of the specialization graph. - **AnyFinal**. Projection succeeds for any non-`default` associated type definition, even if it is defined by a parent impl. Used throughout typechecking. - **Any**. Projection always succeeds. Used by trans. The lasting distinction here is between `AnyFinal` and `Any` -- we wish to treat `default` associated types opaquely for typechecking purposes. In addition to the above, the commit includes a few other minor review fixes.
2016-03-14Initial incorporation of specialization:Aaron Turon-1/+11
- Rewrites the overlap checker to instead build up a specialization graph, checking for overlap errors in the process. - Use the specialization order during impl selection. This commit does not yet handle associated types correctly, and assumes that all items are `default` and are overridden.
2016-03-14Hook `default` keyword into metadata and carry data through to typeckAaron Turon-0/+11
2016-03-10typestrong constant integersOliver Schneider-9/+12
2016-03-03Rename middle::ty::ctxt to TyCtxtJeffrey Seyfried-5/+5
2016-03-02Move span into `StructField`Vadim Petrochenkov-2/+2
+ some cleanup in rustdoc
2016-03-02Use numeric field `Name`s ("0", "1" etc) for positional fieldsVadim Petrochenkov-2/+1
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