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-07-21 19:48:22 +0000
committerbors <bors@rust-lang.org>2025-07-21 19:48:22 +0000
commit9748d87dc70a9a6725c5dbd76ce29d04752b4f90 (patch)
tree4cffbc92abe5995b0348e464ffe6a256f973e653 /compiler/rustc_codegen_llvm/src/llvm
parent3f9f20f71dd945fe7d044e274094a53c90788269 (diff)
parent6628a4afb5d08555f09878a48f0c4179e7582aa2 (diff)
downloadrust-9748d87dc70a9a6725c5dbd76ce29d04752b4f90.tar.gz
rust-9748d87dc70a9a6725c5dbd76ce29d04752b4f90.zip
Auto merge of #144269 - jieyouxu:rollup-137ysl2, r=jieyouxu
Rollup of 14 pull requests

Successful merges:

 - rust-lang/rust#142097 (gpu offload host code generation)
 - rust-lang/rust#143430 (Lower extra lifetimes before normal generic params.)
 - rust-lang/rust#143768 (Constify Try, From, TryFrom and relevant traits)
 - rust-lang/rust#143816 (Implement `check` for compiletest and RA using tool macro)
 - rust-lang/rust#143985 (rustc_public: de-StableMIR-ize)
 - rust-lang/rust#144027 (clippy: make tests work in stage 1)
 - rust-lang/rust#144080 (Mitigate `#[align]` name resolution ambiguity regression with a rename)
 - rust-lang/rust#144176 (Add approval blocking labels for new bors)
 - rust-lang/rust#144187 (fix handling of base address for TypeId allocations)
 - rust-lang/rust#144212 (Remove the ptr_unique lang item)
 - rust-lang/rust#144243 (Subtree update of `rust-analyzer`)
 - rust-lang/rust#144246 (Don't use another main test file as auxiliary)
 - rust-lang/rust#144251 (rustc-dev-guide subtree update)
 - rust-lang/rust#144254 (opt-dist: make `artifact-dir` an absolute path for `opt-dist local`)

r? `@ghost`
`@rustbot` modify labels: rollup
Diffstat (limited to 'compiler/rustc_codegen_llvm/src/llvm')
-rw-r--r--compiler/rustc_codegen_llvm/src/llvm/enzyme_ffi.rs10
-rw-r--r--compiler/rustc_codegen_llvm/src/llvm/ffi.rs8
2 files changed, 17 insertions, 1 deletions
diff --git a/compiler/rustc_codegen_llvm/src/llvm/enzyme_ffi.rs b/compiler/rustc_codegen_llvm/src/llvm/enzyme_ffi.rs
index c696b8d8ff2..56d756e52cc 100644
--- a/compiler/rustc_codegen_llvm/src/llvm/enzyme_ffi.rs
+++ b/compiler/rustc_codegen_llvm/src/llvm/enzyme_ffi.rs
@@ -4,7 +4,7 @@ use libc::{c_char, c_uint};
 
 use super::MetadataKindId;
 use super::ffi::{AttributeKind, BasicBlock, Metadata, Module, Type, Value};
-use crate::llvm::Bool;
+use crate::llvm::{Bool, Builder};
 
 #[link(name = "llvm-wrapper", kind = "static")]
 unsafe extern "C" {
@@ -31,6 +31,14 @@ unsafe extern "C" {
         index: c_uint,
         kind: AttributeKind,
     );
+    pub(crate) fn LLVMRustPositionBefore<'a>(B: &'a Builder<'_>, I: &'a Value);
+    pub(crate) fn LLVMRustPositionAfter<'a>(B: &'a Builder<'_>, I: &'a Value);
+    pub(crate) fn LLVMRustGetFunctionCall(
+        F: &Value,
+        name: *const c_char,
+        NameLen: libc::size_t,
+    ) -> Option<&Value>;
+
 }
 
 unsafe extern "C" {
diff --git a/compiler/rustc_codegen_llvm/src/llvm/ffi.rs b/compiler/rustc_codegen_llvm/src/llvm/ffi.rs
index 80a0e5c5acc..edfb29dd1be 100644
--- a/compiler/rustc_codegen_llvm/src/llvm/ffi.rs
+++ b/compiler/rustc_codegen_llvm/src/llvm/ffi.rs
@@ -1138,6 +1138,11 @@ unsafe extern "C" {
         Count: c_uint,
         Packed: Bool,
     ) -> &'a Value;
+    pub(crate) fn LLVMConstNamedStruct<'a>(
+        StructTy: &'a Type,
+        ConstantVals: *const &'a Value,
+        Count: c_uint,
+    ) -> &'a Value;
     pub(crate) fn LLVMConstVector(ScalarConstantVals: *const &Value, Size: c_uint) -> &Value;
 
     // Constant expressions
@@ -1217,6 +1222,8 @@ unsafe extern "C" {
     ) -> &'a BasicBlock;
 
     // Operations on instructions
+    pub(crate) fn LLVMGetInstructionParent(Inst: &Value) -> &BasicBlock;
+    pub(crate) fn LLVMGetCalledValue(CallInst: &Value) -> Option<&Value>;
     pub(crate) fn LLVMIsAInstruction(Val: &Value) -> Option<&Value>;
     pub(crate) fn LLVMGetFirstBasicBlock(Fn: &Value) -> &BasicBlock;
     pub(crate) fn LLVMGetOperand(Val: &Value, Index: c_uint) -> Option<&Value>;
@@ -2557,6 +2564,7 @@ unsafe extern "C" {
 
     pub(crate) fn LLVMRustSetDataLayoutFromTargetMachine<'a>(M: &'a Module, TM: &'a TargetMachine);
 
+    pub(crate) fn LLVMRustPositionBuilderPastAllocas<'a>(B: &Builder<'a>, Fn: &'a Value);
     pub(crate) fn LLVMRustPositionBuilderAtStart<'a>(B: &Builder<'a>, BB: &'a BasicBlock);
 
     pub(crate) fn LLVMRustSetModulePICLevel(M: &Module);