Skip to content

Commit e2ec83c

Browse files
committed
move place
1 parent 632342a commit e2ec83c

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

compiler/rustc_codegen_llvm/src/context.rs

+8-8
Original file line numberDiff line numberDiff line change
@@ -586,14 +586,6 @@ impl<'ll, 'tcx> CodegenCx<'ll, 'tcx> {
586586
llvm::LLVMSetSection(g, c"llvm.metadata".as_ptr());
587587
}
588588
}
589-
590-
/// A wrapper for [`llvm::LLVMSetMetadata`], but it takes `Metadata` as a parameter instead of `Value`.
591-
pub(crate) fn set_metadata<'a>(&self, val: &'a Value, kind_id: c_uint, md: &'a Metadata) {
592-
unsafe {
593-
let node = llvm::LLVMMetadataAsValue(&self.llcx, md);
594-
llvm::LLVMSetMetadata(val, kind_id, node);
595-
}
596-
}
597589
}
598590

599591
impl<'ll, 'tcx> MiscCodegenMethods<'tcx> for CodegenCx<'ll, 'tcx> {
@@ -1126,6 +1118,14 @@ impl CodegenCx<'_, '_> {
11261118
name.push_str(&(idx as u64).to_base(ALPHANUMERIC_ONLY));
11271119
name
11281120
}
1121+
1122+
/// A wrapper for [`llvm::LLVMSetMetadata`], but it takes `Metadata` as a parameter instead of `Value`.
1123+
pub(crate) fn set_metadata<'a>(&self, val: &'a Value, kind_id: c_uint, md: &'a Metadata) {
1124+
unsafe {
1125+
let node = llvm::LLVMMetadataAsValue(&self.llcx, md);
1126+
llvm::LLVMSetMetadata(val, kind_id, node);
1127+
}
1128+
}
11291129
}
11301130

11311131
impl HasDataLayout for CodegenCx<'_, '_> {

0 commit comments

Comments
 (0)