about summary refs log tree commit diff
path: root/compiler/rustc_codegen_llvm/src/debuginfo
diff options
context:
space:
mode:
authorMatthias Krüger <matthias.krueger@famsik.de>2024-10-30 06:40:37 +0100
committerGitHub <noreply@github.com>2024-10-30 06:40:37 +0100
commitcf2cc010a33b6aa9bd480e1ffa13a8d6ca181ea8 (patch)
treef8493678c7234890de4663496e93b9d68d72a444 /compiler/rustc_codegen_llvm/src/debuginfo
parent2055237e8f7087db9a7ca4c0b9921cbc858f345a (diff)
parent65ff2a6ad71de45c848a622d86b6c74092e1b734 (diff)
downloadrust-cf2cc010a33b6aa9bd480e1ffa13a8d6ca181ea8.tar.gz
rust-cf2cc010a33b6aa9bd480e1ffa13a8d6ca181ea8.zip
Rollup merge of #132340 - Zalathar:set-section, r=compiler-errors
cg_llvm: Consistently use safe wrapper function `set_section`

Follow-up to #131962 and https://github.com/rust-lang/rust/pull/132260#discussion_r1821626260.

To avoid too much scope creep, I've deliberately kept the changes to `LLVMRustGetSliceFromObjectDataByName` as minimal as possible.
Diffstat (limited to 'compiler/rustc_codegen_llvm/src/debuginfo')
-rw-r--r--compiler/rustc_codegen_llvm/src/debuginfo/gdb.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler/rustc_codegen_llvm/src/debuginfo/gdb.rs b/compiler/rustc_codegen_llvm/src/debuginfo/gdb.rs
index 7947c9c8c8e..aef8642f199 100644
--- a/compiler/rustc_codegen_llvm/src/debuginfo/gdb.rs
+++ b/compiler/rustc_codegen_llvm/src/debuginfo/gdb.rs
@@ -72,7 +72,7 @@ pub(crate) fn get_or_insert_gdb_debug_scripts_section_global<'ll>(
             let section_var = cx
                 .define_global(section_var_name, llvm_type)
                 .unwrap_or_else(|| bug!("symbol `{}` is already defined", section_var_name));
-            llvm::LLVMSetSection(section_var, c".debug_gdb_scripts".as_ptr());
+            llvm::set_section(section_var, c".debug_gdb_scripts");
             llvm::LLVMSetInitializer(section_var, cx.const_bytes(section_contents));
             llvm::LLVMSetGlobalConstant(section_var, llvm::True);
             llvm::LLVMSetUnnamedAddress(section_var, llvm::UnnamedAddr::Global);