Skip to content

Commit

Permalink
rustc_codegen_llvm: less pubs
Browse files Browse the repository at this point in the history
  • Loading branch information
klensy committed Jul 3, 2024
1 parent 7d97c59 commit 7d8c5f5
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 7 deletions.
15 changes: 11 additions & 4 deletions compiler/rustc_codegen_llvm/src/llvm/ffi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,7 @@ pub enum DLLStorageClass {
#[derive(Copy, Clone, Debug)]
pub enum AttributeKind {
AlwaysInline = 0,
#[allow(dead_code)]
ByVal = 1,
Cold = 2,
InlineHint = 3,
Expand All @@ -176,15 +177,19 @@ pub enum AttributeKind {
OptimizeForSize = 13,
ReadOnly = 14,
SExt = 15,
#[allow(dead_code)]
StructRet = 16,
#[allow(dead_code)]
UWTable = 17,
ZExt = 18,
InReg = 19,
SanitizeThread = 20,
SanitizeAddress = 21,
SanitizeMemory = 22,
NonLazyBind = 23,
#[allow(dead_code)]
OptimizeNone = 24,
#[allow(dead_code)]
ReadNone = 26,
SanitizeHWAddress = 28,
WillReturn = 29,
Expand All @@ -195,6 +200,7 @@ pub enum AttributeKind {
SanitizeMemTag = 34,
NoCfCheck = 35,
ShadowCallStack = 36,
#[allow(dead_code)]
AllocSize = 37,
AllocatedPointer = 38,
AllocAlign = 39,
Expand Down Expand Up @@ -289,6 +295,7 @@ impl RealPredicate {
/// LLVMTypeKind
#[derive(Copy, Clone, PartialEq, Debug)]
#[repr(C)]
#[allow(dead_code)]
pub enum TypeKind {
Void = 0,
Half = 1,
Expand Down Expand Up @@ -598,6 +605,7 @@ pub enum ThreadLocalMode {
/// LLVMRustTailCallKind
#[derive(Copy, Clone)]
#[repr(C)]
#[allow(dead_code)]
pub enum TailCallKind {
None,
Tail,
Expand Down Expand Up @@ -662,9 +670,6 @@ extern "C" {
pub struct Builder<'a>(InvariantOpaque<'a>);
#[repr(C)]
pub struct PassManager<'a>(InvariantOpaque<'a>);
extern "C" {
pub type Pass;
}
extern "C" {
pub type TargetMachine;
}
Expand Down Expand Up @@ -696,7 +701,6 @@ extern "C" {
}

pub type DiagnosticHandlerTy = unsafe extern "C" fn(&DiagnosticInfo, *mut c_void);
pub type InlineAsmDiagHandlerTy = unsafe extern "C" fn(&SMDiagnostic, *const c_void, c_uint);

pub mod debuginfo {
use super::{InvariantOpaque, Metadata};
Expand Down Expand Up @@ -804,6 +808,7 @@ pub mod debuginfo {
#[repr(C)]
pub enum DebugNameTableKind {
Default,
#[allow(dead_code)]
Gnu,
None,
}
Expand Down Expand Up @@ -1563,6 +1568,8 @@ extern "C" {
Name: *const c_char,
NameLen: size_t,
) -> Option<&Value>;

#[allow(dead_code)]
pub fn LLVMRustSetTailCallKind(CallInst: &Value, TKC: TailCallKind);

// Operations on attributes
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_codegen_llvm/src/llvm/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ pub mod archive_ro;
pub mod diagnostic;
mod ffi;

pub use self::ffi::*;
pub(crate) use self::ffi::*;

impl LLVMRustResult {
pub fn into_result(self) -> Result<(), ()> {
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_codegen_llvm/src/type_.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pub use crate::llvm::Type;
pub(crate) use crate::llvm::Type;

use crate::abi::{FnAbiLlvmExt, LlvmType};
use crate::common;
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_codegen_llvm/src/value.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pub use crate::llvm::Value;
pub(crate) use crate::llvm::Value;

use crate::llvm;

Expand Down

0 comments on commit 7d8c5f5

Please sign in to comment.