diff options
| author | Michael Woerister <michaelwoerister@posteo> | 2018-09-05 13:52:58 +0200 |
|---|---|---|
| committer | Michael Woerister <michaelwoerister@posteo> | 2018-09-05 13:52:58 +0200 |
| commit | fc47a92336c02ee551c72e86ae4d0396895f9535 (patch) | |
| tree | 98decea30f0d5f2680bf1ab9c4e1493a34dac824 /src/librustc_codegen_llvm/back | |
| parent | 3f13b27c2b6a1f83ee08a87c6134c86526edffc0 (diff) | |
| download | rust-fc47a92336c02ee551c72e86ae4d0396895f9535.tar.gz rust-fc47a92336c02ee551c72e86ae4d0396895f9535.zip | |
ThinLTO: Don't keep files open after mmaping them (because it's not needed).
Diffstat (limited to 'src/librustc_codegen_llvm/back')
| -rw-r--r-- | src/librustc_codegen_llvm/back/lto.rs | 6 | ||||
| -rw-r--r-- | src/librustc_codegen_llvm/back/write.rs | 2 |
2 files changed, 4 insertions, 4 deletions
diff --git a/src/librustc_codegen_llvm/back/lto.rs b/src/librustc_codegen_llvm/back/lto.rs index c1dda02264e..25bc662c408 100644 --- a/src/librustc_codegen_llvm/back/lto.rs +++ b/src/librustc_codegen_llvm/back/lto.rs @@ -29,7 +29,7 @@ use {ModuleCodegen, ModuleLlvm, ModuleKind}; use libc; use std::ffi::{CStr, CString}; -use std::fs::{self, File}; +use std::fs; use std::ptr; use std::slice; use std::sync::Arc; @@ -619,7 +619,7 @@ fn run_pass_manager(cgcx: &CodegenContext, pub enum SerializedModule { Local(ModuleBuffer), FromRlib(Vec<u8>), - FromUncompressedFile(memmap::Mmap, File), + FromUncompressedFile(memmap::Mmap), } impl SerializedModule { @@ -627,7 +627,7 @@ impl SerializedModule { match *self { SerializedModule::Local(ref m) => m.data(), SerializedModule::FromRlib(ref m) => m, - SerializedModule::FromUncompressedFile(ref m, _) => m, + SerializedModule::FromUncompressedFile(ref m) => m, } } } diff --git a/src/librustc_codegen_llvm/back/write.rs b/src/librustc_codegen_llvm/back/write.rs index 1c0f89193b2..f76a38c1a2b 100644 --- a/src/librustc_codegen_llvm/back/write.rs +++ b/src/librustc_codegen_llvm/back/write.rs @@ -2485,7 +2485,7 @@ pub(crate) fn submit_pre_lto_module_to_llvm(tcx: TyCtxt, // Schedule the module to be loaded drop(tcx.tx_to_llvm_workers.lock().send(Box::new(Message::AddImportOnlyModule { - module_data: SerializedModule::FromUncompressedFile(mmap, file), + module_data: SerializedModule::FromUncompressedFile(mmap), work_product: module.source, }))); } |
