move place

This commit is contained in:
Luv-Ray 2024-09-19 18:52:09 +08:00
parent 632342a135
commit e2ec83ced9

View File

@ -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<'_, '_> {