Generate an InstBuilder trait.

All of the instruction format an opcode methods are emitted as an
InstBuilder trait instead of adding them to the Bulder struct directly.
The methods only make use of the InstBuilderBase methods to create new
instructions.

This makes it possible to reuse the InstBuilder trait for different ways
of inserting instructions.
This commit is contained in:
Jakob Stoklund Olesen
2016-10-19 18:13:37 -07:00
parent 499fefebd9
commit eef5de1cf0
6 changed files with 96 additions and 37 deletions

View File

@@ -116,7 +116,7 @@ impl DominatorTree {
#[cfg(test)]
mod test {
use super::*;
use ir::{Function, Builder, Cursor, VariableArgs, types};
use ir::{Function, Builder, InstBuilder, Cursor, VariableArgs, types};
use ir::entities::NO_INST;
use cfg::ControlFlowGraph;