about summary refs log tree commit diff
path: root/src/librustc_codegen_ssa/mir
AgeCommit message (Collapse)AuthorLines
2019-12-02Stop invalidating predecessors cache when accessing unique basic block, ↵Paul Daniel Faria-1/+1
invalidate cache when accessing unique terminator
2019-11-30libunwind_panic: adjust miri panic hackRalf Jung-11/+4
2019-11-27rustc: move debug info from LocalDecl and UpvarDecl into a dedicated ↵Eduard-Mihai Burtescu-158/+98
VarDebugInfo.
2019-11-22Rollup merge of #66587 - matthewjasper:handle-static-as-const, r=oli-obkMazdak Farrokhzad-4/+26
Handle statics in MIR as const pointers This is the first PR towards the goal of removing `PlaceBase::Static`. In this PR: * Statics are lowered to dereferencing a const pointer. * The temporaries holding such pointers are tracked in MIR, for the most part this is only used for diagnostics. There are two exceptions: * The borrow checker has some checks for thread-locals that directly use this data. * Const checking will suppress "cannot dereference raw pointer" diagnostics for pointers to `static mut`/`extern static`. This is to maintain the current behaviour (12 tests fail otherwise). The following are left to future PRs (I think that @spastorino will be working on the first 3): * Applying the same treatments to promoted statics. * Removing `PlaceBase::Static`. * Replacing `PlaceBase` with `Local`. * Moving the ever growing collection of metadata that we have for diagnostics in MIR passes somewhere more appropriate. r? @oli-obk
2019-11-21Fix rebaseMatthew Jasper-1/+1
2019-11-21Readjust constant evaluation for operandsSantiago Pastorino-2/+24
2019-11-21Simplify patternSantiago Pastorino-2/+2
2019-11-21Aggregation of drive-by cosmetic changes.Alexander Regueiro-49/+47
2019-11-15Cleaned up unused labelsBart Massey-1/+1
Deleted unused labels from compiler and fixed or allowed unused labels in tests. This patch removes some gratuitous unused labels and turns off the warning for unused labels that are a necessary part of tests. This will permit setting the `unused_labels` lint to `warn`.
2019-11-14Update to use new librustc_error_codes libraryGuillaume Gomez-0/+2
2019-11-14Auto merge of #66233 - cjgillot:constkind, r=oli-obkbors-8/+10
Split ConstValue into two enums Hello, Issue #59210 appeared abandoned, so I gave it a go. Some further cleanup and refactoring may be mandated. I did not test beyond `x.py check`, since my home computer dies compiling librustc. Fixes #59210
2019-11-12Fix tidy.Camille GILLOT-1/+3
2019-11-12Rename in librustc_codegen_ssa.Camille GILLOT-8/+8
2019-11-11Add more detailed codegen commentAaron Hill-0/+5
2019-11-11Fix up intrinsic implementationAaron Hill-0/+10
2019-11-10Rollup merge of #65831 - matthewjasper:array-ptr-cast, r=oli-obkYuki Okushi-0/+1
Don't cast directly from &[T; N] to *const T Split out from #64588 r? @oli-obk
2019-11-06Rollup merge of #65973 - eddyb:caller-location-panic, r=petrochenkovMazdak Farrokhzad-1/+2
caller_location: point to macro invocation sites, like file!/line!, and use in core::panic!. The main change here is to `core::panic!`, trying to fix this remaining regression: https://github.com/rust-lang/rust/pull/65927#issuecomment-547625147 However, in order for `caller_location` to be usable from macros the same way `file!()`/`line!()` are, it needs to have the same behavior (of extracting the macro invocation site `Span` and using that). Arguably we would've had to do this at some point anyway, if we want to use `#[track_caller]` to replace the `file!()`/`line!()` uses from macros, but I'm not sure the RFC mentions this at all. r? @petrochenkov cc @anp @nnethercote
2019-11-03rustc: rename {Fn,Arg}TypeExt to {Fn,Arg}AbiExt.Eduard-Mihai Burtescu-2/+2
2019-11-03rustc_target: rename {Fn,Arg}Type to {Fn,Arg}Abi.Eduard-Mihai Burtescu-56/+56
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-30caller_location: point to macro invocation sites, like file!/line!.Eduard-Mihai Burtescu-1/+2
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-25Don't cast directly from `&[T; N]` to `*const T`Matthew Jasper-0/+1
Instead coerce to `*const [T; N]` and then cast.
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