Skip to content

Commit a0581b5

Browse files
committed
cleanup: run rustfmt
1 parent 3ea4941 commit a0581b5

File tree

5 files changed

+26
-12
lines changed

5 files changed

+26
-12
lines changed

Diff for: compiler/rustc_codegen_llvm/src/back/lto.rs

+4-1
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,10 @@ pub(crate) fn run_thin(
229229
thin_lto(cgcx, &dcx, modules, upstream_modules, cached_modules, &symbols_below_threshold)
230230
}
231231

232-
pub(crate) fn prepare_thin(module: ModuleCodegen<ModuleLlvm>, emit_summary: bool) -> (String, ThinBuffer) {
232+
pub(crate) fn prepare_thin(
233+
module: ModuleCodegen<ModuleLlvm>,
234+
emit_summary: bool,
235+
) -> (String, ThinBuffer) {
233236
let name = module.name;
234237
let buffer = ThinBuffer::new(module.module_llvm.llmod(), true, emit_summary);
235238
(name, buffer)

Diff for: compiler/rustc_codegen_llvm/src/back/write.rs

+9-8
Original file line numberDiff line numberDiff line change
@@ -727,7 +727,9 @@ pub(crate) unsafe fn codegen(
727727
);
728728
}
729729

730-
if config.emit_thin_lto_summary && let Some(thin_link_bitcode_filename) = bc_summary_out.file_name() {
730+
if config.emit_thin_lto_summary
731+
&& let Some(thin_link_bitcode_filename) = bc_summary_out.file_name()
732+
{
731733
let summary_data = thin.thin_link_data();
732734
cgcx.prof.artifact_size(
733735
"llvm_bitcode_summary",
@@ -745,13 +747,12 @@ pub(crate) unsafe fn codegen(
745747
}
746748

747749
if config.emit_bc || config.emit_obj == EmitObj::Bitcode {
748-
let _timer = cgcx.prof.generic_activity_with_arg(
749-
"LLVM_module_codegen_emit_bitcode",
750-
&*module.name,
751-
);
752-
if let Err(err) = fs::write(&bc_out, data) {
753-
dcx.emit_err(WriteBytecode { path: &bc_out, err });
754-
}
750+
let _timer = cgcx
751+
.prof
752+
.generic_activity_with_arg("LLVM_module_codegen_emit_bitcode", &*module.name);
753+
if let Err(err) = fs::write(&bc_out, data) {
754+
dcx.emit_err(WriteBytecode { path: &bc_out, err });
755+
}
755756
}
756757

757758
if config.emit_obj == EmitObj::ObjectCode(BitcodeSection::Full) {

Diff for: compiler/rustc_codegen_llvm/src/lib.rs

+4-1
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,10 @@ impl WriteBackendMethods for LlvmCodegenBackend {
240240
) -> Result<CompiledModule, FatalError> {
241241
back::write::codegen(cgcx, dcx, module, config)
242242
}
243-
fn prepare_thin(module: ModuleCodegen<Self::Module>, emit_summary: bool) -> (String, Self::ThinBuffer) {
243+
fn prepare_thin(
244+
module: ModuleCodegen<Self::Module>,
245+
emit_summary: bool,
246+
) -> (String, Self::ThinBuffer) {
244247
back::lto::prepare_thin(module, emit_summary)
245248
}
246249
fn serialize_module(module: ModuleCodegen<Self::Module>) -> (String, Self::ModuleBuffer) {

Diff for: compiler/rustc_codegen_llvm/src/llvm/ffi.rs

+5-1
Original file line numberDiff line numberDiff line change
@@ -2350,7 +2350,11 @@ extern "C" {
23502350
#[allow(improper_ctypes)]
23512351
pub fn LLVMRustModuleInstructionStats(M: &Module, Str: &RustString);
23522352

2353-
pub fn LLVMRustThinLTOBufferCreate(M: &Module, is_thin: bool, emit_summary: bool) -> &'static mut ThinLTOBuffer;
2353+
pub fn LLVMRustThinLTOBufferCreate(
2354+
M: &Module,
2355+
is_thin: bool,
2356+
emit_summary: bool,
2357+
) -> &'static mut ThinLTOBuffer;
23542358
pub fn LLVMRustThinLTOBufferFree(M: &'static mut ThinLTOBuffer);
23552359
pub fn LLVMRustThinLTOBufferPtr(M: &ThinLTOBuffer) -> *const c_char;
23562360
pub fn LLVMRustThinLTOBufferLen(M: &ThinLTOBuffer) -> size_t;

Diff for: compiler/rustc_codegen_ssa/src/traits/write.rs

+4-1
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,10 @@ pub trait WriteBackendMethods: 'static + Sized + Clone {
5656
module: ModuleCodegen<Self::Module>,
5757
config: &ModuleConfig,
5858
) -> Result<CompiledModule, FatalError>;
59-
fn prepare_thin(module: ModuleCodegen<Self::Module>, want_summary: bool) -> (String, Self::ThinBuffer);
59+
fn prepare_thin(
60+
module: ModuleCodegen<Self::Module>,
61+
want_summary: bool,
62+
) -> (String, Self::ThinBuffer);
6063
fn serialize_module(module: ModuleCodegen<Self::Module>) -> (String, Self::ModuleBuffer);
6164
}
6265

0 commit comments

Comments
 (0)