about summary refs log tree commit diff
path: root/src/librustc_back
AgeCommit message (Collapse)AuthorLines
2015-11-25Remove all uses of `#[staged_api]`Vadim Petrochenkov-1/+1
2015-11-18Various straight-forward ports that override `visit_nested_items`Niko Matsakis-32/+37
to do "in-situ" visits.
2015-11-18Expose archive_format to target specificationsJohn Kåre Alsaker-0/+1
2015-11-04target_family configurationarcnmx-0/+4
2015-11-03Auto merge of #29285 - eefriedman:libsyntax-panic, r=nrcbors-2/+4
A set of commits which pushes some panics out of core parser methods, and into users of those parser methods.
2015-11-01Auto merge of #29471 - pierzchalski:custom-target-custom-unwind-json, ↵bors-0/+1
r=alexcrichton
2015-11-01Auto merge of #29177 - vadimcn:rtstuff, r=alexcrichtonbors-23/+46
Note: for now, this change only affects `-windows-gnu` builds. So why was this `libgcc` dylib dependency needed in the first place? The stack unwinder needs to know about locations of unwind tables of all the modules loaded in the current process. The easiest portable way of achieving this is to have each module register itself with the unwinder when loaded into the process. All modules compiled by GCC do this by calling the __register_frame_info() in their startup code (that's `crtbegin.o` and `crtend.o`, which are automatically linked into any gcc output). Another important piece is that there should be only one copy of the unwinder (and thus unwind tables registry) in the process. This pretty much means that the unwinder must be in a shared library (unless everything is statically linked). Now, Rust compiler tries very hard to make sure that any given Rust crate appears in the final output just once. So if we link the unwinder statically to one of Rust's crates, everything should be fine. Unfortunately, GCC startup objects are built under assumption that `libgcc` is the one true place for the unwind info registry, so I couldn't find any better way than to replace them. So out go `crtbegin`/`crtend`, in come `rsbegin`/`rsend`! A side benefit of this change is that rustc is now more in control of the command line that goes to the linker, so we could stop using `gcc` as the linker driver and just invoke `ld` directly.
2015-10-30Add JSON parser rule for custom_unwind_resume.pierzchalski-0/+1
2015-10-27Make fatal errors more consistent.Eli Friedman-2/+4
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-23Drop `advapi32` and `shell32` from late_link_args.Vadim Chugunov-2/+0
2015-10-21Add the PNaCl/JS targets to the backend.Richard Diamond-1/+44
2015-10-21Moar comments.Vadim Chugunov-3/+3
2015-10-19Don't use GCC's startup objects (crtbegin.o/crtend.o); build and use our own ↵Vadim Chugunov-23/+48
(for now on for -windows-gnu target only). Since it isn't possible to disable linkage of just GCC startup objects, we now need logic for finding libc installation directory and copying the required startup files (e.g. crt2.o) to rustlib directory. Bonus change: use the `-nodefaultlibs` flag on Windows, thus paving the way to direct linker invocation.
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)