rustc_platform_intrinsics: remove unused rustc dependency.

This commit is contained in:
Eduard Burtescu 2016-03-29 13:50:58 +03:00
parent 352b44d1fa
commit 0abd3139db
9 changed files with 12 additions and 23 deletions

View File

@ -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_mir := rustc rustc_front syntax rustc_const_eval
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_privacy := rustc rustc_front log syntax
DEPS_rustc_trans := arena flate getopts graphviz libc rustc rustc_back rustc_mir \

View File

@ -759,12 +759,11 @@ class CompilerDefs(object):
use {{Intrinsic, Type}};
use IntrinsicDef::Named;
use rustc::middle::ty::TyCtxt;
// The default inlining settings trigger a pathological behaviour in
// LLVM, which causes makes compilation very slow. See #28273.
#[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 }}
Some(match &name["{0}".len()..] {{'''.format(platform.intrinsic_prefix())

View File

@ -7,6 +7,3 @@ version = "0.0.0"
name = "rustc_platform_intrinsics"
path = "lib.rs"
crate-type = ["dylib"]
[dependencies]
rustc = { path = "../librustc" }

View File

@ -15,12 +15,11 @@
use {Intrinsic, Type};
use IntrinsicDef::Named;
use rustc::ty::TyCtxt;
// The default inlining settings trigger a pathological behaviour in
// LLVM, which causes makes compilation very slow. See #28273.
#[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 }
Some(match &name["aarch64_v".len()..] {
"hadd_s8" => Intrinsic {

View File

@ -15,12 +15,11 @@
use {Intrinsic, Type};
use IntrinsicDef::Named;
use rustc::ty::TyCtxt;
// The default inlining settings trigger a pathological behaviour in
// LLVM, which causes makes compilation very slow. See #28273.
#[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 }
Some(match &name["arm_v".len()..] {
"hadd_s8" => Intrinsic {

View File

@ -12,14 +12,10 @@
#![unstable(feature = "rustc_private", issue = "27812")]
#![crate_type = "dylib"]
#![crate_type = "rlib"]
#![feature(staged_api, rustc_private)]
#![feature(staged_api)]
#![cfg_attr(not(stage0), deny(warnings))]
#![allow(bad_style)]
extern crate rustc;
use rustc::ty::TyCtxt;
pub struct Intrinsic {
pub inputs: &'static [&'static Type],
pub output: &'static Type,
@ -101,13 +97,13 @@ mod arm;
mod aarch64;
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_") {
x86::find(tcx, name)
x86::find(name)
} else if name.starts_with("arm_") {
arm::find(tcx, name)
arm::find(name)
} else if name.starts_with("aarch64_") {
aarch64::find(tcx, name)
aarch64::find(name)
} else {
None
}

View File

@ -15,12 +15,11 @@
use {Intrinsic, Type};
use IntrinsicDef::Named;
use rustc::ty::TyCtxt;
// The default inlining settings trigger a pathological behaviour in
// LLVM, which causes makes compilation very slow. See #28273.
#[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 }
Some(match &name["x86_mm".len()..] {
"_movemask_ps" => Intrinsic {

View File

@ -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,
None => unreachable!("unknown intrinsic '{}'", name),
};

View File

@ -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) => {
// this function is a platform specific intrinsic
if i_n_tps != 0 {