From e2ec83ced9bd19ae04266c8e500340d8b6ed51e6 Mon Sep 17 00:00:00 2001 From: Luv-Ray Date: Thu, 19 Sep 2024 18:52:09 +0800 Subject: [PATCH] move place --- compiler/rustc_codegen_llvm/src/context.rs | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/compiler/rustc_codegen_llvm/src/context.rs b/compiler/rustc_codegen_llvm/src/context.rs index 02fa1657f40..9817407fcd1 100644 --- a/compiler/rustc_codegen_llvm/src/context.rs +++ b/compiler/rustc_codegen_llvm/src/context.rs @@ -586,14 +586,6 @@ pub(crate) fn create_used_variable_impl(&self, name: &'static CStr, values: &[&' llvm::LLVMSetSection(g, c"llvm.metadata".as_ptr()); } } - - /// A wrapper for [`llvm::LLVMSetMetadata`], but it takes `Metadata` as a parameter instead of `Value`. - pub(crate) fn set_metadata<'a>(&self, val: &'a Value, kind_id: c_uint, md: &'a Metadata) { - unsafe { - let node = llvm::LLVMMetadataAsValue(&self.llcx, md); - llvm::LLVMSetMetadata(val, kind_id, node); - } - } } impl<'ll, 'tcx> MiscCodegenMethods<'tcx> for CodegenCx<'ll, 'tcx> { @@ -1126,6 +1118,14 @@ pub(crate) fn generate_local_symbol_name(&self, prefix: &str) -> String { name.push_str(&(idx as u64).to_base(ALPHANUMERIC_ONLY)); name } + + /// A wrapper for [`llvm::LLVMSetMetadata`], but it takes `Metadata` as a parameter instead of `Value`. + pub(crate) fn set_metadata<'a>(&self, val: &'a Value, kind_id: c_uint, md: &'a Metadata) { + unsafe { + let node = llvm::LLVMMetadataAsValue(&self.llcx, md); + llvm::LLVMSetMetadata(val, kind_id, node); + } + } } impl HasDataLayout for CodegenCx<'_, '_> {