summary refs log tree commit diff
path: root/src/librustc_back
AgeCommit message (Collapse)AuthorLines
2015-10-25std: Stabilize library APIs for 1.5Alex Crichton-2/+20
This commit stabilizes and deprecates library APIs whose FCP has closed in the last cycle, specifically: Stabilized APIs: * `fs::canonicalize` * `Path::{metadata, symlink_metadata, canonicalize, read_link, read_dir, exists, is_file, is_dir}` - all moved to inherent methods from the `PathExt` trait. * `Formatter::fill` * `Formatter::width` * `Formatter::precision` * `Formatter::sign_plus` * `Formatter::sign_minus` * `Formatter::alternate` * `Formatter::sign_aware_zero_pad` * `string::ParseError` * `Utf8Error::valid_up_to` * `Iterator::{cmp, partial_cmp, eq, ne, lt, le, gt, ge}` * `<[T]>::split_{first,last}{,_mut}` * `Condvar::wait_timeout` - note that `wait_timeout_ms` is not yet deprecated but will be once 1.5 is released. * `str::{R,}MatchIndices` * `str::{r,}match_indices` * `char::from_u32_unchecked` * `VecDeque::insert` * `VecDeque::shrink_to_fit` * `VecDeque::as_slices` * `VecDeque::as_mut_slices` * `VecDeque::swap_remove_front` - (renamed from `swap_front_remove`) * `VecDeque::swap_remove_back` - (renamed from `swap_back_remove`) * `Vec::resize` * `str::slice_mut_unchecked` * `FileTypeExt` * `FileTypeExt::{is_block_device, is_char_device, is_fifo, is_socket}` * `BinaryHeap::from` - `from_vec` deprecated in favor of this * `BinaryHeap::into_vec` - plus a `Into` impl * `BinaryHeap::into_sorted_vec` Deprecated APIs * `slice::ref_slice` * `slice::mut_ref_slice` * `iter::{range_inclusive, RangeInclusive}` * `std::dynamic_lib` Closes #27706 Closes #27725 cc #27726 (align not stabilized yet) Closes #27734 Closes #27737 Closes #27742 Closes #27743 Closes #27772 Closes #27774 Closes #27777 Closes #27781 cc #27788 (a few remaining methods though) Closes #27790 Closes #27793 Closes #27796 Closes #27810 cc #28147 (not all parts stabilized)
2015-10-21Add the PNaCl/JS targets to the backend.Richard Diamond-1/+44
2015-10-13Dict -> Struct, StructDef -> VariantData, def -> dataVadim Petrochenkov-1/+1
2015-10-13Provide span for visit_struct_def + remove some dead codeVadim Petrochenkov-1/+2
2015-10-13Remove now redundant NodeId from VariantVadim Petrochenkov-4/+3
2015-09-29Fill in some missing parts in the default HIR visitorVadim Petrochenkov-15/+3
2015-09-28Auto merge of #28668 - alexcrichton:crossing-with-jemalloc, r=nrcbors-9/+9
This commit updates the compiler to not attempt to use jemalloc for platforms where jemalloc is never enabled. Currently the compiler attempts to link in jemalloc based on whether `--disable-jemalloc` was specified at build time for the compiler itself, but this is only the right decision for the host target, not for other targets. This still leaves a hole open where a set of target libraries are downloaded which were built with `--disable-jemalloc` and the compiler is unaware of that, but this is a pretty rare case so it can always be fixed later.
2015-09-26Add support for the rumprun unikernelSebastian Wicki-0/+36
For most parts, rumprun currently looks like NetBSD, as they share the same libc and drivers. However, being a unikernel, rumprun does not support process management, signals or virtual memory, so related functions might fail at runtime. Stack guards are disabled exactly for this reason. Code for rumprun is always cross-compiled, it uses always static linking and needs a custom linker.
2015-09-25rustc: Don't use jemalloc when crossing to MSVCAlex Crichton-9/+9
This commit updates the compiler to not attempt to use jemalloc for platforms where jemalloc is never enabled. Currently the compiler attempts to link in jemalloc based on whether `--disable-jemalloc` was specified at build time for the compiler itself, but this is only the right decision for the host target, not for other targets. This still leaves a hole open where a set of target libraries are downloaded which were built with `--disable-jemalloc` and the compiler is unaware of that, but this is a pretty rare case so it can always be fixed later.
2015-09-24Fix `target_vendor` for AndroidSebastian Wicki-3/+3
2015-09-24rustc: Add target_vendor for target triplesSebastian Wicki-2/+40
This adds a new target property, `target_vendor` which can be used as a matcher for conditional compilation. The vendor is part of the autoconf target triple: <arch><sub>-<vendor>-<os>-<env> The default value for `target_vendor` is "unknown". Matching against the `target_vendor` with `#[cfg]` is currently feature gated as `cfg_target_vendor`.
2015-09-22Use Names in hir::{Field, ExprMethodCall, ExprField}Vadim Petrochenkov-1/+1
2015-09-22Use Names in HIR visitors and foldersVadim Petrochenkov-5/+5
2015-09-22Auto merge of #28578 - gandro:nodefaultlibs, r=alexcrichtonbors-0/+9
This patch basically adds a target option for omitting the `-nodefaultlibs` flag when invoking the linker. I am not sure if this is the correct or only way to approach this problem, so any feedback is welcome. Motivation: I'm currently working on a Rust target specification for the [rumprun](/rumpkernel/rumprun) unikernel. rumprun is based on rump kernels and uses NetBSDs libc and drivers to provide a POSIXy environment. It provides its own linker wrapper that generates binaries which can be "baked" into a unikernel after configuration. Using `-nodefaultlibs` on the rumprun linker will prevent it from selecting the search paths for the rumprun libraries. My current target implementation for rumprun is here: gandro/rust@295744b2ee2378f41a20d4b498b8f1991a75e93c Currently, only a target that `is_like_windows` will omit the `-nodefaultlibs` flag, but since rumprun is not like Windows otherwise, I think a separate flag makes more sense. This might be a breaking change for target specifications that have the `is_like_windows` option set to true. Such targets need to set `no_default_libraries` to false in order to restore the old behavior.
2015-09-22Add `no_default_libraries` target linker optionSebastian Wicki-0/+9
If set to false, `-nodefaultlibs` is not passed to the linker. This was the default behavior on Windows, but it should be configurable per target. This is a [breaking-change] for target specifications that have the `is_like_windows` option set to true. Such targets need to set `no_default_libraries` to false in order to restore the old behavior.
2015-09-17Correctly walk import lists in AST visitorsVadim Petrochenkov-0/+4
2015-09-17Remove hir::ExprParenNick Cameron-2/+0
2015-09-16Use ast attributes every where (remove HIR attributes).Nick Cameron-1/+1
This could be a [breaking-change] if your lint or syntax extension (is that even possible?) uses HIR attributes or literals.
2015-09-14Auto merge of #28256 - petrochenkov:conv, r=alexcrichtonbors-1/+5
This patch transforms functions of the form ``` fn f<Generic: AsRef<Concrete>>(arg: Generic) { let arg: &Concrete = arg.as_ref(); // Code using arg } ``` to the next form: ``` #[inline] fn f<Generic: AsRef<Concrete>>(arg: Generic) { fn f_inner(arg: &Concrete) { // Code using arg } f_inner(arg.as_ref()); } ``` Therefore, most of the code is concrete and not duplicated during monomorphisation (unless inlined) and only the tiny bit of conversion code is duplicated. This method was mentioned by @aturon in the Conversion Traits RFC (https://github.com/rust-lang/rfcs/blame/master/text/0529-conversion-traits.md#L249) and similar techniques are not uncommon in C++ template libraries. This patch goes to the extremes and applies the transformation even to smaller functions<sup>1</sup> for purity of the experiment. *Some of them can be rolled back* if considered too ridiculous. <sup>1</sup> However who knows how small are these functions are after inlining and everything. The functions in question are mostly `fs`/`os` functions and not used especially often with variety of argument types, so the code size reduction is rather small (but consistent). Here are the sizes of stage2 artifacts before and after the patch: https://gist.github.com/petrochenkov/e76a6b280f382da13c5d https://gist.github.com/petrochenkov/6cc28727d5256dbdfed0 Note: All the `inner` functions are concrete and unavailable for cross-crate inlining, some of them may need `#[inline]` annotations in the future. r? @aturon
2015-09-10Auto merge of #28282 - DiamondLovesYou:optional-data-layout, r=alexcrichtonbors-3/+11
NFC.
2015-09-09Refactor `TargetOptions::data_layout` into an `Option`al value to reflect ↵Richard Diamond-3/+11
current usage. NFC.
2015-09-09Reduce code bloat from conversion traits in function parametersVadim Petrochenkov-1/+5
2015-09-05DragonFly: Remove -L paths from pre_link_args.Michael Neumann-2/+0
Having -L/usr/local/lib in the linking path by default interferes with an already installed version of Rust during building of Rust.
2015-09-03Use proper span for break and continue labelsSimonas Kazlauskas-2/+2
Fixes #28109
2015-09-03Add an intital HIR and lowering stepNick Cameron-61/+15
2015-08-30fixes #27124 for DragonFlyMichael Neumann-1/+1
2015-08-25Auto merge of #27957 - overminder:aug23-i686-android, r=alexcrichtonbors-0/+27
- All the libstd tests are passing in the optimized build against a Zenfone2 and the x86 Android emulator. I haven't tested the other libraries though.
2015-08-23i686-linux-android: set -mcpu to pentium4.Overmind JIANG-1/+4
To allow SSE2 to be used.
2015-08-23Auto merge of #27927 - DiamondLovesYou:no-asm, r=alexcrichtonbors-0/+4
2015-08-23New cross target: i686-linux-androidTim JIANG-0/+24
- All the libstd tests are now passing in the optimized build against a Zenfone2 and the x86 Android simulator.
2015-08-21Add a `allow_asm` option so virtual ISA based targets (JS/PNaCl/WAsm) can ↵Richard Diamond-0/+4
disallow the asm! macro.
2015-08-19rustc_back: add configure options for default linker and arMarc-Antoine Perennou-2/+2
Signed-off-by: Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
2015-08-15Add issue for the rustc_private feature everywhereAlex Crichton-1/+1
2015-08-15Auto merge of #27839 - gkoz:netbsd_ar, r=brsonbors-1/+1
NetBSD didn't get its fix for #27124 and still suffers from that issue.
2015-08-14rustc: Allow changing the default allocatorAlex Crichton-0/+22
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-14fixes #27124 for netbsdGleb Kozyrev-1/+1
NetBSD didn't get its fix for #27124 and still suffers from that issue.
2015-08-12Remove all unstable deprecated functionalityAlex Crichton-1/+0
This commit removes all unstable and deprecated functions in the standard library. A release was recently cut (1.3) which makes this a good time for some spring cleaning of the deprecated functions.
2015-08-11rollup merge of #27676: alexcrichton/msvc-unwindAlex Crichton-0/+1
This commit leverages the runtime support for DWARF exception info added in #27210 to enable unwinding by default on 64-bit MSVC. This also additionally adds a few minor fixes here and there in the test harness and such to get `make check` entirely passing on 64-bit MSVC: * The invocation of `maketest.py` now works with spaces/quotes in CC * debuginfo tests are disabled on MSVC * A link error for librustc was hacked around (see #27438)
2015-08-11rollup merge of #27672: eefriedman/ios-target-cpuAlex Crichton-2/+2
This matches the behavior of clang. See also discussion on #27307.
2015-08-11rollup merge of #27622: eefriedman/https-urlAlex Crichton-2/+2
Also fixes a few outdated links.
2015-08-11trans: Re-enable unwinding on 64-bit MSVCAlex Crichton-0/+1
This commit leverages the runtime support for DWARF exception info added in #27210 to enable unwinding by default on 64-bit MSVC. This also additionally adds a few minor fixes here and there in the test harness and such to get `make check` entirely passing on 64-bit MSVC: * The invocation of `maketest.py` now works with spaces/quotes in CC * debuginfo tests are disabled on MSVC * A link error for librustc was hacked around (see #27438)
2015-08-11Use correct target CPU for iOS simulator.Eli Friedman-2/+2
This matches the behavior of clang.
2015-08-11Rollup merge of #27647 - rust-lang:issue-27646, r=alexcrichtonManish Goregaokar-1/+1
This is in line with other targets. Closes #27646
2015-08-11Auto merge of #27518 - alexcrichton:msvc-builtin-llvm-ar, r=huonwbors-0/+1
This means that we no longer need to ship the `llvm-ar.exe` binary in the MSVC distribution, and after a snapshot we can remove a good bit of logic from the makefiles!
2015-08-10trans: Specify `archive_format` for MSVCAlex Crichton-0/+1
This means that we no longer need to ship the `llvm-ar.exe` binary in the MSVC distribution, and after a snapshot we can remove a good bit of logic from the makefiles!
2015-08-10Remove morestack supportAlex Crichton-23/+0
This commit removes all morestack support from the compiler which entails: * Segmented stacks are no longer emitted in codegen. * We no longer build or distribute libmorestack.a * The `stack_exhausted` lang item is no longer required The only current use of the segmented stack support in LLVM is to detect stack overflow. This is no longer really required, however, because we already have guard pages for all threads and registered signal handlers watching for a segfault on those pages (to print out a stack overflow message). Additionally, major platforms (aka Windows) already don't use morestack. This means that Rust is by default less likely to catch stack overflows because if a function takes up more than one page of stack space it won't hit the guard page. This is what the purpose of morestack was (to catch this case), but it's better served with stack probes which have more cross platform support and no runtime support necessary. Until LLVM supports this for all platform it looks like morestack isn't really buying us much. cc #16012 (still need stack probes) Closes #26458 (a drive-by fix to help diagnostics on stack overflow)
2015-08-10Use pentium4 for base CPU on i686-pc-windows-msvcElaine "See More" Nemo-1/+1
This is in line with other targets. Closes #27646
2015-08-09Use https URLs to refer to rust-lang.org where appropriate.Eli Friedman-2/+2
Also fixes a few outdated links.
2015-07-30Implement Win64 eh_personality natively.Vadim Chugunov-0/+7
2015-07-28remove `get_ident` and `get_name`, make `as_str` soundOliver Schneider-19/+9