about summary refs log tree commit diff
path: root/src/librustc_trans
AgeCommit message (Collapse)AuthorLines
2015-01-21rollup merge of #20179: eddyb/blind-itemsAlex Crichton-114/+104
Conflicts: src/librustc/diagnostics.rs src/librustdoc/clean/mod.rs src/librustdoc/html/format.rs src/libsyntax/parse/parser.rs
2015-01-21rollup merge of #21258: aturon/stab-3-indexAlex Crichton-8/+7
Conflicts: src/libcore/ops.rs src/librustc_typeck/astconv.rs src/libstd/io/mem.rs src/libsyntax/parse/lexer/mod.rs
2015-01-21rollup merge of #20642: michaelwoerister/sane-source-locations-pt1Alex Crichton-405/+889
Conflicts: src/librustc_trans/trans/debuginfo.rs
2015-01-21rollup merge of #21457: alexcrichton/issue-21436Alex Crichton-10/+10
Conflicts: src/liballoc/boxed.rs src/librustc/middle/traits/error_reporting.rs src/libstd/sync/mpsc/mod.rs
2015-01-21rollup merge of #21444: petrochenkov/nullAlex Crichton-2/+3
Conflicts: src/libstd/sync/mpsc/select.rs
2015-01-21rollup merge of #21396: japaric/no-parens-in-rangeAlex Crichton-9/+9
Conflicts: src/libsyntax/parse/lexer/comments.rs
2015-01-21rollup merge of #21372: arielb1/remove-the-boxAlex Crichton-381/+8
It is not used anymore
2015-01-21rollup merge of #21340: pshc/libsyntax-no-more-intsAlex Crichton-10/+10
Collaboration with @rylev! I didn't change `int` in the [quasi-quoter](https://github.com/pshc/rust/blob/99ae1a30f3ca28c0f7e431620560d30e44627124/src/libsyntax/ext/quote.rs#L328), because I'm not sure if there will be adverse effects. Addresses #21095.
2015-01-21rollup merge of #21333: stepancheg/trans-write-diagAlex Crichton-3/+3
File cannot be written, for example, if directory does not exist. Before this commit: ``` % rustc -o nonexistent/program program.rs error: could not write output: No such file or directory ``` With this commit: ``` % rustc -o nonexistent/program program.rs error: could not write output to nonexistent/program.0.o: No such file or directory ``` This is useful when full rust command is not displayed, or when last error is followed by thousands of warnings.
2015-01-21Fallout from stabilization.Aaron Turon-8/+7
2015-01-21rustc_trans: fix fallout of merging ast::ViewItem into ast::Item.Eduard Burtescu-114/+104
2015-01-21debuginfo: Make debuginfo source location assignment more stable (Pt. 1)Michael Woerister-405/+889
So far, the source location an LLVM instruction was linked to was controlled by `debuginfo::set_source_location()` and `debuginfo::clear_source_location()`. This interface mimicked how LLVM's `IRBuilder` handles debug location assignment. While this interface has some theoretical performance benefits, it also makes things terribly unstable: One sets some quasi-global state and then hopes that it is still correct when a given instruction is emitted---an assumption that has been proven to not hold a bit too often. This patch requires the debug source location to be passed to the actual instruction emitting function. This makes source location assignment explicit and will prevent future changes to `trans` from accidentally breaking things in the majority of cases. This patch does not yet implement the new principle for all instruction kinds but the stepping experience should have improved significantly nonetheless already.
2015-01-20std: Rename Show/String to Debug/DisplayAlex Crichton-10/+10
This commit is an implementation of [RFC 565][rfc] which is a stabilization of the `std::fmt` module and the implementations of various formatting traits. Specifically, the following changes were performed: [rfc]: https://github.com/rust-lang/rfcs/blob/master/text/0565-show-string-guidelines.md * The `Show` trait is now deprecated, it was renamed to `Debug` * The `String` trait is now deprecated, it was renamed to `Display` * Many `Debug` and `Display` implementations were audited in accordance with the RFC and audited implementations now have the `#[stable]` attribute * Integers and floats no longer print a suffix * Smart pointers no longer print details that they are a smart pointer * Paths with `Debug` are now quoted and escape characters * The `unwrap` methods on `Result` now require `Display` instead of `Debug` * The `Error` trait no longer has a `detail` method and now requires that `Display` must be implemented. With the loss of `String`, this has moved into libcore. * `impl<E: Error> FromError<E> for Box<Error>` now exists * `derive(Show)` has been renamed to `derive(Debug)`. This is not currently warned about due to warnings being emitted on stage1+ While backwards compatibility is attempted to be maintained with a blanket implementation of `Display` for the old `String` trait (and the same for `Show`/`Debug`) this is still a breaking change due to primitives no longer implementing `String` as well as modifications such as `unwrap` and the `Error` trait. Most code is fairly straightforward to update with a rename or tweaks of method calls. [breaking-change] Closes #21436
2015-01-21Rollup merge of #21375 - petrochenkov:ssbsl, r=alexcrichtonBarosl LEE-1/+1
After PR #19766 added implicit coersions `*mut T -> *const T`, the explicit casts can be removed. (The number of such casts turned out to be relatively small).
2015-01-19Auto merge of #21165 - alexcrichton:second-pass-type-id, r=aturonbors-2/+0
This commit aims to stabilize the `TypeId` abstraction by moving it out of the `intrinsics` module into the `any` module of the standard library. Specifically, * `TypeId` is now defined at `std::any::TypeId` * `TypeId::hash` has been removed in favor of an implementation of `Hash`. This commit also performs a final pass over the `any` module, confirming the following: * `Any::get_type_id` remains unstable as *usage* of the `Any` trait will likely never require this, and the `Any` trait does not need to be implemented for any other types. As a result, this implementation detail can remain unstable until associated statics are implemented. * `Any::downcast_ref` is now stable * `Any::downcast_mut` is now stable * `BoxAny` remains unstable. While a direct impl on `Box<Any>` is allowed today it does not allow downcasting of trait objects like `Box<Any + Send>` (those returned from `Thread::join`). This is covered by #18737. * `BoxAny::downcast` is now stable.
2015-01-20Remove onceness & bounds - they don't do anything.Ariel Ben-Yehuda-18/+1
2015-01-20Kill TraitStoreAriel Ben-Yehuda-363/+7
2015-01-19remove unnecessary parentheses from range notationJorge Aparicio-9/+9
2015-01-19Auto merge of #21269 - alexcrichton:issue-6936, r=pnkfelixbors-44/+44
This commit modifies resolve to prevent conflicts with typedef names in the same method that conflits are prevented with enum names. This is a breaking change due to the differing semantics in resolve, and any errors generated on behalf of this change require that a conflicting typedef, module, or structure to be renamed so they do not conflict. [breaking-change] Closes #6936
2015-01-19Auto merge of #21282 - Aatch:init-memzero, r=alexcrichtonbors-5/+4
LLVM gets overwhelmed when presented with a zeroinitializer for a large type. In unoptimised builds, it generates a long sequence of stores to memory. In optmised builds, it manages to generate a standard memset of zero values, but takes a long time doing so. Call out to the `llvm.memset` function to zero out the memory instead. Fixes #21264
2015-01-19Replace `0 as *const/mut T` with `ptr::null/null_mut()`we-2/+3
2015-01-18std: Stabilize TypeId and tweak BoxAnyAlex Crichton-2/+0
This commit aims to stabilize the `TypeId` abstraction by moving it out of the `intrinsics` module into the `any` module of the standard library. Specifically, * `TypeId` is now defined at `std::any::TypeId` * `TypeId::hash` has been removed in favor of an implementation of `Hash`. This commit also performs a final pass over the `any` module, confirming the following: * `Any::get_type_id` remains unstable as *usage* of the `Any` trait will likely never require this, and the `Any` trait does not need to be implemented for any other types. As a result, this implementation detail can remain unstable until associated statics are implemented. * `Any::downcast_ref` is now stable * `Any::downcast_mut` is now stable * `BoxAny` remains unstable. While a direct impl on `Box<Any>` is allowed today it does not allow downcasting of trait objects like `Box<Any + Send>` (those returned from `Thread::join`). This is covered by #18737. * `BoxAny::downcast` is now stable.
2015-01-18Fix typedef/module name conflicts in the compilerAlex Crichton-44/+44
2015-01-19Add test to catch performance regressionsJames Miller-1/+1
2015-01-19Use `zero_mem` instead of a zerointializer for `init` intrinsicJames Miller-5/+4
LLVM gets overwhelmed when presented with a zeroinitializer for a large type. In unoptimised builds, it generates a long sequence of stores to memory. In optmised builds, it manages to generate a standard memset of zero values, but takes a long time doing so. Call out to the `llvm.memset` function to zero out the memory instead.
2015-01-18Make output type in ast::FnDecl optionalSeo Sanghyeon-15/+11
2015-01-17libsyntax: rename functions from uint to usizePaul Collier-10/+10
2015-01-17Set allow(unstable) in crates that use unstable featuresBrian Anderson-0/+1
Lets them build with the -dev, -nightly, or snapshot compiler
2015-01-18rustc: print filename if file cannot be writtenStepan Koltsov-3/+3
File cannot be written, for example, if directory does not exist. Before this commit: ``` % rustc -o nonexistent/program program.rs error: could not write output: No such file or directory ``` With this commit: ``` % rustc -o nonexistent/program program.rs error: could not write output to nonexistent/program.0.o: No such file or directory ``` This is useful when full rust command is not displayed, or when last error is preceded by thousands of warnings.
2015-01-17auto merge of #21233 : huonw/rust/simd-size, r=Aatchbors-113/+214
This stops the compiler ICEing on the use of SIMD types in FFI signatures. It emits correct code for LLVM intrinsics, but I am quite unsure about the ABI handling in general so I've added a new feature gate `simd_ffi` to try to ensure people don't use it without realising there's a non-trivial risk of codegen brokenness. Closes #20043.
2015-01-17Remove unnecessary explicit conversions to *const Twe-1/+1
2015-01-17Feature gate SIMD in FFI, due to unknown ABIs.Huon Wilson-1/+33
I don't know if this handling of SIMD types is correct for the C ABI on all platforms, so lets add an even finer feature gate than just the `simd` one. The `simd` one can be used with (relatively) little risk of complete nonsense, the reason for it is that it is likely that things will change. Using the types in FFI with an incorrect ABI will at best give absolute nonsense results, but possibly cause serious breakage too, so this is a step up in badness, hence a new feature gate.
2015-01-16auto merge of #21113 : alexcrichton/rust/plug-a-hole, r=brsonbors-4/+4
With the addition of separate search paths to the compiler, it was intended that applications such as Cargo could require a `--extern` flag per `extern crate` directive in the source. The system can currently be subverted, however, due to the `existing_match()` logic in the crate loader. When loading crates we first attempt to match an `extern crate` directive against all previously loaded crates to avoid reading metadata twice. This "hit the cache if possible" step was erroneously leaking crates across the search path boundaries, however. For example: extern crate b; extern crate a; If `b` depends on `a`, then it will load crate `a` when the `extern crate b` directive is being processed. When the compiler reaches `extern crate a` it will use the previously loaded version no matter what. If the compiler was not invoked with `-L crate=path/to/a`, it will still succeed. This behavior is allowing `extern crate` declarations in Cargo without a corresponding declaration in the manifest of a dependency, which is considered a bug. This commit fixes this problem by keeping track of the origin search path for a crate. Crates loaded from the dependency search path are not candidates for crates which are loaded from the crate search path.
2015-01-16rustc: Fix a leak in dependency= pathsAlex Crichton-4/+4
With the addition of separate search paths to the compiler, it was intended that applications such as Cargo could require a `--extern` flag per `extern crate` directive in the source. The system can currently be subverted, however, due to the `existing_match()` logic in the crate loader. When loading crates we first attempt to match an `extern crate` directive against all previously loaded crates to avoid reading metadata twice. This "hit the cache if possible" step was erroneously leaking crates across the search path boundaries, however. For example: extern crate b; extern crate a; If `b` depends on `a`, then it will load crate `a` when the `extern crate b` directive is being processed. When the compiler reaches `extern crate a` it will use the previously loaded version no matter what. If the compiler was not invoked with `-L crate=path/to/a`, it will still succeed. This behavior is allowing `extern crate` declarations in Cargo without a corresponding declaration in the manifest of a dependency, which is considered a bug. This commit fixes this problem by keeping track of the origin search path for a crate. Crates loaded from the dependency search path are not candidates for crates which are loaded from the crate search path. As a result of this fix, this is a likely a breaking change for a number of Cargo packages. If the compiler starts informing that a crate can no longer be found, it likely means that the dependency was forgotten in your Cargo.toml. [breaking-change]
2015-01-16Put vector types in regs for arm & mips FFI.Huon Wilson-3/+6
This seems to match what clang does on arm, but I cannot do any experimentation with mips, but it matches how the LLVM intrinsics are defined in any case...
2015-01-16Support SSE with integer types in x86-64 FFI.Huon Wilson-10/+10
Unlike the intrinics in C, this types the SSE values base on integer size. This matches the LLVM intrinsics which have concrete vector types (`<4 x i32>` etc.), and is no loss of expressivity: if one is using a C function that really takes an untyped integral SSE value, just give it whatever Rust type makes most sense.
2015-01-16Add `Type::int_width` for retrieving integer's bit width.Huon Wilson-77/+41
2015-01-16Support SSE types in extern {} better.Huon Wilson-10/+102
This seems to work on x86-64, but I am not able to test on other platforms. cc #20043
2015-01-16Merge pull request #21181 from nick29581/save-fixbors-19/+36
Two minor fixes for save-analysis Reviewed-by: huonw
2015-01-15rollup merge of #21197: michaelwoerister/linestablesonly-forloopAlex Crichton-31/+23
Fixes #21067.
2015-01-15rollup merge of #21191: Zoxc/ltoAlex Crichton-0/+3
Fixes #21184
2015-01-15rollup merge of #21170: Diggsey/issue-21058Alex Crichton-5/+10
While it's unstable and will probably be replaced or "reformed" at some point, it's useful in the mean time to be able to introspect the type system when debugging, and not be limited to sized types. Fixes #21058
2015-01-15rollup merge of #21115: dotdash/iter_vecAlex Crichton-44/+6
There are two places left where we used to only know the byte size of/offset into an array and had to cast to i8 and back to get the right addresses. But by now, we always know the sizes in terms of the number of elements in the array. In fact we have to add an extra Mul instruction so we can use the weird cast-to-u8 code. So we should really just embrace our new knowledge and use simple GEPs to do the address calculations. Fixes #3729
2015-01-15rollup merge of #21107: nikomatsakis/assoc-type-ice-hunt-take-1Alex Crichton-62/+29
Fixes for #20831 and #21010 r? @nick29581
2015-01-15rollup merge of #21089: nikomatsakis/issue-20676-invalid-vtable-for-objectAlex Crichton-3/+14
Support UFCS style calls to a method defined in `Trait` where `Self` is bound to a trait object. Fixes #20676. r? @alexcrichton
2015-01-15rustc: implement fully qualified UFCS expressions.Eduard Burtescu-5/+11
2015-01-15syntax: add fully qualified UFCS expressions.Eduard Burtescu-7/+11
2015-01-15debuginfo: Fix ICE when compiling for-loops with lines-tables-only.Michael Woerister-31/+23
2015-01-15Disable -C lto optimizations on opt_level=0John Kåre Alsaker-0/+3
Fixes #21184
2015-01-15Allow get_tydesc intrinsic to accept unsized typesDiggory Blake-5/+10
Fix tabs Added missing ty_str cases when generating type descriptions Reduce code duplication and improve test