Move the 'ins' method to DataFlowGraph.

This given us better symmetry between the replace and insert builder operations:

    dfg.replace(inst).iadd(x, y)
    dfg.ins(cursor).imul(x, y)
This commit is contained in:
Jakob Stoklund Olesen
2016-10-21 09:44:24 -07:00
parent 0acabc80d0
commit 1305283ed8
4 changed files with 19 additions and 18 deletions

View File

@@ -6,8 +6,6 @@
use std::iter::{Iterator, IntoIterator};
use entity_map::{EntityMap, EntityRef};
use ir::entities::{Ebb, NO_EBB, Inst, NO_INST};
use ir::dfg::DataFlowGraph;
use ir::builder::InsertBuilder;
/// The `Layout` struct determines the layout of EBBs and instructions in a function. It does not
/// contain definitions of instructions or EBBs, but depends on `Inst` and `Ebb` entity references
@@ -617,11 +615,6 @@ impl<'f> Cursor<'f> {
}
}
/// Create a builder for inserting an instruction at the current position.
pub fn ins<'c, 'fd>(&'c mut self, dfg: &'fd mut DataFlowGraph) -> InsertBuilder<'c, 'f, 'fd> {
InsertBuilder::new(dfg, self)
}
/// Insert an EBB at the current position and switch to it.
///
/// As far as possible, this method behaves as if the EBB header were an instruction inserted