提交 70f34098 编写于 作者: E Eduard Burtescu

rustc: de-@ llvm.

上级 637addde
......@@ -1882,37 +1882,23 @@ pub fn val_to_str(&self, val: ValueRef) -> ~str {
/* Memory-managed interface to target data. */
pub struct target_data_res {
pub td: TargetDataRef,
pub struct TargetData {
pub lltd: TargetDataRef
}
impl Drop for target_data_res {
impl Drop for TargetData {
fn drop(&mut self) {
unsafe {
llvm::LLVMDisposeTargetData(self.td);
llvm::LLVMDisposeTargetData(self.lltd);
}
}
}
pub fn target_data_res(td: TargetDataRef) -> target_data_res {
target_data_res {
td: td
}
}
pub struct TargetData {
pub lltd: TargetDataRef,
dtor: @target_data_res
}
pub fn mk_target_data(string_rep: &str) -> TargetData {
let lltd = string_rep.with_c_str(|buf| {
unsafe { llvm::LLVMCreateTargetData(buf) }
});
TargetData {
lltd: lltd,
dtor: @target_data_res(lltd)
lltd: string_rep.with_c_str(|buf| {
unsafe { llvm::LLVMCreateTargetData(buf) }
})
}
}
......@@ -1949,35 +1935,22 @@ fn drop(&mut self) {
/* Memory-managed interface to section iterators. */
pub struct section_iter_res {
pub si: SectionIteratorRef,
pub struct SectionIter {
pub llsi: SectionIteratorRef
}
impl Drop for section_iter_res {
impl Drop for SectionIter {
fn drop(&mut self) {
unsafe {
llvm::LLVMDisposeSectionIterator(self.si);
llvm::LLVMDisposeSectionIterator(self.llsi);
}
}
}
pub fn section_iter_res(si: SectionIteratorRef) -> section_iter_res {
section_iter_res {
si: si
}
}
pub struct SectionIter {
pub llsi: SectionIteratorRef,
dtor: @section_iter_res
}
pub fn mk_section_iter(llof: ObjectFileRef) -> SectionIter {
unsafe {
let llsi = llvm::LLVMGetSections(llof);
SectionIter {
llsi: llsi,
dtor: @section_iter_res(llsi)
llsi: llvm::LLVMGetSections(llof)
}
}
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册