Skip to content

Commit

Permalink
rustc_codegen_llvm: deny(internal).
Browse files Browse the repository at this point in the history
  • Loading branch information
eddyb committed Jun 12, 2019
1 parent 87b6b86 commit 4c98cb6
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 11 deletions.
6 changes: 1 addition & 5 deletions src/librustc_codegen_llvm/debuginfo/metadata.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2257,11 +2257,7 @@ pub fn create_global_var_metadata(
/// given type.
///
/// Adds the created metadata nodes directly to the crate's IR.
pub fn create_vtable_metadata(
cx: &CodegenCx<'ll, 'tcx>,
ty: ty::Ty<'tcx>,
vtable: &'ll Value,
) {
pub fn create_vtable_metadata(cx: &CodegenCx<'ll, 'tcx>, ty: Ty<'tcx>, vtable: &'ll Value) {
if cx.dbg_cx.is_none() {
return;
}
Expand Down
12 changes: 6 additions & 6 deletions src/librustc_codegen_llvm/intrinsic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1417,7 +1417,7 @@ fn generic_simd_intrinsic(
// FIXME: use:
// https://github.com/llvm-mirror/llvm/blob/master/include/llvm/IR/Function.h#L182
// https://github.com/llvm-mirror/llvm/blob/master/include/llvm/IR/Intrinsics.h#L81
fn llvm_vector_str(elem_ty: ty::Ty<'_>, vec_len: usize, no_pointers: usize) -> String {
fn llvm_vector_str(elem_ty: Ty<'_>, vec_len: usize, no_pointers: usize) -> String {
let p0s: String = "p0".repeat(no_pointers);
match elem_ty.sty {
ty::Int(v) => format!("v{}{}i{}", vec_len, p0s, v.bit_width().unwrap()),
Expand All @@ -1427,7 +1427,7 @@ fn generic_simd_intrinsic(
}
}

fn llvm_vector_ty(cx: &CodegenCx<'ll, '_>, elem_ty: ty::Ty<'_>, vec_len: usize,
fn llvm_vector_ty(cx: &CodegenCx<'ll, '_>, elem_ty: Ty<'_>, vec_len: usize,
mut no_pointers: usize) -> &'ll Type {
// FIXME: use cx.layout_of(ty).llvm_type() ?
let mut elem_ty = match elem_ty.sty {
Expand Down Expand Up @@ -1473,15 +1473,15 @@ fn generic_simd_intrinsic(
in_ty, ret_ty);

// This counts how many pointers
fn ptr_count(t: ty::Ty<'_>) -> usize {
fn ptr_count(t: Ty<'_>) -> usize {
match t.sty {
ty::RawPtr(p) => 1 + ptr_count(p.ty),
_ => 0,
}
}

// Non-ptr type
fn non_ptr(t: ty::Ty<'_>) -> ty::Ty<'_> {
fn non_ptr(t: Ty<'_>) -> Ty<'_> {
match t.sty {
ty::RawPtr(p) => non_ptr(p.ty),
_ => t,
Expand Down Expand Up @@ -1572,15 +1572,15 @@ fn generic_simd_intrinsic(
arg_tys[2].simd_size(tcx));

// This counts how many pointers
fn ptr_count(t: ty::Ty<'_>) -> usize {
fn ptr_count(t: Ty<'_>) -> usize {
match t.sty {
ty::RawPtr(p) => 1 + ptr_count(p.ty),
_ => 0,
}
}

// Non-ptr type
fn non_ptr(t: ty::Ty<'_>) -> ty::Ty<'_> {
fn non_ptr(t: Ty<'_>) -> Ty<'_> {
match t.sty {
ty::RawPtr(p) => non_ptr(p.ty),
_ => t,
Expand Down
1 change: 1 addition & 0 deletions src/librustc_codegen_llvm/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
#![feature(static_nobundle)]
#![feature(trusted_len)]
#![deny(rust_2018_idioms)]
#![deny(internal)]
#![deny(unused_lifetimes)]
#![allow(explicit_outlives_requirements)]

Expand Down

0 comments on commit 4c98cb6

Please sign in to comment.