Use DataFlowGraph in Function.

Replace the three tables instructions, extended_basic_blocks, and
extended_values with a single 'dfg' public member.

Clients using Function are changed to refer to func.layout and func.dfg
respectively.
This commit is contained in:
Jakob Stoklund Olesen
2016-07-19 13:05:28 -07:00
parent 39d3a8e3d7
commit c1806d0ab0
6 changed files with 38 additions and 468 deletions

View File

@@ -110,14 +110,14 @@ impl<T: Write> CFGPrinter<T> {
let inst_data = func.layout
.ebb_insts(ebb)
.filter(|inst| {
match func[*inst] {
match func.dfg[*inst] {
InstructionData::Branch { ty: _, opcode: _, data: _ } => true,
InstructionData::Jump { ty: _, opcode: _, data: _ } => true,
_ => false,
}
})
.map(|inst| {
let op = match func[inst] {
let op = match func.dfg[inst] {
InstructionData::Branch { ty: _, opcode, ref data } => {
Some((opcode, data.destination))
}