[meta] Legalization: Unprefix some module paths to make code neater;
This commit is contained in:
@@ -654,36 +654,32 @@ impl FormatPredicateNode {
|
||||
fn rust_predicate(&self) -> String {
|
||||
match &self.kind {
|
||||
FormatPredicateKind::IsEqual(arg) => {
|
||||
format!("crate::predicates::is_equal({}, {})", self.member_name, arg)
|
||||
format!("predicates::is_equal({}, {})", self.member_name, arg)
|
||||
}
|
||||
FormatPredicateKind::IsSignedInt(width, scale) => format!(
|
||||
"crate::predicates::is_signed_int({}, {}, {})",
|
||||
"predicates::is_signed_int({}, {}, {})",
|
||||
self.member_name, width, scale
|
||||
),
|
||||
FormatPredicateKind::IsUnsignedInt(width, scale) => format!(
|
||||
"crate::predicates::is_unsigned_int({}, {}, {})",
|
||||
"predicates::is_unsigned_int({}, {}, {})",
|
||||
self.member_name, width, scale
|
||||
),
|
||||
FormatPredicateKind::IsZero32BitFloat => format!(
|
||||
"crate::predicates::is_zero_32_bit_float({})",
|
||||
self.member_name
|
||||
),
|
||||
FormatPredicateKind::IsZero64BitFloat => format!(
|
||||
"crate::predicates::is_zero_64_bit_float({})",
|
||||
self.member_name
|
||||
),
|
||||
FormatPredicateKind::IsZero32BitFloat => {
|
||||
format!("predicates::is_zero_32_bit_float({})", self.member_name)
|
||||
}
|
||||
FormatPredicateKind::IsZero64BitFloat => {
|
||||
format!("predicates::is_zero_64_bit_float({})", self.member_name)
|
||||
}
|
||||
FormatPredicateKind::LengthEquals(num) => format!(
|
||||
"crate::predicates::has_length_of({}, {}, func)",
|
||||
"predicates::has_length_of({}, {}, func)",
|
||||
self.member_name, num
|
||||
),
|
||||
FormatPredicateKind::IsColocatedFunc => format!(
|
||||
"crate::predicates::is_colocated_func({}, func)",
|
||||
self.member_name,
|
||||
),
|
||||
FormatPredicateKind::IsColocatedData => format!(
|
||||
"crate::predicates::is_colocated_data({}, func)",
|
||||
self.member_name
|
||||
),
|
||||
FormatPredicateKind::IsColocatedFunc => {
|
||||
format!("predicates::is_colocated_func({}, func)", self.member_name,)
|
||||
}
|
||||
FormatPredicateKind::IsColocatedData => {
|
||||
format!("predicates::is_colocated_data({}, func)", self.member_name)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -51,7 +51,7 @@ fn unwrap_inst(
|
||||
|
||||
fmtln!(
|
||||
fmt,
|
||||
"let ({}, predicate) = if let crate::ir::InstructionData::{} {{",
|
||||
"let ({}, predicate) = if let ir::InstructionData::{} {{",
|
||||
arg_names,
|
||||
iform.name
|
||||
);
|
||||
@@ -407,17 +407,16 @@ fn gen_transform_group<'a>(
|
||||
// Function arguments.
|
||||
fmtln!(fmt, "pub fn {}(", group.name);
|
||||
fmt.indent(|fmt| {
|
||||
fmt.line("inst: crate::ir::Inst,");
|
||||
fmt.line("func: &mut crate::ir::Function,");
|
||||
fmt.line("cfg: &mut crate::flowgraph::ControlFlowGraph,");
|
||||
fmt.line("isa: &dyn crate::isa::TargetIsa,");
|
||||
fmt.line("inst: ir::Inst,");
|
||||
fmt.line("func: &mut ir::Function,");
|
||||
fmt.line("cfg: &mut ControlFlowGraph,");
|
||||
fmt.line("isa: &dyn TargetIsa,");
|
||||
});
|
||||
fmtln!(fmt, ") -> bool {");
|
||||
|
||||
// Function body.
|
||||
fmt.indent(|fmt| {
|
||||
fmt.line("use crate::ir::InstBuilder;");
|
||||
fmt.line("use crate::cursor::{Cursor, FuncCursor};");
|
||||
fmt.line("use ir::InstBuilder;");
|
||||
fmt.line("let mut pos = FuncCursor::new(func).at_inst(inst);");
|
||||
fmt.line("pos.use_srcloc(inst);");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user