summary refs log tree commit diff
path: root/src/librustc/metadata/creader.rs
AgeCommit message (Collapse)AuthorLines
2014-06-26Remove unnecessary to_string callsPiotr Jawniak-2/+2
This commit removes superfluous to_string calls from various places
2014-06-24rustc: Don't register syntax crates twiceAlex Crichton-1/+1
We only need to register them once, and once they're registered twice warnings will start being spewed or worse may happen! Closes #14330
2014-06-12Better dylib skipping based on Alex Crichton codeValerii Hiora-3/+3
2014-06-12Basic iOS supportValerii Hiora-1/+2
2014-06-09Implement #[plugin_registrar]Keegan McAllister-13/+11
See RFC 22. [breaking-change]
2014-06-05Fallout from the libcollections movementAlex Crichton-1/+1
2014-05-27std: Rename strbuf operations to stringRicho Healey-6/+6
[breaking-change]
2014-05-24core: rename strbuf::StrBuf to string::StringRicho Healey-1/+1
[breaking-change]
2014-05-22libstd: Remove `~str` from all `libstd` modules except `fmt` and `str`.Patrick Walton-5/+9
2014-05-18Include file paths when dumping the list of resolved crates via `debug!`.Felix S. Klock II-2/+7
2014-05-12librustc: Remove all uses of `~str` from librustc.Patrick Walton-10/+15
2014-05-11Reorganise driver code.Nick Cameron-5/+5
The goal of this refactoring is to make the rustc driver code easier to understand and use. Since this is as close to an API as we have, I think it is important that it is nice. On getting stuck in, I found that there wasn't as much to change as I'd hoped to make the stage... fns easier to use by tools. This patch only moves code around - mostly just moving code to different files, but a few extracted method refactorings too. To summarise the changes: I added driver::config which handles everything about configuring the compiler. driver::session now just defines and builds session objects. I moved driver code from librustc/lib.rs to librustc/driver/mod.rs so all the code is one place. I extracted methods to make emulating the compiler without being the compiler a little easier. Within the driver directory, I moved code around to more logically fit in the modules.
2014-05-08libsyntax: Remove uses of `~str` from libsyntax, and fix falloutPatrick Walton-2/+2
2014-04-23Enable use of syntax extensions when cross compiling.Douglas Young-88/+118
This adds the target triple to the crate metadata. When searching for a crate the phase (link, syntax) is taken into account. During link phase only crates matching the target triple are considered. During syntax phase, either the target or host triple will be accepted, unless the crate defines a macro_registrar, in which case only the host triple will match.
2014-04-22rustc: de-@ metadata::cstore.Eduard Burtescu-6/+6
2014-04-22rustc: de-@ some RefCell's.Eduard Burtescu-9/+4
2014-04-16rustc: Don't allocate a cnum to syntax cratesAlex Crichton-4/+11
Syntax-only crates are no longer registered with the cstore, so there's no need to allocate crate numbers to them. This ends up leaving gaps in the crate numbering scheme which is not expected in the rest of the compiler. Closes #13560
2014-04-13rustc: Don't link in syntax extensionsAlex Crichton-7/+7
This bug was introduced in #13384 by accident, and this commit continues the work of #13384 by finishing support for loading a syntax extension crate without registering it with the local cstore. Closes #13495
2014-04-10Remove some internal ~[] from several libraries.Huon Wilson-2/+2
Some straggling instances of `~[]` across a few different libs. Also, remove some public ones from workcache.
2014-04-08rustc: Never register syntax crates in CStoreAlex Crichton-34/+45
When linking, all crates in the local CStore are used to link the final product. With #[phase(syntax)], crates want to be omitted from this linkage phase, and this was achieved by dumping the entire CStore after loading crates. This causes crates like the standard library to get loaded twice. This loading process is a fairly expensive operation when dealing with decompressing metadata. This commit alters the loading process to never register syntax crates in CStore. Instead, only phase(link) crates ever make their way into the map of crates. The CrateLoader trait was altered to return everything in one method instead of having separate methods for finding information.
2014-04-08rustc: Use CStore, not a separate crate cacheAlex Crichton-70/+49
This separate crate cache is one factor which is causing libstd to be loaded twice during normal compilation. The crates loaded for syntax extensions have a separate cache than the crates loaded for linking, so all crates are loaded once per #[phase] they're tagged with. This removes the cache and instead uses the CStore structure itself as the cache for loaded crates. This should allow crates loaded during the syntax phase to be shared with the crates loaded during the link phase.
2014-04-04auto merge of #13284 : pnkfelix/rust/more-fs-info-on-crate-mismatch, ↵bors-18/+26
r=alexcrichton Fix #13266. There is a little bit of acrobatics in the definition of `crate_paths` to avoid calling `clone()` on the dylib/rlib unless we actually are going to need them. The other oddity is that I have replaced the `root_ident: Option<&str>` parameter with a `root: &Option<CratePaths>`, which may surprise one who was expecting to see something like: `root: Option<&CratePaths>`. I went with the approach here because I could not come up with code for the alternative that was acceptable to the borrow checker.
2014-04-05Accumulate list of paths for crate hash mismatch.Felix S. Klock II-1/+1
(i.e. semi-generalized version of prior errorinfo gathering.) Also revised presentation to put each path on its own line, prefixed by file:linenum information.
2014-04-03syntax: Remove AbiSet, use one AbiAlex Crichton-1/+1
This change removes the AbiSet from the AST, converting all usage to have just one Abi value. The current scheme selects a relevant ABI given a list of ABIs based on the target architecture and how relevant each ABI is to that architecture. Instead of this mildly complicated scheme, only one ABI will be allowed in abi strings, and pseudo-abis will be created for special cases as necessary. For example the "system" abi exists for stdcall on win32 and C on win64. Closes #10049
2014-04-03After a hash mismatch error, emit file-system paths of crates involved.Felix S. Klock II-18/+26
Fix #13266. There is a little bit of acrobatics in the definition of `crate_paths` to avoid calling `clone()` on the dylib/rlib unless we actually are going to need them. The other oddity is that I have replaced the `root_ident: Option<&str>` parameter with a `root: &Option<CratePaths>`, which may surprise one who was expecting to see something like: `root: Option<&CratePaths>`. I went with the approach here because I could not come up with code for the alternative that was acceptable to the borrow checker.
2014-03-31rustc: Switch field privacy as necessaryAlex Crichton-1/+1
2014-03-28auto merge of #13170 : eddyb/rust/syntax-cleanup, r=alexcrichtonbors-3/+4
Removes all Cell's/RefCell's from lexer::Reader implementations and a couple @.
2014-03-28Convert most code to new inner attribute syntax.Brian Anderson-1/+1
Closes #2569
2014-03-28De-@ IdentInterner.Eduard Burtescu-3/+4
2014-03-23iter: remove `to_owned_vec`Daniel Micay-2/+2
This needs to be removed as part of removing `~[T]`. Partial type hints are now allowed, and will remove the need to add a version of this method for `Vec<T>`. For now, this involves a few workarounds for partial type hints not completely working.
2014-03-22rustc: Fix fallout of removing get()Alex Crichton-14/+9
2014-03-20Removing imports of std::vec_ng::VecAlex Crichton-1/+0
It's now in the prelude.
2014-03-20rename std::vec_ng -> std::vecDaniel Micay-1/+1
Closes #12771
2014-03-17De-@ codemap and diagnostic.Eduard Burtescu-1/+1
2014-03-17De-@ CStore uses.Eduard Burtescu-18/+11
2014-03-17De-@ Session usage.Eduard Burtescu-21/+12
2014-03-08librustc: Fix up fallout from the automatic conversion.Felix S. Klock II-3/+5
2014-03-08librustc: Automatically change uses of `~[T]` to `Vec<T>` in rustc.Patrick Walton-3/+3
2014-03-07rename ast::ViewItemExternMod to ast::ViewItemExternCrate, and ↵Liigo Zhuang-1/+1
clean::ExternMod to clean::ExternCrate
2014-03-01librustc: Fix errors arising from the automated `~[T]` conversionPatrick Walton-3/+5
2014-02-28rustc: Add the concept of a Strict Version HashAlex Crichton-12/+18
This new SVH is used to uniquely identify all crates as a snapshot in time of their ABI/API/publicly reachable state. This current calculation is just a hash of the entire crate's AST. This is obviously incorrect, but it is currently the reality for today. This change threads through the new Svh structure which originates from crate dependencies. The concept of crate id hash is preserved to provide efficient matching on filenames for crate loading. The inspected hash once crate metadata is opened has been changed to use the new Svh. The goal of this hash is to identify when upstream crates have changed but downstream crates have not been recompiled. This will prevent the def-id drift problem where upstream crates were recompiled, thereby changing their metadata, but downstream crates were not recompiled. In the future this hash can be expanded to exclude contents of the AST like doc comments, but limitations in the compiler prevent this change from being made at this time. Closes #10207
2014-02-28rustc: Simplify crate loading constraintsAlex Crichton-134/+94
The previous code passed around a {name,version} pair everywhere, but this is better expressed as a CrateId. This patch changes these paths to store and pass around crate ids instead of these pairs of name/version. This also prepares the code to change the type of hash that is stored in crates.
2014-02-23Move std::{trie, hashmap} to libcollectionsAlex Crichton-1/+1
These two containers are indeed collections, so their place is in libcollections, not in libstd. There will always be a hash map as part of the standard distribution of Rust, but by moving it out of the standard library it makes libstd that much more portable to more platforms and environments. This conveniently also removes the stuttering of 'std::hashmap::HashMap', although 'collections::HashMap' is only one character shorter.
2014-02-21Changed NonCamelCaseTypes lint to warn by defaultmr.Shu-1/+3
Added allow(non_camel_case_types) to librustc where necesary Tried to fix problems with non_camel_case_types outside rustc fixed failing tests Docs updated Moved #[allow(non_camel_case_types)] a level higher. markdown.rs reverted Fixed timer that was failing tests Fixed another timer
2014-02-17Updated metadata::creader::resolve_crate_deps to use the correct span. ↵gentlefolk-8/+21
Clarified error message when an external crate's dependency is missing. Closes #2404.
2014-02-14extern mod => extern crateAlex Crichton-1/+1
This was previously implemented, and it just needed a snapshot to go through
2014-02-14Refactored ast_map and friends, mainly to have Paths without storing them.Eduard Burtescu-14/+14
2014-02-13Replace `crate` usage with `krate`Flavio Percoco-6/+6
This patch replaces all `crate` usage with `krate` before introducing the new keyword. This ensures that after introducing the keyword, there won't be any compilation errors. krate might not be the most expressive substitution for crate but it's a very close abbreviation for it. `module` was already used in several places already.
2014-02-02librustc: Remove a bunch of `@str` from the compiler around metadataPatrick Walton-30/+45
handling
2014-02-02librustc: Fix merge fallout.Patrick Walton-4/+4