Zalathar
ce3e14a448
Remove support for -Zprofile
(gcov-style coverage instrumentation)
2024-10-31 09:09:25 +11:00
Matthias Krüger
879c4d5ccc
Rollup merge of #132342 - Zalathar:operand-bundle, r=workingjubilee
...
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.
2024-10-30 06:40:38 +01:00
Zalathar
c3071590ab
Clean up FFI calls for operand bundles
2024-10-30 13:26:24 +11:00
Zalathar
65ff2a6ad7
Consistently use safe wrapper function set_section
2024-10-30 11:38:20 +11:00
Matthias Krüger
2707cd670c
Rollup merge of #132319 - Zalathar:add-module-flag, r=jieyouxu
...
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.
2024-10-29 18:38:59 +01:00
Zalathar
8d2ed4f0f3
Clean up FFI calls for setting module flags
...
- 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
2024-10-29 21:40:34 +11:00
Zalathar
ba81dbf3c6
Don't set unnecessary module flag "LTOPostLink"
...
This module flag was an internal detail of LLVM's optimization passes, and all
code involving it was removed in LLVM 17.
<200cc952a2
>
2024-10-29 21:17:13 +11:00
klensy
2b326e3817
correct LLVMRustDIBuilderCreateOpLLVMFragment return type
2024-10-29 00:47:20 +03:00
klensy
17636374de
correct LLVMRustCreateThinLTOData arg types
2024-10-29 00:47:20 +03:00
Zalathar
d976ca8701
Use LLVM-C APIs for getting/setting visibility
2024-10-27 11:05:33 +11:00
Zalathar
96993a9b5e
Use LLVM-C APIs for getting/setting linkage
2024-10-26 20:20:20 +11:00
Zalathar
b3d65852c3
coverage: Emit MC/DC intrinsics using the normal helper method
2024-10-25 14:01:36 +11:00
Zalathar
4923e856be
coverage: Emit llvm.instrprof.increment
using the normal helper method
2024-10-25 13:55:44 +11:00
Stuart Cook
8f354fc94a
Rollup merge of #131956 - Zalathar:llvm-counters, r=compiler-errors,Swatinem
...
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.
2024-10-24 14:19:57 +11:00
Stuart Cook
0bfc49b053
Rollup merge of #131876 - workingjubilee:llvm-c-c-c-comdat, r=Zalathar
...
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
2024-10-20 14:06:03 +11:00
Zalathar
d1bf77eb34
Pass coverage mappings to LLVM as separate structs
2024-10-20 13:29:34 +11:00
Jubilee Young
492760020e
llvm: Delete LLVMRustSetComdat
2024-10-19 10:46:10 -07:00
Arthur Eubanks
18bbf5f118
clang-format
2024-10-16 21:46:52 +00:00
Arthur Eubanks
6de277c039
rustc_llvm: Fix flattened CLI args
...
Fixes string manipulation errors introduced in #130446 .
2024-10-16 21:26:34 +00:00
Trevor Gross
6f76d6e1a3
Rollup merge of #131552 - durin42:llvm-20-getOrInsertDeclaration, r=cuviper
...
RustWrapper: adapt for rename of Intrinsic::getDeclaration
llvm/llvm-project@fa789dffb1 renamed getDeclaration to getOrInsertDeclaration.
`@rustbot` label: +llvm-main
2024-10-11 16:53:50 -05:00
Augie Fackler
19345d5c6e
RustWrapper: adapt for rename of Intrinsic::getDeclaration
...
llvm/llvm-project@fa789dffb1 renamed
getDeclaration to getOrInsertDeclaration.
@rustbot label: +llvm-main
2024-10-11 12:29:49 -04:00
Zalathar
9357277de7
coverage: Remove code related to LLVM 17
2024-10-11 21:44:36 +11:00
zhuyunxing
911ac56e95
coverage. Disable supporting mcdc on llvm-18
2024-10-08 10:50:18 +08:00
Trevor Gross
eaaa94318b
Unpin cc
and upgrade to the latest version
...
`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
2024-09-30 13:31:42 -04:00
Aleksei Romanov
afb7eef79a
Pass Module Analysis Manager to Standard Instrumentations
2024-09-25 22:57:32 +03:00
bors
1f9a018fa3
Auto merge of #130446 - durin42:llvm-20-fix-CommandLineArgs, r=workingjubilee
...
rustc_llvm: adapt to flattened CLI args in LLVM
This changed in
llvm/llvm-project@e190d074a0 . 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
2024-09-22 05:26:41 +00:00
Josh Stone
6fd8a50680
Update the minimum external LLVM to 18
2024-09-18 13:53:31 -07:00
Krasimir Georgiev
3a352884f8
llvm-wrapper: adapt for LLVM API changes, second try
2024-09-18 13:23:42 +00:00
Matthias Krüger
f8090dda64
Rollup merge of #130477 - tmandry:revert-llvm-20-lto, r=tmandry
...
Revert #129749 to fix segfault in LLVM
This reverts commit 8c7a7e346b
, reversing changes made to a00bd75b6c
.
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`
2024-09-17 20:45:51 +02:00
Tyler Mandry
472fef6a70
Revert "Rollup merge of #129749 - krasimirgg:llvm-20-lto, r=nikic"
...
This reverts commit 8c7a7e346b
, reversing
changes made to a00bd75b6c
.
2024-09-16 17:11:02 -07:00
Augie Fackler
86d67b7933
PassWrapper: clang-format has spoken
2024-09-16 20:06:50 -04:00
Augie Fackler
ad0ecebf43
rustc_llvm: adapt to flattened CLI args in LLVM
...
This changed in
llvm/llvm-project@e190d074a0 . 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
2024-09-16 19:58:05 -04:00
Augie Fackler
1e68f05109
rustc_llvm: update for llvm/llvm-project@2ae968a0d9
...
Just a simple header move.
@rustbot label: +llvm-main
2024-09-16 19:53:13 -04:00
Chris Denton
7223fd8085
Add system libs when cross compiling for Windows
2024-09-15 12:38:55 +00:00
Boxy
0091b8ab2a
update cfgs
2024-09-05 17:24:01 +01:00
Matthias Krüger
8c7a7e346b
Rollup merge of #129749 - krasimirgg:llvm-20-lto, r=nikic
...
llvm-wrapper: adapt for LLVM API changes
No functional changes intended.
Updates the wrapper for 21eddfac3d
.
````@rustbot```` label: +llvm-main
r? ````@nikic````
2024-08-31 14:46:09 +02:00
Guillaume Gomez
d5c40d03dc
Rollup merge of #128970 - DianQK:lint-llvm-ir, r=nikic
...
Add `-Zlint-llvm-ir`
This flag is similar to `-Zverify-llvm-ir` and allows us to lint the generated IR.
r? compiler
2024-08-29 16:21:47 +02:00
Krasimir Georgiev
9c910e81a4
llvm-wrapper: adapt for LLVM API changes
...
Updates the wrapper for 21eddfac3d
.
2024-08-29 14:08:58 +00:00
DianQK
9589eb95d2
Add -Zlint-llvm-ir
2024-08-29 18:12:31 +08:00
Matthias Krüger
489eb230dd
Rollup merge of #129648 - nnethercote:unreachable_pub-2, r=Urgau
...
More `unreachable_pub`
Add `unreachable_pub` checking to some more compiler crates. A follow-up to #126013 .
r? ``@Urgau``
2024-08-27 18:59:29 +02:00
Matthias Krüger
3299e30abc
Rollup merge of #129635 - compiler-errors:unsafe-blocks, r=spastorino
...
Use unsafe extern blocks throughout the compiler
Making this change in preparation for edition 2024.
r? spastorino
2024-08-27 18:59:28 +02:00
Trevor Gross
9c26ebe32e
Rollup merge of #126985 - Mrmaxmeier:dwarf-embed-source, r=davidtwco
...
Implement `-Z embed-source` (DWARFv5 source code embedding extension)
Implement https://github.com/rust-lang/compiler-team/issues/764 MCP which adds an unstable flag that exposes LLVM's [DWARFv5 source code embedding](https://dwarfstd.org/issues/180201.1.html ) support.
2024-08-27 01:46:49 -05:00
Nicholas Nethercote
22cdd632f1
Add warn(unreachable_pub)
to rustc_llvm
.
2024-08-27 15:28:26 +10:00
Michael Goulet
38e62b9841
Use unsafe extern blocks throughout the compiler
2024-08-26 19:51:05 -04:00
Matthias Krüger
2a7f2da422
Rollup merge of #129290 - tgross35:pin-cc, r=Mark-Simulacrum
...
Pin `cc` to 1.0.105
`cc` 1.0.106 removes support for Visual Studio 12. Pin to 1.0.105 so we don't drop support yet.
Fixes: https://github.com/rust-lang/rust/pull/128722#issuecomment-2297605573
2024-08-24 22:14:13 +02:00
Krasimir Georgiev
b509b4226b
llvm-wrapper: adapt for LLVM 20 API changes
...
No functional changes intended.
Adapts llvm-wrapper for the LLVM commits 0f22d47a7a
and d6d8243dcd
.
2024-08-21 16:27:31 +00:00
Trevor Gross
a5f6c15571
Pin cc
to 1.0.105
...
`cc` 1.0.106 removes support for Visual Studio 12. Pin to 1.0.105 so we
don't drop support yet.
Fixes: https://github.com/rust-lang/rust/pull/128722#issuecomment-2297605573
2024-08-19 22:24:46 -04:00
bors
d2b5aa6552
Auto merge of #128936 - bjorn3:fix_thin_archive_reading, r=jieyouxu
...
Support reading thin archives in ArArchiveBuilder
And switch to using ArArchiveBuilder with the LLVM backend too now that all regressions are fixed.
Fixes https://github.com/rust-lang/rust/issues/107407
Fixes https://github.com/rust-lang/rust/issues/107162
https://github.com/rust-lang/rust/issues/107495 has been fixed in a previous PR already.
2024-08-15 14:13:52 +00:00
bjorn3
901c9daa05
Fix null pointer dereference when a file is not an object file
2024-08-14 19:37:14 +00:00
bjorn3
7c972d75dc
Use toString instead of raw_svector_ostream for error messages
2024-08-14 19:26:00 +00:00