Skip to content

Commit 0abd313

Browse files
committed
rustc_platform_intrinsics: remove unused rustc dependency.
1 parent 352b44d commit 0abd313

File tree

9 files changed

+12
-23
lines changed

9 files changed

+12
-23
lines changed

mk/crates.mk

+1-1
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ DEPS_rustc_metadata := rustc rustc_front syntax rbml rustc_const_eval
110110
DEPS_rustc_passes := syntax rustc core rustc_front
111111
DEPS_rustc_mir := rustc rustc_front syntax rustc_const_eval
112112
DEPS_rustc_resolve := arena rustc rustc_front log syntax
113-
DEPS_rustc_platform_intrinsics := rustc rustc_llvm
113+
DEPS_rustc_platform_intrinsics := std
114114
DEPS_rustc_plugin := rustc rustc_metadata syntax rustc_mir
115115
DEPS_rustc_privacy := rustc rustc_front log syntax
116116
DEPS_rustc_trans := arena flate getopts graphviz libc rustc rustc_back rustc_mir \

src/etc/platform-intrinsics/generator.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -759,12 +759,11 @@ def open(self, platform):
759759
760760
use {{Intrinsic, Type}};
761761
use IntrinsicDef::Named;
762-
use rustc::middle::ty::TyCtxt;
763762
764763
// The default inlining settings trigger a pathological behaviour in
765764
// LLVM, which causes makes compilation very slow. See #28273.
766765
#[inline(never)]
767-
pub fn find<'tcx>(_tcx: &TyCtxt<'tcx>, name: &str) -> Option<Intrinsic> {{
766+
pub fn find(name: &str) -> Option<Intrinsic> {{
768767
if !name.starts_with("{0}") {{ return None }}
769768
Some(match &name["{0}".len()..] {{'''.format(platform.intrinsic_prefix())
770769

src/librustc_platform_intrinsics/Cargo.toml

-3
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,3 @@ version = "0.0.0"
77
name = "rustc_platform_intrinsics"
88
path = "lib.rs"
99
crate-type = ["dylib"]
10-
11-
[dependencies]
12-
rustc = { path = "../librustc" }

src/librustc_platform_intrinsics/aarch64.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,11 @@
1515

1616
use {Intrinsic, Type};
1717
use IntrinsicDef::Named;
18-
use rustc::ty::TyCtxt;
1918

2019
// The default inlining settings trigger a pathological behaviour in
2120
// LLVM, which causes makes compilation very slow. See #28273.
2221
#[inline(never)]
23-
pub fn find<'tcx>(_tcx: &TyCtxt<'tcx>, name: &str) -> Option<Intrinsic> {
22+
pub fn find(name: &str) -> Option<Intrinsic> {
2423
if !name.starts_with("aarch64_v") { return None }
2524
Some(match &name["aarch64_v".len()..] {
2625
"hadd_s8" => Intrinsic {

src/librustc_platform_intrinsics/arm.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,11 @@
1515

1616
use {Intrinsic, Type};
1717
use IntrinsicDef::Named;
18-
use rustc::ty::TyCtxt;
1918

2019
// The default inlining settings trigger a pathological behaviour in
2120
// LLVM, which causes makes compilation very slow. See #28273.
2221
#[inline(never)]
23-
pub fn find<'tcx>(_tcx: &TyCtxt<'tcx>, name: &str) -> Option<Intrinsic> {
22+
pub fn find(name: &str) -> Option<Intrinsic> {
2423
if !name.starts_with("arm_v") { return None }
2524
Some(match &name["arm_v".len()..] {
2625
"hadd_s8" => Intrinsic {

src/librustc_platform_intrinsics/lib.rs

+5-9
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,10 @@
1212
#![unstable(feature = "rustc_private", issue = "27812")]
1313
#![crate_type = "dylib"]
1414
#![crate_type = "rlib"]
15-
#![feature(staged_api, rustc_private)]
15+
#![feature(staged_api)]
1616
#![cfg_attr(not(stage0), deny(warnings))]
1717
#![allow(bad_style)]
1818

19-
extern crate rustc;
20-
21-
use rustc::ty::TyCtxt;
22-
2319
pub struct Intrinsic {
2420
pub inputs: &'static [&'static Type],
2521
pub output: &'static Type,
@@ -101,13 +97,13 @@ mod arm;
10197
mod aarch64;
10298

10399
impl Intrinsic {
104-
pub fn find<'tcx>(tcx: &TyCtxt<'tcx>, name: &str) -> Option<Intrinsic> {
100+
pub fn find(name: &str) -> Option<Intrinsic> {
105101
if name.starts_with("x86_") {
106-
x86::find(tcx, name)
102+
x86::find(name)
107103
} else if name.starts_with("arm_") {
108-
arm::find(tcx, name)
104+
arm::find(name)
109105
} else if name.starts_with("aarch64_") {
110-
aarch64::find(tcx, name)
106+
aarch64::find(name)
111107
} else {
112108
None
113109
}

src/librustc_platform_intrinsics/x86.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,11 @@
1515

1616
use {Intrinsic, Type};
1717
use IntrinsicDef::Named;
18-
use rustc::ty::TyCtxt;
1918

2019
// The default inlining settings trigger a pathological behaviour in
2120
// LLVM, which causes makes compilation very slow. See #28273.
2221
#[inline(never)]
23-
pub fn find<'tcx>(_tcx: &TyCtxt<'tcx>, name: &str) -> Option<Intrinsic> {
22+
pub fn find(name: &str) -> Option<Intrinsic> {
2423
if !name.starts_with("x86_mm") { return None }
2524
Some(match &name["x86_mm".len()..] {
2625
"_movemask_ps" => Intrinsic {

src/librustc_trans/intrinsic.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -818,7 +818,7 @@ pub fn trans_intrinsic_call<'a, 'blk, 'tcx>(mut bcx: Block<'blk, 'tcx>,
818818
}
819819

820820
(_, _) => {
821-
let intr = match Intrinsic::find(tcx, &name) {
821+
let intr = match Intrinsic::find(&name) {
822822
Some(intr) => intr,
823823
None => unreachable!("unknown intrinsic '{}'", name),
824824
};

src/librustc_typeck/check/intrinsic.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -360,7 +360,7 @@ pub fn check_platform_intrinsic_type(ccx: &CrateCtxt,
360360
}
361361
}
362362
_ => {
363-
match intrinsics::Intrinsic::find(tcx, &name) {
363+
match intrinsics::Intrinsic::find(&name) {
364364
Some(intr) => {
365365
// this function is a platform specific intrinsic
366366
if i_n_tps != 0 {

0 commit comments

Comments
 (0)