about summary refs log tree commit diff
path: root/src/librustc_codegen_ssa
AgeCommit message (Collapse)AuthorLines
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
2019-03-14Use try blocks in rustc_codegen_ssaTaiki Endo-9/+7
2019-03-10Replace TimeLine with SelfProfilerWesley Wiser-79/+72
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-3/+4
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 #58984 - estebank:multi-treat-err-as-bug, r=oli-obkPietro Albini-1/+1
Teach `-Z treat-err-as-bug` to take a number of errors to emit `-Z treat-err-as-bug` will cause `rustc` to panic after the first error is reported, like previously. `-Z treat-err-as-bug=2` will cause `rustc` to panic after 2 errors have been reported. Fix #58983.
2019-03-08Rollup merge of #58926 - gabi-250:tcx-lifetimes, r=petrochenkovPietro Albini-2/+2
Make the lifetime parameters of tcx consistent. I have implemented `codegen_allocator` for my backend, but I've had to make a small change to its signature in `ExtraBackendMethods`. I wonder if this change is justified, or if it is too specific to my use case to be useful to anyone else. `write_metadata` and `codegen_allocator` are both called from `codegen_crate` (in `librustc_codegen_ssa/base.rs`), and they both receive the same `tcx` as an argument: https://github.com/rust-lang/rust/blob/c196097e588b05e86b5ce6de992b2a6e6a7027bd/src/librustc_codegen_ssa/base.rs#L555-L557 and: https://github.com/rust-lang/rust/blob/c196097e588b05e86b5ce6de992b2a6e6a7027bd/src/librustc_codegen_ssa/base.rs#L640-L642 However, `codegen_allocator` accepts a `TyCtxt` with any lifetime parameters (`tcx: TyCtxt<'_, '_, '_>`), while `write_metadata` requires that the `tcx` argument is of type `TyCtxt<'b, 'gcx, 'gcx>`. In my implementation, I've found that it's necessary for `tcx` in `codegen_allocator` to also have the `<'b, 'gcx, 'gcx>` lifetime parameters. Have I misunderstood the purpose of the parameters of `TyCtxt`? I've read [here](https://rust-lang.github.io/rustc-guide/ty.html) that the last two parameters only need to be distinct if the function needs to be used during type inference, but I don't think that is the case here.
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-07HirIdification: replace NodeId method callsljedrz-2/+2
2019-03-06Make `-Z treat-err-as-bug` take a number of errors to be emittedEsteban Küber-1/+1
`-Z treat-err-as-bug=0` will cause `rustc` to panic after the first error is reported. `-Z treat-err-as-bug=2` will cause `rustc` to panic after 3 errors have been reported.
2019-03-05Use non_erasable_generics for codegenvarkor-1/+3
Co-Authored-By: Gabriel Smith <yodaldevoid@users.noreply.github.com>
2019-03-04Make the lifetime parameters of tcx consistent.Gabriela Alexandra Moldovan-2/+2
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 #58425 - wesleywiser:more_profiler_changes, r=michaelwoeristerbors-0/+28
[self-profiler] Make the profiler faster/more efficient Related to #58372 r? @michaelwoerister
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-03Wrap the self-profiler in an `Arc<Mutex<>>`Wesley Wiser-0/+28
This will allow us to send it across threads and measure things like LLVM time.
2019-03-02Auto merge of #58836 - ljedrz:begone_NodeId, r=Zoxcbors-6/+6
Remove NodeId from even more HIR nodes The next iteration of HirIdification (#57578). Removes `NodeId` from: - [x] `StructField` - [x] `ForeignItem` - [x] `Item` - [x] `Pat` - [x] `FieldPat` - [x] `VariantData` - [x] `ImplItemId` (replaces it with `HirId`) - [x] `TraitItemId` (replaces it with `HirId`)
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-02hir: remove NodeId from StructFieldljedrz-6/+6
2019-03-01Auto merge of #58631 - spastorino:place2_1, r=oli-obkbors-15/+22
Put Local, Static and Promoted as one Base variant of Place Related to #52708 The `Place` 2.0 representation use a `Base` variant for `Local`, `Static` and `Promoted` so we start making this change in the current `Place` to make the following steps simpler. r? @oli-obk
2019-03-01Put Local, Static and Promoted as one Base variant of PlaceSantiago Pastorino-15/+22
2019-03-01Auto merge of #58408 - alexcrichton:update-llvm, r=michaelwoeristerbors-24/+1
rustc: Update LLVM, remove dead wasm code This commit updates the LLVM branch to the rebased version of the upstream release/8.x branch. This includes a wasm patch which means that the `rewrite_imports` pass in rustc is no longer needed (yay!) and we can instead rely on `wasm-import-module`, an attribute we're already emitting, to take care of all the work.
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`.
2019-02-27Refactor FunctionCx::codgen_terminatorDan Robertson-671/+771
- Move closures defined in codegen_terminator into a separate helper structure and implementation. - Create helper functions for each of the complex match arms on the terminators kind in codegen_terminator.
2019-02-27Support defining C compatible variadic functionsDan Robertson-10/+110
Add support for defining C compatible variadic functions in unsafe rust with extern "C".
2019-02-26rustc: Update LLVM, remove dead wasm codeAlex Crichton-24/+1
This commit updates the LLVM branch to the rebased version of the upstream release/8.x branch. This includes a wasm patch which means that the `rewrite_imports` pass in rustc is no longer needed (yay!) and we can instead rely on `wasm-import-module`, an attribute we're already emitting, to take care of all the work.
2019-02-26replace &'tcx Substs with SubstsRefcsmoe-8/+8
2019-02-25librustc_codegen_ssa: deny(elided_lifetimes_in_paths)Mazdak Farrokhzad-30/+34
2019-02-24Rollup merge of #58511 - oli-obk:const_to_op, r=RalfJungMazdak Farrokhzad-4/+4
Const to op simplification r? @RalfJung alternative to https://github.com/rust-lang/rust/pull/58486