Auto merge of #66952 - 0dvictor:print, r=rkruppe
Use Module::print() instead of a PrintModulePass llvm::Module has a print() method. It is unnecessary to create a pass just for the purpose of printing LLVM IR.
This commit is contained in:
commit
1e2a73867d
3 changed files with 9 additions and 50 deletions
|
@ -588,14 +588,11 @@ pub(crate) unsafe fn codegen(cgcx: &CodegenContext<LlvmCodegenBackend>,
|
|||
cursor.position() as size_t
|
||||
}
|
||||
|
||||
with_codegen(tm, llmod, config.no_builtins, |cpm| {
|
||||
let result =
|
||||
llvm::LLVMRustPrintModule(cpm, llmod, out_c.as_ptr(), demangle_callback);
|
||||
llvm::LLVMDisposePassManager(cpm);
|
||||
result.into_result().map_err(|()| {
|
||||
let msg = format!("failed to write LLVM IR to {}", out.display());
|
||||
llvm_err(diag_handler, &msg)
|
||||
})
|
||||
let result =
|
||||
llvm::LLVMRustPrintModule(llmod, out_c.as_ptr(), demangle_callback);
|
||||
result.into_result().map_err(|()| {
|
||||
let msg = format!("failed to write LLVM IR to {}", out.display());
|
||||
llvm_err(diag_handler, &msg)
|
||||
})?;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue