[meta] Rename Operand::is_pure_immediate into is_immediate;

This commit is contained in:
Benjamin Bouvier
2019-10-28 17:46:26 +01:00
parent b657aa57f6
commit 06b1817d89
3 changed files with 7 additions and 8 deletions

View File

@@ -86,12 +86,11 @@ impl EncodingBuilder {
}
// Add immediate value predicates
for (immediate_value, immediate_operand) in inst.immediate_values.iter().zip(
inst.inst
.operands_in
.iter()
.filter(|o| o.is_pure_immediate()),
) {
for (immediate_value, immediate_operand) in inst
.immediate_values
.iter()
.zip(inst.inst.operands_in.iter().filter(|o| o.is_immediate()))
{
let immediate_predicate = InstructionPredicate::new_is_field_equal(
&inst.inst.format,
immediate_operand

View File

@@ -56,7 +56,7 @@ impl Operand {
}
/// Returns true if the operand has an immediate kind.
pub fn is_pure_immediate(&self) -> bool {
pub fn is_immediate(&self) -> bool {
match self.kind.fields {
OperandKindFields::ImmEnum(_) | OperandKindFields::ImmValue => true,
_ => false,

View File

@@ -910,7 +910,7 @@ fn gen_inst_builder(inst: &Instruction, format: &InstructionFormat, fmt: &mut Fo
let mut tmpl_types = Vec::new();
let mut into_args = Vec::new();
for op in &inst.operands_in {
let t = if op.is_pure_immediate() {
let t = if op.is_immediate() {
let t = format!("T{}{}", tmpl_types.len() + 1, op.kind.name);
tmpl_types.push(format!("{}: Into<{}>", t, op.kind.rust_type));
into_args.push(op.name);