summary refs log tree commit diff
path: root/src/librustc_codegen_ssa
AgeCommit message (Collapse)AuthorLines
2019-05-30Auto merge of #61253 - nnethercote:avoid-hygiene_data-lookups, r=petrochenkovbors-1/+1
Avoid `hygiene_data` lookups These commits mostly introduce compound operations that allow two close adjacent `hygiene_data` lookups to be combined. r? @petrochenkov
2019-05-30light refactoring of global AllocMapRalf Jung-1/+1
* rename AllocKind -> GlobalAlloc. This stores the allocation itself, not just its kind. * rename the methods that allocate stuff to have consistent names.
2019-05-30Make the `type_name` intrinsic's output deterministicOliver Scherer-6/+6
2019-05-29Rollup merge of #61297 - eddyb:forsaken-stats, r=nagisaMazdak Farrokhzad-77/+3
Remove LLVM instruction stats and other (obsolete) codegen stats. Both `-Z count_llvm_insns` and `-Z codegen-stats` are removed, as (AFAIK) they have been of little use in the last few years, especially after the transition to MIR->LLVM codegen. Other than for the LLVM instruction counts, `-Z codegen-stats` has long been obsoleted anyway. r? @nagisa cc @rust-lang/compiler
2019-05-29Rollup merge of #61291 - spastorino:avoid-unneeded-bug-call, r=estebankMazdak Farrokhzad-14/+12
Avoid unneeded bug!() call r? @oli-obk
2019-05-29Introduce and use `SyntaxContext::outer_expn_info()`.Nicholas Nethercote-1/+1
It reduces two `hygiene_data` accesses to one on some hot paths.
2019-05-29rustc_codegen_llvm: remove LLVM instruction count stats.Eduard-Mihai Burtescu-67/+3
2019-05-29Rollup merge of #60928 - TheSirC:fix/60229, r=eddybMazdak Farrokhzad-10/+10
Changes the type `mir::Mir` into `mir::Body` Fixes part 1 of #60229 (previously attempted in #60242). I stumbled upon the issue and it seems that the previous attempt at solving it was not merged. This is a second try more up-to-date. The commit should have changed comments as well. At the time of writting, it passes the tidy and check tool.
2019-05-29rustc_codegen_ssa: remove obsolete codegen stats.Eduard-Mihai Burtescu-10/+0
2019-05-28Avoid unneeded bug!() callSantiago Pastorino-14/+12
2019-05-28Changes the type `mir::Mir` into `mir::Body`Claude-Alban RANÉLY-VERGÉ-DÉPRÉ-10/+10
The commit should have changed comments as well. At the time of writting, it passes the tidy and check tool. Revisions asked by eddyb : - Renamed of all the occurences of {visit/super}_mir - Renamed test structures `CachedMir` to `Cached` Fixing the missing import on `AggregateKind`
2019-05-28Rename PgoGenerate to something more general.Michael Woerister-3/+3
2019-05-27Use a PathBuf instead of String for representing the pgo-use path internally.Michael Woerister-2/+2
2019-05-25Make `ConstValue::Slice` solely take `[u8]` and `str`Oliver Scherer-4/+8
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.