summary refs log tree commit diff
path: root/compiler/rustc_codegen_ssa/src/back
AgeCommit message (Collapse)AuthorLines
2020-12-23Exclude unnecessary info from CodegenResultsVictor Ding-2/+3
`foreign_module` and `wasm_import_module` are not needed for linking, and hence can be removed from CodegenResults.
2020-12-16compiletest: add split dwarf compare modeDavid Wood-0/+7
This commit adds a Split DWARF compare mode to compiletest so that debuginfo tests are also tested using Split DWARF in split mode (and manually in single mode). Signed-off-by: David Wood <david@davidtw.co>
2020-12-16cg_llvm: implement split dwarf supportDavid Wood-14/+110
This commit implements Split DWARF support, wiring up the flag (added in earlier commits) to the modified FFI wrapper (also from earlier commits). Signed-off-by: David Wood <david@davidtw.co>
2020-12-16cg_ssa: introduce `TargetMachineFactoryFn` aliasDavid Wood-12/+4
This commit removes the `TargetMachineFactory` struct and adds a `TargetMachineFactoryFn` type alias which is used everywhere that the previous, long type was used. Signed-off-by: David Wood <david@davidtw.co>
2020-12-16cg_ssa: correct documentation commentsDavid Wood-56/+49
This commit changes some comments to documentation comments so that they can be read on the generated rustdoc. Signed-off-by: David Wood <david@davidtw.co>
2020-12-01Rollup merge of #79508 - jryans:check-dsymutil-result, r=nagisaGuillaume Gomez-9/+23
Warn if `dsymutil` returns an error code This checks the error code returned by `dsymutil` and warns if it failed. It also provides the stdout and stderr logs from `dsymutil`, similar to the native linker step. I tried to think of ways to test this change, but so far I haven't found a good way, as you'd likely need to inject some nonsensical args into `dsymutil` to induce failure, which feels too artificial to me. Also, https://github.com/rust-lang/rust/issues/79361 suggests Rust is on the verge of disabling `dsymutil` by default, so perhaps it's okay for this change to be untested. In any case, I'm happy to add a test if someone sees a good approach. Fixes https://github.com/rust-lang/rust/issues/78770
2020-11-30Warn if `dsymutil` returns an error codeJ. Ryan Stinnett-9/+23
This checks the error code returned by `dsymutil` and warns if it failed. It also provides the stdout and stderr logs from `dsymutil`, similar to the native linker step. Fixes https://github.com/rust-lang/rust/issues/78770
2020-11-26Add support for Arm64 Catalyst on ARM MacsBenedikt Terhechte-1/+2
2020-11-12rustc_target: Mark UEFI targets as `is_like_windows`/`is_like_msvc`Vadim Petrochenkov-0/+2
Document what `is_like_windows` and `is_like_msvc` mean in more detail.
2020-11-08rustc_target: Rename some target options to avoid tautologyVadim Petrochenkov-6/+6
`target.target_endian` -> `target.endian` `target.target_c_int_width` -> `target.c_int_width` `target.target_os` -> `target.os` `target.target_env` -> `target.env` `target.target_vendor` -> `target.vendor` `target.target_family` -> `target.os_family` `target.target_mcount` -> `target.mcount`
2020-11-08Collapse all uses of `target.options.foo` into `target.foo`Vadim Petrochenkov-80/+72
with an eye on merging `TargetOptions` into `Target`. `TargetOptions` as a separate structure is mostly an implementation detail of `Target` construction, all its fields logically belong to `Target` and available from `Target` through `Deref` impls.
2020-10-15Remove rustc_session::config::Configest31-7/+3
The wrapper type led to tons of target.target across the compiler. Its ptr_width field isn't required any more, as target_pointer_width is already present in parsed form.
2020-10-15Replace target.target with target and target.ptr_width with target.pointer_widthest31-92/+87
Preparation for a subsequent change that replaces rustc_target::config::Config with its wrapped Target. On its own, this commit breaks the build. I don't like making build-breaking commits, but in this instance I believe that it makes review easier, as the "real" changes of this PR can be seen much more easily. Result of running: find compiler/ -type f -exec sed -i -e 's/target\.target\([)\.,; ]\)/target\1/g' {} \; find compiler/ -type f -exec sed -i -e 's/target\.target$/target/g' {} \; find compiler/ -type f -exec sed -i -e 's/target.ptr_width/target.pointer_width/g' {} \; ./x.py fmt
2020-10-15Rename target_pointer_width to pointer_width and turn it into an u32est31-2/+2
Rename target_pointer_width to pointer_width because it is already member of the Target struct. The compiler supports only three valid values for target_pointer_width: 16, 32, 64. Thus it can safely be turned into an int. This means less allocations and clones as well as easier handling of the type.
2020-10-15Rollup merge of #77739 - est31:remove_unused_code, r=petrochenkov,varkorYuki Okushi-2/+0
Remove unused code Rustc has a builtin lint for detecting unused code inside a crate, but when an item is marked `pub`, the code, even if unused inside the entire workspace, is never marked as such. Therefore, I've built [warnalyzer](https://github.com/est31/warnalyzer) to detect unused items in a cross-crate setting. Closes https://github.com/est31/warnalyzer/issues/2
2020-10-14Remove unused code from rustc_codegen_*est31-2/+0
2020-10-14Rollup merge of #77795 - bjorn3:codegen_backend_interface_refactor, r=oli-obkDylan DPC-14/+0
Codegen backend interface refactor This moves several things away from the codegen backend to rustc_interface. There are a few behavioral changes where previously the incremental cache (incorrectly) wouldn't get finalized, but now it does. See the individual commit messages.
2020-10-13Replace absolute paths with relative onesest31-1/+1
Modern compilers allow reaching external crates like std or core via relative paths in modules outside of lib.rs and main.rs.
2020-10-12Remove dump_incremental_databjorn3-9/+0
2020-10-12Fix -Clinker-plugin-lto with opt-levels s and zJonas Schievink-3/+1
2020-10-10Move finalize_session_directory call out of cg_llvmbjorn3-5/+0
This causes it to be called even when passing `-Zno-link`, when linking fails or when neither `--emit link` nor `--emit metadata` is used.
2020-10-05Instruct lld that our @ files are posix-style, not WindowsMark Rousskov-0/+6
An upstream LLVM change changed behavior here to respect the host system quoting rules; previously the posix-style format was always used for @files.
2020-10-01Rollup merge of #77202 - ehuss:defer-apple-sdkroot, r=petrochenkovDylan DPC-0/+86
Defer Apple SDKROOT detection to link time. This defers the detection of the SDKROOT for Apple iOS/tvOS targets to link time, instead of when the `Target` is defined. This allows commands that don't need to link to work (like `rustdoc` or `rustc --print=target-list`). This also makes `--print=target-list` a bit faster. This also removes the note in the platform support documentation about these targets being missing. When I wrote it, I misunderstood how the SDKROOT stuff worked. Notes: * This means that JSON spec targets can't explicitly override these flags. I think that is probably fine, as I believe the value is generally required, and can be set with the SDKROOT environment variable. * This changes `x86_64-apple-tvos` to use `appletvsimulator`. I think the original code was wrong (it was using `iphonesimulator`). Also, `x86_64-apple-tvos` seems broken in general, and I cannot build it locally. The `data_layout` does not appear to be correct (it is a copy of the arm64 layout instead of the x86_64 layout). I have not tried building Apple's LLVM to see if that helps, but I suspect it is just wrong (I'm uncertain since I don't know how the tvOS simulator works with its bitcode-only requirements). * I'm tempted to remove the use of `Result` for built-in target definitions, since I don't think they should be fallible. This was added in https://github.com/rust-lang/rust/pull/34980, but that only relates to JSON definitions. I think the built-in targets shouldn't fail. I can do this now, or not. Fixes #36156 Fixes #76584
2020-09-26Move add_apple_sdk out of add_pre_link_args.Eric Huss-1/+3
2020-09-25Defer Apple SDKROOT detection to link time.Eric Huss-0/+84
2020-09-25Link dynamic and static late_link_args before generic onesMateusz Mikuła-3/+3
2020-09-10use push(char) instead of push_str(&str) to add single chars to stringsMatthias Krüger-1/+1
clippy::single-char-push-str
2020-09-09Add `-Z combine_cgu` flagVictor Ding-12/+47
Introduce a compiler option to let rustc combines all regular CGUs into a single one at the end of compilation. Part of Issue #64191
2020-09-03Rollup merge of #76167 - mati865:mingw-self-contained-heuristic, r=petrochenkovDylan DPC-92/+25
Replace MinGW library hack with heuristic controlling link mode Depends on https://github.com/rust-lang/rust/pull/76158 Closes https://github.com/rust-lang/rust/issues/68887
2020-09-01Rollup merge of #76158 - mati865:self-contained-option, r=petrochenkovTyler Mandry-3/+3
Stabilise link-self-contained option MCP has been accepted: https://github.com/rust-lang/compiler-team/issues/343 I'll add improved heuristic in next PR.
2020-09-01Replace MinGW library hack with heuristic controlling link modeMateusz Mikuła-92/+25
2020-08-31Fix `-Z instrument-coverage` on MSVCRich Kadel-1/+1
Found that -C link-dead-code (which was enabled automatically under -Z instrument-coverage) was causing the linking error that resulted in segmentation faults in coverage instrumented binaries. Link dead code is now disabled under MSVC, allowing `-Z instrument-coverage` to be enabled under MSVC for the first time. More details are included in Issue #76038. (This PR was broken out from PR #75828)
2020-08-31Stabilise link-self-contained optionMateusz Mikuła-3/+3
2020-08-30mv compiler to compiler/mark-0/+6371