about summary refs log tree commit diff
path: root/compiler/rustc_codegen_llvm/src/llvm/ffi.rs
diff options
context:
space:
mode:
authorsayantn <sayantn05@gmail.com>2025-05-30 21:41:36 +0530
committersayantn <sayantn05@gmail.com>2025-06-12 00:32:42 +0530
commitd56fcd968d1334bf0c80205fb805a88999fffb5a (patch)
treeb29157143ae1fde9e88c98ee3043ca7a6e7348aa /compiler/rustc_codegen_llvm/src/llvm/ffi.rs
parent14863ea0777c68348b3e6e7a8472423d273a52af (diff)
downloadrust-d56fcd968d1334bf0c80205fb805a88999fffb5a.tar.gz
rust-d56fcd968d1334bf0c80205fb805a88999fffb5a.zip
Simplify implementation of Rust intrinsics by using type parameters in the cache
Diffstat (limited to 'compiler/rustc_codegen_llvm/src/llvm/ffi.rs')
-rw-r--r--compiler/rustc_codegen_llvm/src/llvm/ffi.rs12
1 files changed, 12 insertions, 0 deletions
diff --git a/compiler/rustc_codegen_llvm/src/llvm/ffi.rs b/compiler/rustc_codegen_llvm/src/llvm/ffi.rs
index e27fbf94f34..59c61db5fcd 100644
--- a/compiler/rustc_codegen_llvm/src/llvm/ffi.rs
+++ b/compiler/rustc_codegen_llvm/src/llvm/ffi.rs
@@ -15,6 +15,7 @@
 
 use std::fmt::Debug;
 use std::marker::PhantomData;
+use std::num::NonZero;
 use std::ptr;
 
 use bitflags::bitflags;
@@ -1195,6 +1196,17 @@ unsafe extern "C" {
     // Operations on functions
     pub(crate) fn LLVMSetFunctionCallConv(Fn: &Value, CC: c_uint);
 
+    // Operations about llvm intrinsics
+    pub(crate) fn LLVMLookupIntrinsicID(Name: *const c_char, NameLen: size_t) -> c_uint;
+    pub(crate) fn LLVMIntrinsicIsOverloaded(ID: NonZero<c_uint>) -> Bool;
+    pub(crate) fn LLVMIntrinsicCopyOverloadedName2<'a>(
+        Mod: &'a Module,
+        ID: NonZero<c_uint>,
+        ParamTypes: *const &'a Type,
+        ParamCount: size_t,
+        NameLength: *mut size_t,
+    ) -> *mut c_char;
+
     // Operations on parameters
     pub(crate) fn LLVMIsAArgument(Val: &Value) -> Option<&Value>;
     pub(crate) safe fn LLVMCountParams(Fn: &Value) -> c_uint;