move place
This commit is contained in:
parent
632342a135
commit
e2ec83ced9
1 changed files with 8 additions and 8 deletions
|
@ -586,14 +586,6 @@ impl<'ll, 'tcx> CodegenCx<'ll, 'tcx> {
|
||||||
llvm::LLVMSetSection(g, c"llvm.metadata".as_ptr());
|
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> {
|
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.push_str(&(idx as u64).to_base(ALPHANUMERIC_ONLY));
|
||||||
name
|
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<'_, '_> {
|
impl HasDataLayout for CodegenCx<'_, '_> {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue