Use informational target machine for metadata
Since there is nothing to optimise there...
This commit is contained in:
@@ -23,7 +23,7 @@
|
||||
#![deny(rust_2018_idioms)]
|
||||
#![allow(explicit_outlives_requirements)]
|
||||
|
||||
use back::write::create_target_machine;
|
||||
use back::write::{create_target_machine, create_informational_target_machine};
|
||||
use syntax_pos::symbol::Symbol;
|
||||
|
||||
extern crate flate2;
|
||||
@@ -112,8 +112,9 @@ pub struct LlvmCodegenBackend(());
|
||||
|
||||
impl ExtraBackendMethods for LlvmCodegenBackend {
|
||||
fn new_metadata(&self, tcx: TyCtxt<'_, '_, '_>, mod_name: &str) -> ModuleLlvm {
|
||||
ModuleLlvm::new(tcx, mod_name)
|
||||
ModuleLlvm::new_metadata(tcx, mod_name)
|
||||
}
|
||||
|
||||
fn write_metadata<'b, 'gcx>(
|
||||
&self,
|
||||
tcx: TyCtxt<'b, 'gcx, 'gcx>,
|
||||
@@ -363,7 +364,6 @@ impl ModuleLlvm {
|
||||
unsafe {
|
||||
let llcx = llvm::LLVMRustContextCreate(tcx.sess.fewer_names());
|
||||
let llmod_raw = context::create_module(tcx, llcx, mod_name) as *const _;
|
||||
|
||||
ModuleLlvm {
|
||||
llmod_raw,
|
||||
llcx,
|
||||
@@ -372,6 +372,18 @@ impl ModuleLlvm {
|
||||
}
|
||||
}
|
||||
|
||||
fn new_metadata(tcx: TyCtxt<'_, '_, '_>, mod_name: &str) -> Self {
|
||||
unsafe {
|
||||
let llcx = llvm::LLVMRustContextCreate(tcx.sess.fewer_names());
|
||||
let llmod_raw = context::create_module(tcx, llcx, mod_name) as *const _;
|
||||
ModuleLlvm {
|
||||
llmod_raw,
|
||||
llcx,
|
||||
tm: create_informational_target_machine(&tcx.sess, false),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fn parse(
|
||||
cgcx: &CodegenContext<LlvmCodegenBackend>,
|
||||
name: &str,
|
||||
|
||||
Reference in New Issue
Block a user