Add PrimaryEntityData marker trait.
Require this trait on the value type stored in an EntityMap to 'unlock' the methods intended for primary entity maps that are allowed to create references with the 'push method. This prevents accidentally depending on these methods in secondary maps.
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
//! Data flow graph tracking Instructions, Values, and EBBs.
|
||||
|
||||
use entity_map::EntityMap;
|
||||
use entity_map::{EntityMap, PrimaryEntityData};
|
||||
use ir::entities::{Ebb, Inst, Value, NO_VALUE, ExpandedValue};
|
||||
use ir::instructions::InstructionData;
|
||||
use ir::types::Type;
|
||||
@@ -33,6 +33,9 @@ pub struct DataFlowGraph {
|
||||
extended_values: Vec<ValueData>,
|
||||
}
|
||||
|
||||
impl PrimaryEntityData for InstructionData {}
|
||||
impl PrimaryEntityData for EbbData {}
|
||||
|
||||
impl DataFlowGraph {
|
||||
/// Create a new empty `DataFlowGraph`.
|
||||
pub fn new() -> DataFlowGraph {
|
||||
|
||||
Reference in New Issue
Block a user