summary refs log tree commit diff
path: root/src/librustc_metadata/encoder.rs
AgeCommit message (Collapse)AuthorLines
2016-12-08also generate MIR for staticsOliver Schneider-0/+1
2016-12-07add a -Z flag to guarantee that MIR is generated for all functionsOliver Schneider-2/+4
2016-12-05trans: Rename `reachable` to `exported_symbols` where appropriate.Michael Woerister-12/+12
2016-12-02Auto merge of #38053 - eddyb:lazy-9, r=nikomatsakisbors-1/+0
[9/n] rustc: move type information out of AdtDef and TraitDef. _This is part of a series ([prev](https://github.com/rust-lang/rust/pull/37688) | [next]()) of patches designed to rework rustc into an out-of-order on-demand pipeline model for both better feature support (e.g. [MIR-based](https://github.com/solson/miri) early constant evaluation) and incremental execution of compiler passes (e.g. type-checking), with beneficial consequences to IDE support as well. If any motivation is unclear, please ask for additional PR description clarifications or code comments._ <hr> Both `AdtDef` and `TraitDef` contained type information (field types, generics and predicates) which was required to create them, preventing their use before that type information exists, or in the case of field types, *mutation* was required, leading to a variance-magicking implementation of `ivar`s. This PR takes that information out and the resulting cleaner setup could even eventually end up merged with HIR, because, just like `AssociatedItem` before it, there's no dependency on types anymore. (With one exception, variant discriminants should probably be moved into their own map later.)
2016-11-30rustc: track the Span's of definitions across crates.Eduard-Mihai Burtescu-12/+18
2016-11-29rustc: remove type information from TraitDef.Eduard-Mihai Burtescu-1/+0
2016-11-29revamp `Visitor` with a single method for controlling nested visitsNiko Matsakis-3/+3
2016-11-29Split nested_visit_mode function off from nested_visit_mapFlorian Diebold-3/+3
... and make the latter mandatory to implement.
2016-11-29Refactor inlined items some moreFlorian Diebold-3/+3
They don't implement FnLikeNode anymore, instead are handled differently further up in the call tree. Also, keep less information (just def ids for the args).
2016-11-29Add make tidy fixesFlorian Diebold-3/+9
2016-11-29Fix cross-crate associated constant evaluationFlorian Diebold-1/+3
2016-11-29Save bodies of functions for inlining into other cratesFlorian Diebold-3/+5
This is quite hacky and I hope to refactor it a bit, but at least it seems to work.
2016-11-29rustc_metadata: fix compilationFlorian Diebold-2/+5
2016-11-28rustc: embed path resolutions into the HIR instead of keeping DefMap.Eduard-Mihai Burtescu-1/+1
2016-11-28rustc: desugar `use a::{b,c};` into `use a::b; use a::c;` in HIR.Eduard-Mihai Burtescu-2/+2
2016-11-22rustc_metadata: don't break the version check when CrateRoot changes.Eduard-Mihai Burtescu-4/+11
2016-11-21Use `Symbol` instead of `InternedString` in the AST, HIR, and various other ↵Jeffrey Seyfried-3/+3
places.
2016-11-20Move `syntax::util::interner` -> `syntax::symbol`, cleanup.Jeffrey Seyfried-3/+3
2016-11-17Auto merge of #37660 - nikomatsakis:incremental-36349, r=eddybbors-9/+19
Separate impl items from the parent impl This change separates impl item bodies out of the impl itself. This gives incremental more resolution. In so doing, it refactors how the visitors work, and cleans up a bit of the collect/check logic (mostly by moving things out of collect that didn't really belong there, because they were just checking conditions). However, this is not as effective as I expected, for a kind of frustrating reason. In particular, when invoking `foo.bar()` you still wind up with dependencies on private items. The problem is that the method resolution code scans that list for methods with the name `bar` -- and this winds up touching *all* the methods, even private ones. I can imagine two obvious ways to fix this: - separating fn bodies from fn sigs (#35078, currently being pursued by @flodiebold) - a more aggressive model of incremental that @michaelwoerister has been advocating, in which we hash the intermediate results (e.g., the outputs of collect) so that we can see that the intermediate result hasn't changed, even if a particular impl item has changed. So all in all I'm not quite sure whether to land this or not. =) It still seems like it has to be a win in some cases, but not with the test cases we have just now. I can try to gin up some test cases, but I'm not sure if they will be totally realistic. On the other hand, some of the early refactorings to the visitor trait seem worthwhile to me regardless. cc #36349 -- well, this is basically a fix for that issue, I guess r? @michaelwoerister NB: Based atop of @eddyb's PR https://github.com/rust-lang/rust/pull/37402; don't land until that lands.
2016-11-17hash the contents of impl-item-ref by adding them to visitorNiko Matsakis-6/+11
Also simplify some of the `ty::AssociatedItem` representation, in particular by folding `has_value` into `hir::Defaultness`
2016-11-16fallout from separating impl-items from implsNiko Matsakis-0/+4
Basically adding `visit_impl_item` in various places and so forth.
2016-11-16refactor Visitor into ItemLikeVisitor and intravisit::VisitorNiko Matsakis-3/+4
There are now three patterns (shallow, deep, and nested visit). These are described in detail on the docs in `itemlikevisit::ItemLikeVisitor`.
2016-11-16rustc: Implement #[link(cfg(..))] and crt-staticAlex Crichton-8/+3
This commit is an implementation of [RFC 1721] which adds a new target feature to the compiler, `crt-static`, which can be used to select how the C runtime for a target is linked. Most targets dynamically linke the C runtime by default with the notable exception of some of the musl targets. [RFC 1721]: https://github.com/rust-lang/rfcs/blob/master/text/1721-crt-static.md This commit first adds the new target-feature, `crt-static`. If enabled, then the `cfg(target_feature = "crt-static")` will be available. Targets like musl will have this enabled by default. This feature can be controlled through the standard target-feature interface, `-C target-feature=+crt-static` or `-C target-feature=-crt-static`. Next this adds an gated and unstable `#[link(cfg(..))]` feature to enable the `crt-static` semantics we want with libc. The exact behavior of this attribute is a little squishy, but it's intended to be a forever-unstable implementation detail of the liblibc crate. Specifically the `#[link(cfg(..))]` annotation means that the `#[link]` directive is only active in a compilation unit if that `cfg` value is satisfied. For example when compiling an rlib, these directives are just encoded and ignored for dylibs, and all staticlibs are continued to be put into the rlib as usual. When placing that rlib into a staticlib, executable, or dylib, however, the `cfg` is evaluated *as if it were defined in the final artifact* and the library is decided to be linked or not. Essentially, what'll happen is: * On MSVC with `-C target-feature=-crt-static`, the `msvcrt.lib` library will be linked to. * On MSVC with `-C target-feature=+crt-static`, the `libcmt.lib` library will be linked to. * On musl with `-C target-feature=-crt-static`, the object files in liblibc.rlib are removed and `-lc` is passed instead. * On musl with `-C target-feature=+crt-static`, the object files in liblibc.rlib are used and `-lc` is not passed. This commit does **not** include an update to the liblibc module to implement these changes. I plan to do that just after the 1.14.0 beta release is cut to ensure we get ample time to test this feature. cc #37406
2016-11-12rustc_typeck: register item types for closuresAriel Ben-Yehuda-1/+1
This makes them closer to actual items and allows for more transparent treatment.
2016-11-12rustc: move closure upvar types to the closure substsAriel Ben-Yehuda-1/+1
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-12Rollup merge of #37688 - eddyb:lazy-8, r=petrochenkovEduard-Mihai Burtescu-5/+5
[8/n] rustc: clean up lookup_item_type and remove TypeScheme. _This is part of a series ([prev](https://github.com/rust-lang/rust/pull/37676) | [next]()) of patches designed to rework rustc into an out-of-order on-demand pipeline model for both better feature support (e.g. [MIR-based](https://github.com/solson/miri) early constant evaluation) and incremental execution of compiler passes (e.g. type-checking), with beneficial consequences to IDE support as well. If any motivation is unclear, please ask for additional PR description clarifications or code comments._ <hr> * `tcx.tcache` -> `tcx.item_types` * `TypeScheme` (grouping `Ty` and `ty::Generics`) is removed * `tcx.item_types` entries no longer duplicated in `tcx.tables.node_types` * `tcx.lookup_item_type(def_id).ty` -> `tcx.item_type(def_id)` * `tcx.lookup_item_type(def_id).generics` -> `tcx.item_generics(def_id)` * `tcx.lookup_generics(def_id)` -> `tcx.item_generics(def_id)` * `tcx.lookup_{super_,}predicates(def_id)` -> `tcx.item_{super_,}predicates(def_id)`
2016-11-10rustc: clean up lookup_item_type and remove TypeScheme.Eduard Burtescu-5/+5
2016-11-10Improve macro reexports.Jeffrey Seyfried-20/+35
2016-11-10Refactor `explicitly_linked: bool` -> `dep_kind: DepKind`.Jeffrey Seyfried-1/+1
2016-11-10rustc: unify and simplify managing associated items.Eduard Burtescu-44/+40
2016-11-08Replace FnvHasher use with FxHasher.Nicholas Nethercote-6/+6
This speeds up compilation by 3--6% across most of rustc-benchmarks.
2016-11-02rustc: make all read access to tcx.tables go through a method.Eduard Burtescu-1/+1
2016-10-28rustc: move the MIR map into TyCtxt.Eduard Burtescu-6/+2
2016-10-28rustc: move mir::repr::* to mir.Eduard Burtescu-1/+1
2016-10-25run rustfmt on librustc_metadata folderSrinivas Reddy Thatiparthy-169/+149
2016-10-07Auto merge of #36945 - alexcrichton:proc-macro-rename, r=nrcbors-3/+3
rustc: Rename rustc_macro to proc_macro This commit blanket renames the `rustc_macro` infrastructure to `proc_macro`, which reflects the general consensus of #35900. A follow up PR to Cargo will be required to purge the `rustc-macro` name as well.
2016-10-06rustc: Rename rustc_macro to proc_macroAlex Crichton-3/+3
This commit blanket renames the `rustc_macro` infrastructure to `proc_macro`, which reflects the general consensus of #35900. A follow up PR to Cargo will be required to purge the `rustc-macro` name as well.
2016-10-04Eliminate ty::VariantKind in favor of def::CtorKindVadim Petrochenkov-17/+10
2016-10-04Fix cross-crate resolution of half-items created by export shadowingVadim Petrochenkov-2/+6
2016-09-30Fix RUSTC_VERSION for 'documenting' build stage.Scott Olson-1/+1
Previously the `env!("RUSTC_VERSION")` requirement would break the "Documenting rustc_metadata" stage of the rustc build, since that environment variable is only defined during the main build.
2016-09-27add a panic-strategy field to the target specificationJorge Aparicio-1/+1
Now a target can define its panic strategy in its specification. If a user doesn't specify a panic strategy via the command line, i.e. '-C panic', then the compiler will use the panic strategy defined by the target specification. Custom targets can pick their panic strategy via the "panic-strategy" field of their target specification JSON file. If omitted in the specification, the strategy defaults to "unwind". closes #36647
2016-09-20rustc_metadata: reduce Lazy{,Seq} overhead by using a relative encoding.Eduard Burtescu-15/+58
2016-09-20rustc_metadata: replace RBML with a simple and type-safe scheme.Eduard Burtescu-757/+773
2016-09-20rustc_metadata: split the Def description of a DefId from item_children.Eduard Burtescu-0/+1
2016-09-20rustc_metadata: move all encoding/decoding helpers to methods.Eduard Burtescu-224/+219
2016-09-20rustc_metadata: use the shorthand encoding for predicates also.Eduard Burtescu-68/+42
2016-09-20rustc_metadata: group information into less tags.Eduard Burtescu-698/+371
2016-09-20rustc_metadata: group the tags into root tags and item tags.Eduard Burtescu-68/+66
2016-09-20rustc: remove ImplOrTraitItemId and TraitDef's associated_type_names.Eduard Burtescu-14/+3
2016-09-20rustc_metadata: move more RBML tags to auto-serialization.Eduard Burtescu-566/+374