Rename the entity_ref module to 'entity'.
This is in preparation for moving a number of data structures into sub-modules of the 'entity' module: - EntityList - EntityMap - SparseMap
This commit is contained in:
@@ -2,6 +2,8 @@
|
||||
//!
|
||||
//! This module defines an `EntityRef` trait that should be implemented by reference types wrapping
|
||||
//! a small integer index.
|
||||
//!
|
||||
//! Various data structures based on the entity references are defined in sub-modules.
|
||||
|
||||
/// A type wrapping a small integer index should implement `EntityRef` so it can be used as the key
|
||||
/// of an `EntityMap` or `SparseMap`.
|
||||
@@ -19,7 +21,7 @@ pub trait EntityRef: Copy + Eq {
|
||||
macro_rules! entity_impl {
|
||||
// Basic traits.
|
||||
($entity:ident) => {
|
||||
impl $crate::entity_ref::EntityRef for $entity {
|
||||
impl $crate::entity::EntityRef for $entity {
|
||||
fn new(index: usize) -> Self {
|
||||
assert!(index < (::std::u32::MAX as usize));
|
||||
$entity(index as u32)
|
||||
@@ -46,7 +46,7 @@
|
||||
//! The index stored in an `EntityList` points to part 2, the list elements. The value 0 is
|
||||
//! reserved for the empty list which isn't allocated in the vector.
|
||||
|
||||
use entity_ref::EntityRef;
|
||||
use entity::EntityRef;
|
||||
use std::hash::{Hash, Hasher};
|
||||
use std::marker::PhantomData;
|
||||
use std::mem;
|
||||
@@ -483,7 +483,7 @@ mod tests {
|
||||
use super::*;
|
||||
use super::{sclass_size, sclass_for_length};
|
||||
use ir::Inst;
|
||||
use entity_ref::EntityRef;
|
||||
use entity::EntityRef;
|
||||
|
||||
#[test]
|
||||
fn size_classes() {
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
//! - A *secondary* `EntityMap` contains additional data about entities kept in a primary map. The
|
||||
//! values need to implement `Clone + Default` traits so the map can be grown with `ensure`.
|
||||
|
||||
use entity_ref::EntityRef;
|
||||
use entity::EntityRef;
|
||||
use std::marker::PhantomData;
|
||||
use std::ops::{Index, IndexMut};
|
||||
|
||||
|
||||
@@ -122,7 +122,7 @@ impl Display for JumpTableData {
|
||||
mod tests {
|
||||
use super::JumpTableData;
|
||||
use ir::Ebb;
|
||||
use entity_ref::EntityRef;
|
||||
use entity::EntityRef;
|
||||
|
||||
#[test]
|
||||
fn empty() {
|
||||
|
||||
@@ -1086,7 +1086,7 @@ impl<'c, 'fc: 'c, 'fd> InstInserterBase<'fd> for LayoutCursorInserter<'c, 'fc, '
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::{Layout, Cursor, CursorBase, CursorPosition};
|
||||
use entity_ref::EntityRef;
|
||||
use entity::EntityRef;
|
||||
use ir::{Ebb, Inst, ProgramOrder};
|
||||
use std::cmp::Ordering;
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
//! Program points.
|
||||
|
||||
use entity_ref::EntityRef;
|
||||
use entity::EntityRef;
|
||||
use ir::{Ebb, Inst, ValueDef};
|
||||
use std::fmt;
|
||||
use std::u32;
|
||||
@@ -135,7 +135,7 @@ pub trait ProgramOrder {
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::*;
|
||||
use entity_ref::EntityRef;
|
||||
use entity::EntityRef;
|
||||
use ir::{Inst, Ebb};
|
||||
|
||||
#[test]
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
//! Data structures describing the registers in an ISA.
|
||||
|
||||
use entity_ref::EntityRef;
|
||||
use entity::EntityRef;
|
||||
use std::fmt;
|
||||
|
||||
/// Register units are the smallest units of register allocation.
|
||||
|
||||
@@ -13,7 +13,7 @@ pub const VERSION: &'static str = env!("CARGO_PKG_VERSION");
|
||||
#[macro_use]
|
||||
pub mod dbg;
|
||||
#[macro_use]
|
||||
pub mod entity_ref;
|
||||
pub mod entity;
|
||||
|
||||
pub mod binemit;
|
||||
pub mod bitset;
|
||||
|
||||
@@ -104,7 +104,7 @@ impl RegDiversions {
|
||||
mod tests {
|
||||
use super::*;
|
||||
use ir::Value;
|
||||
use entity_ref::EntityRef;
|
||||
use entity::EntityRef;
|
||||
|
||||
#[test]
|
||||
fn inserts() {
|
||||
|
||||
@@ -435,7 +435,7 @@ impl SparseMapValue<Value> for LiveRange {
|
||||
mod tests {
|
||||
use super::LiveRange;
|
||||
use ir::{Inst, Ebb, Value};
|
||||
use entity_ref::EntityRef;
|
||||
use entity::EntityRef;
|
||||
use ir::{ProgramOrder, ExpandedProgramPoint};
|
||||
use std::cmp::Ordering;
|
||||
|
||||
|
||||
@@ -702,7 +702,7 @@ impl Solver {
|
||||
#[cfg(test)]
|
||||
#[cfg(build_arm32)]
|
||||
mod tests {
|
||||
use entity_ref::EntityRef;
|
||||
use entity::EntityRef;
|
||||
use ir::Value;
|
||||
use isa::{TargetIsa, RegClass, RegUnit};
|
||||
use regalloc::AllocatableSet;
|
||||
|
||||
@@ -36,7 +36,7 @@
|
||||
//! contain their own key.
|
||||
|
||||
use entity_map::EntityMap;
|
||||
use entity_ref::EntityRef;
|
||||
use entity::EntityRef;
|
||||
use std::mem;
|
||||
use std::slice;
|
||||
use std::u32;
|
||||
@@ -221,7 +221,7 @@ pub type SparseSet<T> = SparseMap<T, T>;
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::*;
|
||||
use entity_ref::EntityRef;
|
||||
use entity::EntityRef;
|
||||
use ir::Inst;
|
||||
|
||||
// Mock key-value object for testing.
|
||||
|
||||
@@ -7,7 +7,7 @@ use cretonne::ir::function::DisplayFunction;
|
||||
use cretonne::isa::TargetIsa;
|
||||
use ssa::{SSABuilder, SideEffects, Block};
|
||||
use cretonne::entity_map::{EntityMap, PrimaryEntityData};
|
||||
use cretonne::entity_ref::EntityRef;
|
||||
use cretonne::entity::EntityRef;
|
||||
use std::hash::Hash;
|
||||
|
||||
/// Permanent structure used for translating into Cretonne IL.
|
||||
@@ -571,7 +571,7 @@ impl<'a, Variable> FunctionBuilder<'a, Variable>
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
|
||||
use cretonne::entity_ref::EntityRef;
|
||||
use cretonne::entity::EntityRef;
|
||||
use cretonne::ir::{FunctionName, Function, CallConv, Signature, ArgumentType, InstBuilder};
|
||||
use cretonne::ir::types::*;
|
||||
use frontend::{ILBuilder, FunctionBuilder};
|
||||
|
||||
@@ -35,7 +35,7 @@
|
||||
//! extern crate cretonne;
|
||||
//! extern crate cton_frontend;
|
||||
//!
|
||||
//! use cretonne::entity_ref::EntityRef;
|
||||
//! use cretonne::entity::EntityRef;
|
||||
//! use cretonne::ir::{FunctionName, CallConv, Function, Signature, ArgumentType, InstBuilder};
|
||||
//! use cretonne::ir::types::*;
|
||||
//! use cton_frontend::{ILBuilder, FunctionBuilder};
|
||||
|
||||
@@ -10,7 +10,7 @@ use cretonne::ir::{Ebb, Value, Inst, Type, DataFlowGraph, JumpTables, Layout, Cu
|
||||
use cretonne::ir::instructions::BranchInfo;
|
||||
use std::hash::Hash;
|
||||
use cretonne::entity_map::{EntityMap, PrimaryEntityData};
|
||||
use cretonne::entity_ref::EntityRef;
|
||||
use cretonne::entity::EntityRef;
|
||||
use cretonne::packed_option::PackedOption;
|
||||
use cretonne::packed_option::ReservedValue;
|
||||
use std::u32;
|
||||
@@ -607,7 +607,7 @@ impl<Variable> SSABuilder<Variable>
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use cretonne::entity_ref::EntityRef;
|
||||
use cretonne::entity::EntityRef;
|
||||
use cretonne::ir::{Function, InstBuilder, Cursor, CursorBase, Inst, JumpTableData};
|
||||
use cretonne::ir::types::*;
|
||||
use cretonne::verify_function;
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
//! The `SourceMap` struct defined in this module makes the same mapping available to parser
|
||||
//! clients.
|
||||
|
||||
use cretonne::entity_ref::EntityRef;
|
||||
use cretonne::entity::EntityRef;
|
||||
use cretonne::ir::entities::AnyEntity;
|
||||
use cretonne::ir::{StackSlot, GlobalVar, JumpTable, Ebb, Value, SigRef, FuncRef};
|
||||
use error::{Result, Location};
|
||||
|
||||
Reference in New Issue
Block a user