about summary refs log tree commit diff
path: root/src/librustc_codegen_ssa/mir
AgeCommit message (Collapse)AuthorLines
2019-04-25Support variantful generatorsTyler Mandry-13/+36
This allows generators to overlap fields using variants.
2019-04-25Give GeneratorLayout a list of fields for each variantTyler Mandry-2/+4
But don't really use it yet.
2019-04-23rustc: dissuade compiler developers from misusing upvar debuginfo.Eduard-Mihai Burtescu-5/+6
2019-04-23rustc_codegen_ssa: rename debuginfo_upvar_decls_ops_sequence to ↵Eduard-Mihai Burtescu-1/+1
debuginfo_upvar_ops_sequence.
2019-04-20Auto merge of #59987 - saleemjaffer:refactor_adjust_castkinds, r=oli-obkbors-8/+8
Refactor Adjust and CastKind fixes rust-lang#59588
2019-04-15basic refactor. Adding PointerCast enumSaleem Jaffer-8/+8
2019-04-11Add discr_index to multi-variant layoutsTyler Mandry-6/+8
We relax the assumption that the discriminant is always field 0, in preparations for layouts like generators where this is not going to be the case.
2019-04-04Rollup merge of #59639 - cuviper:ignore-uninhabited, r=eddybMazdak Farrokhzad-0/+7
Never return uninhabited values at all Functions with uninhabited return values are already marked `noreturn`, but we were still generating return instructions for this. When running with `-C passes=lint`, LLVM prints: Unusual: Return statement in function with noreturn attribute The LLVM manual makes a stronger statement about `noreturn` though: > This produces undefined behavior at runtime if the function ever does dynamically return. We now emit an `abort` anywhere that would have tried to return an uninhabited value. Fixes #48227 cc #7463 #48229 r? @eddyb
2019-04-03Never return uninhabited values at allJosh Stone-0/+7
Functions with uninhabited return values are already marked `noreturn`, but we were still generating return instructions for this. When running with `-C passes=lint`, LLVM prints: Unusual: Return statement in function with noreturn attribute The LLVM manual makes a stronger statement about `noreturn` though: > This produces undefined behavior at runtime if the function ever does dynamically return. We now emit an `abort` anywhere that would have tried to return an uninhabited value.
2019-04-03Rollup merge of #59630 - nnethercote:shrink-mir-Statement, r=pnkfelixMazdak Farrokhzad-6/+6
Shrink `mir::Statement`. The `InlineAsm` variant is extremely rare, and `mir::Statement` often contributes significantly to peak memory usage.
2019-04-03Rollup merge of #59514 - tmandry:remove-adt-def-from-projection-elem, r=eddybMazdak Farrokhzad-7/+7
Remove adt_def from projections and downcasts in MIR As part of optimizing generator layouts in MIR, we'd like to allow downcasting generators to variants which do not have a corresponding `def_id`, since they are created by the compiler. This refactor hopes to allow that, without regressing perf. r? @eddyb
2019-04-03Shrink `mir::Statement`.Nicholas Nethercote-6/+6
The `InlineAsm` variant is extremely rare, and `mir::Statement` often contributes significantly to peak memory usage.
2019-04-02Remove adt_def from PlaceTy and make it a structTyler Mandry-7/+7
2019-04-02renames EvalErrorKind to InterpErrorkenta7777-3/+3
2019-03-31Auto merge of #59577 - dlrobertson:fix_58881, r=nagisabors-13/+2
Fix LLVM IR generated for C-variadic arguments It is possible to create malformed LLVM IR given variadic arguments that are aggregate types. This occurs due to improper tracking of the current argument in the functions list of arguments. Fixes: #58881
2019-03-31Fix LLVM IR generated for C-variadic argumentsDan Robertson-13/+2
It is possible to create malformed LLVM IR given variadic arguments that are aggregate types. This occurs due to improper tracking of the current argument in the functions list of arguments.
2019-03-31Rollup merge of #59580 - taiki-e:coerce-closure, r=oli-obkMazdak Farrokhzad-1/+1
Allow closure to unsafe fn coercion Closes #57883
2019-03-31Rollup merge of #59519 - eddyb:layout-variants-refactor, r=oli-obkMazdak Farrokhzad-18/+21
rustc_target: factor out common fields of non-Single Variants. @tmandry and I were discussing ways to generalize the current variants/discriminant layout to allow more fields in the "`enum`" (or another multi-variant types, such as potentially generator state, in the future), shared by all variants, than just the tag/niche discriminant. This refactor should make it easier to extend multi-variant layouts, as nothing is duplicating anymore between "tagged enums" and "niche-filling enums". r? @oli-obk
2019-04-01Allow closure to unsafe fn coercionTaiki Endo-1/+1
2019-03-30Remove redundant importsFabian Drinck-1/+0
2019-03-29Use ExactSizeIterator + TrustedLen instead of num_cases arg for switchbjorn3-1/+0
2019-03-29Add a method for emiting a switch.bjorn3-10/+7
2019-03-29Remove type_variadic_func and typ_array from cg_ssabjorn3-25/+4
2019-03-29Move get_param and set_value_namebjorn3-7/+7
2019-03-29[WIP] Make some debug info methods take &mut FunctionDebugContextbjorn3-9/+5
declare_local still takes &FunctionDebugContext, because of borrowck errors
2019-03-29Remove internal mutability from source_locations_enabledbjorn3-1/+1
2019-03-29Remove param_substs from FunctionCxbjorn3-9/+3
2019-03-29Remove const_{cstr,str_slice,get_elt,get_real} and is_const_real methods ↵bjorn3-33/+20
from cg_ssa This introduces the static_panic_msg trait method to StaticBuilderMethods.
2019-03-29Miscbjorn3-2/+3
2019-03-29Use Builder instead of CodegenCx for OperandRef and LocalRefbjorn3-24/+27
2019-03-29`eval_mir_constant` doesn't need a builder parambjorn3-6/+5
2019-03-29Don't use c_uint in cg_ssabjorn3-7/+6
2019-03-29rustc_target: factor out common fields of non-Single Variants.Eduard-Mihai Burtescu-18/+21
2019-03-23adding mir::StaticKind enum for static and promotedSaleem Jaffer-9/+17
2019-03-21review fixesSaleem Jaffer-4/+4
2019-03-18fixed all compilation errorsSaleem Jaffer-7/+15
2019-03-16Revert the `LazyConst` PROliver Scherer-20/+12
2019-03-15rustc: remove fmt::{Debug,Display} from ty::TyKind.Eduard-Mihai Burtescu-1/+1
2019-03-09Rollup merge of #58518 - oli-obk:unreachable_result_errors, r=RalfJungMazdak Farrokhzad-7/+7
Use early unwraps instead of bubbling up errors just to unwrap in the end r? @RalfJung
2019-03-09Auto merge of #59012 - pietroalbini:rollup, r=pietroalbinibors-0/+1
Rollup of 24 pull requests Successful merges: - #58080 (Add FreeBSD armv6 and armv7 targets) - #58204 (On return type `impl Trait` for block with no expr point at last semi) - #58269 (Add librustc and libsyntax to rust-src distribution.) - #58369 (Make the Entry API of HashMap<K, V> Sync and Send) - #58861 (Expand where negative supertrait specific error is shown) - #58877 (Suggest removal of `&` when borrowing macro and appropriate) - #58883 (Suggest appropriate code for unused field when destructuring pattern) - #58891 (Remove stray ` in the docs for the FromIterator implementation for Option) - #58893 (race condition in thread local storage example) - #58906 (Monomorphize generator field types for debuginfo) - #58911 (Regression test for #58435.) - #58912 (Regression test for #58813) - #58916 (Fix release note problems noticed after merging.) - #58918 (Regression test added for an async ICE.) - #58921 (Add an explicit test for issue #50582) - #58926 (Make the lifetime parameters of tcx consistent.) - #58931 (Elide invalid method receiver error when it contains TyErr) - #58940 (Remove JSBackend from config.toml) - #58950 (Add self to mailmap) - #58961 (On incorrect cfg literal/identifier, point at the right span) - #58963 (libstd: implement Error::source for io::Error) - #58970 (delay_span_bug in wfcheck's ty.lift_to_tcx unwrap) - #58984 (Teach `-Z treat-err-as-bug` to take a number of errors to emit) - #59007 (Add a test for invalid const arguments) Failed merges: - #58959 (Add release notes for PR #56243) r? @ghost
2019-03-08Auto merge of #58985 - dlrobertson:fix_58980, r=alexregbors-9/+8
Fix segfaults in release build C-variadic fns `va_start` and `va_end` must be called to initialize/cleanup the "spoofed" `VaList` in a Rust defined C-variadic function even if the `VaList` is not used. r? @alexreg Fixes: #58980
2019-03-08Rollup merge of #58906 - Nemo157:generator-state-debug-info, r=ZoxcPietro Albini-0/+1
Monomorphize generator field types for debuginfo Fixes #58888 r? @Zoxc
2019-03-07Fix segfaults in release build C-variadic fnsDan Robertson-9/+8
`va_start` and `va_end` must be called to initialize/cleanup the "spoofed" `VaList` in a Rust defined C-variadic function even if the `VaList` is not used.
2019-03-05Use non_erasable_generics for codegenvarkor-0/+2
Co-Authored-By: Gabriel Smith <yodaldevoid@users.noreply.github.com>
2019-03-04Use early unwraps instead of bubbling up errors just to unwrap in the endOliver Scherer-7/+7
2019-03-04Monomorphize generator field types for debuginfoWim Looman-0/+1
2019-03-03Auto merge of #58673 - matthewjasper:typeck-ptr-coercions, r=pnkfelixbors-2/+4
[NLL] Type check operations with pointer types It seems these were forgotten about. Moving to `Rvalue::AddressOf` simplifies the coercions from references, but I want this to be fixed as soon as possible. r? @pnkfelix
2019-03-02Auto merge of #58077 - Nemo157:generator-state-debug-info, r=Zoxcbors-4/+31
Add debug-info to access variables from generator state
2019-03-01Put Local, Static and Promoted as one Base variant of PlaceSantiago Pastorino-15/+22
2019-02-27Rename variadic to c_variadicDan Robertson-4/+4
Function signatures with the `variadic` member set are actually C-variadic functions. Make this a little more explicit by renaming the `variadic` boolean value, `c_variadic`.