about summary refs log tree commit diff
path: root/src/librustc/metadata/encoder.rs
AgeCommit message (Collapse)AuthorLines
2015-11-26split the metadata code into rustc_metadataAriel Ben-Yehuda-2078/+0
tests & rustdoc still broken
2015-11-26make CrateStore a trait objectAriel Ben-Yehuda-2/+2
rustdoc still broken
2015-11-18Port a bunch of code new-visitor; all of these ports wereNiko Matsakis-23/+25
straightforward uses of `visit_all_items`. In some cases I had to remove empty `visit_item` calls that were just to suppress visiting nested items.
2015-11-16ImplItem_ -> ImplItemKind renameOliver Schneider-1/+1
2015-11-16rename ImplItem_::*ImplItem to ImplItem_::*Oliver Schneider-1/+1
[breaking change]
2015-11-13Store a valid name for the root module in metadatamitaa-1/+1
2015-10-13Merge VariantData and VariantData_Vadim Petrochenkov-4/+4
2015-10-13Merge struct fields and struct kindVadim Petrochenkov-3/+3
2015-10-13Dict -> Struct, StructDef -> VariantData, def -> dataVadim Petrochenkov-5/+5
2015-10-13Fix rebaseVadim Petrochenkov-2/+2
2015-10-13Remove now redundant NodeId from VariantVadim Petrochenkov-1/+1
2015-10-13Decouple structure kinds from NodeIdsVadim Petrochenkov-9/+4
2015-10-02unify the 2 impl indexesAriel Ben-Yehuda-50/+24
2015-10-02Merge branch 'master' into metadietAriel Ben-Yehuda-233/+196
rlib sizes: 1445222 liballoc_jemalloc-bb943c5a.rlib 10664 liballoc_system-bb943c5a.rlib 143592 libarena-bb943c5a.rlib 3639102 libcollections-bb943c5a.rlib 16316910 libcore-bb943c5a.rlib 214154 libflate-bb943c5a.rlib 231440 libfmt_macros-bb943c5a.rlib 536976 libgetopts-bb943c5a.rlib 209672 libgraphviz-bb943c5a.rlib 408008 liblibc-bb943c5a.rlib 189610 liblog-bb943c5a.rlib 662184 librand-bb943c5a.rlib 605112 librbml-bb943c5a.rlib 1397820 librustc_back-bb943c5a.rlib 38383772 librustc-bb943c5a.rlib 12842 librustc_bitflags-bb943c5a.rlib 2297822 librustc_borrowck-bb943c5a.rlib 571064 librustc_data_structures-bb943c5a.rlib 9356542 librustc_driver-bb943c5a.rlib 9477226 librustc_front-bb943c5a.rlib 1605698 librustc_lint-bb943c5a.rlib 77111720 librustc_llvm-bb943c5a.rlib 4783848 librustc_mir-bb943c5a.rlib 3534256 librustc_platform_intrinsics-bb943c5a.rlib 593038 librustc_privacy-bb943c5a.rlib 3122202 librustc_resolve-bb943c5a.rlib 14185212 librustc_trans-bb943c5a.rlib 11940328 librustc_typeck-bb943c5a.rlib 1634264 librustc_unicode-bb943c5a.rlib 15564160 librustdoc-bb943c5a.rlib 8153964 libstd-bb943c5a.rlib 30589338 libsyntax-bb943c5a.rlib 897110 libterm-bb943c5a.rlib 1360662 libtest-bb943c5a.rlib
2015-10-01don't store method_ftyAriel Ben-Yehuda-18/+0
It is redundant with the item type. This is not much of a win, as there are really not *that* many methods, but it makes the code uglier.
2015-10-01improve the tyencode abbrev formatAriel Ben-Yehuda-2/+2
3% win on libcore 528828 liballoc-bb943c5a.rlib 1425126 liballoc_jemalloc-bb943c5a.rlib 10090 liballoc_system-bb943c5a.rlib 144904 libarena-bb943c5a.rlib 3773896 libcollections-bb943c5a.rlib 17075242 libcore-bb943c5a.rlib 195770 libflate-bb943c5a.rlib 234702 libfmt_macros-bb943c5a.rlib 536342 libgetopts-bb943c5a.rlib 212028 libgraphviz-bb943c5a.rlib 397068 liblibc-bb943c5a.rlib 185038 liblog-bb943c5a.rlib 680782 librand-bb943c5a.rlib 577574 librbml-bb943c5a.rlib 1381992 librustc_back-bb943c5a.rlib 37554736 librustc-bb943c5a.rlib 12826 librustc_bitflags-bb943c5a.rlib 2257392 librustc_borrowck-bb943c5a.rlib 533858 librustc_data_structures-bb943c5a.rlib 9338878 librustc_driver-bb943c5a.rlib 8960016 librustc_front-bb943c5a.rlib 1594212 librustc_lint-bb943c5a.rlib 79159342 librustc_llvm-bb943c5a.rlib 4590656 librustc_mir-bb943c5a.rlib 3529292 librustc_platform_intrinsics-bb943c5a.rlib 590688 librustc_privacy-bb943c5a.rlib 3084134 librustc_resolve-bb943c5a.rlib 14032890 librustc_trans-bb943c5a.rlib 11833852 librustc_typeck-bb943c5a.rlib 1641496 librustc_unicode-bb943c5a.rlib 15611582 librustdoc-bb943c5a.rlib 2693764 libserialize-bb943c5a.rlib 8266920 libstd-bb943c5a.rlib 29573790 libsyntax-bb943c5a.rlib 895484 libterm-bb943c5a.rlib
2015-10-01share stored predicatesAriel Ben-Yehuda-52/+88
while most of the duplication in predicates was caused by stubs, this is still a 5% win on libcore. 567924 liballoc-bb943c5a.rlib 1425564 liballoc_jemalloc-bb943c5a.rlib 10520 liballoc_system-bb943c5a.rlib 154842 libarena-bb943c5a.rlib 4113790 libcollections-bb943c5a.rlib 18513674 libcore-bb943c5a.rlib 199466 libflate-bb943c5a.rlib 249548 libfmt_macros-bb943c5a.rlib 560488 libgetopts-bb943c5a.rlib 226772 libgraphviz-bb943c5a.rlib 442966 liblibc-bb943c5a.rlib 189884 liblog-bb943c5a.rlib 736764 librand-bb943c5a.rlib 609874 librbml-bb943c5a.rlib 1411678 librustc_back-bb943c5a.rlib 38770354 librustc-bb943c5a.rlib 12868 librustc_bitflags-bb943c5a.rlib 2327196 librustc_borrowck-bb943c5a.rlib 582178 librustc_data_structures-bb943c5a.rlib 9379344 librustc_driver-bb943c5a.rlib 9540324 librustc_front-bb943c5a.rlib 1614996 librustc_lint-bb943c5a.rlib 79217876 librustc_llvm-bb943c5a.rlib 4833518 librustc_mir-bb943c5a.rlib 3535794 librustc_platform_intrinsics-bb943c5a.rlib 603190 librustc_privacy-bb943c5a.rlib 3158032 librustc_resolve-bb943c5a.rlib 14300126 librustc_trans-bb943c5a.rlib 12024054 librustc_typeck-bb943c5a.rlib 1834852 librustc_unicode-bb943c5a.rlib 15611582 librustdoc-bb943c5a.rlib 2926594 libserialize-bb943c5a.rlib 8780060 libstd-bb943c5a.rlib 30772000 libsyntax-bb943c5a.rlib 917984 libterm-bb943c5a.rlib 1369754 libtest-bb943c5a.rlib
2015-10-01add a cross-reference indexAriel Ben-Yehuda-100/+103
it still does not *do* anything
2015-10-01remove unneeded tags from metadataAriel Ben-Yehuda-32/+4
stage1 release rlib sizes: 580890 liballoc-bb943c5a.rlib 1425558 liballoc_jemalloc-bb943c5a.rlib 10514 liballoc_system-bb943c5a.rlib 157192 libarena-bb943c5a.rlib 4316234 libcollections-bb943c5a.rlib 19580128 libcore-bb943c5a.rlib 199498 libflate-bb943c5a.rlib 249328 libfmt_macros-bb943c5a.rlib 560406 libgetopts-bb943c5a.rlib 233620 libgraphviz-bb943c5a.rlib 442964 liblibc-bb943c5a.rlib 190178 liblog-bb943c5a.rlib 778488 librand-bb943c5a.rlib 621972 librbml-bb943c5a.rlib 1415040 librustc_back-bb943c5a.rlib 38849082 librustc-bb943c5a.rlib 12862 librustc_bitflags-bb943c5a.rlib 2331690 librustc_borrowck-bb943c5a.rlib 616880 librustc_data_structures-bb943c5a.rlib 9386582 librustc_driver-bb943c5a.rlib 9600440 librustc_front-bb943c5a.rlib 1615058 librustc_lint-bb943c5a.rlib 79218480 librustc_llvm-bb943c5a.rlib 5020974 librustc_mir-bb943c5a.rlib 3535448 librustc_platform_intrinsics-bb943c5a.rlib 603640 librustc_privacy-bb943c5a.rlib 3163628 librustc_resolve-bb943c5a.rlib 14326646 librustc_trans-bb943c5a.rlib 12033174 librustc_typeck-bb943c5a.rlib 1838202 librustc_unicode-bb943c5a.rlib 15611582 librustdoc-bb943c5a.rlib 3056280 libserialize-bb943c5a.rlib 8954312 libstd-bb943c5a.rlib 30906736 libsyntax-bb943c5a.rlib 925480 libterm-bb943c5a.rlib 1377952 libtest-bb943c5a.rlib
2015-10-01remove code for re-exports of static methodsNiko Matsakis-119/+3
2015-10-01Convert DefId to use DefIndex, which is an index into a list ofNiko Matsakis-114/+134
paths, and construct paths for all definitions. Also, stop rewriting DefIds for closures, and instead just load the closure data from the original def-id, which may be in another crate.
2015-10-01move direct accesses of `node` to go through `as_local_node_id`, unlessNiko Matsakis-25/+48
they are being used as an opaque "position identifier"
2015-10-01move job of creating local-def-ids to ast-map (with a few stragglers)Niko Matsakis-33/+38
2015-10-01move LOCAL_CRATE to cstoreNiko Matsakis-1/+2
2015-10-01kill the fake provided method stubsAriel Ben-Yehuda-13/+7
this simplifies the code while reducing the size of libcore.rlib by 3.3 MiB (~1M of which is bloat a separate patch of mine removes too), while reducing rustc memory usage on small crates by 18MiB. This also simplifies the code considerably.
2015-09-29store the rustc version in metadata and check itAriel Ben-Yehuda-0/+5
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-23Remove random Idents outside of libsyntaxVadim Petrochenkov-2/+2
2015-09-22Use Names in path fragments and MacroDefVadim Petrochenkov-1/+1
2015-09-22Use Names in HIR ItemsVadim Petrochenkov-19/+19
2015-09-16Use ast attributes every where (remove HIR attributes).Nick Cameron-77/+77
This could be a [breaking-change] if your lint or syntax extension (is that even possible?) uses HIR attributes or literals.
2015-09-03rewrite metadata indexingAriel Ben-Yehuda-87/+32
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-19/+21
2015-08-24convert to use `is_local` instead of `== LOCAL_CRATE`Niko Matsakis-1/+1
2015-08-24fallout from moving def-idNiko Matsakis-40/+39
2015-08-17Create "platform-intrinsic" ABI for SIMD/platform intrinsics.Huon Wilson-1/+1
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 #27851 - nikomatsakis:cleanup-ty-decoder, r=eddybbors-19/+11
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-14move InlinedItem into librustc, where it belongsNiko Matsakis-19/+11
2015-08-14rustc: Allow changing the default allocatorAlex Crichton-22/+26
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-10trans: Stop informing LLVM about dllexportAlex Crichton-16/+13
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-07rename ADTDef to AdtDef etc.Ariel Ben-Yehuda-12/+9
2015-08-06create VariantDef-s (but don't actually use them)Ariel Ben-Yehuda-48/+44
2015-07-28remove `get_ident` and `get_name`, make `as_str` soundOliver Schneider-20/+16
2015-07-12Auto merge of #26957 - wesleywiser:rename_connect_to_join, r=alexcrichtonbors-1/+1
Fixes #26900
2015-07-12Auto merge of #26895 - jroesch:modernize-typeck-names, r=nikomatsakisbors-2/+2
This PR modernizes some names in the type checker. The only remaining snake_case name in ty.rs is `ctxt` which should be resolved by @eddyb's pending refactor. We can bike shed over the names, it would just be nice to bring the type checker inline with modern Rust. r? @eddyb cc @nikomatsakis
2015-07-10Change some instances of .connect() to .join()Wesley Wiser-1/+1
2015-07-08trans: Link rlibs to dylibs with --whole-archiveAlex Crichton-5/+1
This commit starts passing the `--whole-archive` flag (`-force_load` on OSX) to the linker when linking rlibs into dylibs. The primary purpose of this commit is to ensure that the linker doesn't strip out objects from an archive when creating a dynamic library. Information on how this can go wrong can be found in issues #14344 and #25185. The unfortunate part about passing this flag to the linker is that we have to preprocess the rlib to remove the metadata and compressed bytecode found within. This means that creating a dylib will now take longer to link as we've got to copy around the input rlibs to a temporary location, modify them, and then invoke the linker. This isn't done for executables, however, so the "hello world" compile time is not affected. This fix was instigated because of the previous commit where rlibs may not contain multiple object files instead of one due to codegen units being greater than one. That change prevented the main distribution from being compiled with more than one codegen-unit and this commit fixes that. Closes #14344 Closes #25185
2015-07-08Remove snake_case names from ty.rsJared Roesch-2/+2
2015-06-30Actually encode default associated typesAriel Ben-Yehuda-0/+4
Fixes #26636
2015-06-26rustc: switch most remaining middle::ty functions to methods.Eduard Burtescu-27/+24