| Age | Commit message (Collapse) | Author | Lines |
|
- `cc` 1.2.4 contains a fix to address [rustc uses wrong build tools
when compiling from MSVC
#133794](https://github.com/rust-lang/rust/issues/133794). See
<https://github.com/rust-lang/cc-rs/releases/tag/cc-v1.2.4>.
- `cc` 1.2.5 contains a fix to also check linking when testing if
certain compiler flags are supported, which fixed an issue that was
causing previous compiler `cc` bumps to fail. See
<https://github.com/rust-lang/cc-rs/releases/tag/cc-v1.2.5>.
Co-authored-by: David Lönnhager <david.l@mullvad.net>
(cherry picked from commit 3775d220af5a666b4239c9fdd1e0184d3df0c7a8)
|
|
As described here UseOdrIndicator should be disabled on Windows
since link.exe does not support duplicate weak definitions
(https://reviews.llvm.org/D137227).
Co-Authored-By: Bastian Kersting <bkersting@google.com>
|
|
single point.
LLVM does not expect to ever see multiple dbg_declares for the same variable at the same
location with different values. proc-macros make it possible for arbitrary code,
including multiple calls that get inlined, to happen at any given location in the source
code. Add discriminators when that happens so these locations are different to LLVM.
This may interfere with the AddDiscriminators pass in LLVM, which is added by the
unstable flag -Zdebug-info-for-profiling.
Fixes #131944
|
|
Trim and tidy includes in `rustc_llvm`
These includes tend to accumulate over time, and are usually only removed when something breaks in a new LLVM version, so it's nice to clean them up manually once in a while.
General strategy used for this PR:
- Remove all includes from `LLVMWrapper.h` that aren't needed by the header itself, transplanting them to individual source files as necessary.
- For each source file, temporarily remove each include if doing so doesn't cause a compile error.
- If a “required” include looks like it shouldn't be needed, try replacing it with its sub-includes, then trim that list.
- After doing all of the above, go back and re-add any removed include if the file does actually use things defined in that header, even if the header happens to also be included by something else.
|
|
|
|
|
|
Simplify FFI calls for `-Ztime-llvm-passes` and `-Zprint-codegen-stats`
The existing code for these unstable LLVM-infodump flags was jumping through hoops to pass an allocated C string across the FFI boundary, when it's much simpler to just write to a `&RustString` instead.
|
|
coverage: Extract safe FFI wrapper functions to `llvm_cov`
This PR takes all of the inline `unsafe` calls in coverage codegen, and all the safe wrapper functions in `coverageinfo/mod.rs`, and moves them to a new `llvm_cov` submodule that is dedicated to safe FFI wrapper functions. This reduces the mixing of abstraction levels in the rest of coverage codegen.
As a follow-up, this PR also tidies up the names and signatures of several of the coverage FFI functions.
|
|
llvm/llvm-project@390300d9f41df6ad71f0f4196ef4885d4bd5dc48 added a new
parameter to some callbacks, so we have to handle them.
@rustbot label: +llvm-main
|
|
|
|
|
|
|
|
|
|
Rollup of 15 pull requests
Successful merges:
- #129329 (Implement `From<&mut {slice}>` for `Box/Rc/Arc<{slice}>`)
- #131377 (Add LowerExp and UpperExp implementations to NonZero)
- #132393 (Docs: added brief colon explanation)
- #132437 (coverage: Regression test for inlining into an uninstrumented crate)
- #132499 (unicode_data.rs: show command for generating file)
- #132503 (better test for const HashMap; remove const_hash leftovers)
- #132511 (stabilize const_arguments_as_str)
- #132520 (NFC add known bug nr to test)
- #132522 (make codegen help output more consistent)
- #132523 (Added regression test for generics index out of bounds)
- #132528 (Use `*_opt` typeck results fns to not ICE in fallback suggestion)
- #132537 (PassWrapper: adapt for llvm/llvm-project@5445edb5d)
- #132540 (Do not format generic consts)
- #132543 (add and update some crashtests)
- #132550 (compiler: Continue introducing rustc_abi to the compiler)
r? `@ghost`
`@rustbot` modify labels: rollup
|
|
Port most of `--print=target-cpus` to Rust
The logic and formatting needed by `--print=target-cpus` has historically been carried out in C++ code. Originally it used `printf` to write directly to the console, but later it switched over to writing to a `std::ostringstream` and then passing its buffer to a callback function pointer.
This PR replaces that C++ code with a very simple function that writes a list of CPU names to a `&RustString`, with the rest of the logic and formatting being handled by ordinary safe Rust code.
|
|
PassWrapper: adapt for llvm/llvm-project@5445edb5d
As with ab5583ed1e75869b765a90386dac9119992f8ed7, we had been explicitly passing defaults whose type have changed. Rather than do an ifdef, we simply rely on the defaults.
````@rustbot```` label: +llvm-main
|
|
PassWrapper: adapt for llvm/llvm-project@b01e2a8b5620466c3b
A boolean turned into an enum. None matches the old behavior of false, so we pass that.
`@rustbot` label: +llvm-main
|
|
As with ab5583ed1e75869b765a90386dac9119992f8ed7, we had been explicitly
passing defaults whose type have changed. Rather than do an ifdef, we
simply rely on the defaults.
@rustbot label: +llvm-main
|
|
llvm/llvm-project@b01e2a8b5620466c3b80cc6f049efbc90b9d103a
We don't see a reason to explicitly pass the default here, so just use
the default instead of explicitly passing it and needing an ifdef.
@rustbot label: +llvm-main
|
|
|
|
|
|
|
|
cg_llvm: Clean up FFI calls for operand bundles
All of these FFI functions have equivalents in the stable LLVM-C API, though `LLVMBuildCallBr` requires a temporary polyfill on LLVM 18.
This PR also creates a clear split between `OperandBundleOwned` and `OperandBundle`, and updates the internals of the owner to be a little less terrifying.
|
|
|
|
|
|
cg_llvm: Clean up FFI calls for setting module flags
This is a combination of several inter-related changes to how module flags are set:
- Remove some unnecessary code for setting an `"LTOPostLink"` flag, which has been obsolete since LLVM 17.
- Define our own enum instead of relying on enum values defined by LLVM's unstable C++ API.
- Use safe wrapper functions to set module flags, instead of direct `unsafe` calls.
- Consistently pass pointer/length strings instead of C strings.
- Remove or shrink some `unsafe` blocks.
|
|
- Don't rely on enum values defined by LLVM's C++ API
- Use safe wrapper functions instead of direct `unsafe` calls
- Consistently pass pointer/length strings instead of C strings
|
|
This module flag was an internal detail of LLVM's optimization passes, and all
code involving it was removed in LLVM 17.
<https://github.com/llvm/llvm-project/commit/200cc952a28a73687ba24d5334415df6332f2d5b>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
coverage: Pass coverage mappings to LLVM as separate structs
Instead of trying to cram *N* different kinds of coverage mapping data into a single list for FFI, pass *N* different lists of simpler structs.
This avoids the need to fill unused fields with dummy values, and avoids the need to tag structs with their underlying kind. It also lets us call the dedicated LLVM constructors for each different mapping type, instead of having to go through the complex general-purpose constructor.
Even though this adds multiple new structs to the FFI surface area, the resulting C++ code is simpler and shorter.
---
I've structured this mostly as a single atomic patch, rather than a series of incremental changes, because that avoids the need to make fiddly fixes to code that is about to be deleted anyway.
|
|
compiler: Use LLVM's Comdat support
Acting on these long-ago issues:
- https://github.com/rust-lang/rust/issues/46437
- https://github.com/rust-lang/rust/issues/68955
|
|
|
|
|
|
|
|
Fixes string manipulation errors introduced in #130446.
|
|
RustWrapper: adapt for rename of Intrinsic::getDeclaration
llvm/llvm-project@fa789dffb1e12c2aece0187aeacc48dfb1768340 renamed getDeclaration to getOrInsertDeclaration.
`@rustbot` label: +llvm-main
|
|
llvm/llvm-project@fa789dffb1e12c2aece0187aeacc48dfb1768340 renamed
getDeclaration to getOrInsertDeclaration.
@rustbot label: +llvm-main
|
|
|
|
|
|
`cc` was previously pinned because version 1.1.106 dropped support for
Visual Studio 12 (2013), and we wanted to decouple that from the rest of
the automated updates. As noted in [2], there is no longer anything
indicating we support VS2013, so it should be okay to unpin it.
`cc` 1.1.22 contains a fix that may help improve the high MSVC CI
failure rate [3], so we also have motivation to update to that point.
[1]: https://github.com/rust-lang/rust/issues/129307
[2]: https://github.com/rust-lang/rust/issues/129307#issuecomment-2383749868
[3]: https://github.com/rust-lang/rust/issues/127883
|
|
|
|
rustc_llvm: adapt to flattened CLI args in LLVM
This changed in
llvm/llvm-project@e190d074a0a77c9f8a7d7938a8187a7e2076e290. I decided to stick with more duplication between the ifdef blocks to make the code easier to read for the next two years before we can plausibly drop LLVM 19.
`@rustbot` label: +llvm-main
try-job: x86_64-msvc
|
|
|
|
|
|
Revert #129749 to fix segfault in LLVM
This reverts commit 8c7a7e346be4cdf13e77ab4acbfb5ade819a4e60, reversing changes made to a00bd75b6c5c96d0a35afa2dc07ce3155112d278.
Reported in https://github.com/rust-lang/rust/pull/129749#issuecomment-2354417960. `@nikic's` theory is that the LLVM API changed in a way that makes it impossible to use concurrently from multiple threads (https://github.com/llvm/llvm-project/pull/106427#issuecomment-2354783802). I pinged `@krasimirgg` who was fine with reverting.
r? `@rust-lang/wg-llvm`
|