summary refs log tree commit diff
path: root/src/librustc/util
AgeCommit message (Collapse)AuthorLines
2014-01-07Fixup the rest of the tests in the compilerAlex Crichton-2/+2
2014-01-06Disowned the Visitor.Eduard Burtescu-6/+6
2014-01-03librustc: Remove `@mut` support from the typechecker and borrow checkerPatrick Walton-1/+1
2014-01-03librustc: De-`@mut` the AST mapPatrick Walton-12/+20
2013-12-26librustc: Remove the unused `stmt_map` from the borrow checkerPatrick Walton-3/+0
2013-12-26librustc: Remove `ty_param_defs` from the type contextPatrick Walton-4/+3
2013-12-16librustc: Implement a `Pod` kind for types that can be `memcpy`'d.Patrick Walton-0/+2
This will be used for the new `Cell`.
2013-12-15std::vec: remove unnecessary count parameter on {bytes,Huon Wilson-6/+3
raw}::copy_memory. Slices carry their length with them, so we can just use that information.
2013-12-11Make 'self lifetime illegal.Erik Price-7/+7
Also remove all instances of 'self within the codebase. This fixes #10889.
2013-12-10Make crate hash stable and externally computable.Jack Moffitt-0/+670
This replaces the link meta attributes with a pkgid attribute and uses a hash of this as the crate hash. This makes the crate hash computable by things other than the Rust compiler. It also switches the hash function ot SHA1 since that is much more likely to be available in shell, Python, etc than SipHash. Fixes #10188, #8523.
2013-12-09Implement LTOAlex Crichton-1/+10
This commit implements LTO for rust leveraging LLVM's passes. What this means is: * When compiling an rlib, in addition to insdering foo.o into the archive, also insert foo.bc (the LLVM bytecode) of the optimized module. * When the compiler detects the -Z lto option, it will attempt to perform LTO on a staticlib or binary output. The compiler will emit an error if a dylib or rlib output is being generated. * The actual act of performing LTO is as follows: 1. Force all upstream libraries to have an rlib version available. 2. Load the bytecode of each upstream library from the rlib. 3. Link all this bytecode into the current LLVM module (just using llvm apis) 4. Run an internalization pass which internalizes all symbols except those found reachable for the local crate of compilation. 5. Run the LLVM LTO pass manager over this entire module 6a. If assembling an archive, then add all upstream rlibs into the output archive. This ignores all of the object/bitcode/metadata files rust generated and placed inside the rlibs. 6b. If linking a binary, create copies of all upstream rlibs, remove the rust-generated object-file, and then link everything as usual. As I have explained in #10741, this process is excruciatingly slow, so this is *not* turned on by default, and it is also why I have decided to hide it behind a -Z flag for now. The good news is that the binary sizes are about as small as they can be as a result of LTO, so it's definitely working. Closes #10741 Closes #10740
2013-12-08Remove dead codesKiet Tran-11/+1
2013-12-01Box Block, fn_decl, variant and Ty in the AST, as they were inflating ↵Eduard Burtescu-2/+2
critical enum sizes.
2013-11-28Register new snapshotsAlex Crichton-20/+20
2013-11-26librustc: Remove remaining uses of `&fn()` in favor of `||`.Patrick Walton-2/+2
2013-11-19librustc: Change most uses of `&fn()` to `||`.Patrick Walton-5/+5
2013-11-08Rename and modernize region enum namesNiko Matsakis-47/+47
2013-11-08Generalize AST and ty::Generics to accept multiple lifetimes.Niko Matsakis-34/+118
2013-11-04libsyntax/librustc: Allow calling variadic foreign functions.Luqman Aden-0/+4
2013-10-31librustc: Implement `|A| -> B` syntax for closures and make bare `fn`Patrick Walton-17/+37
work
2013-10-29librustc: Implement the `proc` type as sugar for `~once fn` and `proc`Patrick Walton-9/+20
notation for closures, and disable the feature gate for `once fn` if used with the `~` sigil.
2013-10-22Drop the '2' suffix from logging macrosAlex Crichton-4/+4
Who doesn't like a massive renaming?
2013-10-05auto merge of #9250 : erickt/rust/num, r=ericktbors-1/+1
This PR solves one of the pain points with c-style enums. Simplifies writing a fn to convert from an int/uint to an enum. It does this through a `#[deriving(FromPrimitive)]` syntax extension. Before this is committed though, we need to discuss if `ToPrimitive`/`FromPrimitive` has the right design (cc #4819). I've changed all the `.to_int()` and `from_int()` style functions to return `Option<int>` so we can handle partial functions. For this PR though only enums and `extra::num::bigint::*` take advantage of returning None for unrepresentable values. In the long run it'd be better if `i64.to_i8()` returned `None` if the value was too large, but I'll save this for a future PR. Closes #3868.
2013-10-04rustc: Use static strings in a few literalsblake2-ppc-1/+1
Avoid allocating extra copies of strings by using "" instead of ~"" for the debug options list and for the `time` function. This is a small change, but it is in a path that's always executed.
2013-10-02std: Replace num::IntConvertible with {To,From}PrimitiveErick Tryzelaar-1/+1
2013-10-01remove the `float` typeDaniel Micay-1/+0
It is simply defined as `f64` across every platform right now. A use case hasn't been presented for a `float` type defined as the highest precision floating point type implemented in hardware on the platform. Performance-wise, using the smallest precision correct for the use case greatly saves on cache space and allows for fitting more numbers into SSE/AVX registers. If there was a use case, this could be implemented as simply a type alias or a struct thanks to `#[cfg(...)]`. Closes #6592 The mailing list thread, for reference: https://mail.mozilla.org/pipermail/rust-dev/2013-July/004632.html
2013-09-30rustc: Remove usage of fmt!Alex Crichton-65/+65
2013-09-29Remove all usage of @ast::CrateAlex Crichton-3/+3
2013-09-26Update the compiler to not use printf/printflnAlex Crichton-1/+1
2013-09-25Move the linearly-updated flag state into the Visitor.Felix S. Klock II-16/+18
2013-09-23librustc: Remove garbage-collected functions from util/common.Patrick Walton-12/+16
2013-09-16switch Drop to `&mut self`Daniel Micay-1/+1
2013-09-15debuginfo: Basic support for trait objects.Michael Woerister-1/+1
2013-09-04auto merge of #8875 : alexcrichton/rust/fix-inner-static-library-bug, r=huonwbors-1/+2
These commits fix bugs related to identically named statics in functions of implementations in various situations. The commit messages have most of the information about what bugs are being fixed and why. As a bonus, while I was messing around with name mangling, I improved the backtraces we'll get in gdb by removing `__extensions__` for the trait/type being implemented and by adding the method name as well. Yay!
2013-09-04stop treating char as an integer typeDaniel Micay-2/+2
Closes #7609
2013-09-03Modernized a few more types in syntax::astMarvin Löbel-24/+24
2013-09-02Remove __extensions__ in names for a "pretty name"Alex Crichton-1/+2
As with the previous commit, this is targeted at removing the possibility of collisions between statics. The main use case here is when there's a type-parametric function with an inner static that's compiled as a library. Before this commit, any impl would generate a path item of "__extensions__". This changes this identifier to be a "pretty name", which is either the last element of the path of the trait implemented or the last element of the type's path that's being implemented. That doesn't quite cut it though, so the (trait, type) pair is hashed and again used to append information to the symbol. Essentially, __extensions__ was removed for something nicer for debugging, and then some more information was added to symbol name by including a hash of the trait being implemented and type it's being implemented for. This should prevent colliding names for inner statics in regular functions with similar names.
2013-09-02Renamed syntax::ast::ident -> IdentMarvin Löbel-2/+2
2013-09-01Modernized a few type names in rustc and syntaxMarvin Löbel-7/+7
2013-08-27librustc: Remove `&const` and `*const` from the language.Patrick Walton-1/+0
They are still present as part of the borrow check.
2013-08-20auto merge of #8519 : msullivan/rust/objects, r=catamorphismbors-2/+12
r?
2013-08-19auto merge of #8623 : pnkfelix/rust/fsk-visitor-vpar-defaults-step4, r=nmatsakisbors-25/+32
Follow up to #8619 (step 3 of 5). (See #8527, which was step 1 of 5, for the full outline.) Part of #7081.
2013-08-19Make supertrait methods callable on object types.Michael Sullivan-2/+12
This requires changes to method search and to codegen. We now emit a vtable for objects that includes methods from all supertraits. Closes #4100. Also, actually populate the cache for vtables, and also key it by type so that it actually works.
2013-08-19Issue #3678: Remove wrappers and call foreign functions directlyNiko Matsakis-0/+12
2013-08-15port util/common.rs from oldvisit to <V:Visitor> trait API.Felix S. Klock II-25/+32
2013-08-11typeck: Modify method resolution to use new object adjustments, andNiko Matsakis-3/+2
to favor inherent methods over extension methods. The reason to favor inherent methods is that otherwise an impl like impl Foo for @Foo { fn method(&self) { self.method() } } causes infinite recursion. The current change to favor inherent methods is rather hacky; the method resolution code is in need of a refactoring.
2013-08-06auto merge of #8313 : msullivan/rust/cleanup, r=catamorphismbors-3/+7
2013-08-06Move EnumSet into libextraSangeun Kim-324/+4
2013-08-05Updated std::Option, std::Either and std::ResultMarvin Löbel-1/+1
- Made naming schemes consistent between Option, Result and Either - Changed Options Add implementation to work like the maybe monad (return None if any of the inputs is None) - Removed duplicate Option::get and renamed all related functions to use the term `unwrap` instead
2013-08-05Improve debug spew in _match.Michael Sullivan-3/+7