Rename EntityMap to SecondaryMap (#528)
* Rename `EntityMap` to `SecondaryMap`
This commit is contained in:
committed by
Dan Gohman
parent
7ff71fcfd9
commit
d266b1a42d
@@ -1,6 +1,6 @@
|
||||
//! Data flow graph tracking Instructions, Values, and EBBs.
|
||||
|
||||
use entity::{self, EntityMap, PrimaryMap};
|
||||
use entity::{self, PrimaryMap, SecondaryMap};
|
||||
use ir;
|
||||
use ir::builder::ReplaceBuilder;
|
||||
use ir::extfunc::ExtFuncData;
|
||||
@@ -34,7 +34,7 @@ pub struct DataFlowGraph {
|
||||
///
|
||||
/// This map gets resized automatically by `make_inst()` so it is always in sync with the
|
||||
/// primary `insts` map.
|
||||
results: EntityMap<Inst, ValueList>,
|
||||
results: SecondaryMap<Inst, ValueList>,
|
||||
|
||||
/// Extended basic blocks in the function and their parameters.
|
||||
///
|
||||
@@ -67,7 +67,7 @@ impl DataFlowGraph {
|
||||
pub fn new() -> Self {
|
||||
Self {
|
||||
insts: PrimaryMap::new(),
|
||||
results: EntityMap::new(),
|
||||
results: SecondaryMap::new(),
|
||||
ebbs: PrimaryMap::new(),
|
||||
value_lists: ValueListPool::new(),
|
||||
values: PrimaryMap::new(),
|
||||
@@ -90,7 +90,7 @@ impl DataFlowGraph {
|
||||
/// Get the total number of instructions created in this function, whether they are currently
|
||||
/// inserted in the layout or not.
|
||||
///
|
||||
/// This is intended for use with `EntityMap::with_capacity`.
|
||||
/// This is intended for use with `SecondaryMap::with_capacity`.
|
||||
pub fn num_insts(&self) -> usize {
|
||||
self.insts.len()
|
||||
}
|
||||
@@ -103,7 +103,7 @@ impl DataFlowGraph {
|
||||
/// Get the total number of extended basic blocks created in this function, whether they are
|
||||
/// currently inserted in the layout or not.
|
||||
///
|
||||
/// This is intended for use with `EntityMap::with_capacity`.
|
||||
/// This is intended for use with `SecondaryMap::with_capacity`.
|
||||
pub fn num_ebbs(&self) -> usize {
|
||||
self.ebbs.len()
|
||||
}
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
//! instructions.
|
||||
|
||||
use binemit::CodeOffset;
|
||||
use entity::{EntityMap, PrimaryMap};
|
||||
use entity::{PrimaryMap, SecondaryMap};
|
||||
use ir;
|
||||
use ir::{DataFlowGraph, ExternalName, Layout, Signature};
|
||||
use ir::{
|
||||
@@ -84,10 +84,10 @@ impl Function {
|
||||
jump_tables: PrimaryMap::new(),
|
||||
dfg: DataFlowGraph::new(),
|
||||
layout: Layout::new(),
|
||||
encodings: EntityMap::new(),
|
||||
locations: EntityMap::new(),
|
||||
offsets: EntityMap::new(),
|
||||
srclocs: EntityMap::new(),
|
||||
encodings: SecondaryMap::new(),
|
||||
locations: SecondaryMap::new(),
|
||||
offsets: SecondaryMap::new(),
|
||||
srclocs: SecondaryMap::new(),
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
//! The order of extended basic blocks in a function and the order of instructions in an EBB is
|
||||
//! determined by the `Layout` data structure defined in this module.
|
||||
|
||||
use entity::EntityMap;
|
||||
use entity::SecondaryMap;
|
||||
use ir::progpoint::{ExpandedProgramPoint, ProgramOrder};
|
||||
use ir::{Ebb, Inst};
|
||||
use packed_option::PackedOption;
|
||||
@@ -28,11 +28,11 @@ use timing;
|
||||
pub struct Layout {
|
||||
/// Linked list nodes for the layout order of EBBs Forms a doubly linked list, terminated in
|
||||
/// both ends by `None`.
|
||||
ebbs: EntityMap<Ebb, EbbNode>,
|
||||
ebbs: SecondaryMap<Ebb, EbbNode>,
|
||||
|
||||
/// Linked list nodes for the layout order of instructions. Forms a double linked list per EBB,
|
||||
/// terminated in both ends by `None`.
|
||||
insts: EntityMap<Inst, InstNode>,
|
||||
insts: SecondaryMap<Inst, InstNode>,
|
||||
|
||||
/// First EBB in the layout order, or `None` when no EBBs have been laid out.
|
||||
first_ebb: Option<Ebb>,
|
||||
@@ -45,8 +45,8 @@ impl Layout {
|
||||
/// Create a new empty `Layout`.
|
||||
pub fn new() -> Self {
|
||||
Self {
|
||||
ebbs: EntityMap::new(),
|
||||
insts: EntityMap::new(),
|
||||
ebbs: SecondaryMap::new(),
|
||||
insts: SecondaryMap::new(),
|
||||
first_ebb: None,
|
||||
last_ebb: None,
|
||||
}
|
||||
|
||||
@@ -47,20 +47,20 @@ pub use ir::types::Type;
|
||||
pub use ir::valueloc::{ArgumentLoc, ValueLoc};
|
||||
|
||||
use binemit;
|
||||
use entity::{EntityMap, PrimaryMap};
|
||||
use entity::{PrimaryMap, SecondaryMap};
|
||||
use isa;
|
||||
|
||||
/// Map of value locations.
|
||||
pub type ValueLocations = EntityMap<Value, ValueLoc>;
|
||||
pub type ValueLocations = SecondaryMap<Value, ValueLoc>;
|
||||
|
||||
/// Map of jump tables.
|
||||
pub type JumpTables = PrimaryMap<JumpTable, JumpTableData>;
|
||||
|
||||
/// Map of instruction encodings.
|
||||
pub type InstEncodings = EntityMap<Inst, isa::Encoding>;
|
||||
pub type InstEncodings = SecondaryMap<Inst, isa::Encoding>;
|
||||
|
||||
/// Code offsets for EBBs.
|
||||
pub type EbbOffsets = EntityMap<Ebb, binemit::CodeOffset>;
|
||||
pub type EbbOffsets = SecondaryMap<Ebb, binemit::CodeOffset>;
|
||||
|
||||
/// Source locations for instructions.
|
||||
pub type SourceLocs = EntityMap<Inst, SourceLoc>;
|
||||
pub type SourceLocs = SecondaryMap<Inst, SourceLoc>;
|
||||
|
||||
Reference in New Issue
Block a user