Skip to content

Commit

Permalink
async-llvm(20): Do some cleanup.
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelwoerister committed Jul 31, 2017
1 parent 81b789f commit ab3bc58
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 25 deletions.
45 changes: 22 additions & 23 deletions src/librustc_trans/back/write.rs
Expand Up @@ -341,7 +341,7 @@ pub struct CodegenContext {
// compiling incrementally
pub incr_comp_session_dir: Option<PathBuf>,
// Channel back to the main control thread to send messages to
pub coordinator_send: Sender<Message>,
coordinator_send: Sender<Message>,
}

impl CodegenContext {
Expand Down Expand Up @@ -660,17 +660,17 @@ fn need_crate_bitcode_for_rlib(sess: &Session) -> bool {
sess.opts.output_types.contains_key(&OutputType::Exe)
}

pub fn run_passes(sess: &Session,
crate_output: &OutputFilenames,
crate_name: Symbol,
link: LinkMeta,
metadata: EncodedMetadata,
exported_symbols: Arc<ExportedSymbols>,
no_builtins: bool,
windows_subsystem: Option<String>,
linker_info: LinkerInfo,
no_integrated_as: bool)
-> OngoingCrateTranslation {
pub fn start_async_translation(sess: &Session,
crate_output: &OutputFilenames,
crate_name: Symbol,
link: LinkMeta,
metadata: EncodedMetadata,
exported_symbols: Arc<ExportedSymbols>,
no_builtins: bool,
windows_subsystem: Option<String>,
linker_info: LinkerInfo,
no_integrated_as: bool)
-> OngoingCrateTranslation {
let output_types_override = if no_integrated_as {
OutputTypes::new(&[(OutputType::Assembly, None)])
} else {
Expand Down Expand Up @@ -1061,16 +1061,15 @@ fn execute_work_item(cgcx: &CodegenContext, work_item: WorkItem)
}

#[derive(Debug)]
pub enum Message {
enum Message {
Token(io::Result<Acquired>),
Done { result: Result<CompiledModule, ()> },
WorkItem(WorkItem),
CheckErrorMessages,
TranslationDone,
}


pub struct Diagnostic {
struct Diagnostic {
msg: String,
code: Option<String>,
lvl: Level,
Expand Down Expand Up @@ -1519,14 +1518,14 @@ impl SharedEmitterMain {
}

pub struct OngoingCrateTranslation {
pub crate_name: Symbol,
pub link: LinkMeta,
pub metadata: EncodedMetadata,
pub exported_symbols: Arc<ExportedSymbols>,
pub no_builtins: bool,
pub windows_subsystem: Option<String>,
pub linker_info: LinkerInfo,
pub no_integrated_as: bool,
crate_name: Symbol,
link: LinkMeta,
metadata: EncodedMetadata,
exported_symbols: Arc<ExportedSymbols>,
no_builtins: bool,
windows_subsystem: Option<String>,
linker_info: LinkerInfo,
no_integrated_as: bool,

output_filenames: OutputFilenames,
regular_module_config: ModuleConfig,
Expand Down
4 changes: 2 additions & 2 deletions src/librustc_trans/base.rs
Expand Up @@ -962,7 +962,7 @@ pub fn trans_crate<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
!tcx.sess.opts.output_types.should_trans() {
let empty_exported_symbols = ExportedSymbols::empty();
let linker_info = LinkerInfo::new(&shared_ccx, &empty_exported_symbols);
let ongoing_translation = write::run_passes(
let ongoing_translation = write::start_async_translation(
tcx.sess,
output_filenames,
tcx.crate_name(LOCAL_CRATE),
Expand Down Expand Up @@ -1012,7 +1012,7 @@ pub fn trans_crate<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
(output_filenames.outputs.contains_key(&OutputType::Object) ||
output_filenames.outputs.contains_key(&OutputType::Exe)));

let ongoing_translation = write::run_passes(
let ongoing_translation = write::start_async_translation(
tcx.sess,
output_filenames,
tcx.crate_name(LOCAL_CRATE),
Expand Down

0 comments on commit ab3bc58

Please sign in to comment.