diff options
| author | Zalathar <Zalathar@users.noreply.github.com> | 2025-10-02 16:39:58 +1000 |
|---|---|---|
| committer | Zalathar <Zalathar@users.noreply.github.com> | 2025-10-02 18:04:24 +1000 |
| commit | ffeed2b94ed432c959e3d9cf9bd5f7016f9577d3 (patch) | |
| tree | 313111cc3bcfedfbc58fe7f1b9546269198f9c69 /compiler/rustc_codegen_llvm/src/consts.rs | |
| parent | ecb831dcf4c28d3b66c9bce7aa4c3a8eb221fa5e (diff) | |
| download | rust-ffeed2b94ed432c959e3d9cf9bd5f7016f9577d3.tar.gz rust-ffeed2b94ed432c959e3d9cf9bd5f7016f9577d3.zip | |
Extract helper method `module_add_named_metadata_node`
Diffstat (limited to 'compiler/rustc_codegen_llvm/src/consts.rs')
| -rw-r--r-- | compiler/rustc_codegen_llvm/src/consts.rs | 11 |
1 files changed, 1 insertions, 10 deletions
diff --git a/compiler/rustc_codegen_llvm/src/consts.rs b/compiler/rustc_codegen_llvm/src/consts.rs index 40375ef6510..b4ca85a26c8 100644 --- a/compiler/rustc_codegen_llvm/src/consts.rs +++ b/compiler/rustc_codegen_llvm/src/consts.rs @@ -494,16 +494,7 @@ impl<'ll> CodegenCx<'ll, '_> { let bytes = alloc.inspect_with_uninit_and_ptr_outside_interpreter(0..alloc.len()); let alloc = self.create_metadata(bytes); let data = [section, alloc]; - let meta = - unsafe { llvm::LLVMMDNodeInContext2(self.llcx, data.as_ptr(), data.len()) }; - let val = self.get_metadata_value(meta); - unsafe { - llvm::LLVMAddNamedMetadataOperand( - self.llmod, - c"wasm.custom_sections".as_ptr(), - val, - ) - }; + self.module_add_named_metadata_node(self.llmod(), c"wasm.custom_sections", &data); } } else { base::set_link_section(g, attrs); |
