about summary refs log tree commit diff
path: root/src/librustc_codegen_ssa
AgeCommit message (Collapse)AuthorLines
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!
2019-09-23rustc: Fix mixing crates with different `share_generics`Alex Crichton-1/+1
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-23rustc: Convert `dependency_formats` to a queryAlex Crichton-27/+53
This commit converts a field of `Session`, `dependency_formats`, into a query of `TyCtxt`. This information then also needed to be threaded through to other remaining portions of the linker, but it's relatively straightforward. The only change here is that instead of `HashMap<CrateType, T>` the data structure changed to `Vec<(CrateType, T)>` to make it easier to deal with in queries.
2019-09-23Auto merge of #64272 - Mark-Simulacrum:parallel-handler, r=estebankbors-15/+7
Refactor librustc_errors::Handler API This should be reviewed by-commit. The last commit moves all fields into an inner struct behind a single lock; this is done to prevent possible deadlocks in a multi-threaded compiler, as well as inconsistent state observation.
2019-09-23Remove unused dependenciesShotaro Yamada-1/+0
2019-09-17Get rid of special const intrinsic query in favour of `const_eval`Oliver Scherer-4/+3
2019-09-17Remove Handler::{emit, emit_with_code}Mark Rousskov-13/+5
2019-09-17Replace DiagnosticBuilder with Diagnostic when emitting errorMark Rousskov-2/+2
2019-09-16Auto merge of #64381 - mati865:rand, r=alexcrichtonbors-2/+2
Upgrade parking_lot and tempfile rustc dependencies This should be last piece to unbreak `rustc` in https://github.com/rust-lang/rust/issues/63848
2019-09-14Rollup merge of #64435 - eddyb:arguments-against-arg, r=rkruppeMazdak Farrokhzad-32/+32
codegen: use "_N" (like for other locals) instead of "argN", for argument names. Based on #64408 (second commit is new), fixing something I mentioned in #64408 (which turned to be an immediate blocker for unifying relevant codepaths). Closes #64408 (by containing it). r? @rkruppe
2019-09-13codegen: use "_N" (like for other locals) instead of "argN", for argument names.Eduard-Mihai Burtescu-1/+2
2019-09-13Auto merge of #63420 - spastorino:place2_5, r=oli-obkbors-78/+71
[Place 2.0] Convert Place's projection to a boxed slice This is still work in progress, it's not compiling right now I need to review a bit more to see what's going on but wanted to open the PR to start discussing it. r? @oli-obk
2019-09-13Auto merge of #64254 - aleksijuvani:fix-macos-sysroot, r=alexcrichtonbors-0/+19
Fix sysroot on macOS when cross-compiling and SDKROOT is set Fixes rust-lang/cargo#7283 Closes rust-lang/cargo#7284 r? @alexcrichton
2019-09-12codegen: be more explicit about setting giving names to allocas.Eduard-Mihai Burtescu-31/+30
2019-09-12Remove env vars instead of setting them to an empty stringAleksi Juvani-0/+19
2019-09-11Make Place Boxed on Statement to reduce size from 64 bytes to 32 bytesSantiago Pastorino-6/+6
2019-09-11Upgrade parking_lot and tempfile rustc dependenciesMateusz Mikuła-2/+2
2019-09-11Use `Symbol` in `Linker`.Nicholas Nethercote-51/+63
2019-09-09Use slice patterns to match projection baseSantiago Pastorino-10/+3
2019-09-09Convert Place's projection to a boxed sliceSantiago Pastorino-72/+72
2019-09-07Rollup merge of #64139 - Mark-Simulacrum:strip-legacy-proc-macro, r=petrochenkovMazdak Farrokhzad-6/+1
Migrate internal diagnostic registration to macro_rules Review is best done commit-by-commit. Fixes #64132.
2019-09-06rustc_codegen_llvm: give names to non-alloca variable values.Eduard-Mihai Burtescu-10/+24
2019-09-05Remove rustc_diagnostic_macros featureMark Rousskov-1/+0
2019-09-05Replace diagnostic plugins with macro_rulesMark Rousskov-5/+1
2019-09-05Rollup merge of #64003 - Dante-Broggi:place-align-in-layout, r=matthewjasperMazdak Farrokhzad-11/+22
place: Passing `align` = `layout.align.abi`, when also passing `layout` Of the calls changed: 7/12 use `align` = `layout.align.abi`. `from_const_alloc` uses `alloc.align`, but that is `assert_eq!` to `layout.align.abi`. only 4/11 use something interesting for `align`.
2019-09-04Remove `LocalInternedString` uses from `librustc_codegen_llvm`.Nicholas Nethercote-9/+8
2019-09-04Remove `LocalInternedString` uses from `librustc/ty/`.Nicholas Nethercote-2/+2
This is not a compelling change in isolation, but it is a necessary step.
2019-08-29`new_sized` is mostly used without alignDante-Broggi-8/+20
so rename it `new_sized_aligned`. 6/11 use `align` = `layout.align.abi`. `from_const_alloc` uses `alloc.align`, but that is `assert_eq!` to `layout.align.abi`. only 4/11 use something interesting for `align`.
2019-08-29`new_thin_place` is only used with `align` = `layout.align.abi`Dante-Broggi-3/+2
and is not `pub`.
2019-08-29Rollup merge of #63965 - loganwendholt:linker-script-fix, r=michaelwoeristerMazdak Farrokhzad-4/+7
Prevent syntax error in LD linker version script As discussed in #63925, there is an edge case in which an invalid LD version script is generated when building a `cdylib` with no exported symbols. This PR makes a slight modification to the LD version script generation by first checking to see if any symbols need to be exported. If not, the `global` section of the linker script is simply omitted, and the syntax error is averted.
2019-08-29Rollup merge of #63961 - JohnTitor:improve-require-lang-item, r=estebankMazdak Farrokhzad-1/+1
Add Option<Span> to `require_lang_item` Fixes #63954 I'm not sure where to take `Some(span)` or something so I use `None` in many places. r? @estebank
2019-08-28Auto merge of #63875 - philipc:issue-57822, r=michaelwoeristerbors-4/+10
debuginfo: give unique names to closure and generator types Closure types have been moved to the namespace where they are defined, and both closure and generator type names now include the disambiguator. This fixes an exception when lldb prints nested closures. Fixes #57822 I haven't included the `DW_AT_artificial` changes discussed in #57822 because they make the output worse IMO, but I can easily add these if still required. For example, for the new test case the output is now: ``` (lldb) p g (issue_57822::main::closure-1) $1 = closure-1(closure(1)) ``` but adding `DW_AT_artificial` changes this to: ``` (lldb) p g (issue_57822::main::closure-1) $0 = closure-1 { } ``` Note that nested generators didn't cause the exception. I haven't determined why, but I think it makes sense to add the disambiguator for them too. It feels like we still don't really understand why closures were causing an error though. r? @michaelwoerister
2019-08-27Prevent syntax error in ld linker version scriptLogan Wendholt-4/+7