Add a Cursor::ins() method which constructs a Builder.

Rewrite Builder uses in test cases to use this method and construct a
new builder for each instruction. This pattern allows us to change the
InstBuilder trait to a one-shot implementation that can only create a
single instruction.

Don't re-export the Builder struct, it is less important than the
InstBuilder trait, and we may get more implementations.
This commit is contained in:
Jakob Stoklund Olesen
2016-10-19 18:50:11 -07:00
parent 368b12e7cd
commit ab910b3f58
4 changed files with 29 additions and 22 deletions

View File

@@ -24,4 +24,4 @@ pub use ir::jumptable::JumpTableData;
pub use ir::dfg::{DataFlowGraph, ValueDef};
pub use ir::layout::{Layout, Cursor};
pub use ir::function::Function;
pub use ir::builder::{Builder, InstBuilder};
pub use ir::builder::InstBuilder;