rustc_codegen_llvm: fix ownership of Builder.
This commit is contained in:
parent
265f2fa4de
commit
54c98ab0dd
2 changed files with 105 additions and 96 deletions
|
@ -27,14 +27,14 @@ use std::ptr;
|
|||
// All Builders must have an llfn associated with them
|
||||
#[must_use]
|
||||
pub struct Builder<'a, 'll: 'a, 'tcx: 'll> {
|
||||
pub llbuilder: &'ll llvm::Builder,
|
||||
pub llbuilder: &'ll mut llvm::Builder<'ll>,
|
||||
pub cx: &'a CodegenCx<'ll, 'tcx>,
|
||||
}
|
||||
|
||||
impl Drop for Builder<'a, 'll, 'tcx> {
|
||||
fn drop(&mut self) {
|
||||
unsafe {
|
||||
llvm::LLVMDisposeBuilder(self.llbuilder);
|
||||
llvm::LLVMDisposeBuilder(&mut *(self.llbuilder as *mut _));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue