about summary refs log tree commit diff
path: root/src/librustc_codegen_ssa
AgeCommit message (Collapse)AuthorLines
2019-10-14Rollup merge of #65398 - estebank:capitalization-only, r=varkorTyler Mandry-1/+5
Bring attention to suggestions when the only difference is capitalization CC #65386.
2019-10-13Bring attention to suggestions when the only difference is capitalizationEsteban Küber-1/+5
2019-10-13Add top level provide/provide_extern to cg_ssa and cg_utilsbjorn3-0/+11
2019-10-13Remove MiscMethods::instancesbjorn3-15/+14
2019-10-13Inline functions from cg_ssa::callee and remove the modbjorn3-63/+24
Fixes #65271
2019-10-13s/FuncId/Functionbjorn3-12/+12
2019-10-13Move span_invalid_monomorphization_error from cg_llvm to cg_ssabjorn3-0/+40
The associated long diagnostic didn't get registered before
2019-10-13Remove is_const_integral method from ConstMethodsbjorn3-6/+4
2019-10-13Introduce FuncId backend typebjorn3-10/+13
2019-10-13Auto merge of #65182 - anp:reify-shim, r=eddybbors-1/+18
Add `Instance::resolve_for_fn_ptr` (RFC 2091 #2/N) Supercedes: https://github.com/rust-lang/rust/pull/65082 Depends on: https://github.com/rust-lang/rust/pull/65037 Tracking issue: https://github.com/rust-lang/rust/issues/47809 [RFC text](https://github.com/rust-lang/rfcs/blob/master/text/2091-inline-semantic.md) steps taken: * [x] add a `ReifyShim` that is similar to `VirtualShim` in behavior (see #54183) * [x] add `ty::Instance::resolve_for_fn_ptr` (leave `ty::Instance::resolve_vtable` alone), migrate appropriate callers * [x] `resolve_for_fn_ptr` returns the shim if calling a `#[track_caller]` function
2019-10-11Auto merge of #64716 - jonhoo:stabilize-mem-take, r=SimonSapinbors-1/+0
Stabilize mem::take (mem_take) Tracking issue: https://github.com/rust-lang/rust/issues/61129 r? @matklad
2019-10-10Auto merge of #59546 - sfanxiang:interminable-ub, r=nagisabors-1/+43
Add llvm.sideeffect to potential infinite loops and recursions LLVM assumes that a thread will eventually cause side effect. This is not true in Rust if a loop or recursion does nothing in its body, causing undefined behavior even in common cases like `loop {}`. Inserting llvm.sideeffect fixes the undefined behavior. As a micro-optimization, only insert llvm.sideeffect when jumping back in blocks or calling a function. A patch for LLVM is expected to allow empty non-terminate code by default and fix this issue from LLVM side. https://github.com/rust-lang/rust/issues/28728 **UPDATE:** [Mentoring instructions here](https://github.com/rust-lang/rust/pull/59546#issuecomment-515072429) to unstall this PR
2019-10-09Reifying callers of Instance::resolve use resolve_for_fn_ptr.Adam Perry-1/+18
2019-10-08Stabilize mem::take (mem_take)Jon Gjengset-1/+0
Tracking issue: https://github.com/rust-lang/rust/issues/61129
2019-10-08Rollup merge of #65081 - Mark-Simulacrum:remove-profile-queries, ↵Mazdak Farrokhzad-1/+1
r=michaelwoerister Remove -Zprofile-queries r? @michaelwoerister Per [zulip thread](https://zulip-archive.rust-lang.org/131828tcompiler/57361RemoveZprofilequeries.html).
2019-10-07Auto merge of #64780 - choller:master, r=michaelwoeristerbors-1/+3
Only add sanitizer runtimes when linking an executable (#64629). This change modifies the code to only add sanitizer runtimes if we are linking an executable, as those runtimes should never be part of libraries. I successfully compiled `mozilla-central` with ASan using this patch.
2019-10-07Rollup merge of #65137 - andjo403:selfProfiling_fix, r=michaelwoeristerMazdak Farrokhzad-4/+0
remove event that causes panics in measureme tools the measureme tools summarize and crox do not alow a event to go out of scope of the parent event codegen_and_optimize_crate ends after the codegen_crate event r? @wesleywiser cc @michaelwoerister @Mark-Simulacrum
2019-10-07Add feature gate for raw_dylib.Charles Lew-3/+13
2019-10-05Rollup merge of #65151 - tmandry:revert-emscripten-upgrade, r=tmandryTyler Mandry-2/+5
Revert #63649 - "Upgrade Emscripten targets to use upstream LLVM backend" This change caused the runtime of the linux-asmjs builder to nearly double from 2+ hours to about 4 hours, which happens to be the bors timeout. (It made it in barely under 4 hours when it was merged.) This is causing timeouts on all new changes. This reverts commit 7870050796e5904a0fc85ecbe6fa6dde1cfe0c91, reversing changes made to 2e7244807a7878f6eca3eb7d97ae9b413aa49014.
2019-10-05Rollup merge of #65100 - csmoe:generator, r=nikomatsakisTyler Mandry-1/+1
Replace GeneratorSubsts with SubstsRef Closes #42340 r? @nikomatsakis
2019-10-05Revert "Auto merge of #63649 - tlively:emscripten-upstream-upgrade, ↵Tyler Mandry-2/+5
r=alexcrichton" This reverts commit 7870050796e5904a0fc85ecbe6fa6dde1cfe0c91, reversing changes made to 2e7244807a7878f6eca3eb7d97ae9b413aa49014.
2019-10-05remove event that causes panics in measureme toolsAndreas Jonson-4/+0
the measureme tools summarize and crox do not alow a event to go out of scope of the parent event codegen_and_optimize_crate ends after the codegen_crate event
2019-10-04Auto merge of #63649 - tlively:emscripten-upstream-upgrade, r=alexcrichtonbors-5/+2
Upgrade Emscripten targets to use upstream LLVM backend - Refactors the Emscripten target spec to share code with other wasm targets. - Replaces the incorrect wasm32 C call ABI with the old asmjs version, which is correct for both wasm32 and JS. - Updates the varargs ABI used by Emscripten and deletes the old one. - Removes the obsolete wasm32-experimental-emscripten target. - Temporarily makes Emscripten targets use panic=abort by default because supporting unwinding will require an LLVM patch.
2019-10-04clean up GeneratorSubstscsmoe-1/+1
2019-10-04Upgrade Emscripten targets to use upstream LLVM backendThomas Lively-5/+2
- Refactors the Emscripten target spec to share code with other wasm targets. - Replaces the incorrect wasm32 C call ABI with the old asmjs version, which is correct for both wasm32 and JS. - Updates the varargs ABI used by Emscripten and deletes the old one. - Removes the obsolete wasm32-experimental-emscripten target. - Temporarily makes Emscripten targets use panic=abort by default because supporting unwinding will require an LLVM patch.
2019-10-04Rollup merge of #64817 - csmoe:closure, r=nikomatsakisMazdak Farrokhzad-2/+6
Replace ClosureSubsts with SubstsRef Addresses https://github.com/rust-lang/rust/issues/42340 part 3 https://github.com/rust-lang/rust/pull/59312 might benefit from this clean up. r? @nikomatsakis
2019-10-03Remove -Zprofile-queriesMark Rousskov-1/+1
2019-10-03generate ClosureSubsts from SubstsRefcsmoe-3/+4
2019-10-01Rollup merge of #64840 - michaelwoerister:self-profiling-raii-refactor, ↵Tyler Mandry-72/+12
r=wesleywiser SelfProfiler API refactoring and part one of event review This PR refactors the `SelfProfiler` a little bit so that most profiling methods are RAII-based. The codegen backend code already had something similar, this refactoring pulls this functionality up into `SelfProfiler` itself, for general use. The second commit of this PR is a review and update of the existing events we are already recording. Names have been made more consistent. CGU names have been removed from event names. They will be added back in when function parameter recording is implemented. There is still some work to be done for adding new events, especially around trait resolution and the incremental system. r? @wesleywiser
2019-09-30Self-Profiling: Make names of existing events more consistent and use new API.Michael Woerister-72/+12
2019-09-29remove indexed_vec re-export from rustc_data_structurescsmoe-7/+7
2019-09-29remove ClosureSubsts with SubstsRefcsmoe-2/+5
2019-09-29remove bit_set re-export from rustc_data_structurescsmoe-2/+3
2019-09-29Rollup merge of #64824 - Mark-Simulacrum:no-stable-hasher-result-everywhere, ↵Mazdak Farrokhzad-5/+2
r=michaelwoerister No StableHasherResult everywhere This removes the generic parameter on `StableHasher`, instead moving it to the call to `finish`. This has the side-effect of making all `HashStable` impls nicer, since we no longer need the verbose `<W: StableHasherResult>` that previously existed -- often forcing line wrapping. This is done for two reasons: * we should avoid false "generic" dependency on the result of StableHasher * we don't need to codegen two/three copies of all the HashStable impls when they're transitively used to produce a fingerprint, u64, or u128. I haven't measured, but this might actually make our artifacts somewhat smaller too. * Easier to understand/read/write code -- the result of the stable hasher is irrelevant when writing a hash impl.
2019-09-28Switch over all StableHash impls to new formatMark Rousskov-5/+2
2019-09-28rustc_codegen_ssa: remove redundant `va_list_ref` field from `FunctionCx`.Eduard-Mihai Burtescu-18/+8
2019-09-28rustc: rely on c_variadic == true instead of CVarArgs in HIR/Ty fn signatures.Eduard-Mihai Burtescu-57/+33
2019-09-28Generate llvm.sideeffect at function entry instead of callXiang Fan-5/+9
2019-09-28Gate llvm.sideeffect under -Z insert-sideeffectXiang Fan-7/+9
2019-09-28Add llvm.sideeffect to potential infinite loops and recursionsXiang Fan-1/+37
LLVM assumes that a thread will eventually cause side effect. This is not true in Rust if a loop or recursion does nothing in its body, causing undefined behavior even in common cases like `loop {}`. Inserting llvm.sideeffect fixes the undefined behavior. As a micro-optimization, only insert llvm.sideeffect when jumping back in blocks or calling a function. A patch for LLVM is expected to allow empty non-terminate code by default and fix this issue from LLVM side. https://github.com/rust-lang/rust/issues/28728
2019-09-27Auto merge of #64813 - varkor:node-to-kind, r=Centrilbors-5/+5
Rename `*.node` to `*.kind`, and `hair::Pattern*` to `hair::Pat*` In both `ast::Expr` and `hir::Expr`: - Rename `Expr.node` to `Expr.kind`. - Rename `Pat.node` to `Pat.kind`. - Rename `ImplItem.node` to `ImplItem.kind`. - Rename `Lit.node` to `Lit.kind`. - Rename `TraitItem.node` to `TraitItem.kind`. - Rename `Ty.node` to `Ty.kind`. - Rename `Stmt.node` to `Stmt.kind`. - Rename `Item.node` to `Item.kind`. - Rename `ForeignItem.node` to `ForeignItem.kind`. - Rename `MetaItem.node` to `MetaItem.kind`. Also: - Rename `hair::FieldPattern` to `hair::FieldPat`. - Rename `hair::PatternKind` to `hair::PatKind`. - Rename `hair::PatternRange` to `hair::PatRange`. - Rename `PatternContext` to `PatCtxt`. - Rename `PatternTypeProjection` to `PatTyProj`. - Rename `hair::Pattern` to `hair::Pat`. These two sets of changes are grouped together to aid with merging. The only changes are renamings. r? @petrochenkov
2019-09-26Rename `Item.node` to `Item.kind`varkor-4/+4
2019-09-26Rename `ImplItem.node` to `ImplItem.kind`varkor-1/+1
2019-09-26Rollup merge of #64772 - Mark-Simulacrum:no-tyctxt-tx, r=eddybMazdak Farrokhzad-29/+27
Remove tx_to_llvm_workers from TyCtxt This can be kept within the codegen backend crates entirely -- there's no reason for us to create it outside and attempt to hold it in the (global) context. Changes here aren't really too easily reviewable I suspect -- not sure if they can be cleaned up by splitting into more commits though, it's just hard to reason about `Box<Any>` in general. If there are thoughts though I'd be happy to hear them. The primary goal of this PR is to get rid of the field on `rustc_interface::Queries`.
2019-09-25Remove tx_to_llvm_workers from TyCtxtMark Rousskov-29/+27
This can be kept within the codegen backend crates entirely
2019-09-25Only add sanitizer runtimes when linking an executable (#64629).Christian Holler (:decoder)-1/+3
2019-09-25Rename `sty` to `kind`varkor-23/+23
2019-09-25Rollup merge of #64324 - alexcrichton:share-generics-again, r=michaelwoeristerMazdak Farrokhzad-30/+74
rustc: Fix mixing crates with different `share_generics` This commit addresses #64319 by removing the `dylib` crate type from the list of crate type that exports generic symbols. The bug in #64319 arises because a `dylib` crate type was trying to export a symbol in an uptream crate but it miscalculated the symbol name of the uptream symbol. This isn't really necessary, though, since `dylib` crates aren't that heavily used, so we can just conservatively say that the `dylib` crate type never exports generic symbols, forcibly removing them from the exported symbol lists if were to otherwise find them. The fix here happens in two places: * First is in the `local_crate_exports_generics` method, indicating that it's now `false` for the `Dylib` crate type. Only rlibs actually export generics at this point. * Next is when we load exported symbols from upstream crate. If, for our compilation session, the crate may be included from a dynamic library, then its generic symbols are removed. When the crate was linked into a dynamic library its symbols weren't exported, so we can't consider them a candidate to link against. Overally this should avoid situations where we incorrectly calculate the upstream symbol names in the face of differnet `share_generics` options, ultimately... Closes #64319
2019-09-24Rollup merge of #64702 - sinkuu:deps, r=jonas-schievinkMazdak Farrokhzad-1/+0
Remove unused dependencies
2019-09-23Allow using upstream generics in a dylib crate typeAlex Crichton-2/+20
... just don't export them!