Rename builder.rs to inst_builder.rs.
This reflects its purpose, to define the `InstBuilder` trait.
This commit is contained in:
@@ -687,7 +687,7 @@ def gen_builder(insts, fmt):
|
|||||||
fmt.doc_comment("""
|
fmt.doc_comment("""
|
||||||
Convenience methods for building instructions.
|
Convenience methods for building instructions.
|
||||||
|
|
||||||
The `InstrBuilder` trait has one method per instruction opcode for
|
The `InstBuilder` trait has one method per instruction opcode for
|
||||||
conveniently constructing the instruction with minimum arguments.
|
conveniently constructing the instruction with minimum arguments.
|
||||||
Polymorphic instructions infer their result types from the input
|
Polymorphic instructions infer their result types from the input
|
||||||
arguments when possible. In some cases, an explicit `ctrl_typevar`
|
arguments when possible. In some cases, an explicit `ctrl_typevar`
|
||||||
@@ -722,7 +722,7 @@ def generate(isas, out_dir):
|
|||||||
gen_type_constraints(fmt, instrs)
|
gen_type_constraints(fmt, instrs)
|
||||||
fmt.update_file('opcodes.rs', out_dir)
|
fmt.update_file('opcodes.rs', out_dir)
|
||||||
|
|
||||||
# builder.rs
|
# inst_builder.rs
|
||||||
fmt = srcgen.Formatter()
|
fmt = srcgen.Formatter()
|
||||||
gen_builder(instrs, fmt)
|
gen_builder(instrs, fmt)
|
||||||
fmt.update_file('builder.rs', out_dir)
|
fmt.update_file('inst_builder.rs', out_dir)
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ pub trait InstBuilderBase<'f>: Sized {
|
|||||||
//
|
//
|
||||||
// This file defines the `InstBuilder` trait as an extension of `InstBuilderBase` with methods per
|
// This file defines the `InstBuilder` trait as an extension of `InstBuilderBase` with methods per
|
||||||
// instruction format and per opcode.
|
// instruction format and per opcode.
|
||||||
include!(concat!(env!("OUT_DIR"), "/builder.rs"));
|
include!(concat!(env!("OUT_DIR"), "/inst_builder.rs"));
|
||||||
|
|
||||||
/// Any type implementing `InstBuilderBase` gets all the `InstBuilder` methods for free.
|
/// Any type implementing `InstBuilderBase` gets all the `InstBuilder` methods for free.
|
||||||
impl<'f, T: InstBuilderBase<'f>> InstBuilder<'f> for T {}
|
impl<'f, T: InstBuilderBase<'f>> InstBuilder<'f> for T {}
|
||||||
|
|||||||
Reference in New Issue
Block a user