about summary refs log tree commit diff
path: root/src/librustc_codegen_ssa
AgeCommit message (Collapse)AuthorLines
2019-05-25Don't use `ty::Const` without immediately interningOliver Scherer-4/+4
2019-05-23Update dylib_dependency_formats, extern_crate and reachable_non_genericsJohn Kåre Alsaker-4/+3
2019-05-23Update foreign_modules and dllimport_foreign_itemsJohn Kåre Alsaker-2/+1
2019-05-23Update upstream_monomorphizations and upstream_monomorphizations_forJohn Kåre Alsaker-8/+4
2019-05-23Rollup merge of #61014 - jsgf:emit-artifact-type, r=alexcrichtonMazdak Farrokhzad-1/+1
Make -Zemit-artifact-notifications also emit the artifact type This is easier for tooling to handle than trying to reverse-engineer the type from the filename extension. The field name and value is intended to reflect the `--emit` command-line option. Related issues https://github.com/rust-lang/rust/issues/60988 https://github.com/rust-lang/rust/issues/58465 cc @alexcrichton
2019-05-23Auto merge of #60740 - petrochenkov:kw, r=nnethercotebors-3/+3
Simplify use of keyword symbols They mirror non-keyword symbols now (see https://github.com/rust-lang/rust/pull/60630). `keywords::MyKeyword.name()` -> `kw::MyKeyword` `keywords::MyKeyword.ident()` -> `Ident::with_empty_ctxt(kw::MyKeyword)` (not common) `keywords::Invalid.ident()` -> `Ident::invalid()` (more common) Keywords are simply `Symbol` constants now, the `Keyword` struct is eliminated. This means `kw::MyKeyword` can now be used in `match` in particular.
2019-05-22Simplify use of keyword symbolsVadim Petrochenkov-3/+3
2019-05-22Make maybe_codegen_consume_direct iterate instead of doing recursionSantiago Pastorino-34/+36
2019-05-21Make -Zemit-artifact-notifications also emit the artifact typeJeremy Fitzhardinge-1/+1
This is easier for tooling to handle than trying to reverse-engineer it from the filename extension.
2019-05-20Auto merge of #60815 - nnethercote:use-Symbol-more-2, r=petrochenkovbors-5/+5
Use `Symbol` even more These patches simplify the code a bit (fewer conversions) and also speed things up a bit (fewer `with_interner` calls). r? @petrochenkov
2019-05-20Introduce `LocalInternedString::intern`.Nicholas Nethercote-5/+5
`LocalInternedString::intern(x)` is preferable to `Symbol::intern(x).as_str()`, because the former involves one call to `with_interner` while the latter involves two.
2019-05-20Rollup merge of #60895 - chandde:master, r=alexcrichtonMazdak Farrokhzad-0/+2
Enable thumbv7a-pc-windows-msvc target build end to end in rust/master With this PR, plus another commit https://github.com/rust-lang-nursery/compiler-builtins/commit/cf98161da7ed5217b6031796f0f60b4dd07148a4, I'm able to build the target thumbv7a-pc-windows-msvc successfully, and I'm able to use the stage2 artifacts to build arm32 projects. The commit in compiler_builtins is in release 0.1.14, the current cargo.lock in rust master still uses 0.1.12, so I bumped the compiler_builtins version in cargo.lock to 0.1.15 The command I used to build rust ``` c:\python27\python.exe x.py build --host x86_64-pc-windows-msvc --build x86_64-pc-windows-msvc --target thumbv7a-pc-windows-msvc --verbose ``` **Changes** 1. update cargolock to use compiler_builtins 0.1.15 2. handle libunwind in libtest for thumv7a the same as what we have for aarch64 3. in llvm codegen add a field in CodegenContext to carry the arch, so later in create_msvc_imps function, the arch can be used to check against "x86", instead of 32 pointer width. Apparently Thumv7a is handled differently than x86. **Background** I'm from Microsoft working on enabling Azure IoTEdge on ARM32 Windows IoTCore, Azure IoTEdge has a component called IoTEdged written in rust as a NT service running on Windows, so we need to enable rust on thumbv7a in order to have full IoTEdge. My colleague had made some heavy lifting and we've been using our private toolchain to build IoTEdged in our devops pipeline, because at that time we cannot build thumbv7a target end to end successfully. This change is a followup to enable the end to end build for thumbv7a-pc-windows-msvc target. **Next step** I'll submit more changes to have this target built nightly in rust/master, to achieve the same availability for aarch64-pc-windows-msvc, indexed here https://rust-lang.github.io/rustup-components-history/aarch64-pc-windows-msvc.html and can be manually installed. **Please do share what takes to make this happen, is there a formal process I need to follow\?**
2019-05-17Rollup merge of #60862 - spastorino:get-ty-from-local_decls, r=oli-obkMazdak Farrokhzad-3/+2
Get ty from local_decls instead of using Place r? @oli-obk This is from one of your review on Place 2.0
2019-05-16add targetarch for CodegenContextChandler Deng-0/+2
2019-05-16Auto merge of #60693 - saleemjaffer:refactor_fntype_stuff, r=eddybbors-20/+19
refactor some `FnType` stuff to `rustc::ty::layout` Does work in the direction of #56166.
2019-05-15Get ty from local_decls instead of using PlaceSantiago Pastorino-3/+2
2019-05-14removes `AbiMethods`Saleem Jaffer-20/+19
2019-05-13Remove the equality operation between `Symbol` and strings.Nicholas Nethercote-1/+1
And also the equality between `Path` and strings, because `Path` is made up of `Symbol`s.
2019-05-13Pass a `Symbol` to `check_name`, `emit_feature_err`, and related functions.Nicholas Nethercote-6/+6
2019-05-07Auto merge of #60464 - eddyb:not-overly-specific-pipelining, r=alexcrichtonbors-0/+3
rustc: rename -Z emit-directives to -Z emit-artifact-notifications and simplify the output. This is my take on #60006 / #60419 (see https://github.com/rust-lang/rust/pull/60006#discussion_r275983732). I'm not too attached the "notifications" part, it's pretty much bikeshed material. **EDIT**: for "artifact", @matklad pointed out Cargo already uses it (in https://github.com/rust-lang/rust/pull/60464#issuecomment-488576998) The first two commits are fixes that could be landed independently, especially the `compiletest` one, which removes the need for any of the normalization added in #60006 to land the test. The last commit enables the emission for all outputs, which was my main suggestion for #60006, mostly to show that it's minimal and not really a "scope creep" (as suggested in https://github.com/rust-lang/rust/pull/60006#discussion_r279964081). cc @alexcrichton @nnethercote
2019-05-07rustc_codegen_ssa: emit artifact notifications for the main link product too.Eduard-Mihai Burtescu-0/+3
2019-05-06Auto merge of #60526 - alexcrichton:wasm-main-symbols, r=oli-obkbors-6/+14
rustc: Always handle exported symbols on the wasm target Currently when linking an artifact rustc will only conditionally call the `Linker::export_symbols` function, but this causes issues on some targets, like WebAssembly, where it means that executable outputs will not have the same symbols exported that cdylib outputs have. This commit sinks the conditional call to `export_symbols` inside the various implementations of the function that still need it, and otherwise the wasm linker is configured to always pass through symbol visibility lists.
2019-05-05code review fixesSaleem Jaffer-2/+1
2019-05-04adding HasParamEnv traitSaleem Jaffer-2/+9
2019-05-04Auto merge of #59897 - tmandry:variantful-generators, r=eddybbors-23/+49
Multi-variant layouts for generators This allows generators to overlap fields using variants, but doesn't do any such overlapping yet. It creates one variant for every state of the generator (unresumed, returned, panicked, plus one for every yield), and puts every stored local in each of the yield-point variants. Required for optimizing generator layouts (#52924). There was quite a lot of refactoring needed for this change. I've done my best in later commits to eliminate assumptions in the code that only certain kinds of types are multi-variant, and to centralize knowledge of the inner mechanics of generators in as few places as possible. This change also emits debuginfo about the fields contained in each variant, as well as preserving debuginfo about stored locals while running in the generator. Also, fixes #59972. Future work: - Use this change for an optimization pass that actually overlaps locals within the generator struct (#52924) - In the type layout fields, don't include locals that are uninitialized for a particular variant, so miri and UB sanitizers can check our memory (see https://github.com/rust-lang/rust/issues/59972#issuecomment-483058172) - Preserve debuginfo scopes across generator yield points
2019-05-03Split out debuginfo from type info in MIR GeneratorLayoutTyler Mandry-3/+5
2019-05-03rustc: Always handle exported symbols on the wasm targetAlex Crichton-6/+14
Currently when linking an artifact rustc will only conditionally call the `Linker::export_symbols` function, but this causes issues on some targets, like WebAssembly, where it means that executable outputs will not have the same symbols exported that cdylib outputs have. This commit sinks the conditional call to `export_symbols` inside the various implementations of the function that still need it, and otherwise the wasm linker is configured to always pass through symbol visibility lists.
2019-05-02Auto merge of #59008 - varkor:const-generics-infer, r=eddybbors-0/+1
Add const generics to infer (and transitive dependencies) Split out from #53645. This work is a collaborative effort with @yodaldevoid. There are a number of stubs. These are mainly to ensure we don't overlook them when completing the implementation, but are not necessary for the initial implementation. We plan to address these in follow up PRs. r? @eddyb / @nikomatsakis
2019-05-02Rollup merge of #60385 - nnethercote:earlier-metadata, r=alexcrichtonMazdak Farrokhzad-110/+69
Emit metadata files earlier This will make cargo pipelining much more effective.
2019-05-01Add `ConstValue::Placeholder`varkor-0/+1
2019-05-01Auto merge of #60195 - varkor:commontypes-to-common, r=eddybbors-1/+1
Split `CommonTypes` into `CommonTypes` and `CommonLifetimes` The so-called "`CommonTypes`" contains more than just types. r? @eddyb
2019-05-01Move metadata writing earlier.Nicholas Nethercote-29/+6
The commit moves metadata writing from `link_binary` to `encode_metadata` (and renames the latter as `encode_and_write_metadata`). This is at the very start of code generation.
2019-05-01Inline and remove `link_binary_output`.Nicholas Nethercote-74/+61
This change simplifies things for the subsequent commit.
2019-04-30Move metadata encoding earlier.Nicholas Nethercote-30/+25
This commit separates metadata encoding (`tcx.encode_metadata`) from the creation of the metadata module (which is now handled by `write_compressed_metadata`, formerly `write_metadata`). The metadata encoding now occurs slightly earlier in the pipeline, at the very start of code generation within `start_codegen`. Metadata *writing* still occurs near the end of compilation; that will be moved forward in subsequent commits.
2019-04-30Auto merge of #60389 - Centril:rollup-nefreyr, r=Centrilbors-10/+8
Rollup of 4 pull requests Successful merges: - #59869 (SGX target: implemented vectored I/O) - #60238 (Update rustfmt to 1.2.2) - #60276 (Cleanup the MIR visitor) - #60380 (Fix line number display in source view) Failed merges: r? @ghost
2019-04-30Rollup merge of #60276 - matthewjasper:cleanup-mir-visitor, r=estebankMazdak Farrokhzad-10/+8
Cleanup the MIR visitor * Remove useless `BasicBlock` parameters on methods with `Location`s. * Prefer `visit_terminator_kind` to `visit_terminator`. * Remove `Region` from PlaceContexts. `visit_rvalue` should be used when the region is important. * Remove unused visitor methods.
2019-04-29Auto merge of #60006 - nnethercote:json-for-pipelining, r=alexcrichtonbors-29/+25
In JSON output, emit a directive after metadata is generated. To implement pipelining, Cargo needs to know when metadata generation is finished. This is done via a new JSON "directive". Unfortunately, metadata file writing currently occurs very late during compilation, so pipelining won't produce a speed-up. Moving metadata file writing earlier will be a follow-up. r? @alexcrichton
2019-04-30In JSON output, emit a directive after metadata is generated.Nicholas Nethercote-4/+10
To implement pipelining, Cargo needs to know when metadata generation is finished. This commit adds code to do that. Unfortunately, metadata file writing currently occurs very late during compilation, so pipelining won't produce a speed-up. Moving metadata file writing earlier will be a follow-up. The change involves splitting the existing `Emitter::emit` method in two: `Emitter::emit_diagnostic` and `Emitter::emit_directive`. The JSON directives look like this: ``` {"directive":"metadata file written: liba.rmeta"} ``` The functionality is behind the `-Z emit-directives` option, and also requires `--error-format=json`.
2019-04-26Remove region from borrow place contextsMatthew Jasper-6/+6
2019-04-26Remove BasicBlock parameter from mir visitor methodsMatthew Jasper-4/+2
2019-04-26Update handling of Tuplevarkor-1/+1
2019-04-26Remove some unused return values.Nicholas Nethercote-25/+15
2019-04-25Update existing usagesvarkor-1/+1
2019-04-25Preserve visibility scopes in stored generator localsTyler Mandry-9/+17
Unfortunately, this didn't have quite the effect I was hoping for. Locals still appear visible at every point in the function, regardless of scopes. I suspect all the rewriting of the MIR we do for the generator transform makes these scopes less useful. I didn't observe any regressions in behavior, but it's possible that this change is wrong without additional changes to the MIR.
2019-04-25Generalize discriminant info calls for generators and ADTsTyler Mandry-18/+9
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-24Rollup merge of #60190 - nnethercote:less-metadata-gen, r=alexcrichtonMazdak Farrokhzad-23/+37
Don't generate unnecessary rmeta files. As per https://github.com/rust-lang/rust/pull/60006#issuecomment-484284191. r? @alexcrichton
2019-04-24Don't generate unnecessary rmeta files.Nicholas Nethercote-23/+37
2019-04-23rustc: dissuade compiler developers from misusing upvar debuginfo.Eduard-Mihai Burtescu-5/+6