summary refs log tree commit diff
path: root/src/librustc_codegen_ssa/mir
AgeCommit message (Collapse)AuthorLines
2019-12-14Ensure that we get a hard error on generic ZST constants if their body ↵Oliver Scherer-1/+4
causes an error during evaluation
2019-10-31rustc_codegen_ssa: introduce MIR VarDebugInfo, but only for codegen.Eduard-Mihai Burtescu-138/+186
2019-10-31rustc_codegen_ssa: hide address ops from the declare_local interface.Eduard-Mihai Burtescu-21/+17
2019-10-31rustc_codegen_ssa: move debuginfo scopes into FunctionDebugContext.Eduard-Mihai Burtescu-68/+34
2019-10-31rustc_codegen_ssa: change set_var_name back to taking a &str.Eduard-Mihai Burtescu-31/+7
2019-10-31rustc_codegen_ssa: move all set_var_name calls to mir::debuginfo.Eduard-Mihai Burtescu-87/+118
2019-10-31rustc_codegen_ssa: move local variable debuginfo to mir::debuginfo.Eduard-Mihai Burtescu-241/+227
2019-10-31rustc_codegen_ssa: move debuginfo-related things to a new mir::debuginfo module.Eduard-Mihai Burtescu-61/+149
2019-10-27Always use consteval to codegen caller_location.Adam Perry-10/+20
2019-10-27Panicking infra uses &core::panic::Location.Adam Perry-39/+8
This allows us to remove `static_panic_msg` from the SSA<->LLVM boundary, along with its fat pointer representation for &str. Also changes the signature of PanicInfo::internal_contructor to avoid copying. Closes #65856.
2019-10-27Implement core::intrinsics::caller_location.Adam Perry-0/+16
Returns a `&core::panic::Location` corresponding to where it was called, also making `Location` a lang item.
2019-10-25Rollup merge of #65315 - spastorino:intern-place-projection, r=oli-obkMazdak Farrokhzad-65/+40
Intern place projection This should sit on top of https://github.com/rust-lang/rust/pull/65197. After that one merged, I'm gonna rebase on top of it. The important commits are the last three and there's a bunch of code repetition that I'm going to remove but for that I need to refactor some things that probably need to be added before this PR. Anyway this work helps as is because we can run perf tests :). r? @oli-obk /cc @nikomatsakis
2019-10-22Pattern match over PlaceRef rather than PlaceSantiago Pastorino-65/+40
This prepares the code base for when projection is interned. Place's projection field is going to be `&List<PlaceElem<'tcx>>` so we won't be able to pattern match against it.
2019-10-21Rename `ConstValue::Infer(InferConst::Canonical(..))` to `ConstValue::Bound(..)`varkor-0/+1
2019-10-19Remove unreachable unit tuple compare binop codegenCaleb Behunin-8/+1
2019-10-13Remove MiscMethods::instancesbjorn3-7/+7
2019-10-13Inline functions from cg_ssa::callee and remove the modbjorn3-2/+9
Fixes #65271
2019-10-13s/FuncId/Functionbjorn3-2/+2
2019-10-13Remove is_const_integral method from ConstMethodsbjorn3-3/+3
2019-10-13Introduce FuncId backend typebjorn3-2/+2
2019-10-13Auto merge of #65182 - anp:reify-shim, r=eddybbors-1/+1
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-10Auto merge of #59546 - sfanxiang:interminable-ub, r=nagisabors-1/+42
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/+1
2019-10-04clean up GeneratorSubstscsmoe-1/+1
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-03generate ClosureSubsts from SubstsRefcsmoe-3/+4
2019-09-29remove indexed_vec re-export from rustc_data_structurescsmoe-4/+4
2019-09-29remove ClosureSubsts with SubstsRefcsmoe-2/+5
2019-09-29remove bit_set re-export from rustc_data_structurescsmoe-2/+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/+36
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-25Rename `sty` to `kind`varkor-15/+15
2019-09-17Get rid of special const intrinsic query in favour of `const_eval`Oliver Scherer-2/+1
2019-09-14Rollup merge of #64435 - eddyb:arguments-against-arg, r=rkruppeMazdak Farrokhzad-29/+30
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-12codegen: be more explicit about setting giving names to allocas.Eduard-Mihai Burtescu-28/+28
2019-09-11Make Place Boxed on Statement to reduce size from 64 bytes to 32 bytesSantiago Pastorino-6/+6
2019-09-09Use slice patterns to match projection baseSantiago Pastorino-10/+3
2019-09-09Convert Place's projection to a boxed sliceSantiago Pastorino-72/+71
2019-09-06rustc_codegen_llvm: give names to non-alloca variable values.Eduard-Mihai Burtescu-9/+23
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-6/+5
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-22Handle statics in `Subst::subst()` by implementing `TypeFoldable`Wesley Wiser-9/+2
2019-08-22Fix tidyWesley Wiser-1/+0
2019-08-22Move def_id out add substsrefWesley Wiser-7/+20