2021-03-21 09:05:48 +00:00
|
|
|
#![feature(rustc_private, decl_macro, never_type, hash_drain_filter)]
|
2020-04-05 11:48:26 +00:00
|
|
|
#![warn(rust_2018_idioms)]
|
|
|
|
#![warn(unused_lifetimes)]
|
2020-10-28 20:46:08 +00:00
|
|
|
#![warn(unreachable_pub)]
|
2018-06-17 16:05:11 +00:00
|
|
|
|
2020-09-05 09:00:34 +00:00
|
|
|
extern crate snap;
|
2020-08-20 14:51:01 +00:00
|
|
|
#[macro_use]
|
2020-03-31 11:20:19 +00:00
|
|
|
extern crate rustc_middle;
|
2020-08-28 10:10:48 +00:00
|
|
|
extern crate rustc_ast;
|
2018-11-24 10:23:49 +00:00
|
|
|
extern crate rustc_codegen_ssa;
|
2018-11-24 11:47:53 +00:00
|
|
|
extern crate rustc_data_structures;
|
2020-04-03 09:54:18 +00:00
|
|
|
extern crate rustc_errors;
|
2018-11-24 11:47:53 +00:00
|
|
|
extern crate rustc_fs_util;
|
2020-01-09 16:43:10 +00:00
|
|
|
extern crate rustc_hir;
|
2018-06-17 16:05:11 +00:00
|
|
|
extern crate rustc_incremental;
|
2019-10-03 15:22:01 +00:00
|
|
|
extern crate rustc_index;
|
2019-12-31 15:43:24 +00:00
|
|
|
extern crate rustc_session;
|
2020-01-06 19:11:03 +00:00
|
|
|
extern crate rustc_span;
|
2018-07-31 10:25:16 +00:00
|
|
|
extern crate rustc_target;
|
2018-06-17 16:05:11 +00:00
|
|
|
|
2020-04-05 11:48:26 +00:00
|
|
|
// This prevents duplicating functions and statics that are already part of the host rustc process.
|
|
|
|
#[allow(unused_extern_crates)]
|
|
|
|
extern crate rustc_driver;
|
|
|
|
|
2018-07-23 09:17:39 +00:00
|
|
|
use std::any::Any;
|
2020-12-25 10:31:33 +00:00
|
|
|
use std::str::FromStr;
|
2018-06-17 16:05:11 +00:00
|
|
|
|
2020-08-28 10:10:48 +00:00
|
|
|
use rustc_codegen_ssa::traits::CodegenBackend;
|
|
|
|
use rustc_codegen_ssa::CodegenResults;
|
2020-04-03 09:54:18 +00:00
|
|
|
use rustc_errors::ErrorReported;
|
2020-10-15 08:34:13 +00:00
|
|
|
use rustc_middle::dep_graph::{WorkProduct, WorkProductId};
|
2020-03-31 11:20:19 +00:00
|
|
|
use rustc_middle::middle::cstore::{EncodedMetadata, MetadataLoader};
|
|
|
|
use rustc_middle::ty::query::Providers;
|
2020-08-28 10:10:48 +00:00
|
|
|
use rustc_session::config::OutputFilenames;
|
|
|
|
use rustc_session::Session;
|
2018-06-17 16:05:11 +00:00
|
|
|
|
2020-06-20 16:44:49 +00:00
|
|
|
use cranelift_codegen::settings::{self, Configurable};
|
2018-06-17 16:05:11 +00:00
|
|
|
|
2018-11-10 14:12:00 +00:00
|
|
|
use crate::constant::ConstantCx;
|
|
|
|
use crate::prelude::*;
|
|
|
|
|
2018-07-19 17:33:42 +00:00
|
|
|
mod abi;
|
2018-11-05 17:29:15 +00:00
|
|
|
mod allocator;
|
2018-08-09 08:46:56 +00:00
|
|
|
mod analyze;
|
2018-11-09 17:38:30 +00:00
|
|
|
mod archive;
|
2019-10-16 18:48:09 +00:00
|
|
|
mod backend;
|
2020-08-28 10:10:48 +00:00
|
|
|
mod base;
|
2019-07-31 07:45:11 +00:00
|
|
|
mod cast;
|
2019-07-07 16:08:38 +00:00
|
|
|
mod codegen_i128;
|
2018-06-22 17:18:53 +00:00
|
|
|
mod common;
|
2018-07-31 10:25:16 +00:00
|
|
|
mod constant;
|
2019-01-17 17:07:27 +00:00
|
|
|
mod debuginfo;
|
2019-08-14 10:01:41 +00:00
|
|
|
mod discriminant;
|
2019-05-04 14:54:25 +00:00
|
|
|
mod driver;
|
2020-07-10 12:45:45 +00:00
|
|
|
mod inline_asm;
|
2018-10-03 16:21:52 +00:00
|
|
|
mod intrinsics;
|
2019-03-11 19:36:29 +00:00
|
|
|
mod linkage;
|
2018-10-20 16:41:26 +00:00
|
|
|
mod main_shim;
|
2018-08-15 10:07:08 +00:00
|
|
|
mod metadata;
|
2019-08-14 09:52:39 +00:00
|
|
|
mod num;
|
2019-12-26 12:37:10 +00:00
|
|
|
mod optimize;
|
2019-12-20 15:02:47 +00:00
|
|
|
mod pointer;
|
2018-08-15 12:45:32 +00:00
|
|
|
mod pretty_clif;
|
2020-07-09 16:55:46 +00:00
|
|
|
mod toolchain;
|
2018-11-16 16:35:47 +00:00
|
|
|
mod trap;
|
2018-12-29 14:33:34 +00:00
|
|
|
mod unsize;
|
2019-06-11 13:43:22 +00:00
|
|
|
mod value_and_place;
|
2018-09-08 16:00:06 +00:00
|
|
|
mod vtable;
|
2018-06-17 16:05:11 +00:00
|
|
|
|
|
|
|
mod prelude {
|
2020-03-27 11:14:45 +00:00
|
|
|
pub(crate) use std::convert::{TryFrom, TryInto};
|
|
|
|
|
|
|
|
pub(crate) use rustc_span::Span;
|
|
|
|
|
|
|
|
pub(crate) use rustc_hir::def_id::{DefId, LOCAL_CRATE};
|
2020-08-28 10:10:48 +00:00
|
|
|
pub(crate) use rustc_middle::bug;
|
2020-03-31 11:20:19 +00:00
|
|
|
pub(crate) use rustc_middle::mir::{self, *};
|
2020-04-03 09:54:18 +00:00
|
|
|
pub(crate) use rustc_middle::ty::layout::{self, TyAndLayout};
|
2020-03-31 11:20:19 +00:00
|
|
|
pub(crate) use rustc_middle::ty::{
|
2021-01-30 18:29:02 +00:00
|
|
|
self, FloatTy, Instance, InstanceDef, IntTy, ParamEnv, Ty, TyCtxt, TypeAndMut,
|
|
|
|
TypeFoldable, UintTy,
|
2018-06-17 16:05:11 +00:00
|
|
|
};
|
2020-08-28 10:10:48 +00:00
|
|
|
pub(crate) use rustc_target::abi::{Abi, LayoutOf, Scalar, Size, VariantIdx};
|
2019-10-03 15:22:01 +00:00
|
|
|
|
2020-03-27 11:14:45 +00:00
|
|
|
pub(crate) use rustc_data_structures::fx::FxHashMap;
|
|
|
|
|
|
|
|
pub(crate) use rustc_index::vec::Idx;
|
|
|
|
|
|
|
|
pub(crate) use cranelift_codegen::entity::EntitySet;
|
|
|
|
pub(crate) use cranelift_codegen::ir::condcodes::{FloatCC, IntCC};
|
|
|
|
pub(crate) use cranelift_codegen::ir::function::Function;
|
|
|
|
pub(crate) use cranelift_codegen::ir::types;
|
2020-08-28 10:10:48 +00:00
|
|
|
pub(crate) use cranelift_codegen::ir::{
|
|
|
|
AbiParam, Block, ExternalName, FuncRef, Inst, InstBuilder, MemFlags, Signature, SourceLoc,
|
|
|
|
StackSlot, StackSlotData, StackSlotKind, TrapCode, Type, Value,
|
|
|
|
};
|
2020-03-27 11:14:45 +00:00
|
|
|
pub(crate) use cranelift_codegen::isa::{self, CallConv};
|
2020-08-28 10:10:48 +00:00
|
|
|
pub(crate) use cranelift_codegen::Context;
|
2020-03-27 11:14:45 +00:00
|
|
|
pub(crate) use cranelift_frontend::{FunctionBuilder, FunctionBuilderContext, Variable};
|
2020-10-01 08:38:23 +00:00
|
|
|
pub(crate) use cranelift_module::{self, DataContext, DataId, FuncId, Linkage, Module};
|
2018-06-22 17:18:53 +00:00
|
|
|
|
2020-03-27 11:14:45 +00:00
|
|
|
pub(crate) use crate::abi::*;
|
2020-11-01 13:24:30 +00:00
|
|
|
pub(crate) use crate::base::{codegen_operand, codegen_place};
|
2020-03-27 11:14:45 +00:00
|
|
|
pub(crate) use crate::cast::*;
|
|
|
|
pub(crate) use crate::common::*;
|
2020-06-13 15:03:34 +00:00
|
|
|
pub(crate) use crate::debuginfo::{DebugContext, UnwindContext};
|
2020-03-27 11:14:45 +00:00
|
|
|
pub(crate) use crate::pointer::Pointer;
|
|
|
|
pub(crate) use crate::trap::*;
|
|
|
|
pub(crate) use crate::value_and_place::{CPlace, CPlaceInner, CValue};
|
2020-06-20 16:44:49 +00:00
|
|
|
}
|
2020-03-17 15:26:56 +00:00
|
|
|
|
2020-06-20 16:44:49 +00:00
|
|
|
struct PrintOnPanic<F: Fn() -> String>(F);
|
|
|
|
impl<F: Fn() -> String> Drop for PrintOnPanic<F> {
|
|
|
|
fn drop(&mut self) {
|
|
|
|
if ::std::thread::panicking() {
|
|
|
|
println!("{}", (self.0)());
|
|
|
|
}
|
2020-03-17 15:26:56 +00:00
|
|
|
}
|
2018-06-17 16:05:11 +00:00
|
|
|
}
|
|
|
|
|
2021-02-22 15:00:20 +00:00
|
|
|
struct CodegenCx<'m, 'tcx: 'm> {
|
2019-06-16 09:13:49 +00:00
|
|
|
tcx: TyCtxt<'tcx>,
|
2021-02-22 15:00:20 +00:00
|
|
|
module: &'m mut dyn Module,
|
2020-07-09 17:24:53 +00:00
|
|
|
global_asm: String,
|
2019-08-18 14:52:07 +00:00
|
|
|
constants_cx: ConstantCx,
|
2020-01-04 16:58:38 +00:00
|
|
|
cached_context: Context,
|
2020-04-05 12:01:02 +00:00
|
|
|
vtables: FxHashMap<(Ty<'tcx>, Option<ty::PolyExistentialTraitRef<'tcx>>), DataId>,
|
2020-06-12 19:15:13 +00:00
|
|
|
debug_context: Option<DebugContext<'tcx>>,
|
|
|
|
unwind_context: UnwindContext<'tcx>,
|
2018-12-18 17:28:02 +00:00
|
|
|
}
|
|
|
|
|
2021-02-22 15:00:20 +00:00
|
|
|
impl<'m, 'tcx> CodegenCx<'m, 'tcx> {
|
|
|
|
fn new(
|
|
|
|
tcx: TyCtxt<'tcx>,
|
|
|
|
backend_config: BackendConfig,
|
|
|
|
module: &'m mut dyn Module,
|
|
|
|
debug_info: bool,
|
|
|
|
) -> Self {
|
2021-02-12 15:39:58 +00:00
|
|
|
let unwind_context = UnwindContext::new(
|
|
|
|
tcx,
|
|
|
|
module.isa(),
|
|
|
|
matches!(backend_config.codegen_mode, CodegenMode::Aot),
|
|
|
|
);
|
2021-03-05 10:21:44 +00:00
|
|
|
let debug_context =
|
|
|
|
if debug_info { Some(DebugContext::new(tcx, module.isa())) } else { None };
|
2018-12-18 17:28:02 +00:00
|
|
|
CodegenCx {
|
|
|
|
tcx,
|
|
|
|
module,
|
2020-07-09 17:24:53 +00:00
|
|
|
global_asm: String::new(),
|
2019-08-18 14:52:07 +00:00
|
|
|
constants_cx: ConstantCx::default(),
|
2020-01-04 16:58:38 +00:00
|
|
|
cached_context: Context::new(),
|
2020-04-05 12:01:02 +00:00
|
|
|
vtables: FxHashMap::default(),
|
2019-01-17 17:07:27 +00:00
|
|
|
debug_context,
|
2020-05-01 17:21:29 +00:00
|
|
|
unwind_context,
|
2018-12-18 17:28:02 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-02-22 15:00:20 +00:00
|
|
|
fn finalize(self) -> (String, Option<DebugContext<'tcx>>, UnwindContext<'tcx>) {
|
|
|
|
self.constants_cx.finalize(self.tcx, self.module);
|
|
|
|
(self.global_asm, self.debug_context, self.unwind_context)
|
2018-12-18 17:28:02 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-09-29 16:41:59 +00:00
|
|
|
#[derive(Copy, Clone, Debug)]
|
2020-12-25 10:31:33 +00:00
|
|
|
pub enum CodegenMode {
|
|
|
|
Aot,
|
|
|
|
Jit,
|
2020-12-25 10:41:48 +00:00
|
|
|
JitLazy,
|
2020-12-25 10:31:33 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
impl Default for CodegenMode {
|
|
|
|
fn default() -> Self {
|
|
|
|
CodegenMode::Aot
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
impl FromStr for CodegenMode {
|
|
|
|
type Err = String;
|
|
|
|
|
|
|
|
fn from_str(s: &str) -> Result<Self, Self::Err> {
|
|
|
|
match s {
|
|
|
|
"aot" => Ok(CodegenMode::Aot),
|
|
|
|
"jit" => Ok(CodegenMode::Jit),
|
2020-12-25 10:41:48 +00:00
|
|
|
"jit-lazy" => Ok(CodegenMode::JitLazy),
|
2020-12-25 10:31:33 +00:00
|
|
|
_ => Err(format!("Unknown codegen mode `{}`", s)),
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
#[derive(Copy, Clone, Debug, Default)]
|
2020-09-29 16:41:59 +00:00
|
|
|
pub struct BackendConfig {
|
2020-12-25 10:31:33 +00:00
|
|
|
pub codegen_mode: CodegenMode,
|
|
|
|
}
|
|
|
|
|
|
|
|
impl BackendConfig {
|
|
|
|
fn from_opts(opts: &[String]) -> Result<Self, String> {
|
|
|
|
let mut config = BackendConfig::default();
|
|
|
|
for opt in opts {
|
|
|
|
if let Some((name, value)) = opt.split_once('=') {
|
|
|
|
match name {
|
|
|
|
"mode" => config.codegen_mode = value.parse()?,
|
|
|
|
_ => return Err(format!("Unknown option `{}`", name)),
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
return Err(format!("Invalid option `{}`", opt));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
Ok(config)
|
|
|
|
}
|
2020-09-29 16:41:59 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
pub struct CraneliftCodegenBackend {
|
2020-12-25 10:31:33 +00:00
|
|
|
pub config: Option<BackendConfig>,
|
2020-09-29 16:41:59 +00:00
|
|
|
}
|
2018-07-23 09:17:39 +00:00
|
|
|
|
2018-07-14 09:59:42 +00:00
|
|
|
impl CodegenBackend for CraneliftCodegenBackend {
|
2020-01-17 19:33:27 +00:00
|
|
|
fn init(&self, sess: &Session) {
|
2021-03-15 13:48:58 +00:00
|
|
|
use rustc_session::config::Lto;
|
|
|
|
match sess.lto() {
|
|
|
|
Lto::No | Lto::ThinLocal => {}
|
|
|
|
Lto::Thin | Lto::Fat => sess.warn("LTO is not supported. You may get a linker error."),
|
2020-01-17 19:33:27 +00:00
|
|
|
}
|
|
|
|
}
|
2018-06-17 16:05:11 +00:00
|
|
|
|
2018-11-17 17:23:52 +00:00
|
|
|
fn metadata_loader(&self) -> Box<dyn MetadataLoader + Sync> {
|
2018-08-15 10:07:08 +00:00
|
|
|
Box::new(crate::metadata::CraneliftMetadataLoader)
|
2018-06-17 16:05:11 +00:00
|
|
|
}
|
|
|
|
|
2020-10-15 08:34:13 +00:00
|
|
|
fn provide(&self, _providers: &mut Providers) {}
|
2020-07-13 17:32:31 +00:00
|
|
|
fn provide_extern(&self, _providers: &mut Providers) {}
|
2018-06-17 16:05:11 +00:00
|
|
|
|
2020-06-20 14:22:03 +00:00
|
|
|
fn target_features(&self, _sess: &Session) -> Vec<rustc_span::Symbol> {
|
2020-08-15 19:04:33 +00:00
|
|
|
vec![]
|
2020-06-20 14:22:03 +00:00
|
|
|
}
|
|
|
|
|
2021-03-09 11:37:39 +00:00
|
|
|
fn codegen_crate(
|
2018-06-17 16:05:11 +00:00
|
|
|
&self,
|
2021-03-09 11:37:39 +00:00
|
|
|
tcx: TyCtxt<'_>,
|
2019-05-04 12:57:41 +00:00
|
|
|
metadata: EncodedMetadata,
|
2019-05-04 14:54:25 +00:00
|
|
|
need_metadata_module: bool,
|
2018-11-17 17:23:52 +00:00
|
|
|
) -> Box<dyn Any> {
|
2020-12-25 10:31:33 +00:00
|
|
|
let config = if let Some(config) = self.config {
|
|
|
|
config
|
|
|
|
} else {
|
|
|
|
BackendConfig::from_opts(&tcx.sess.opts.cg.llvm_args)
|
|
|
|
.unwrap_or_else(|err| tcx.sess.fatal(&err))
|
|
|
|
};
|
2021-03-09 11:37:39 +00:00
|
|
|
driver::codegen_crate(tcx, metadata, need_metadata_module, config)
|
2018-06-17 16:05:11 +00:00
|
|
|
}
|
|
|
|
|
2020-02-07 12:49:48 +00:00
|
|
|
fn join_codegen(
|
2018-06-17 16:05:11 +00:00
|
|
|
&self,
|
2020-02-07 12:49:48 +00:00
|
|
|
ongoing_codegen: Box<dyn Any>,
|
2020-10-15 08:34:13 +00:00
|
|
|
_sess: &Session,
|
|
|
|
) -> Result<(CodegenResults, FxHashMap<WorkProductId, WorkProduct>), ErrorReported> {
|
|
|
|
Ok(*ongoing_codegen
|
2020-08-28 10:10:48 +00:00
|
|
|
.downcast::<(CodegenResults, FxHashMap<WorkProductId, WorkProduct>)>()
|
2020-10-15 08:34:13 +00:00
|
|
|
.unwrap())
|
2020-02-07 12:49:48 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
fn link(
|
|
|
|
&self,
|
|
|
|
sess: &Session,
|
2020-10-15 08:34:13 +00:00
|
|
|
codegen_results: CodegenResults,
|
2018-06-17 16:05:11 +00:00
|
|
|
outputs: &OutputFilenames,
|
2019-03-11 19:02:47 +00:00
|
|
|
) -> Result<(), ErrorReported> {
|
2019-04-01 17:34:26 +00:00
|
|
|
use rustc_codegen_ssa::back::link::link_binary;
|
|
|
|
|
2021-01-02 15:59:23 +00:00
|
|
|
let target_cpu = crate::target_triple(sess).to_string();
|
|
|
|
link_binary::<crate::archive::ArArchiveBuilder<'_>>(
|
|
|
|
sess,
|
|
|
|
&codegen_results,
|
|
|
|
outputs,
|
|
|
|
&codegen_results.crate_name.as_str(),
|
|
|
|
&target_cpu,
|
|
|
|
);
|
2019-04-01 17:34:26 +00:00
|
|
|
|
2018-06-17 16:05:11 +00:00
|
|
|
Ok(())
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-05-25 10:30:21 +00:00
|
|
|
fn target_triple(sess: &Session) -> target_lexicon::Triple {
|
2020-10-16 07:35:48 +00:00
|
|
|
sess.target.llvm_target.parse().unwrap()
|
2019-05-25 10:30:21 +00:00
|
|
|
}
|
|
|
|
|
2020-12-17 18:31:38 +00:00
|
|
|
fn build_isa(sess: &Session) -> Box<dyn isa::TargetIsa + 'static> {
|
2019-10-27 15:55:35 +00:00
|
|
|
use target_lexicon::BinaryFormat;
|
|
|
|
|
|
|
|
let target_triple = crate::target_triple(sess);
|
|
|
|
|
2018-12-12 14:11:15 +00:00
|
|
|
let mut flags_builder = settings::builder();
|
2020-12-17 18:31:38 +00:00
|
|
|
flags_builder.enable("is_pic").unwrap();
|
2020-01-14 12:55:08 +00:00
|
|
|
flags_builder.set("enable_probestack", "false").unwrap(); // __cranelift_probestack is not provided
|
2021-03-06 14:33:47 +00:00
|
|
|
let enable_verifier =
|
|
|
|
cfg!(debug_assertions) || std::env::var("CG_CLIF_ENABLE_VERIFIER").is_ok();
|
|
|
|
flags_builder.set("enable_verifier", if enable_verifier { "true" } else { "false" }).unwrap();
|
2018-12-12 14:11:15 +00:00
|
|
|
|
2019-10-27 15:55:35 +00:00
|
|
|
let tls_model = match target_triple.binary_format {
|
|
|
|
BinaryFormat::Elf => "elf_gd",
|
|
|
|
BinaryFormat::Macho => "macho",
|
|
|
|
BinaryFormat::Coff => "coff",
|
|
|
|
_ => "none",
|
|
|
|
};
|
|
|
|
flags_builder.set("tls_model", tls_model).unwrap();
|
|
|
|
|
2020-03-27 19:55:54 +00:00
|
|
|
flags_builder.set("enable_simd", "true").unwrap();
|
|
|
|
|
2020-05-25 19:43:22 +00:00
|
|
|
flags_builder.set("enable_llvm_abi_extensions", "true").unwrap();
|
|
|
|
|
2020-03-24 12:09:44 +00:00
|
|
|
use rustc_session::config::OptLevel;
|
2019-05-04 14:54:25 +00:00
|
|
|
match sess.opts.optimize {
|
2018-12-12 14:11:15 +00:00
|
|
|
OptLevel::No => {
|
2020-03-31 12:13:03 +00:00
|
|
|
flags_builder.set("opt_level", "none").unwrap();
|
2018-12-12 14:11:15 +00:00
|
|
|
}
|
|
|
|
OptLevel::Less | OptLevel::Default => {}
|
2021-03-15 13:48:58 +00:00
|
|
|
OptLevel::Size | OptLevel::SizeMin | OptLevel::Aggressive => {
|
2020-03-31 12:13:03 +00:00
|
|
|
flags_builder.set("opt_level", "speed_and_size").unwrap();
|
2018-12-12 14:11:15 +00:00
|
|
|
}
|
2020-12-12 09:38:46 +00:00
|
|
|
}
|
2018-12-12 14:11:15 +00:00
|
|
|
|
|
|
|
let flags = settings::Flags::new(flags_builder);
|
2020-03-27 19:55:54 +00:00
|
|
|
|
2021-02-09 12:47:29 +00:00
|
|
|
let variant = cranelift_codegen::isa::BackendVariant::MachInst;
|
2021-01-18 13:48:50 +00:00
|
|
|
let mut isa_builder = cranelift_codegen::isa::lookup_variant(target_triple, variant).unwrap();
|
2020-07-25 14:15:42 +00:00
|
|
|
// Don't use "haswell", as it implies `has_lzcnt`.macOS CI is still at Ivy Bridge EP, so `lzcnt`
|
|
|
|
// is interpreted as `bsr`.
|
|
|
|
isa_builder.enable("nehalem").unwrap();
|
2020-03-27 19:55:54 +00:00
|
|
|
isa_builder.finish(flags)
|
2018-12-12 14:11:15 +00:00
|
|
|
}
|
|
|
|
|
2018-07-14 09:59:42 +00:00
|
|
|
/// This is the entrypoint for a hot plugged rustc_codegen_cranelift
|
2018-06-17 16:05:11 +00:00
|
|
|
#[no_mangle]
|
2018-11-17 17:23:52 +00:00
|
|
|
pub fn __rustc_codegen_backend() -> Box<dyn CodegenBackend> {
|
2020-12-25 10:31:33 +00:00
|
|
|
Box::new(CraneliftCodegenBackend { config: None })
|
2018-06-18 16:39:07 +00:00
|
|
|
}
|