diff options
| author | bors <bors@rust-lang.org> | 2025-05-12 17:39:21 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2025-05-12 17:39:21 +0000 |
| commit | 1a7f290a9aedc138edf9c88a82019292019754d9 (patch) | |
| tree | 4746f5f00e66e349bd24cd7625b5043728be8879 /compiler/rustc_codegen_llvm/src/back/write.rs | |
| parent | 420ca7104f4db107837cba4d8e48a82c53fcb76c (diff) | |
| parent | eccf0647d3dfcef826a40fdcc7cde279ea154eaf (diff) | |
| download | rust-1a7f290a9aedc138edf9c88a82019292019754d9.tar.gz rust-1a7f290a9aedc138edf9c88a82019292019754d9.zip | |
Auto merge of #140914 - Zalathar:asm-bindings, r=compiler-errors
cg_llvm: Clean up some inline assembly bindings This PR combines a few loosely-related cleanups to LLVM bindings related to inline assembly. These include: - Replacing `LLVMRustInlineAsm` with LLVM-C's `LLVMGetInlineAsm` - Adjusting FFI declarations to avoid the need for explicit `as_c_char_ptr` conversions - Flattening control flow in `inline_asm_call` There should be no functional changes.
Diffstat (limited to 'compiler/rustc_codegen_llvm/src/back/write.rs')
| -rw-r--r-- | compiler/rustc_codegen_llvm/src/back/write.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/compiler/rustc_codegen_llvm/src/back/write.rs b/compiler/rustc_codegen_llvm/src/back/write.rs index 4ac77c8f7f1..20721c74608 100644 --- a/compiler/rustc_codegen_llvm/src/back/write.rs +++ b/compiler/rustc_codegen_llvm/src/back/write.rs @@ -1148,9 +1148,9 @@ unsafe fn embed_bitcode( // We need custom section flags, so emit module-level inline assembly. let section_flags = if cgcx.is_pe_coff { "n" } else { "e" }; let asm = create_section_with_flags_asm(".llvmbc", section_flags, bitcode); - llvm::LLVMAppendModuleInlineAsm(llmod, asm.as_c_char_ptr(), asm.len()); + llvm::append_module_inline_asm(llmod, &asm); let asm = create_section_with_flags_asm(".llvmcmd", section_flags, cmdline.as_bytes()); - llvm::LLVMAppendModuleInlineAsm(llmod, asm.as_c_char_ptr(), asm.len()); + llvm::append_module_inline_asm(llmod, &asm); } } } |
