summary refs log tree commit diff
path: root/src/librustc_metadata/decoder.rs
AgeCommit message (Collapse)AuthorLines
2016-04-07Auto merge of #32016 - nikomatsakis:incr-comp-save, r=mwbors-3/+3
Save/load incremental compilation dep graph Contains the code to serialize/deserialize the dep graph to disk between executions. We also hash the item contents and compare to the new hashes. Also includes a unit test harness. There are definitely some known limitations, such as https://github.com/rust-lang/rust/issues/32014 and https://github.com/rust-lang/rust/issues/32015, but I am leaving those for follow-up work. Note that this PR builds on https://github.com/rust-lang/rust/pull/32007, so the overlapping commits can be excluded from review. r? @michaelwoerister
2016-04-07Make `hir::Visibility` non-copyable and add `ty::Visibility`Jeffrey Seyfried-13/+13
2016-04-06make an incremental crateNiko Matsakis-3/+3
for now, this houses `svh` and the code to check `assert_dep_graph` is sane
2016-04-06rustc: retire hir::map's paths.Eduard Burtescu-26/+0
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-3/+3
2016-03-31librustc_metadata: use bug!(), span_bug!()Benjamin Herr-34/+30
2016-03-30rename `rustc_const_eval` to `rustc_const_math`Oliver Schneider-1/+1
2016-03-27rustc: move cfg, infer, traits and ty from middle to top-level.Eduard Burtescu-3/+3
2016-03-27rustc: move middle::subst into middle::ty.Eduard Burtescu-1/+1
2016-03-25Correections due to refactoring .Niko Matsakis-2/+2
2016-03-25track the extern-crate def-id rather than pathNiko Matsakis-1/+3
We used to track, for each crate, a path that led to the extern-crate that imported it. Instead of that, track the def-id of the extern crate, along with a bit more information, and derive the path on the fly.
2016-03-25store krate information more uniformlyNiko Matsakis-5/+1
make DefPath store krate and enable uniform access to crate_name/crate_disambiguator
2016-03-25track def-id for inlined itemsNiko Matsakis-7/+25
2016-03-25Add a "link-guard" to avoid accidentally linking to a wrong dylib at runtime.Michael Woerister-3/+3
We want to prevent compiling something against one version of a dynamic library and then, at runtime accidentally using a different version of the dynamic library. With the old symbol-naming scheme this could not happen because every symbol had the SVH in it and you'd get an error by the dynamic linker when using the wrong version of a dylib. With the new naming scheme this isn't the case any more, so this patch adds the "link-guard" to prevent this error case. This is implemented as follows: - In every crate that we compile, we emit a function called "__rustc_link_guard_<crate-name>_<crate-svh>" - The body of this function contains calls to the "__rustc_link_guard" functions of all dependencies. - An executable contains a call to it's own "__rustc_link_guard" function. As a consequence the "__rustc_link_guard" function call graph mirrors the crate graph and the dynamic linker will fail if a wrong dylib is loaded somewhere because its "__rustc_link_guard" function will contain a different SVH in its name.
2016-03-25Make the compiler emit an error if the crate graph contains two crates with ↵Michael Woerister-2/+2
the same crate-name and crate-salt but different SVHs.
2016-03-25Compute a salt from arguments passed via -Cmetadata.Michael Woerister-0/+7
2016-03-22try! -> ?Jorge Aparicio-6/+6
Automated conversion using the untry tool [1] and the following command: ``` $ find -name '*.rs' -type f | xargs untry ``` at the root of the Rust repo. [1]: https://github.com/japaric/untry
2016-03-17trans: Rename MonoId to Instance and start using it in more places.Eduard Burtescu-7/+11
2016-03-17metadata: Constrain FoundAst::FoundParent to an Item.Eduard Burtescu-40/+23
2016-03-17metedata: Remove the unnecessary indirection to astencode.Eduard Burtescu-11/+1
2016-03-14Fixes after a rebaseAaron Turon-1/+0
2016-03-14Initial incorporation of specialization:Aaron Turon-0/+8
- 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/+17
2016-03-10typestrong constant integersOliver Schneider-3/+5
2016-03-09Auto merge of #31710 - eddyb:reify, r=nikomatsakisbors-3/+4
Distinguish fn item types to allow reification from nothing to fn pointers. The first commit is a rebase of #26284, except for files that have moved since. This is a [breaking-change], due to: * each FFI function has a distinct type, like all other functions currently do * all generic parameters on functions are recorded in their item types, e.g.: `size_of::<u8>` & `size_of::<i8>`'s types differ despite their identical signature. * function items are zero-sized, which will stop transmutes from working on them The first two cases are handled in most cases with the new coerce-unify logic, which will combine incompatible function item types into function pointers, at the outer-most level of if-else chains, match arms and array literals. The last case is specially handled during type-checking such that transmutes from a function item type to a pointer or integer type will continue to work for another release cycle, but are being linted against. To get rid of warnings and ensure your code will continue to compile, cast to a pointer before transmuting.
2016-03-09Track fn type and lifetime parameters in TyFnDef.Eduard Burtescu-3/+3
2016-03-09Split TyBareFn into TyFnDef and TyFnPtr.Eli Friedman-3/+4
There's a lot of stuff wrong with the representation of these types: TyFnDef doesn't actually uniquely identify a function, TyFnPtr is used to represent method calls, TyFnDef in the sub-expression of a cast isn't correctly reified, and probably some other stuff I haven't discovered yet. Splitting them seems like the right first step, though.
2016-03-06Add method `visibility` to `CrateStore`Jeffrey Seyfried-0/+4
2016-03-03Rename middle::ty::ctxt to TyCtxtJeffrey Seyfried-28/+28
2016-03-02Use numeric field `Name`s ("0", "1" etc) for positional fieldsVadim Petrochenkov-5/+9
2016-02-12Autoderef in librustc_metadataJonas Schievink-5/+5
2016-02-11Pass through diagnostic handler insteadarcnmx-1/+2
2016-02-11Only retain external static symbols across LTOarcnmx-19/+20
2016-02-11[breaking-change] don't glob export ast::MetaItem_Oliver 'ker' Schneider-1/+1
2016-02-11[breaking-change] don't glob import/export syntax::abi enum variantsOliver Schneider-2/+2
2016-02-02Auto merge of #31279 - DanielJCampbell:MacroReferencing, r=nrcbors-3/+12
r? @nrc
2016-02-01Implemented macro referencing for save analysisDaniel Campbell-3/+12
2016-01-26Implement the translation item collector.Michael Woerister-0/+10
The purpose of the translation item collector is to find all monomorphic instances of functions, methods and statics that need to be translated into LLVM IR in order to compile the current crate. So far these instances have been discovered lazily during the trans path. For incremental compilation we want to know the set of these instances in advance, and that is what the trans::collect module provides. In the future, incremental and regular translation will be driven by the collector implemented here.
2016-01-20Rename Def's variants and don't reexport themVadim Petrochenkov-15/+15
2016-01-20Refactor definitions of ADTs in rustc::middle::defVadim Petrochenkov-35/+47
2016-01-15Preserve struct/variant kinds in metadataVadim Petrochenkov-8/+24
Add tests for use of empty structs in cross-crate scenarios
2016-01-07Refactor away extension traits RegionEscape and HasTypeFlagsJeffrey Seyfried-1/+1
2016-01-05Refactor compiler to make use of dep-tracking-maps. Also, in cases whereNiko Matsakis-11/+6
we were using interior mutability (RefCells, TyIvar), add some reads/writes.
2015-12-31Rollup merge of #30565 - michaelwoerister:opaque_encoder, r=brsonSimonas Kazlauskas-4/+8
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-4/+8
2015-12-28Rename ExplicitSelfCategory's variants and stop re-exporting them.Ms2ger-5/+5
2015-12-22Fix def paths creation for items inlined from external crates.Michael Woerister-11/+36
Avoid duplicating the last element of the def path which led to paths like "std::slice::into_vec::into_vec".
2015-12-12Implement `#[deprecated]` attribute (RFC 1270)Vadim Petrochenkov-0/+8
2015-12-10Make MIR encodable and store it in crate metadata.Michael Woerister-2/+56