Use CGU name as LLVM module name and add some caching to CGU name generation.

This commit is contained in:
Michael Woerister 2018-08-14 17:55:22 +02:00
parent e192e498ab
commit d662083a6c
9 changed files with 207 additions and 169 deletions

View file

@ -728,7 +728,7 @@ unsafe fn codegen(cgcx: &CodegenContext,
if config.emit_bc_compressed {
let dst = bc_out.with_extension(RLIB_BYTECODE_EXTENSION);
let data = bytecode::encode(&module.llmod_id, data);
let data = bytecode::encode(&module.name, data);
if let Err(e) = fs::write(&dst, data) {
diag_handler.err(&format!("failed to write bytecode: {}", e));
}
@ -1338,7 +1338,6 @@ fn execute_work_item(cgcx: &CodegenContext,
assert_eq!(bytecode_compressed.is_some(), config.emit_bc_compressed);
Ok(WorkItemResult::Compiled(CompiledModule {
llmod_id: module.llmod_id.clone(),
name: module_name,
kind: ModuleKind::Regular,
pre_existing: true,