rustc_platform_intrinsics: remove unused rustc dependency.
This commit is contained in:
parent
352b44d1fa
commit
0abd3139db
9 changed files with 12 additions and 23 deletions
|
@ -110,7 +110,7 @@ DEPS_rustc_metadata := rustc rustc_front syntax rbml rustc_const_eval
|
||||||
DEPS_rustc_passes := syntax rustc core rustc_front
|
DEPS_rustc_passes := syntax rustc core rustc_front
|
||||||
DEPS_rustc_mir := rustc rustc_front syntax rustc_const_eval
|
DEPS_rustc_mir := rustc rustc_front syntax rustc_const_eval
|
||||||
DEPS_rustc_resolve := arena rustc rustc_front log syntax
|
DEPS_rustc_resolve := arena rustc rustc_front log syntax
|
||||||
DEPS_rustc_platform_intrinsics := rustc rustc_llvm
|
DEPS_rustc_platform_intrinsics := std
|
||||||
DEPS_rustc_plugin := rustc rustc_metadata syntax rustc_mir
|
DEPS_rustc_plugin := rustc rustc_metadata syntax rustc_mir
|
||||||
DEPS_rustc_privacy := rustc rustc_front log syntax
|
DEPS_rustc_privacy := rustc rustc_front log syntax
|
||||||
DEPS_rustc_trans := arena flate getopts graphviz libc rustc rustc_back rustc_mir \
|
DEPS_rustc_trans := arena flate getopts graphviz libc rustc rustc_back rustc_mir \
|
||||||
|
|
|
@ -759,12 +759,11 @@ class CompilerDefs(object):
|
||||||
|
|
||||||
use {{Intrinsic, Type}};
|
use {{Intrinsic, Type}};
|
||||||
use IntrinsicDef::Named;
|
use IntrinsicDef::Named;
|
||||||
use rustc::middle::ty::TyCtxt;
|
|
||||||
|
|
||||||
// The default inlining settings trigger a pathological behaviour in
|
// The default inlining settings trigger a pathological behaviour in
|
||||||
// LLVM, which causes makes compilation very slow. See #28273.
|
// LLVM, which causes makes compilation very slow. See #28273.
|
||||||
#[inline(never)]
|
#[inline(never)]
|
||||||
pub fn find<'tcx>(_tcx: &TyCtxt<'tcx>, name: &str) -> Option<Intrinsic> {{
|
pub fn find(name: &str) -> Option<Intrinsic> {{
|
||||||
if !name.starts_with("{0}") {{ return None }}
|
if !name.starts_with("{0}") {{ return None }}
|
||||||
Some(match &name["{0}".len()..] {{'''.format(platform.intrinsic_prefix())
|
Some(match &name["{0}".len()..] {{'''.format(platform.intrinsic_prefix())
|
||||||
|
|
||||||
|
|
|
@ -7,6 +7,3 @@ version = "0.0.0"
|
||||||
name = "rustc_platform_intrinsics"
|
name = "rustc_platform_intrinsics"
|
||||||
path = "lib.rs"
|
path = "lib.rs"
|
||||||
crate-type = ["dylib"]
|
crate-type = ["dylib"]
|
||||||
|
|
||||||
[dependencies]
|
|
||||||
rustc = { path = "../librustc" }
|
|
||||||
|
|
|
@ -15,12 +15,11 @@
|
||||||
|
|
||||||
use {Intrinsic, Type};
|
use {Intrinsic, Type};
|
||||||
use IntrinsicDef::Named;
|
use IntrinsicDef::Named;
|
||||||
use rustc::ty::TyCtxt;
|
|
||||||
|
|
||||||
// The default inlining settings trigger a pathological behaviour in
|
// The default inlining settings trigger a pathological behaviour in
|
||||||
// LLVM, which causes makes compilation very slow. See #28273.
|
// LLVM, which causes makes compilation very slow. See #28273.
|
||||||
#[inline(never)]
|
#[inline(never)]
|
||||||
pub fn find<'tcx>(_tcx: &TyCtxt<'tcx>, name: &str) -> Option<Intrinsic> {
|
pub fn find(name: &str) -> Option<Intrinsic> {
|
||||||
if !name.starts_with("aarch64_v") { return None }
|
if !name.starts_with("aarch64_v") { return None }
|
||||||
Some(match &name["aarch64_v".len()..] {
|
Some(match &name["aarch64_v".len()..] {
|
||||||
"hadd_s8" => Intrinsic {
|
"hadd_s8" => Intrinsic {
|
||||||
|
|
|
@ -15,12 +15,11 @@
|
||||||
|
|
||||||
use {Intrinsic, Type};
|
use {Intrinsic, Type};
|
||||||
use IntrinsicDef::Named;
|
use IntrinsicDef::Named;
|
||||||
use rustc::ty::TyCtxt;
|
|
||||||
|
|
||||||
// The default inlining settings trigger a pathological behaviour in
|
// The default inlining settings trigger a pathological behaviour in
|
||||||
// LLVM, which causes makes compilation very slow. See #28273.
|
// LLVM, which causes makes compilation very slow. See #28273.
|
||||||
#[inline(never)]
|
#[inline(never)]
|
||||||
pub fn find<'tcx>(_tcx: &TyCtxt<'tcx>, name: &str) -> Option<Intrinsic> {
|
pub fn find(name: &str) -> Option<Intrinsic> {
|
||||||
if !name.starts_with("arm_v") { return None }
|
if !name.starts_with("arm_v") { return None }
|
||||||
Some(match &name["arm_v".len()..] {
|
Some(match &name["arm_v".len()..] {
|
||||||
"hadd_s8" => Intrinsic {
|
"hadd_s8" => Intrinsic {
|
||||||
|
|
|
@ -12,14 +12,10 @@
|
||||||
#![unstable(feature = "rustc_private", issue = "27812")]
|
#![unstable(feature = "rustc_private", issue = "27812")]
|
||||||
#![crate_type = "dylib"]
|
#![crate_type = "dylib"]
|
||||||
#![crate_type = "rlib"]
|
#![crate_type = "rlib"]
|
||||||
#![feature(staged_api, rustc_private)]
|
#![feature(staged_api)]
|
||||||
#![cfg_attr(not(stage0), deny(warnings))]
|
#![cfg_attr(not(stage0), deny(warnings))]
|
||||||
#![allow(bad_style)]
|
#![allow(bad_style)]
|
||||||
|
|
||||||
extern crate rustc;
|
|
||||||
|
|
||||||
use rustc::ty::TyCtxt;
|
|
||||||
|
|
||||||
pub struct Intrinsic {
|
pub struct Intrinsic {
|
||||||
pub inputs: &'static [&'static Type],
|
pub inputs: &'static [&'static Type],
|
||||||
pub output: &'static Type,
|
pub output: &'static Type,
|
||||||
|
@ -101,13 +97,13 @@ mod arm;
|
||||||
mod aarch64;
|
mod aarch64;
|
||||||
|
|
||||||
impl Intrinsic {
|
impl Intrinsic {
|
||||||
pub fn find<'tcx>(tcx: &TyCtxt<'tcx>, name: &str) -> Option<Intrinsic> {
|
pub fn find(name: &str) -> Option<Intrinsic> {
|
||||||
if name.starts_with("x86_") {
|
if name.starts_with("x86_") {
|
||||||
x86::find(tcx, name)
|
x86::find(name)
|
||||||
} else if name.starts_with("arm_") {
|
} else if name.starts_with("arm_") {
|
||||||
arm::find(tcx, name)
|
arm::find(name)
|
||||||
} else if name.starts_with("aarch64_") {
|
} else if name.starts_with("aarch64_") {
|
||||||
aarch64::find(tcx, name)
|
aarch64::find(name)
|
||||||
} else {
|
} else {
|
||||||
None
|
None
|
||||||
}
|
}
|
||||||
|
|
|
@ -15,12 +15,11 @@
|
||||||
|
|
||||||
use {Intrinsic, Type};
|
use {Intrinsic, Type};
|
||||||
use IntrinsicDef::Named;
|
use IntrinsicDef::Named;
|
||||||
use rustc::ty::TyCtxt;
|
|
||||||
|
|
||||||
// The default inlining settings trigger a pathological behaviour in
|
// The default inlining settings trigger a pathological behaviour in
|
||||||
// LLVM, which causes makes compilation very slow. See #28273.
|
// LLVM, which causes makes compilation very slow. See #28273.
|
||||||
#[inline(never)]
|
#[inline(never)]
|
||||||
pub fn find<'tcx>(_tcx: &TyCtxt<'tcx>, name: &str) -> Option<Intrinsic> {
|
pub fn find(name: &str) -> Option<Intrinsic> {
|
||||||
if !name.starts_with("x86_mm") { return None }
|
if !name.starts_with("x86_mm") { return None }
|
||||||
Some(match &name["x86_mm".len()..] {
|
Some(match &name["x86_mm".len()..] {
|
||||||
"_movemask_ps" => Intrinsic {
|
"_movemask_ps" => Intrinsic {
|
||||||
|
|
|
@ -818,7 +818,7 @@ pub fn trans_intrinsic_call<'a, 'blk, 'tcx>(mut bcx: Block<'blk, 'tcx>,
|
||||||
}
|
}
|
||||||
|
|
||||||
(_, _) => {
|
(_, _) => {
|
||||||
let intr = match Intrinsic::find(tcx, &name) {
|
let intr = match Intrinsic::find(&name) {
|
||||||
Some(intr) => intr,
|
Some(intr) => intr,
|
||||||
None => unreachable!("unknown intrinsic '{}'", name),
|
None => unreachable!("unknown intrinsic '{}'", name),
|
||||||
};
|
};
|
||||||
|
|
|
@ -360,7 +360,7 @@ pub fn check_platform_intrinsic_type(ccx: &CrateCtxt,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
_ => {
|
_ => {
|
||||||
match intrinsics::Intrinsic::find(tcx, &name) {
|
match intrinsics::Intrinsic::find(&name) {
|
||||||
Some(intr) => {
|
Some(intr) => {
|
||||||
// this function is a platform specific intrinsic
|
// this function is a platform specific intrinsic
|
||||||
if i_n_tps != 0 {
|
if i_n_tps != 0 {
|
||||||
|
|
Loading…
Reference in a new issue