summaryrefslogtreecommitdiff
path: root/compiler/rustc_llvm/llvm-wrapper
Commit message (Collapse)AuthorAgeFilesLines
* Auto merge of #111364 - cuviper:unhack-thinlto, r=nikicHEADmasterbors2023-05-181-57/+0
|\ | | | | | | | | | | | | | | | | | | | | Remove the ThinLTO CU hack This reverts #46722, commit e0ab5d5feb4eb2d8af11b8dd9446c2b45fada8af. Since #111167, commit 10b69dde3fd15334ea2382d2dc9e9a261de1afaf, we are generating DWARF subprograms in a way that is meant to be more compatible with LLVM's expectations, so hopefully we don't need this workaround rewriting CUs anymore.
| * Remove the ThinLTO CU hackJosh Stone2023-05-081-57/+0
| | | | | | | | | | | | | | | | | | This reverts #46722, commit e0ab5d5feb4eb2d8af11b8dd9446c2b45fada8af. Since #111167, commit 10b69dde3fd15334ea2382d2dc9e9a261de1afaf, we are generating DWARF subprograms in a way that is meant to be more compatible with LLVM's expectations, so hopefully we don't need this workaround rewriting CUs anymore.
* | Usage of atomic counters for llvm code coverageEvgeniy A. Dushistov2023-05-121-0/+3
| |
* | Correctly mark parameter `RustMappingRegions` as pointer-to-`const`Zalathar2023-05-091-1/+1
| | | | | | | | | | The regions don't need to be mutable because we pass a copy of them to LLVM instead, and this matches the `*const` in the Rust-side signature.
* | Isolate coverage FFI type layouts from their underlying LLVM C++ typesZalathar2023-05-091-7/+100
|/
* Rollup merge of #111274 - cuviper:print-target-cpus, r=Mark-SimulacrumMatthias Krüger2023-05-061-14/+16
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | Expand the LLVM coverage of `--print target-cpus` We've been relying on a custom patch to add `MCSubtargetInfo::getCPUTable` for `rustc --print target-cpus`, and just printing that it's not supported on external LLVM builds. LLVM `main` now has `getAllProcessorDescriptions` that can replace ours, so now we try to use that. In addition, the fallback path can at least print the native and default cpu options. There were also some mismatches in the function signatures here between `LLVM_RUSTLLVM` and otherwise; this is now mitigated by sharing these functions and only using cpp to adjust the function bodies.
| * Expand the LLVM coverage of `--print target-cpus`Josh Stone2023-05-051-14/+16
| | | | | | | | | | | | | | | | | | | | | | | | We've been relying on a custom patch to add `MCSubtargetInfo::getCPUTable` for `rustc --print target-cpus`, and just printing that it's not supported on external LLVM builds. LLVM `main` now has `getAllProcessorDescriptions` that can replace ours, so now we try to use that. In addition, the fallback path can at least print the native and default cpu options. There were also some mismatches in the function signatures here between `LLVM_RUSTLLVM` and otherwise; this is now mitigated by sharing these functions and only using cpp to adjust the function bodies.
* | Rollup merge of #111167 - cuviper:type-decl-disubprogram, r=michaelwoeristerMatthias Krüger2023-05-061-0/+22
|\ \ | |/ |/| | | | | | | | | | | | | | | | | | | | | | | debuginfo: split method declaration and definition When we're adding a method to a type DIE, we only want a DW_AT_declaration there, because LLVM LTO can't unify type definitions when a child DIE is a full subprogram definition. Now the subprogram definition gets added at the CU level with a specification link back to the abstract declaration. Both GCC and Clang write debuginfo this way for C++ class methods. Fixes #109730. Fixes #109934.
| * debuginfo: split method declaration and definitionJosh Stone2023-05-031-0/+22
| | | | | | | | | | | | | | When we're adding a method to a type DIE, we only want a DW_AT_declaration there, because LLVM LTO can't unify type definitions when a child DIE is a full subprogram definition. Now the subprogram definition gets added at the CU level with a specification link back to the abstract declaration.
* | change expect() to unwrap_or_else() and update msgJames Dietz2023-05-041-2/+6
| |
* | moved default CPU message inlineJames Dietz2023-05-041-9/+7
| |
* | `--print target-cpus` shows default target cpu, updated docsJames Dietz2023-05-041-2/+9
|/
* [LLVM17] Adapt to `ExplicitEmulatedTLS` removal.Tim Neumann2023-04-241-0/+5
|
* Rollup merge of #110668 - ehuss:fix-native-cpu-list, r=cuviperMatthias Krüger2023-04-231-1/+3
|\ | | | | | | | | | | | | | | Fix printing native CPU on cross-compiled compiler. If `rustc` is cross-compiled from a different host, then the "native" entry in `rustc --print=target-cpus` would not appear. There is a check in the printing code that will avoid printing the "native" entry if the user has passed `--target`. However, that check was comparing the `--target` value with the `LLVM_TARGET_TRIPLE` which is the triple of the host that `rustc` was built on (the "build" target in Rust lingo), not the target it was being built for (the "host" in Rust lingo). This fixes it to use the target that LLVM was built for (which I'm pretty sure this is the correct function to determine that). This fixes the cpu listing for aarch64-apple-darwin which is built on CI using the x86_64-apple-darwin host.
| * Fix printing native CPU on cross-compiled compiler.Eric Huss2023-04-231-1/+3
| |
* | Remove deprecated LLVM any_isaQiu Chaofan2023-04-201-8/+8
|/
* Recognize AIX style archive kindQiu Chaofan2023-04-191-0/+3
|
* Spelling - compilerJosh Soref2023-04-171-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * account * achieved * advising * always * ambiguous * analysis * annotations * appropriate * build * candidates * cascading * category * character * clarification * compound * conceptually * constituent * consts * convenience * corresponds * debruijn * debug * debugable * debuggable * deterministic * discriminant * display * documentation * doesn't * ellipsis * erroneous * evaluability * evaluate * evaluation * explicitly * fallible * fulfill * getting * has * highlighting * illustrative * imported * incompatible * infringing * initialized * into * intrinsic * introduced * javascript * liveness * metadata * monomorphization * nonexistent * nontrivial * obligation * obligations * offset * opaque * opportunities * opt-in * outlive * overlapping * paragraph * parentheses * poisson * precisely * predecessors * predicates * preexisting * propagated * really * reentrant * referent * responsibility * rustonomicon * shortcircuit * simplifiable * simplifications * specify * stabilized * structurally * suggestibility * translatable * transmuting * two * unclosed * uninhabited * visibility * volatile * workaround Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
* Rollup merge of #96971 - zhaixiaojuan:master, r=wesleywiserMichael Goulet2023-04-111-0/+7
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Initial support for loongarch64-unknown-linux-gnu Hi, We hope to add a new port in rust for LoongArch. LoongArch intro LoongArch is a RISC style ISA which is independently designed by Loongson Technology in China. It is divided into two versions, the 32-bit version (LA32) and the 64-bit version (LA64). LA64 applications have application-level backward binary compatibility with LA32 applications. LoongArch is composed of a basic part (Loongson Base) and an expanded part. The expansion part includes Loongson Binary Translation (LBT), Loongson VirtualiZation (LVZ), Loongson SIMD EXtension (LSX) and Loongson Advanced SIMD EXtension(LASX). Currently the LA464 processor core supports LoongArch ISA and the Loongson 3A5000 processor integrates 4 64-bit LA464 cores. LA464 is a four-issue 64-bit high-performance processor core. It can be used as a single core for high-end embedded and desktop applications, or as a basic processor core to form an on-chip multi-core system for server and high-performance machine applications. Documentations: ISA: https://loongson.github.io/LoongArch-Documentation/LoongArch-Vol1-EN.html ABI: https://loongson.github.io/LoongArch-Documentation/LoongArch-ELF-ABI-EN.html More docs can be found at: https://loongson.github.io/LoongArch-Documentation/README-EN.html Since last year, we have locally adapted two versions of rust, rust1.41 and rust1.57, and completed the test locally. I'm not sure if I'm submitting all the patches at once, so I split up the patches and here's one of the commits
| * Enable loongarch64 LLVM targetzhaixiaojuan2023-04-041-0/+7
| |
* | Auto merge of #109862 - klensy:llvm-dd, r=nikicbors2023-04-081-74/+3
|\ \ | | | | | | | | | | | | | | | llvm: replace some deprecated functions, add fixmes Replace some deprecated llvm functions, add FIXME's (for simpler future work), replace some rust custom functions with llvm ones.
| * | reviewklensy2023-04-051-1/+1
| | |
| * | replaceklensy2023-04-041-12/+1
| | | | | | | | | | | | | | | LLVMRustBuildIntCast -> LLVMBuildIntCast2 LLVMRustAddHandler -> LLVMAddHandler
| * | Use existing llvm methods, instead of rust wrappers for:klensy2023-04-041-49/+0
| | | | | | | | | | | | | | | | | | | | | | | | LLVMRustBuildCleanupPad -> LLVMBuildCleanupPad LLVMRustBuildCleanupRet -> LLVMBuildCleanupRet LLVMRustBuildCatchPad -> LLVMBuildCatchPad LLVMRustBuildCatchRet -> LLVMBuildCatchRet LLVMRustBuildCatchSwitch -> LLVMBuildCatchSwitch
| * | replace LLVMRustAppendModuleInlineAsm with LLVMAppendModuleInlineAsm, ↵klensy2023-04-041-9/+0
| | | | | | | | | | | | LLVMRustMetadataTypeInContext with LLVMMetadataTypeInContext
| * | replace LLVMRustMetadataAsValue with LLVMMetadataAsValueklensy2023-04-041-4/+0
| | |
| * | add bunch of fixmes: currently there exist some functions that accept ↵klensy2023-04-041-0/+2
| | | | | | | | | | | | LLVMValueRef, some that accept LLVMMetadataRef, and replacing one with another not always possible without explicit convertion
* | | Preserve, clarify, and extend debug informationJulia Tatz2023-03-311-0/+3
|/ / | | | | | | | | | | | | | | | | | | `-Cdebuginfo=1` was never line tables only and can't be due to backwards compatibility issues. This was clarified and an option for line tables only was added. Additionally an option for line info directives only was added, which is well needed for some targets. The debug info options should now behave the same as clang's debug info options.
* | Auto merge of #109720 - Dylan-DPC:rollup-u564m8s, r=Dylan-DPCbors2023-03-291-7/+10
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Rollup of 7 pull requests Successful merges: - #108335 (rustdoc + rustdoc-json support for `feature(non_lifetime_binders)`) - #109534 (rustdoc: Unsupport importing `doc(primitive)` and `doc(keyword)` modules) - #109659 (llvm-wrapper: adapt for LLVM API change) - #109664 (Use span of placeholders in format_args!() expansion.) - #109683 (Check for overflow in `assemble_candidates_after_normalizing_self_ty`) - #109713 (Fix mismatched punctuation in Debug impl of AttrId) - #109718 (Rename `IndexVec::last` → `last_index`) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
| * | llvm-wrapper: adapt for LLVM API changeKrasimir Georgiev2023-03-271-7/+10
| |/ | | | | | | Adapts the wrapper for the LLVM commit https://github.com/llvm/llvm-project/commit/377e1311d50c7e5b5aab3db081938e0d0ceebdfc.
* | Add OpenHarmony targetsAmanieu d'Antras2023-03-281-1/+6
|/ | | | | - `aarch64-unknown-linux-ohos` - `armv7-unknown-linux-ohos`
* Remove an extraneous includeKazu Hirata2023-03-071-1/+0
| | | | | | | | SymbolWrapper.cpp doesn't use std::optional or llvm::Optional, so this patch removes the extraneous include. Note that llvm/ADT/Optional.h has been deprecated upstream. This patch ensures that SymbolWrapper.cpp continues to compile even after the upcoming removal of Optional.h.
* Remove references to PassManagerBuilderNikita Popov2023-03-061-2/+0
| | | | This is a legacy PM concept that we no longer use.
* Rollup merge of #108599 - nikic:drop-init, r=cuviperMatthias Krüger2023-03-031-34/+2
|\ | | | | | | | | | | | | | | Remove legacy PM leftovers This drops two leftovers of legacy PM usage: * We don't need to initialize passes anymore. * The pass listing was still using legacy PM passes. Replace it with the corresponding new PM listing.
| * Print NewPM passesNikita Popov2023-03-011-16/+2
| | | | | | | | | | -C passes=list was printing passes for the legacy pass manager. Use PassBuilder::printPassNames() to print NewPM passes instead.
| * Remove pass initialization codeNikita Popov2023-03-011-18/+0
| | | | | | | | This is no longer necessary with the new pass manager.
* | record llvm cgu instruction statscsmoe2023-02-252-0/+14
|/
* Add `kernel-address` sanitizer support for freestanding targetsWesley Norris2023-02-141-3/+7
|
* Update the minimum external LLVM to 14Josh Stone2023-02-102-54/+4
|
* llvm-16: Use Triple.h from new header location.Matthew Maurer2023-02-071-1/+6
| | | | LLVM 16 has moved Triple.h from ADT and into TargetParser
* llvm-wrapper: adapt for LLVM API changesKrasimir Georgiev2023-02-021-8/+30
| | | | | | | | Adapts the wrapper for https://github.com/llvm/llvm-project/commit/516e301752560311d2cd8c2b549493eb0f98d01b, where the constructor of PGOOptions gained a new FileSystem argument. Adapted to use the real file system, similarly to the changes inside of LLVM: https://github.com/llvm/llvm-project/commit/516e301752560311d2cd8c2b549493eb0f98d01b#diff-f409934ba27ad86494f3012324e9a3995b56e0743609ded7a387ba62bbf5edb0R236
* Rollup merge of #106113 - krasimirgg:llvm-16-ext-tyid, r=nikicMichael Goulet2023-01-211-11/+9
|\ | | | | | | | | | | | | | | llvm-wrapper: adapt for LLVM API change No functional changes intended. The LLVM commit https://github.com/llvm/llvm-project/commit/e6b02214c68df2c9f826e02310c9352ac652e456 added `TargetExtTyID` to the `TypeID` enum. This adapts `RustWrapper` accordingly.
| * llvm-wrapper: adapt for LLVM API changeKrasimir Georgiev2023-01-021-11/+9
| | | | | | | | | | | | No functional changes intended. The LLVM commit https://github.com/llvm/llvm-project/commit/e6b02214c68df2c9f826e02310c9352ac652e456 added `TargetExtTyID` to the `TypeID` enum. This adapts `RustWrapper` accordingly.
* | Remove double spaces after dots in commentsMaybe Waffle2023-01-171-2/+2
| |
* | rustc_llvm: replace llvm::makeArrayRef with ArrayRef constructors.Dmitri Gribenko2023-01-112-12/+13
|/ | | | LLVM upstream has deprecated llvm::makeArrayRef and will remove it.
* llvm-wrapper: adapt for LLVM API changesKrasimir Georgiev2022-12-112-1/+15
| | | | | | | | | | This is a follow-up of https://github.com/rust-lang/rust/commit/75aec4703dea7ef8e13924ccfa3a3d2e8c5c7cff. There, I updated the wrapper to only include llvm/ADT/Optional.h for LLVM version below 16. But I missed updating some of the None references. Found by our experimental rust + llvm at HEAD bot: https://buildkite.com/llvm-project/rust-llvm-integrate-prototype/builds/15587#0185006b-e0af-49e5-8b06-280ed125ff0d/200-539
* Rollup merge of #105109 - rcvalle:rust-kcfi, r=bjorn3Matthias Krüger2022-12-101-8/+8
|\ | | | | | | | | | | | | | | | | | | | | | | Add LLVM KCFI support to the Rust compiler This PR adds LLVM Kernel Control Flow Integrity (KCFI) support to the Rust compiler. It initially provides forward-edge control flow protection for operating systems kernels for Rust-compiled code only by aggregating function pointers in groups identified by their return and parameter types. (See llvm/llvm-project@cff5bef.) Forward-edge control flow protection for C or C++ and Rust -compiled code "mixed binaries" (i.e., for when C or C++ and Rust -compiled code share the same virtual address space) will be provided in later work as part of this project by identifying C char and integer type uses at the time types are encoded (see Type metadata in the design document in the tracking issue #89653). LLVM KCFI can be enabled with -Zsanitizer=kcfi. Thank you again, `@bjorn3,` `@eddyb,` `@nagisa,` and `@ojeda,` for all the help!
| * Add LLVM KCFI support to the Rust compilerRamon de C Valle2022-12-081-8/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit adds LLVM Kernel Control Flow Integrity (KCFI) support to the Rust compiler. It initially provides forward-edge control flow protection for operating systems kernels for Rust-compiled code only by aggregating function pointers in groups identified by their return and parameter types. (See llvm/llvm-project@cff5bef.) Forward-edge control flow protection for C or C++ and Rust -compiled code "mixed binaries" (i.e., for when C or C++ and Rust -compiled code share the same virtual address space) will be provided in later work as part of this project by identifying C char and integer type uses at the time types are encoded (see Type metadata in the design document in the tracking issue #89653). LLVM KCFI can be enabled with -Zsanitizer=kcfi. Co-authored-by: bjorn3 <17426603+bjorn3@users.noreply.github.com>
* | Rollup merge of #105298 - krasimirgg:llvm-16-dec-1, r=cuviperMatthias Krüger2022-12-062-1/+26
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | llvm-wrapper: adapt for an LLVM API change Adapts llvm-wrapper for https://github.com/llvm/llvm-project/commit/8c7c20f033c7036a8bf231ca6f9e02172cb581f0. No functional changes intended. Found via our experimental rust + llvm @ HEAD bot: https://buildkite.com/llvm-project/rust-llvm-integrate-prototype/builds/15404#0184d95d-5a68-4db6-ad32-51ddbc3ab543/202-571
| * | llvm-wrapper: adapt for and LLVM API changeKrasimir Georgiev2022-12-062-1/+26
| | |