diff options
| author | Augie Fackler <augie@google.com> | 2024-05-23 15:10:04 -0400 |
|---|---|---|
| committer | Augie Fackler <augie@google.com> | 2024-05-23 15:10:04 -0400 |
| commit | a0581b5b7fe6b9add5c1f0fe90a9f2cc8249b01e (patch) | |
| tree | dd6e16b576adfee6a185ed63a44ab32f8f9153a2 /compiler/rustc_codegen_llvm/src | |
| parent | 3ea494190f0df0e6d1454b160419c9a72cfca5ba (diff) | |
| download | rust-a0581b5b7fe6b9add5c1f0fe90a9f2cc8249b01e.tar.gz rust-a0581b5b7fe6b9add5c1f0fe90a9f2cc8249b01e.zip | |
cleanup: run rustfmt
Diffstat (limited to 'compiler/rustc_codegen_llvm/src')
| -rw-r--r-- | compiler/rustc_codegen_llvm/src/back/lto.rs | 5 | ||||
| -rw-r--r-- | compiler/rustc_codegen_llvm/src/back/write.rs | 17 | ||||
| -rw-r--r-- | compiler/rustc_codegen_llvm/src/lib.rs | 5 | ||||
| -rw-r--r-- | compiler/rustc_codegen_llvm/src/llvm/ffi.rs | 6 |
4 files changed, 22 insertions, 11 deletions
diff --git a/compiler/rustc_codegen_llvm/src/back/lto.rs b/compiler/rustc_codegen_llvm/src/back/lto.rs index 0dc91524f84..c4bcf16bef3 100644 --- a/compiler/rustc_codegen_llvm/src/back/lto.rs +++ b/compiler/rustc_codegen_llvm/src/back/lto.rs @@ -229,7 +229,10 @@ pub(crate) fn run_thin( thin_lto(cgcx, &dcx, modules, upstream_modules, cached_modules, &symbols_below_threshold) } -pub(crate) fn prepare_thin(module: ModuleCodegen<ModuleLlvm>, emit_summary: bool) -> (String, ThinBuffer) { +pub(crate) fn prepare_thin( + module: ModuleCodegen<ModuleLlvm>, + emit_summary: bool, +) -> (String, ThinBuffer) { let name = module.name; let buffer = ThinBuffer::new(module.module_llvm.llmod(), true, emit_summary); (name, buffer) diff --git a/compiler/rustc_codegen_llvm/src/back/write.rs b/compiler/rustc_codegen_llvm/src/back/write.rs index daefac8480b..08cfda9e8ce 100644 --- a/compiler/rustc_codegen_llvm/src/back/write.rs +++ b/compiler/rustc_codegen_llvm/src/back/write.rs @@ -727,7 +727,9 @@ pub(crate) unsafe fn codegen( ); } - if config.emit_thin_lto_summary && let Some(thin_link_bitcode_filename) = bc_summary_out.file_name() { + if config.emit_thin_lto_summary + && let Some(thin_link_bitcode_filename) = bc_summary_out.file_name() + { let summary_data = thin.thin_link_data(); cgcx.prof.artifact_size( "llvm_bitcode_summary", @@ -745,13 +747,12 @@ pub(crate) unsafe fn codegen( } if config.emit_bc || config.emit_obj == EmitObj::Bitcode { - let _timer = cgcx.prof.generic_activity_with_arg( - "LLVM_module_codegen_emit_bitcode", - &*module.name, - ); - if let Err(err) = fs::write(&bc_out, data) { - dcx.emit_err(WriteBytecode { path: &bc_out, err }); - } + let _timer = cgcx + .prof + .generic_activity_with_arg("LLVM_module_codegen_emit_bitcode", &*module.name); + if let Err(err) = fs::write(&bc_out, data) { + dcx.emit_err(WriteBytecode { path: &bc_out, err }); + } } if config.emit_obj == EmitObj::ObjectCode(BitcodeSection::Full) { diff --git a/compiler/rustc_codegen_llvm/src/lib.rs b/compiler/rustc_codegen_llvm/src/lib.rs index 4a9502fa897..1e4f4c01b1c 100644 --- a/compiler/rustc_codegen_llvm/src/lib.rs +++ b/compiler/rustc_codegen_llvm/src/lib.rs @@ -240,7 +240,10 @@ impl WriteBackendMethods for LlvmCodegenBackend { ) -> Result<CompiledModule, FatalError> { back::write::codegen(cgcx, dcx, module, config) } - fn prepare_thin(module: ModuleCodegen<Self::Module>, emit_summary: bool) -> (String, Self::ThinBuffer) { + fn prepare_thin( + module: ModuleCodegen<Self::Module>, + emit_summary: bool, + ) -> (String, Self::ThinBuffer) { back::lto::prepare_thin(module, emit_summary) } fn serialize_module(module: ModuleCodegen<Self::Module>) -> (String, Self::ModuleBuffer) { diff --git a/compiler/rustc_codegen_llvm/src/llvm/ffi.rs b/compiler/rustc_codegen_llvm/src/llvm/ffi.rs index 1e84c2be3c6..132e1f9e8fd 100644 --- a/compiler/rustc_codegen_llvm/src/llvm/ffi.rs +++ b/compiler/rustc_codegen_llvm/src/llvm/ffi.rs @@ -2350,7 +2350,11 @@ extern "C" { #[allow(improper_ctypes)] pub fn LLVMRustModuleInstructionStats(M: &Module, Str: &RustString); - pub fn LLVMRustThinLTOBufferCreate(M: &Module, is_thin: bool, emit_summary: bool) -> &'static mut ThinLTOBuffer; + pub fn LLVMRustThinLTOBufferCreate( + M: &Module, + is_thin: bool, + emit_summary: bool, + ) -> &'static mut ThinLTOBuffer; pub fn LLVMRustThinLTOBufferFree(M: &'static mut ThinLTOBuffer); pub fn LLVMRustThinLTOBufferPtr(M: &ThinLTOBuffer) -> *const c_char; pub fn LLVMRustThinLTOBufferLen(M: &ThinLTOBuffer) -> size_t; |
