about summary refs log tree commit diff
path: root/src/librustc/metadata
AgeCommit message (Collapse)AuthorLines
2015-09-29store the rustc version in metadata and check itAriel Ben-Yehuda-0/+39
This prevents ICEs when old crates are used with a new version of rustc. Currently, the linking of crates compiled with different versions of rustc is completely unsupported. Fixes #28700
2015-09-28Minor code cleanup.Scott Olson-1/+1
2015-09-29Fill in some missing parts in the default HIR visitorVadim Petrochenkov-0/+6
2015-09-24Cleanup interfaces of Name, SyntaxContext and IdentVadim Petrochenkov-1/+1
Make sure Name, SyntaxContext and Ident are passed by value Make sure Idents don't serve as keys (or parts of keys) in maps, Ident comparison is not well defined
2015-09-23Remove random Idents outside of libsyntaxVadim Petrochenkov-7/+7
2015-09-22Use Names in path fragments and MacroDefVadim Petrochenkov-1/+1
2015-09-22Use Names in HIR ItemsVadim Petrochenkov-22/+22
2015-09-16Auto merge of #28353 - GuillaumeGomez:error_codes, r=Manishearthbors-40/+53
r? @Manishearth This is a work in progress.
2015-09-16Use ast attributes every where (remove HIR attributes).Nick Cameron-111/+108
This could be a [breaking-change] if your lint or syntax extension (is that even possible?) uses HIR attributes or literals.
2015-09-14split ty::util and ty::adjustmentAriel Ben-Yehuda-6/+10
2015-09-14Auto merge of #28392 - arielb1:sort-bounds-list, r=eddybbors-3/+2
The sort key is a (DefId, Name), which is *not* stable between runs, so we must re-sort when loading. Fixes #24063 Fixes #25467 Fixes #27222 Fixes #28377 r? @eddyb
2015-09-13sort the existential bounds list in tydecodeAriel Ben-Yehuda-3/+2
The sort key is a (DefId, Name), which is *not* stable between runs, so we must re-sort when loading. Fixes #24063 Fixes #25467 Fixes #27222 Fixes #28377
2015-09-13Add part of new error codes in librustcGuillaume Gomez-40/+53
2015-09-03rewrite metadata indexingAriel Ben-Yehuda-243/+322
this improves the compilation time for small crates by ~20%
2015-09-03remove totally useless struct-field indexAriel Ben-Yehuda-46/+34
2015-09-03Add an intital HIR and lowering stepNick Cameron-131/+173
2015-08-24address nitsAriel Ben-Yehuda-4/+10
2015-08-24store the CodeExtent directly in FreeRegionAriel Ben-Yehuda-12/+2
this makes the code cleaner
2015-08-24Use a Vec instead of an HashMap for the scope hierarchyAriel Ben-Yehuda-23/+55
This increases regionck performance greatly - type-checking on librustc decreased from 9.1s to 8.1s. Because of Amdahl's law, total performance is improved only by about 1.5% (LLVM wizards, this is your opportunity to shine!). before: 576.91user 4.26system 7:42.36elapsed 125%CPU (0avgtext+0avgdata 1142192maxresident)k after: 566.50user 4.84system 7:36.84elapsed 125%CPU (0avgtext+0avgdata 1124304maxresident)k I am somewhat worried really need to find out why we have this Red Queen's Race going on here. Originally I suspected it may be a problem from RFC1214's warnings, but it seems to be an effect from other changes. However, the increase seems to be mostly in LLVM's time, so I guess it's the LLVM wizards' problem.
2015-08-24Use a u32 instead of a usize in CodeExtentAriel Ben-Yehuda-2/+1
This reduces the size of CodeExtent to 12 bytes (was 24). We should have a warning for this kind of problem.
2015-08-24split ReInfer into ReVar and ReSkolemizedAriel Ben-Yehuda-1/+1
this should reduce the size of ty::Region to 24 bytes (from 32), and they are treated differently in most cases anyway.
2015-08-24convert to use `is_local` instead of `== LOCAL_CRATE`Niko Matsakis-2/+2
2015-08-24fallout from moving def-idNiko Matsakis-123/+127
2015-08-17Create "platform-intrinsic" ABI for SIMD/platform intrinsics.Huon Wilson-2/+2
This is purposely separate to the "rust-intrinsic" ABI, because these intrinsics are theoretically going to become stable, and should be fine to be independent of the compiler/language internals since they're intimately to the platform.
2015-08-16Auto merge of #27643 - mitaa:get_item_, r=arielb1bors-0/+10
(this incidentally fixes an error message where the paths separator is " " instead of "::")
2015-08-16Auto merge of #27851 - nikomatsakis:cleanup-ty-decoder, r=eddybbors-828/+669
Just a little code cleanup I was doing as part of another refactoring (which may turn out not to be needed). The main thrust of this is to cleanup the interface to `tydecode.rs` to be less ridiculously repetitive. I also purged the generic "def-id conversion" parameter in favor of a trait object, just to reduce code duplication a bit and make the signatures a bit less messy. I measured the bootstrapping time to build stage2 with these changes, it was identical. (But it'd be easy enough to restore the unboxed closure if we wanted it.)
2015-08-15remove the last remnants of old interfaceNiko Matsakis-133/+26
2015-08-15astencode: convert code to use TyDecoder directlyNiko Matsakis-7/+16
2015-08-15s/PState/TyDecoder/Niko Matsakis-21/+21
2015-08-15tydecode: tighten privacyNiko Matsakis-3/+3
2015-08-15convert tydecode to use an impl, eliminating a lot of boilerplateNiko Matsakis-621/+618
2015-08-14convert tydecode to use a closure for def-id conversion andNiko Matsakis-259/+142
to store the closure in the PSState struct
2015-08-14move InlinedItem into librustc, where it belongsNiko Matsakis-22/+81
2015-08-14rustc: Allow changing the default allocatorAlex Crichton-55/+216
This commit is an implementation of [RFC 1183][rfc] which allows swapping out the default allocator on nightly Rust. No new stable surface area should be added as a part of this commit. [rfc]: https://github.com/rust-lang/rfcs/pull/1183 Two new attributes have been added to the compiler: * `#![needs_allocator]` - this is used by liballoc (and likely only liballoc) to indicate that it requires an allocator crate to be in scope. * `#![allocator]` - this is a indicator that the crate is an allocator which can satisfy the `needs_allocator` attribute above. The ABI of the allocator crate is defined to be a set of symbols that implement the standard Rust allocation/deallocation functions. The symbols are not currently checked for exhaustiveness or typechecked. There are also a number of restrictions on these crates: * An allocator crate cannot transitively depend on a crate that is flagged as needing an allocator (e.g. allocator crates can't depend on liballoc). * There can only be one explicitly linked allocator in a final image. * If no allocator is explicitly requested one will be injected on behalf of the compiler. Binaries and Rust dylibs will use jemalloc by default where available and staticlibs/other dylibs will use the system allocator by default. Two allocators are provided by the distribution by default, `alloc_system` and `alloc_jemalloc` which operate as advertised. Closes #27389
2015-08-12Add two new kinds of predicates, WellFormed and ObjectSafe.Niko Matsakis-0/+13
2015-08-12Replace get_item_path[-1] with get_item_namemitaa-0/+10
2015-08-11Auto merge of #26818 - sfackler:duration-stabilization, r=aturonbors-1/+1
This commit stabilizes the `std::time` module and the `Duration` type. `Duration::span` remains unstable, and the `Display` implementation for `Duration` has been removed as it is still being reworked and all trait implementations for stable types are de facto stable. This is a [breaking-change] to those using `Duration`'s `Display` implementation. I'm opening this PR as a platform for discussion - there may be some method renaming to do as part of the stabilization process.
2015-08-10trans: Stop informing LLVM about dllexportAlex Crichton-23/+45
Rust's current compilation model makes it impossible on Windows to generate one object file with a complete and final set of dllexport annotations. This is because when an object is generated the compiler doesn't actually know if it will later be included in a dynamic library or not. The compiler works around this today by flagging *everything* as dllexport, but this has the drawback of exposing too much. Thankfully there are alternate methods of specifying the exported surface area of a dll on Windows, one of which is passing a `*.def` file to the linker which lists all public symbols of the dynamic library. This commit removes all locations that add `dllexport` to LLVM variables and instead dynamically generates a `*.def` file which is passed to the linker. This file will include all the public symbols of the current object file as well as all upstream libraries, and the crucial aspect is that it's only used when generating a dynamic library. When generating an executable this file isn't generated, so all the symbols aren't exported from an executable. To ensure that statically included native libraries are reexported correctly, the previously added support for the `#[linked_from]` attribute is used to determine the set of FFI symbols that are exported from a dynamic library, and this is required to get the compiler to link correctly.
2015-08-10syntax: Add a new unstable #[linked_from] attributeAlex Crichton-75/+90
To correctly reexport statically included libraries from a DLL on Windows, the compiler will soon need to have knowledge about what symbols are statically included and which are not. To solve this problem a new unstable `#[linked_from]` attribute is being added and recognized on `extern` blocks to indicate which native library the symbols are coming from. The compiler then keeps track of what the set of FFI symbols are that are included statically. This information will be used in a future commit to configure how we invoke the linker on Windows.
2015-08-10Stabilize the Duration APISteven Fackler-1/+1
This commit stabilizes the `std::time` module and the `Duration` type. `Duration::span` remains unstable, and the `Display` implementation for `Duration` has been removed as it is still being reworked and all trait implementations for stable types are de facto stable. This is a [breaking-change] to those using `Duration`'s `Display` implementation.
2015-08-07Auto merge of #27551 - arielb1:adt-def, r=nikomatsakisbors-145/+178
This ended up being a bigger refactoring than I thought, as I also cleaned a few ugly points in rustc. There are still a few areas that need improvements. Performance numbers: ``` Before: 572.70user 5.52system 7:33.21elapsed 127%CPU (0avgtext+0avgdata 1173368maxresident)k llvm-time: 385.858 After: 545.27user 5.49system 7:10.22elapsed 128%CPU (0avgtext+0avgdata 1145348maxresident)k llvm-time: 387.119 ``` A good 5% perf improvement. Note that after this patch >70% of the time is spent in LLVM - Amdahl's law is in full effect. Passes make check locally. r? @nikomatsakis
2015-08-07rename ADTDef to AdtDef etc.Ariel Ben-Yehuda-28/+25
2015-08-07stop using skip_binderAriel Ben-Yehuda-2/+8
2015-08-06Cache a linear search for the #[staged_api] attribute.Brian Anderson-10/+15
This search happens a lot! Locally, compiling hyper sees the following improvements: before real 0m30.843s user 0m51.644s sys 0m2.128s real 0m30.164s user 0m53.320s sys 0m2.208s after real 0m28.438s user 0m51.076s sys 0m2.276s real 0m28.612s user 0m51.560s sys 0m2.192s
2015-08-06remove ty::{VariantInfo, FieldTy}Ariel Ben-Yehuda-89/+8
2015-08-06create VariantDef-s (but don't actually use them)Ariel Ben-Yehuda-55/+150
2015-08-06add variant info to ADTDef, but don't actually use itAriel Ben-Yehuda-1/+2
2015-08-06introduce an ADTDef struct for struct/enum definitionsAriel Ben-Yehuda-4/+19
2015-08-05Auto merge of #27458 - mitaa:local_cpath, r=nikomatsakisbors-129/+178
This changes the current behaviour for two cases (that I know of) ```rust mod foo { extern crate bar; } // `bar::` changes to `foo::bar::` ``` ```rust extern crate bar as quux; // `bar::` changes to `quux::` ``` For example: ```rust mod foo { extern crate core; } fn assert_clone<T>() where T : Clone { } fn main() { assert_clone::<foo::core::atomic::AtomicBool>(); // error: the trait `core::clone::Clone` is not implemented for the type `core::atomic::AtomicBool` [E0277] // changes to // error: the trait `foo::core::clone::Clone` is not implemented for the type `foo::core::atomic::AtomicBool` [E0277] } ``` Notably the following test case broke: ```rust #[bench] fn bar(x: isize) { } //~^ ERROR mismatched types //~| expected `fn(&mut test::Bencher)` // changed to //~| expected `fn(&mut __test::test::Bencher)` ``` If a crate is linked multiple times the path with the least segments is stored. Partially addresses #1920. (this doesn't solve the issue raised about re-exports) r? @nikomatsakis
2015-08-04rustc: replace def::MethodProvenance with ty::ImplOrTraitItemContainer.Eduard Burtescu-21/+2