Skip to content

Commit cd40bbf

Browse files
committed
Move MetadataKindId into its own submodule
1 parent 29b7717 commit cd40bbf

File tree

3 files changed

+16
-10
lines changed

3 files changed

+16
-10
lines changed

compiler/rustc_codegen_llvm/src/llvm/ffi.rs

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ use super::debuginfo::{
2929
DITemplateTypeParameter, DIType, DebugEmissionKind, DebugNameTableKind,
3030
};
3131
use crate::llvm;
32+
use crate::llvm::MetadataKindId;
3233

3334
/// In the LLVM-C API, boolean values are passed as `typedef int LLVMBool`,
3435
/// which has a different ABI from Rust or C++ `bool`.
@@ -1035,16 +1036,6 @@ pub(crate) type GetSymbolsCallback =
10351036
unsafe extern "C" fn(*mut c_void, *const c_char) -> *mut c_void;
10361037
pub(crate) type GetSymbolsErrorCallback = unsafe extern "C" fn(*const c_char) -> *mut c_void;
10371038

1038-
#[derive(Copy, Clone)]
1039-
#[repr(transparent)]
1040-
pub(crate) struct MetadataKindId(c_uint);
1041-
1042-
impl From<MetadataType> for MetadataKindId {
1043-
fn from(value: MetadataType) -> Self {
1044-
Self(value as c_uint)
1045-
}
1046-
}
1047-
10481039
unsafe extern "C" {
10491040
// Create and destroy contexts.
10501041
pub(crate) fn LLVMContextDispose(C: &'static mut Context);
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
use libc::c_uint;
2+
3+
use crate::llvm::MetadataType;
4+
5+
#[derive(Copy, Clone)]
6+
#[repr(transparent)]
7+
pub(crate) struct MetadataKindId(c_uint);
8+
9+
impl From<MetadataType> for MetadataKindId {
10+
fn from(value: MetadataType) -> Self {
11+
Self(value as c_uint)
12+
}
13+
}

compiler/rustc_codegen_llvm/src/llvm/mod.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,13 @@ pub(crate) use self::CallConv::*;
1313
pub(crate) use self::CodeGenOptSize::*;
1414
pub(crate) use self::MetadataType::*;
1515
pub(crate) use self::ffi::*;
16+
pub(crate) use self::metadata_kind::MetadataKindId;
1617
use crate::common::AsCCharPtr;
1718

1819
pub(crate) mod diagnostic;
1920
pub(crate) mod enzyme_ffi;
2021
mod ffi;
22+
mod metadata_kind;
2123

2224
pub(crate) use self::enzyme_ffi::*;
2325

0 commit comments

Comments
 (0)