about summary refs log tree commit diff
path: root/src/librustc_codegen_ssa
AgeCommit message (Collapse)AuthorLines
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-03Deny internal lints on non conflicting cratesflip1995-0/+1
- libarena - librustc_allocator - librustc_borrowck - librustc_codegen_ssa - librustc_codegen_utils - librustc_driver - librustc_errors - librustc_incremental - librustc_metadata - librustc_passes - librustc_privacy - librustc_resolve - librustc_save_analysis - librustc_target - librustc_traits - libsyntax - libsyntax_ext - libsyntax_pos
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-02Rollup merge of #59607 - kenta7777:renames-EvalErrorKind-to-InterpError, ↵Mazdak Farrokhzad-3/+3
r=oli-obk Renames `EvalErrorKind` to `InterpError` This PR renames `EvalErrorKind` to `InterpError`. This is related to #54395.
2019-04-02renames EvalErrorKind to InterpErrorkenta7777-3/+3
2019-04-01Rollup merge of #58507 - Zoxc:time-extended, r=michaelwoeristerMazdak Farrokhzad-2/+2
Add a -Z time option which prints only passes which runs once This ensures `-Z time-passes` fits on my screen =P r? @michaelwoerister
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-31Remove redundant importFabian Drinck-1/+0
2019-03-30Remove redundant importsFabian Drinck-1/+0
2019-03-29Use ExactSizeIterator + TrustedLen instead of num_cases arg for switchbjorn3-3/+3
2019-03-29Add a method for emiting a switch.bjorn3-12/+10
2019-03-29Remove inline_asm_call from cg_ssabjorn3-14/+0
`count_insn` is no longer called for inline asm, because it is private to builder.rs
2019-03-29Remove type_variadic_func and typ_array from cg_ssabjorn3-34/+12
2019-03-29Remove a lot of methods from *TypeMethodsbjorn3-78/+8
2019-03-29Remove scalar_lltypes from cg_ssabjorn3-3/+0
2019-03-29Move get_param and set_value_namebjorn3-12/+12
2019-03-29Remove a lot of methods from BuilderMethodsbjorn3-47/+0
2019-03-29[WIP] Make some debug info methods take &mut FunctionDebugContextbjorn3-11/+7
declare_local still takes &FunctionDebugContext, because of borrowck errors
2019-03-29Remove internal mutability from source_locations_enabledbjorn3-6/+5
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-42/+29
from cg_ssa This introduces the static_panic_msg trait method to StaticBuilderMethods.
2019-03-29Remove const_{fat_ptr,array,vector,bytes} from cg_ssabjorn3-4/+0
2019-03-29Miscbjorn3-3/+4
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-9/+7
2019-03-29rustc_target: factor out common fields of non-Single Variants.Eduard-Mihai Burtescu-18/+21
2019-03-29Auto merge of #58605 - nagisa:fix-the-metadata, r=michaelwoeristerbors-1/+7
Use informational target machine for metadata Since there is nothing to optimise there... Should fix #58323 but haven’t tested locally. r? @michaelwoerister
2019-03-28Rollup merge of #59320 - alexcrichton:wasm-clang, r=sanxiynMazdak Farrokhzad-56/+21
rustc: Allow using `clang` for wasm32 targets This commit adds support code for using `clang` directly to link the wasm32-unknown-unknown target. Currently the target is only really configured to link with LLD directly, but this ensures that `clang` can be configured as well. While not immediately useful in the near term it's likely that more wasm32 targets will pop up over time with Clang's new native support for WebAssembly in the 8.0.0 release. Getting support into rustc early should make it easier to experiment with these targets and try out various changes here and there.
2019-03-28Rollup merge of #59318 - alexcrichton:check-for-clang, r=michaelwoeristerMazdak Farrokhzad-8/+11
rustc: Update linker flavor inference from filename This commit fixes what is believed to be a preexisting bug in the linker flavor inference and additionally adds a new features. Previously if the linker didn't end in `exe` the entire file name was compared to infer the linker's flavor. This commit fixes the code to instead unconditionally inspect `file_stem()` which is the relevant part we're looking at to figure out what the linker flavor is. Additionally this commit now also adds recognition of `clang` and clang wrappers that end in `-clang` (which look like gcc wrappers). This should allow clang-specific wrappers to get correctly inferred to the `Gcc` linker flavor rather than the default linker flavor configured for a target.
2019-03-28Rollup merge of #59441 - TheGoddessInari:natvis, r=alexcrichtonMazdak Farrokhzad-12/+0
Remove the block on natvis for lld-link. Since #56642 bumped minimum LLVM version to 6.0.0, Rust should be able to honor or ignore Windows natvis support with lld-link. It looks like https://github.com/llvm-mirror/lld/commit/9133ca57b was in LLVM 7.0, while https://github.com/llvm-mirror/lld/commit/27b9c4285 made it into 6.0, at least if the release branches are anything to go by. Fixes #59383.
2019-03-27Use informational target machine for metadataSimonas Kazlauskas-1/+7
Since there is nothing to optimise there...
2019-03-26Remove the block on natvis for lld-link.TheGoddessInari-12/+0
2019-03-23adding mir::StaticKind enum for static and promotedSaleem Jaffer-9/+17
2019-03-21review fixesSaleem Jaffer-4/+4
2019-03-20rustc: Allow using `clang` for wasm32 targetsAlex Crichton-56/+21
This commit adds support code for using `clang` directly to link the wasm32-unknown-unknown target. Currently the target is only really configured to link with LLD directly, but this ensures that `clang` can be configured as well. While not immediately useful in the near term it's likely that more wasm32 targets will pop up over time with Clang's new native support for WebAssembly in the 8.0.0 release. Getting support into rustc early should make it easier to experiment with these targets and try out various changes here and there.
2019-03-20Add a -Z time option which prints only passes which runs onceJohn Kåre Alsaker-2/+2
2019-03-19rustc: Update linker flavor inference from filenameAlex Crichton-8/+11
This commit fixes what is believed to be a preexisting bug in the linker flavor inference and additionally adds a new features. Previously if the linker didn't end in `exe` the entire file name was compared to infer the linker's flavor. This commit fixes the code to instead unconditionally inspect `file_stem()` which is the relevant part we're looking at to figure out what the linker flavor is. Additionally this commit now also adds recognition of `clang` and clang wrappers that end in `-clang` (which look like gcc wrappers). This should allow clang-specific wrappers to get correctly inferred to the `Gcc` linker flavor rather than the default linker flavor configured for a target.
2019-03-18fixed all compilation errorsSaleem Jaffer-7/+15
2019-03-16Revert the `LazyConst` PROliver Scherer-20/+12
2019-03-16Rollup merge of #59180 - taiki-e:try_blocks, r=scottmcmkennytm-9/+7
Use try blocks in rustc_codegen_ssa r? @scottmcm
2019-03-15rustc: remove fmt::{Debug,Display} from ty::TyKind.Eduard-Mihai Burtescu-2/+2