about summary refs log tree commit diff
path: root/compiler/rustc_codegen_llvm/src/llvm/ffi.rs
diff options
context:
space:
mode:
authorZalathar <Zalathar@users.noreply.github.com>2025-05-10 18:26:57 +1000
committerZalathar <Zalathar@users.noreply.github.com>2025-05-11 14:38:42 +1000
commitb1094f6a0a489bb1bc2be6ca17d2bec269bd9364 (patch)
tree1955bd2300730b3468d2c2640437fb312427869b /compiler/rustc_codegen_llvm/src/llvm/ffi.rs
parentd1bb310a7aa54b4bfc68c6960e1de0976ff447a5 (diff)
downloadrust-b1094f6a0a489bb1bc2be6ca17d2bec269bd9364.tar.gz
rust-b1094f6a0a489bb1bc2be6ca17d2bec269bd9364.zip
Add a safe wrapper for `LLVMAppendModuleInlineAsm`
This patch also changes the Rust-side declaration to take `*const c_uchar`
instead of `*const c_char`, to avoid the need for `AsCCharPtr`.
Diffstat (limited to 'compiler/rustc_codegen_llvm/src/llvm/ffi.rs')
-rw-r--r--compiler/rustc_codegen_llvm/src/llvm/ffi.rs8
1 files changed, 6 insertions, 2 deletions
diff --git a/compiler/rustc_codegen_llvm/src/llvm/ffi.rs b/compiler/rustc_codegen_llvm/src/llvm/ffi.rs
index 2b71e8954bb..507a29c15c8 100644
--- a/compiler/rustc_codegen_llvm/src/llvm/ffi.rs
+++ b/compiler/rustc_codegen_llvm/src/llvm/ffi.rs
@@ -1014,8 +1014,12 @@ unsafe extern "C" {
     pub(crate) fn LLVMGetDataLayoutStr(M: &Module) -> *const c_char;
     pub(crate) fn LLVMSetDataLayout(M: &Module, Triple: *const c_char);
 
-    /// See Module::setModuleInlineAsm.
-    pub(crate) fn LLVMAppendModuleInlineAsm(M: &Module, Asm: *const c_char, Len: size_t);
+    /// Append inline assembly to a module. See `Module::appendModuleInlineAsm`.
+    pub(crate) fn LLVMAppendModuleInlineAsm(
+        M: &Module,
+        Asm: *const c_uchar, // See "PTR_LEN_STR".
+        Len: size_t,
+    );
 
     /// Create the specified uniqued inline asm string. See `InlineAsm::get()`.
     pub(crate) fn LLVMGetInlineAsm<'ll>(