about summary refs log tree commit diff
path: root/compiler/rustc_codegen_llvm/src
diff options
context:
space:
mode:
authorLuv-Ray <zhuoxun.yang777@outlook.com>2024-09-19 18:52:09 +0800
committerLuv-Ray <zhuoxun.yang777@outlook.com>2024-09-19 18:52:09 +0800
commite2ec83ced9bd19ae04266c8e500340d8b6ed51e6 (patch)
tree44012fcf24d633fae677251b64aee79c72a714a9 /compiler/rustc_codegen_llvm/src
parent632342a13513dfdbb53fcbd14ac2e493e36ed6ff (diff)
downloadrust-e2ec83ced9bd19ae04266c8e500340d8b6ed51e6.tar.gz
rust-e2ec83ced9bd19ae04266c8e500340d8b6ed51e6.zip
move place
Diffstat (limited to 'compiler/rustc_codegen_llvm/src')
-rw-r--r--compiler/rustc_codegen_llvm/src/context.rs16
1 files 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 @@ impl<'ll, 'tcx> CodegenCx<'ll, 'tcx> {
             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 @@ impl CodegenCx<'_, '_> {
         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<'_, '_> {