Moved LLVM cleanup to after after_llvm phase
This commit is contained in:
parent
bbdbe99c7a
commit
ce1146ac5f
2 changed files with 12 additions and 2 deletions
|
|
@ -616,11 +616,19 @@ unsafe fn optimize_and_codegen(cgcx: &CodegenContext,
|
|||
}
|
||||
}
|
||||
|
||||
llvm::LLVMDisposeModule(llmod);
|
||||
llvm::LLVMContextDispose(llcx);
|
||||
llvm::LLVMRustDisposeTargetMachine(tm);
|
||||
}
|
||||
|
||||
|
||||
pub fn cleanup_llvm(trans: &CrateTranslation) {
|
||||
for module in trans.modules.iter() {
|
||||
unsafe {
|
||||
llvm::LLVMDisposeModule(module.llmod);
|
||||
llvm::LLVMContextDispose(module.llcx);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pub fn run_passes(sess: &Session,
|
||||
trans: &CrateTranslation,
|
||||
output_types: &HashMap<OutputType, Option<PathBuf>>,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue