Add new_regular
and new_allocator
to ModuleCodegen
This commit is contained in:
parent
f32ca1afaf
commit
9431427cc3
6 changed files with 23 additions and 28 deletions
|
@ -632,17 +632,16 @@ pub unsafe fn optimize_thin_module(
|
|||
Arc::new(SyncContext::new(context))
|
||||
}
|
||||
};
|
||||
let module = ModuleCodegen {
|
||||
module_llvm: GccContext {
|
||||
let module = ModuleCodegen::new_regular(
|
||||
thin_module.name().to_string(),
|
||||
GccContext {
|
||||
context,
|
||||
should_combine_object_files,
|
||||
// TODO(antoyo): use the correct relocation model here.
|
||||
relocation_model: RelocModel::Pic,
|
||||
temp_dir: None,
|
||||
},
|
||||
name: thin_module.name().to_string(),
|
||||
kind: ModuleKind::Regular,
|
||||
};
|
||||
);
|
||||
/*{
|
||||
let target = &*module.module_llvm.tm;
|
||||
let llmod = module.module_llvm.llmod();
|
||||
|
|
|
@ -4,10 +4,10 @@ use std::sync::Arc;
|
|||
use std::time::Instant;
|
||||
|
||||
use gccjit::{CType, Context, FunctionType, GlobalKind};
|
||||
use rustc_codegen_ssa::ModuleCodegen;
|
||||
use rustc_codegen_ssa::base::maybe_create_entry_wrapper;
|
||||
use rustc_codegen_ssa::mono_item::MonoItemExt;
|
||||
use rustc_codegen_ssa::traits::DebugInfoCodegenMethods;
|
||||
use rustc_codegen_ssa::{ModuleCodegen, ModuleKind};
|
||||
use rustc_middle::dep_graph;
|
||||
use rustc_middle::mir::mono::Linkage;
|
||||
#[cfg(feature = "master")]
|
||||
|
@ -237,16 +237,15 @@ pub fn compile_codegen_unit(
|
|||
}
|
||||
}
|
||||
|
||||
ModuleCodegen {
|
||||
name: cgu_name.to_string(),
|
||||
module_llvm: GccContext {
|
||||
ModuleCodegen::new_regular(
|
||||
cgu_name.to_string(),
|
||||
GccContext {
|
||||
context: Arc::new(SyncContext::new(context)),
|
||||
relocation_model: tcx.sess.relocation_model(),
|
||||
should_combine_object_files: false,
|
||||
temp_dir: None,
|
||||
},
|
||||
kind: ModuleKind::Regular,
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
(module, cost)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue