about summary refs log tree commit diff
path: root/src/librustc_trans
AgeCommit message (Collapse)AuthorLines
2018-01-24llvm6: CodeModel::{JIT,}Default no longer existsAlex Crichton-15/+17
LLVM has since removed the `CodeModel::Default` enum value in favor of an `Optional` implementationg throughout LLVM. Let's mirror the same change in Rust and update the various bindings we call accordingly. Removed in llvm-mirror/llvm@9aafb854c
2018-01-23Auto merge of #45337 - Zoxc:gen-static, r=nikomatsakisbors-0/+1
Immovable generators This adds support for immovable generators which allow you to borrow local values inside generator across suspension points. These are declared using a `static` keyword: ```rust let mut generator = static || { let local = &Vec::new(); yield; local.push(0i8); }; generator.resume(); // ERROR moving the generator after it has resumed would invalidate the interior reference // drop(generator); ``` Region inference is no longer affected by the types stored in generators so the regions inside should be similar to other code (and unaffected by the presence of `yield` expressions). The borrow checker is extended to pick up the slack so interior references still result in errors for movable generators. This fixes #44197, #45259 and #45093. This PR depends on [PR #44917 (immovable types)](https://github.com/rust-lang/rust/pull/44917), I suggest potential reviewers ignore the first commit as it adds immovable types.
2018-01-23rustc: Add `-C lto=val` optionAlex Crichton-66/+80
This commit primarily adds the ability to control what kind of LTO happens when rustc performs LTO, namely allowing values to be specified to the `-C lto` option, such as `-C lto=thin` and `-C lto=fat`. (where "fat" is the previous kind of LTO, throw everything in one giant module) Along the way this also refactors a number of fields which store information about whether LTO/ThinLTO are enabled to unify them all into one field through which everything is dispatched, hopefully removing a number of special cases throughout. This is intended to help mitigate #47409 but will require a backport as well, and this would unfortunately need to be an otherwise insta-stable option.
2018-01-23Let LLVM 5 add DW_OP_deref to indirect args itselfJosh Stone-7/+9
We needed to manually added the `DW_OP_deref` ourselves in earlier LLVM, but starting with [D31439] in LLVM 5, it appears that LLVM will always handle this itself. When we were still adding this manually, the resulting `.debug_loc` had too many derefs, and this failed test `debuginfo/by-value-self-argument-in-trait-impl.rs`. [D31439]: https://reviews.llvm.org/D31439 Fixes #47611. cc @alexcrichton r? @michaelwoerister
2018-01-23Rollup merge of #47610 - cuviper:captured-dwarf, r=eddybkennytm-1/+1
LLVM5: Update DW_OP_plus to DW_OP_plus_uconst LLVM <= 4.0 used a non-standard interpretation of `DW_OP_plus`. In the DWARF standard, this adds two items on the expressions stack. LLVM's behavior was more like DWARF's `DW_OP_plus_uconst` -- adding a constant that follows the op. The patch series starting with [D33892] switched to the standard DWARF interpretation, so we need to follow. [D33892]: https://reviews.llvm.org/D33892 Fixes #47464 r? @eddyb
2018-01-23Rollup merge of #47541 - psumbera:master, r=eddybkennytm-1/+6
Fixes sparc64 cabi fixes. Argument up to 16 bytes size is provided in registers. Return value up to 32 bytes size is stored in registers. Fixes: #46679 --- Firefox now (almost) build on sparc. Original rust issue seems to be gone. Note that I'm not rust expert and the fix was suggested in bug.
2018-01-23Adds support for immovable generators. Move checking of invalid borrows ↵John Kåre Alsaker-0/+1
across suspension points to borrowck. Fixes #44197, #45259 and #45093.
2018-01-21rustc: Lower link args to `@`-files on Windows moreAlex Crichton-32/+78
When spawning a linker rustc has historically been known to blow OS limits for the command line being too large, notably on Windows. This is especially true of incremental compilation where there can be dozens of object files per compilation. The compiler currently has logic for detecting a failure to spawn and instead passing arguments via a file instead, but this failure detection only triggers if a process actually fails to spawn. Unfortunately on Windows we've got something else to worry about which is `cmd.exe`. The compiler may be running a linker through `cmd.exe` where `cmd.exe` has a limit of 8192 on the command line vs 32k on `CreateProcess`. Moreso rustc actually succeeds in spawning `cmd.exe` today, it's just that after it's running `cmd.exe` fails to spawn its child, which rustc doesn't currently detect. Consequently this commit updates the logic for the spawning the linker on Windows to instead have a heuristic to see if we need to pass arguments via a file. This heuristic is an overly pessimistic and "inaccurate" calculation which just calls `len` on a bunch of `OsString` instances (where `len` is not precisely the length in u16 elements). This number, when exceeding the 6k threshold, will force rustc to always pass arguments through a file. This strategy should avoid us trying to parse the output on Windows of the linker to see if it successfully spawned yet failed to actually sub-spawn the linker. We may just be passing arguments through files a little more commonly now... The motivation for this commit was a recent bug in Gecko [1] when beta testing, notably when incremental compilation was enabled it blew out the limit on `cmd.exe`. This commit will also fix #46999 as well though as emscripten uses a bat script as well (and we're blowing the limit there). [1]: https://bugzilla.mozilla.org/show_bug.cgi?id=1430886 Closes #46999
2018-01-21rustc_trans: remove an unwrap by replacing a bool with Result.Eduard-Mihai Burtescu-26/+30
2018-01-20Teach rustc about DW_AT_noreturn and a few more DIFlagsA.J. Gardner-0/+3
2018-01-19Update DW_OP_plus to DW_OP_plus_uconstJosh Stone-1/+1
LLVM <= 4.0 used a non-standard interpretation of `DW_OP_plus`. In the DWARF standard, this adds two items on the expressions stack. LLVM's behavior was more like DWARF's `DW_OP_plus_uconst` -- adding a constant that follows the op. The patch series starting with [D33892] switched to the standard DWARF interpretation, so we need to follow. [D33892]: https://reviews.llvm.org/D33892
2018-01-19Hopefully fix the 32bit SEGVbjorn3-1/+1
2018-01-19Fix review commentsbjorn3-2/+5
2018-01-19Hot plug rustc_transbjorn3-0/+3
2018-01-19Hide even more of rustc_transbjorn3-31/+31
2018-01-19Hide more stuff from rustc_transbjorn3-21/+21
2018-01-19Allow runtime switching between trans backendsbjorn3-801/+107
2018-01-19Auto merge of #47494 - michaelwoerister:proc-macro-incremental, r=nikomatsakisbors-6/+3
Don't include DefIndex in proc-macro registrar function symbol. There can only ever be one registrar function per plugin or proc-macro crate, so adding the `DefIndex` to the function's symbol name does not serve a real purpose. Remove the `DefIndex` from the symbol name makes it stable across incremental compilation sessions. This should fix issue #47292.
2018-01-19Auto merge of #47401 - rkruppe:issue-47278, r=eddybbors-3/+3
Compute LLVM argument indices correctly in face of padding Closes #47278 r? @eddyb
2018-01-19Update comments about the partitioning inefficiencyvarkor-3/+1
2018-01-19Refactor CodegenUnit size estimatesvarkor-2/+2
2018-01-18Removed uneeded argument to make_indirect.Petr Sumbera-1/+1
2018-01-18Removed uneeded change.Petr Sumbera-1/+1
2018-01-18Fixes sparc64 cabi fixes.Petr Sumbera-2/+7
Argument up to 16 bytes size is provided in registers. Return value up to 32 bytes size is stored in registers. Fixes: #46679
2018-01-18Rollup merge of #47514 - gnzlbg:whitelist_x86_fxsr, r=rkruppekennytm-1/+2
whitelist x86 fxsr feature https://github.com/rust-lang/rust/pull/47223 properly checks that only white-listed features are allowed in combination with `target_feature`, but the `fxsr` feature used by `stdsimd` was not white-listed. r? @alexcrichton
2018-01-18Rollup merge of #47505 - alexcrichton:fix-bat-spawn-regression, r=estebankkennytm-6/+7
rustc: Spawn `cmd /c` for `.bat` scripts This fixes an accidental regression #46335 where the behavior of `Path::ends_with` is different from `str::ends_with` (paths operate over components, strs operate over chars).
2018-01-18Rollup merge of #47302 - andjo403:commentfix, r=michaelwoeristerkennytm-9/+4
fix faulty comment after #43506 there is no fixed number of request sent.
2018-01-17whitelist x86 fxsr featuregnzlbg-1/+2
2018-01-16rustc: Spawn `cmd /c` for `.bat` scriptsAlex Crichton-6/+7
This fixes an accidental regression #46335 where the behavior of `Path::ends_with` is different from `str::ends_with` (paths operate over components, strs operate over chars).
2018-01-16Don't include DefIndex in plugin- and proc-macro registrar fn symbol.Michael Woerister-6/+3
2018-01-16rustc_trans: take into account primitives larger than 8 bytes.Eduard-Mihai Burtescu-55/+43
2018-01-16rustc_trans: ignore trailing padding larger than 8 bytes.Eduard-Mihai Burtescu-6/+6
2018-01-16Compute LLVM argument indices correctly in face of paddingRobin Kruppe-3/+3
Closes #47278
2018-01-15Fix no_integrated_as option to work with new codegen architecture.Vadzim Dambrouski-52/+58
Old implementation called the assembler once per crate, but we need to call it for each object file instead, because a single crate can now have more than one object file. This patch fixes issue #45836 (Can't compile core for msp430 in release mode)
2018-01-14rustc_trans: rename mircx: MirContext to fx: FunctionCx.Eduard-Mihai Burtescu-58/+58
2018-01-14rustc_trans: rename bcx to bx.Eduard-Mihai Burtescu-906/+906
2018-01-14rustc_trans: rename ccx to cx.Eduard-Mihai Burtescu-1193/+1193
2018-01-14rustc_trans: rename CrateContext to CodegenCx.Eduard-Mihai Burtescu-273/+273
2018-01-14rustc_trans: access fields directly on CrateContext.Eduard-Mihai Burtescu-393/+298
2018-01-14rustc_trans: remove unused `TargetDataRef` accessor.Eduard-Mihai Burtescu-4/+0
2018-01-14rustc_trans: collapse {Local,Shared}CrateContext.Eduard-Mihai Burtescu-243/+113
2018-01-13rustc: Tweak `#[target_feature]` syntaxAlex Crichton-27/+127
This is an implementation of the `#[target_feature]` syntax-related changes of [RFC 2045][rfc]. Notably two changes have been implemented: * The new syntax is `#[target_feature(enable = "..")]` instead of `#[target_feature = "+.."]`. The `enable` key is necessary instead of the `+` to indicate that a feature is being enabled, and a sub-list is used for possible expansion in the future. Additionally within this syntax the feature names being enabled are now whitelisted against a known set of target feature names that we know about. * The `#[target_feature]` attribute can only be applied to unsafe functions. It was decided in the RFC that invoking an instruction possibly not defined for the current processor is undefined behavior, so to enable this feature for now it requires an `unsafe` intervention. [rfc]: https://github.com/rust-lang/rfcs/blob/master/text/2045-target-feature.md
2018-01-13Rollup merge of #47328 - mbrubeck:fs_read, r=sfacklerkennytm-12/+8
Use the new fs_read_write functions in rustc internals Uses `fs::read` and `fs::write` (added by #45837) where appropriate, to simplify code and dog-food these new APIs. This also improves performance, when combined with #47324.
2018-01-11Auto merge of #47087 - Zoxc:incr_no_in_ignore, r=michaelwoeristerbors-13/+14
Replace uses of DepGraph.in_ignore with DepGraph.with_ignore I currently plan to track tasks in thread local storage. Ignoring things in a closure ensures that the ignore tasks do not overlap the beginning or end of any other task. The TLS API will also use a closure to change a TLS value, so having the ignore task be a closure also helps there. It also adds `assert_ignored` which is used before a `TyCtxt` is created. Instead of adding a new ignore task this simply ensures that we are in a context where reads are ignored. r? @michaelwoerister
2018-01-10Use the new fs_read_write functions in rustc internalsMatt Brubeck-12/+8
2018-01-09fix faulty commentandjo403-9/+4
2018-01-09Replace uses of DepGraph.in_ignore with DepGraph.with_ignoreJohn Kåre Alsaker-13/+14
2018-01-09Auto merge of #47269 - michaelwoerister:mangled-cgu-names, r=alexcrichtonbors-3/+7
Shorten names of some compiler generated artifacts. This PR makes the compiler mangle codegen unit names by default. The name of every codegen unit name will now be a random string of 16 characters. It also makes the file extensions of some intermediate compiler products shorter. Hopefully, these changes will reduce the pressure on tools with path length restrictions like buildbot. The change should also solve problems with case-insensitive file system. cc #47186 and #47222 r? @alexcrichton
2018-01-09Rollup merge of #47258 - rkruppe:struct-assert, r=eddybkennytm-2/+2
rustc::ty: Rename struct_variant to non_enum_variant r? @eddyb
2018-01-09Rollup merge of #47233 - dotdash:cleanup_llvm, r=alexcrichtonkennytm-5/+1
Remove unused LLVM related code Ticks a few more boxes on #46437