about summary refs log tree commit diff
path: root/compiler/rustc_llvm
AgeCommit message (Collapse)AuthorLines
2023-03-06Remove references to PassManagerBuilderNikita Popov-2/+0
This is a legacy PM concept that we no longer use.
2023-03-03Rollup merge of #108599 - nikic:drop-init, r=cuviperMatthias Krüger-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.
2023-03-01Print NewPM passesNikita Popov-16/+2
-C passes=list was printing passes for the legacy pass manager. Use PassBuilder::printPassNames() to print NewPM passes instead.
2023-03-01Remove pass initialization codeNikita Popov-18/+0
This is no longer necessary with the new pass manager.
2023-02-25record llvm cgu instruction statscsmoe-0/+14
2023-02-14Add `kernel-address` sanitizer support for freestanding targetsWesley Norris-3/+7
2023-02-10Update the minimum external LLVM to 14Josh Stone-54/+4
2023-02-07llvm-16: Use Triple.h from new header location.Matthew Maurer-1/+6
LLVM 16 has moved Triple.h from ADT and into TargetParser
2023-02-02llvm-wrapper: adapt for LLVM API changesKrasimir Georgiev-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
2023-01-21Rollup merge of #106113 - krasimirgg:llvm-16-ext-tyid, r=nikicMichael Goulet-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.
2023-01-17Remove double spaces after dots in commentsMaybe Waffle-2/+2
2023-01-11rustc_llvm: replace llvm::makeArrayRef with ArrayRef constructors.Dmitri Gribenko-12/+13
LLVM upstream has deprecated llvm::makeArrayRef and will remove it.
2023-01-05Fix `uninlined_format_args` for some compiler cratesnils-14/+14
Convert all the crates that have had their diagnostic migration completed (except save_analysis because that will be deleted soon and apfloat because of the licensing problem).
2023-01-02llvm-wrapper: adapt for LLVM API changeKrasimir Georgiev-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.
2022-12-11llvm-wrapper: adapt for LLVM API changesKrasimir Georgiev-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
2022-12-10Rollup merge of #105109 - rcvalle:rust-kcfi, r=bjorn3Matthias Krüger-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!
2022-12-09Auto merge of #104572 - pkubaj:patch-1, r=cuviperbors-6/+8
Fix build on powerpc-unknown-freebsd Probably also fixes build on arm and mips*. Related to https://github.com/rust-lang/rust/issues/104220
2022-12-08Add LLVM KCFI support to the Rust compilerRamon de C Valle-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>
2022-12-09Fix build on powerpc-unknown-freebsdpkubaj-6/+8
Probably also fixes build on mips*. Related to https://github.com/rust-lang/rust/issues/104220
2022-12-06Rollup merge of #105298 - krasimirgg:llvm-16-dec-1, r=cuviperMatthias Krüger-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
2022-12-06llvm-wrapper: adapt for and LLVM API changeKrasimir Georgiev-1/+26
2022-11-26Use LLVM for getting symbols from COFF bigobj filesbjorn3-10/+24
2022-11-26Rewrite LLVM's archive writer in Rustbjorn3-0/+87
This allows it to be used by other codegen backends
2022-11-25[llvm-wrapper] adapt for LLVM API changeKrasimir Georgiev-0/+4
Adapt for the LLVM API changes from https://github.com/llvm/llvm-project/commit/721f975d3518403502f770ce11f3f02509b30c5b#diff-5a347903b8412ed1b1b1948c3fce47f9a6ff05dc70bfaeedb6d06b622e399d91.
2022-11-24Rollup merge of #104517 - dfordivam:patch-1, r=cuviperMatthias Krüger-1/+1
Throw error on failure in loading llvm-plugin The following code silently ignores the error as the `LLVMRustSetLastError` only tracks one error at a time. At all other places where `LLVMRustSetLastError` is used the code immediately returns. https://github.com/rust-lang/rust/blob/251831ece9601d64172127b6caae9087358c2386/compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp#L801-L804
2022-11-21Auto merge of #102717 - beetrees:repr128-c-style-debuginfo, r=nagisabors-2/+3
Pass 128-bit C-style enum enumerator values to LLVM Pass the full 128 bits of C-style enum enumerators through to LLVM. This means that debuginfo for C-style repr128 enums is now emitted correctly for DWARF platforms (as compared to not being correctly emitted on any platform). Tracking issue: #56071
2022-11-17Throw error on failure in loading llvm-pluginDivam Narula-1/+1
2022-11-15Introduce composite debuginfo.Camille GILLOT-0/+4
2022-11-14[llvm-wrapper] adapt for LLVM API changeKrasimir Georgiev-1/+1
2022-11-13Rollup merge of #103709 - cuviper:netbsd-9, r=pietroalbiniManish Goregaokar-1/+1
ci: Upgrade dist-x86_64-netbsd to NetBSD 9.0 This is another step in toolchain upgrades for LLVM 16, which will need at least GCC 7.1. Our previous NetBSD 8.0 cross-toolchain used its system GCC 5.5. While there are newer versions available in pkgsrc, I could not get those working for cross-compilation. Upgrading to NetBSD 9.0 gets us GCC 7.4, which is sufficient for now. This will affect the compatibility of the build we ship for `x86_64-unknown-netbsd`, but others may still build their own from source if that is needed. It is expected that NetBSD 8 will reach EOL soon anyway, approximately one month after 10 is released, but there is no firm date for that.
2022-11-04LLVM 16: Switch to using MemoryEffectsTim Neumann-3/+40
2022-10-28Upgrade dist-x86_64-netbsd to NetBSD 9.0Josh Stone-1/+1
2022-10-25llvm-16: Don't initialize removed legacy passesMatthew Maurer-0/+2
LLVM removed initialization for legacy passes: https://reviews.llvm.org/D136615
2022-10-09Pass 128-bit C-style enum enumerator values to LLVMbeetrees-2/+3
2022-09-26Avoid LLVM-deprecated `Optional::hasValue`Josh Stone-1/+1
LLVM 15 added `Optional::has_value`, and LLVM `main` (16) has deprecated `hasValue`. However, its `explicit operator bool` does the same thing, and was added long ago, so we can use that across our full LLVM range of compatibility.
2022-09-25Rollup merge of #101997 - cuviper:drop-legacy-pm, r=nikicfee1-dead-257/+7
Remove support for legacy PM This removes support for optimizing with LLVM's legacy pass manager, as well as the unstable `-Znew-llvm-pass-manager` option. We have been defaulting to the new PM since LLVM 13 (except for s390x that waited for 14), and LLVM 15 removed support altogether. The only place we still use the legacy PM is for writing the output file, just like `llc` does. cc #74705 r? ``@nikic``
2022-09-18Use LLVM C-API to build atomic cmpxchg and fenceJosh Stone-39/+0
2022-09-18Use the helper for internalizing with new PMJosh Stone-5/+2
2022-09-18Never use legacy PM for writing bitcodeJosh Stone-18/+4
2022-09-18Remove support for LLVM's legacy pass managerJosh Stone-234/+1
2022-09-09Introduce a fallible variant of LLVMConstIntGetZExtValueTomasz Miąsko-0/+8
which verifies that a constant bit width is within 64 bits or fails.
2022-09-09Rollup merge of #99207 - 5225225:msan-eager-checks, r=jackh726Matthias Krüger-1/+14
Enable eager checks for memory sanitizer Fixes #99179
2022-09-07llvm-wrapper: adapt for LLVM API changesKrasimir Georgiev-1/+7
No functional changes intended. Adapts PassWrapper for two recent LLVM API changes: * https://github.com/llvm/llvm-project/commit/e7bac3b9fa739f8d167a390a547068aad1d424a7 * https://github.com/llvm/llvm-project/commit/93600eb50ceeec83c488ded24fa0fd25f997fec6 * https://github.com/llvm/llvm-project/commit/5e38b2a456df6e263a509af60a731cec57310498
2022-08-31Rollup merge of #101025 - semarie:openbsd-archs, r=petrochenkovMatthias Krüger-2/+2
Add tier-3 support for powerpc64 and riscv64 openbsd # powerpc64 - MCP for [powerpc64-unknown-openbsd tier-3 support](https://github.com/rust-lang/compiler-team/issues/551) - only need to add spec definition in rustc_target # riscv64 - MCP for [riscv64-unknown-openbsd tier-3 support](https://github.com/rust-lang/compiler-team/issues/552) - add spec definition in rustc_target - follow freebsd about avoiding linking with `libatomic`
2022-08-30Auto merge of #98100 - bjorn3:use_object_for_bitcode_reading, r=wesleywiserbors-13/+0
Use object instead of LLVM for reading bitcode from rlibs Together with changes I plan to make as part of https://github.com/rust-lang/rust/pull/97485 this will allow entirely removing usage of LLVM's archive reader and thus allow removing `archive_ro.rs` and `ArchiveWrapper.cpp`.
2022-08-28add riscv64gc-unknown-openbsd support (target riscv64-unknown-openbsd on ↵Sébastien Marie-2/+2
OpenBSD) - add platform-support documentation - add riscv64gc-unknown-openbsd spec - do not try to link with -latomic on openbsd
2022-08-21Auto merge of #100627 - krasimirgg:lto-llvm-16, r=cuviperbors-2/+23
llvm-wrapper: adapt for LLVM API change No functional changes intended. LLVM commit https://github.com/llvm/llvm-project/commit/633f5663c37a670e28040cadd938200abd854483 removed `createWriteThinLTOBitcodePass`. This adapts PassWrapper similarly to the example mentioned upstream: https://github.com/llvm/llvm-project/commit/853b57fe80bdb9d6b19697e6f2abc734834e9f6d. Detected via our experimental rust + llvm @ head bot: https://buildkite.com/llvm-project/rust-llvm-integrate-prototype/builds/12768#0182a6be-ed6e-4dc6-a230-7a46f9d3a2c2/205-537
2022-08-18Add diagnostic translation lints to crates that don't emit them5225225-0/+2
2022-08-17llvm-wrapper: use new pass manager for thin lto with LLVM version 15Krasimir Georgiev-2/+23
No functional changes intended. LLVM commit https://github.com/llvm/llvm-project/commit/633f5663c37a670e28040cadd938200abd854483 removed `createWriteThinLTOBitcodePass`. This adapts PassWrapper similarly to the example mentioned upstream: https://github.com/llvm/llvm-project/commit/633f5663c37a670e28040cadd938200abd854483.
2022-08-16Rollup merge of #100460 - cuviper:drop-llvm-12, r=nagisaMatthias Krüger-63/+1
Update the minimum external LLVM to 13 With this change, we'll have stable support for LLVM 13 through 15 (pending release). For reference, the previous increase to LLVM 12 was #90175. r? `@nagisa`