mirror of
https://github.com/rust-lang/rust.git
synced 2026-05-17 05:25:37 +03:00
Moved LLVM cleanup to after after_llvm phase
This commit is contained in:
@@ -225,6 +225,8 @@ macro_rules! controller_entry_point {
|
||||
phase5_result);
|
||||
phase5_result?;
|
||||
|
||||
write::cleanup_llvm(&trans);
|
||||
|
||||
phase_6_link_output(sess, &trans, &outputs);
|
||||
|
||||
Ok(())
|
||||
|
||||
@@ -616,11 +616,19 @@ unsafe fn with_codegen<F>(tm: TargetMachineRef,
|
||||
}
|
||||
}
|
||||
|
||||
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>>,
|
||||
|
||||
Reference in New Issue
Block a user