[meta] Add more pub(crate) definitions.

This commit is contained in:
Benjamin Bouvier
2019-10-28 18:13:25 +01:00
parent 06b1817d89
commit 5889dd2c64
17 changed files with 86 additions and 93 deletions

View File

@@ -1,35 +1,35 @@
use crate::cdsl::operands::{OperandKind, OperandKindBuilder as Builder, OperandKindFields};
pub struct EntityRefs {
pub(crate) struct EntityRefs {
/// A reference to an extended basic block in the same function.
/// This is primarliy used in control flow instructions.
pub ebb: OperandKind,
pub(crate) ebb: OperandKind,
/// A reference to a stack slot declared in the function preamble.
pub stack_slot: OperandKind,
pub(crate) stack_slot: OperandKind,
/// A reference to a global value.
pub global_value: OperandKind,
pub(crate) global_value: OperandKind,
/// A reference to a function signature declared in the function preamble.
/// This is used to provide the call signature in a call_indirect instruction.
pub sig_ref: OperandKind,
pub(crate) sig_ref: OperandKind,
/// A reference to an external function declared in the function preamble.
/// This is used to provide the callee and signature in a call instruction.
pub func_ref: OperandKind,
pub(crate) func_ref: OperandKind,
/// A reference to a jump table declared in the function preamble.
pub jump_table: OperandKind,
pub(crate) jump_table: OperandKind,
/// A reference to a heap declared in the function preamble.
pub heap: OperandKind,
pub(crate) heap: OperandKind,
/// A reference to a table declared in the function preamble.
pub table: OperandKind,
pub(crate) table: OperandKind,
/// A variable-sized list of value operands. Use for Ebb and function call arguments.
pub varargs: OperandKind,
pub(crate) varargs: OperandKind,
}
impl EntityRefs {

View File

@@ -1,6 +1,6 @@
use crate::cdsl::settings::{SettingGroup, SettingGroupBuilder};
pub fn define() -> SettingGroup {
pub(crate) fn define() -> SettingGroup {
let mut settings = SettingGroupBuilder::new("shared");
settings.add_enum(

View File

@@ -1,7 +1,7 @@
//! This module predefines all the Cranelift scalar types.
#[derive(Debug, Clone, Copy, Eq, PartialEq, Hash)]
pub enum Bool {
pub(crate) enum Bool {
/// 1-bit bool.
B1 = 1,
/// 8-bit bool.
@@ -17,7 +17,7 @@ pub enum Bool {
}
/// This provides an iterator through all of the supported bool variants.
pub struct BoolIterator {
pub(crate) struct BoolIterator {
index: u8,
}
@@ -45,7 +45,7 @@ impl Iterator for BoolIterator {
}
#[derive(Debug, Clone, Copy, Eq, PartialEq, Hash)]
pub enum Int {
pub(crate) enum Int {
/// 8-bit int.
I8 = 8,
/// 16-bit int.
@@ -59,7 +59,7 @@ pub enum Int {
}
/// This provides an iterator through all of the supported int variants.
pub struct IntIterator {
pub(crate) struct IntIterator {
index: u8,
}
@@ -86,13 +86,13 @@ impl Iterator for IntIterator {
}
#[derive(Debug, Clone, Copy, Eq, PartialEq, Hash)]
pub enum Float {
pub(crate) enum Float {
F32 = 32,
F64 = 64,
}
/// Iterator through the variants of the Float enum.
pub struct FloatIterator {
pub(crate) struct FloatIterator {
index: u8,
}
@@ -120,7 +120,7 @@ impl Iterator for FloatIterator {
///
/// Flags can't be stored in memory.
#[derive(Debug, Clone, Copy, Eq, PartialEq, Hash)]
pub enum Flag {
pub(crate) enum Flag {
/// CPU flags from an integer comparison.
IFlags,
/// CPU flags from a floating point comparison.
@@ -128,7 +128,7 @@ pub enum Flag {
}
/// Iterator through the variants of the Flag enum.
pub struct FlagIterator {
pub(crate) struct FlagIterator {
index: u8,
}
@@ -152,7 +152,7 @@ impl Iterator for FlagIterator {
}
#[derive(Debug, Clone, Copy, Eq, PartialEq, Hash)]
pub enum Reference {
pub(crate) enum Reference {
/// 32-bit reference.
R32 = 32,
/// 64-bit reference.
@@ -160,7 +160,7 @@ pub enum Reference {
}
/// This provides an iterator through all of the supported reference variants.
pub struct ReferenceIterator {
pub(crate) struct ReferenceIterator {
index: u8,
}