summary refs log tree commit diff
path: root/compiler/rustc_llvm/llvm-wrapper
AgeCommit message (Collapse)AuthorLines
2024-09-16rustc_llvm: adapt to flattened CLI args in LLVMAugie Fackler-1/+18
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
2024-09-16rustc_llvm: update for ↵Augie Fackler-2/+6
llvm/llvm-project@2ae968a0d9fb61606b020e898d884c82dd0ed8b5 Just a simple header move. @rustbot label: +llvm-main
2024-08-31Rollup merge of #129749 - krasimirgg:llvm-20-lto, r=nikicMatthias Krüger-3/+7
llvm-wrapper: adapt for LLVM API changes No functional changes intended. Updates the wrapper for https://github.com/5c4lar/llvm-project/commit/21eddfac3d75879b3e0b09c5bc848526dcab6ab0. ````@rustbot```` label: +llvm-main r? ````@nikic````
2024-08-29Rollup merge of #128970 - DianQK:lint-llvm-ir, r=nikicGuillaume Gomez-1/+8
Add `-Zlint-llvm-ir` This flag is similar to `-Zverify-llvm-ir` and allows us to lint the generated IR. r? compiler
2024-08-29llvm-wrapper: adapt for LLVM API changesKrasimir Georgiev-3/+7
Updates the wrapper for https://github.com/5c4lar/llvm-project/commit/21eddfac3d75879b3e0b09c5bc848526dcab6ab0.
2024-08-29Add `-Zlint-llvm-ir`DianQK-1/+8
2024-08-27Rollup merge of #126985 - Mrmaxmeier:dwarf-embed-source, r=davidtwcoTrevor Gross-2/+7
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-21llvm-wrapper: adapt for LLVM 20 API changesKrasimir Georgiev-0/+11
No functional changes intended. Adapts llvm-wrapper for the LLVM commits https://github.com/llvm/llvm-project/commit/0f22d47a7a1f70ec77ea8ccdf08a6487827937db and https://github.com/llvm/llvm-project/commit/d6d8243dcd4ea768549904036ed31b8e59e14c73.
2024-08-15Auto merge of #128936 - bjorn3:fix_thin_archive_reading, r=jieyouxubors-9/+5
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-14Fix null pointer dereference when a file is not an object filebjorn3-0/+3
2024-08-14Use toString instead of raw_svector_ostream for error messagesbjorn3-9/+2
2024-08-11Add range attribute to scalar function results and argumentsAndreas Jonson-0/+12
2024-07-30Disable MC/DC tests on LLVM 19Krasimir Georgiev-1/+1
Disable the tests and generate an error if MC/DC is used on LLVM 19. The support will be ported separately, as it is substantially different on LLVM 19, and there are no plans to support both versions.
2024-07-29Add `-Z embed-source=yes` to embed source code in DWARF debug infoMrmaxmeier-2/+7
2024-07-25LLVM: LLVM-20.0 removes MMX typesMatthew Maurer-2/+0
See llvm/llvm-project#98505
2024-07-16Rollup merge of #124033 - bjorn3:ar_archive_writer_0_3_0, r=davidtwcoTrevor Gross-31/+105
Sync ar_archive_writer to LLVM 18.1.3 From LLVM 15.0.0-rc3. This adds support for COFF archives containing Arm64EC object files and has various fixes for AIX big archive files.
2024-07-12Remove LLVMRustDIBuilderInsertDeclareAtEnd return valueNikita Popov-11/+6
The return value changed from an Instruction to a DbgRecord in LLVM 19. As we don't actually use the result, drop the return value entirely to support both.
2024-07-07Fix review commentsbjorn3-0/+5
2024-07-07Fix building on LLVM 17bjorn3-0/+3
2024-07-07Sync ar_archive_writer to LLVM 18.1.3bjorn3-31/+97
From LLVM 15.0.0-rc3. This adds support for COFF archives containing Arm64EC object files and has various fixes for AIX big archive files.
2024-07-02Rename the `asm-comments` compiler flag to `verbose-asm`Trevor Gross-2/+2
Since this codegen flag now only controls LLVM-generated comments rather than all assembly comments, make the name more accurate (and also match Clang).
2024-07-02Always preserve user-written comments in assemblyTrevor Gross-1/+2
2024-06-26Format C++ files in `llvm-wrapper`DianQK-821/+764
2024-05-29Teach rustc about the Xtensa arch.Scott Mabin-0/+7
2024-05-23thinlto: only build summary file if neededAugie Fackler-2/+5
If we don't do this, some versions of LLVM (at least 17, experimentally) will double-emit some error messages, which is how I noticed this. Given that it seems to be costing some extra work, let's only request the summary bitcode production if we'll actually bother writing it down, otherwise skip it.
2024-05-22rustc_codegen_llvm: add support for writing summary bitcodeAugie Fackler-1/+13
Typical uses of ThinLTO don't have any use for this as a standalone file, but distributed ThinLTO uses this to make the linker phase more efficient. With clang you'd do something like `clang -flto=thin -fthin-link-bitcode=foo.indexing.o -c foo.c` and then get both foo.o (full of bitcode) and foo.indexing.o (just the summary or index part of the bitcode). That's then usable by a two-stage linking process that's more friendly to distributed build systems like bazel, which is why I'm working on this area. I talked some to @teresajohnson about naming in this area, as things seem to be a little confused between various blog posts and build systems. "bitcode index" and "bitcode summary" tend to be a little too ambiguous, and she tends to use "thin link bitcode" and "minimized bitcode" (which matches the descriptions in LLVM). Since the clang option is thin-link-bitcode, I went with that to try and not add a new spelling in the world. Per @dtolnay, you can work around the lack of this by using `lld --thinlto-index-only` to do the indexing on regular .o files of bitcode, but that is a bit wasteful on actions when we already have all the information in rustc and could just write out the matching minimized bitcode. I didn't test that at all in our infrastructure, because by the time I learned that I already had this patch largely written.
2024-04-25Auto merge of #121298 - nikic:writable, r=cuviperbors-0/+12
Set writable and dead_on_unwind attributes for sret arguments Set the `writable` and `dead_on_unwind` attributes for `sret` arguments. This allows call slot optimization to remove more memcpy's. See https://llvm.org/docs/LangRef.html#parameter-attributes for the specification of these attributes. In short, the statement we're making here is that: * The return slot is writable. * The return slot will not be read if the function unwinds. Fixes https://github.com/rust-lang/rust/issues/90595.
2024-04-25Set writable and dead_on_unwind attributes for sret argumentsNikita Popov-0/+12
2024-04-20Rollup merge of #124132 - RalfJung:OpBundlesIndirect, r=Mark-Simulacrum许杰友 Jieyou Xu (Joe)-0/+3
llvm RustWrapper: explain OpBundlesIndirect argument type Follow-up to https://github.com/rust-lang/rust/pull/123941 r? ``@Mark-Simulacrum``
2024-04-20coverage. Lowering MC/DC statements to llvm-irzhuyunxing-0/+27
2024-04-19coverage. Generate Mappings of decisions and conditions for MC/DCzhuyunxing-3/+91
2024-04-18llvm RustWrapper: explain OpBundlesIndirect argument typeRalf Jung-0/+3
2024-04-15Add support for Arm64EC to the Standard LibraryDaniel Paoliello-2/+2
2024-04-14Fix UB in LLVM FFI when passing zero or >1 bundleMark Rousskov-6/+29
Rust passes a *const &OperandBundleDef to these APIs, usually from a Vec<&OperandBundleDef> or so. Previously we were dereferencing that pointer and passing it to the ArrayRef constructor with some length (N). This meant that if the length was 0, we were dereferencing a pointer to nowhere, and if the length was >1 then loading the *second* element somewhere in LLVM would've been reading past the end. Since Rust can't hold OperandBundleDef by-value we're forced to indirect through a vector that copies out the OperandBundleDefs from the by-reference list on the Rust side in order to match the LLVM expected API.
2024-04-10Rollup merge of #123612 - kxxt:riscv-target-abi, r=jieyouxu,nikic,DianQKMatthias Krüger-1/+11
Set target-abi module flag for RISC-V targets Fixes cross-language LTO on RISC-V targets (Fixes #121924)
2024-04-09Pass value and valueLen to create a StringRefLevi Zim-3/+4
Instead of creating a cstring. Co-authored-by: LoveSy <shana@zju.edu.cn>
2024-04-09Set target-abi module flag for RISC-V targetskxxt-1/+10
Fixes cross-language LTO on RISC-V targets (Fixes #121924)
2024-04-08Rollup merge of #123591 - Zalathar:useless-cast, r=cuviperMatthias Krüger-2/+2
Remove unnecessary cast from `LLVMRustGetInstrProfIncrementIntrinsic` (Noticed while reviewing #123409.) This particular cast appears to have been copied over from clang, but there are plenty of other call sites in clang that don't bother with a cast here, and it works fine without one. For context, `llvm::Intrinsic::ID` is a typedef for `unsigned`, and `llvm::Intrinsic::instrprof_increment` is a member of `enum IndependentIntrinsics : unsigned`. --- The formatting change in `unwrap(M)` is the result of manually running `clang-format` on this file, and then reverting all changes other than the ones affecting these lines.
2024-04-08Rollup merge of #122807 - danielhuang:fix-1, r=davidtwcoMatthias Krüger-1/+1
Add consistency with phrases "meantime" and "mean time" "mean time" is used in a few places while "meantime" is used everywhere else; this would make usage consistent throughout the codebase.
2024-04-07Remove unnecessary cast from `LLVMRustGetInstrProfIncrementIntrinsic`Zalathar-2/+2
This particular cast appears to have been copied over from clang, but there are plenty of other call sites in clang that don't bother with a cast here, and it works fine without one. For context, `llvm::Intrinsic::ID` is a typedef for `unsigned`, and `llvm::Intrinsic::instrprof_increment` is a member of `enum IndependentIntrinsics : unsigned`.
2024-04-04Rollup merge of #123437 - Zalathar:clang-format, r=cuviperJacob Pratt-28/+20
Manually run `clang-format` on `CoverageMappingWrapper.cpp` In the current version of #123409, there are several unrelated changes to `CoverageMappingWrapper.cpp` that seem to be the result of running `clang-format` on that file. Instead of asking for those changes to be undone, I figure it's easier to just make them myself as a separate PR, since I was vaguely intending to do that at some point anyway. In a few cases I've strategically added comments to make the grouping of parameters a little nicer, but mostly it doesn't matter much.
2024-04-04Manually run `clang-format` on `CoverageMappingWrapper.cpp`Zalathar-28/+20
2024-04-03update messagesDan-1/+1
2024-04-03coverage: Correctly report and check LLVM's coverage mapping versionZalathar-1/+4
2024-03-26RustWrapper: update call for ↵Augie Fackler-0/+4
llvm/llvm-project@44d037cc258dcf179d2c48c93996bb406ecd0fae Easy change. @rustbot label: +llvm-main
2024-03-17Update the minimum external LLVM to 17Josh Stone-52/+4
2024-03-15Install the bad-alloc handler before fatal errorsJosh Stone-1/+1
The bad-alloc installer was incorrectly asserting that the other handler isn't set yet, instead of checking its own, but we can avoid that by changing the order we install them. Ref: https://github.com/llvm/llvm-project/issues/83040
2024-03-15Aggressively ignore write errors during bad-allocJosh Stone-3/+3
2024-03-15Register LLVM handlers for bad-alloc / OOMJosh Stone-1/+24
LLVM's default bad-alloc handler may throw if exceptions are enabled, and `operator new` isn't hooked at all by default. Now we register our own handler that prints a message similar to fatal errors, then aborts. We also call the function that registers the C++ `std::new_handler`.
2024-03-12llvm-wrapper: adapt for LLVM API changesKrasimir Georgiev-2/+7
Adapts rust for https://github.com/llvm/llvm-project/commit/9997e0397156ff7e01aecbd17bdeb7bfe5fb15b0.