about summary refs log tree commit diff
path: root/compiler/rustc_codegen_llvm/src/llvm
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2025-02-12 06:54:18 +0000
committerbors <bors@rust-lang.org>2025-02-12 06:54:18 +0000
commit33d92df3e6552a91ace2594eb7a2e1dc0c3e37fb (patch)
treee4d932374c9d0fd20161c427d151e555946c3d9d /compiler/rustc_codegen_llvm/src/llvm
parent672e3aaf28ab1e5cbe80b3ff012cd3a8e4ef98af (diff)
parent77a1d6b266fa6254d65fc7cc2a4401bf6426290f (diff)
downloadrust-33d92df3e6552a91ace2594eb7a2e1dc0c3e37fb.tar.gz
rust-33d92df3e6552a91ace2594eb7a2e1dc0c3e37fb.zip
Auto merge of #136905 - matthiaskrgr:rollup-8zwcgta, r=matthiaskrgr
Rollup of 8 pull requests

Successful merges:

 - #135549 (Document some safety constraints and use more safe wrappers)
 - #135965 (In "specify type" suggestion, skip type params that are already known)
 - #136193 (Implement pattern type ffi checks)
 - #136646 (Add a TyPat in the AST to reuse the generic arg lowering logic)
 - #136874 (Change the issue number for `likely_unlikely` and `cold_path`)
 - #136884 (Lower fn items as ZST valtrees and delay a bug)
 - #136885 (i686-linux-android: increase CPU baseline to Pentium 4 (without an actual change)
 - #136891 (Check sig for errors before checking for unconstrained anonymous lifetime)

r? `@ghost`
`@rustbot` modify labels: rollup
Diffstat (limited to 'compiler/rustc_codegen_llvm/src/llvm')
-rw-r--r--compiler/rustc_codegen_llvm/src/llvm/ffi.rs2
-rw-r--r--compiler/rustc_codegen_llvm/src/llvm/mod.rs4
2 files changed, 5 insertions, 1 deletions
diff --git a/compiler/rustc_codegen_llvm/src/llvm/ffi.rs b/compiler/rustc_codegen_llvm/src/llvm/ffi.rs
index 4d6a76b23ea..441d144ce50 100644
--- a/compiler/rustc_codegen_llvm/src/llvm/ffi.rs
+++ b/compiler/rustc_codegen_llvm/src/llvm/ffi.rs
@@ -2359,7 +2359,7 @@ unsafe extern "C" {
     );
     pub fn LLVMRustWriteOutputFile<'a>(
         T: &'a TargetMachine,
-        PM: &PassManager<'a>,
+        PM: *mut PassManager<'a>,
         M: &'a Module,
         Output: *const c_char,
         DwoOutput: *const c_char,
diff --git a/compiler/rustc_codegen_llvm/src/llvm/mod.rs b/compiler/rustc_codegen_llvm/src/llvm/mod.rs
index 707aeba22cc..7becba4ccd4 100644
--- a/compiler/rustc_codegen_llvm/src/llvm/mod.rs
+++ b/compiler/rustc_codegen_llvm/src/llvm/mod.rs
@@ -241,6 +241,10 @@ pub fn set_linkage(llglobal: &Value, linkage: Linkage) {
     }
 }
 
+pub fn is_declaration(llglobal: &Value) -> bool {
+    unsafe { LLVMIsDeclaration(llglobal) == ffi::True }
+}
+
 pub fn get_visibility(llglobal: &Value) -> Visibility {
     unsafe { LLVMGetVisibility(llglobal) }.to_rust()
 }