Add an ISA argument to dfg.display_inst().
Include ISA-specific annotations in tracing and error messages.
This commit is contained in:
@@ -127,7 +127,7 @@ impl SubTest for TestBinEmit {
|
||||
AnyEntity::Inst(inst) => {
|
||||
if let Some(prev) = bins.insert(inst, want) {
|
||||
return Err(format!("multiple 'bin:' directives on {}: '{}' and '{}'",
|
||||
func.dfg.display_inst(inst),
|
||||
func.dfg.display_inst(inst, isa),
|
||||
prev,
|
||||
want));
|
||||
}
|
||||
@@ -166,7 +166,7 @@ impl SubTest for TestBinEmit {
|
||||
encinfo.bytes(enc),
|
||||
"Inconsistent size for [{}] {}",
|
||||
encinfo.display(enc),
|
||||
func.dfg.display_inst(inst));
|
||||
func.dfg.display_inst(inst, isa));
|
||||
}
|
||||
|
||||
// Check against bin: directives.
|
||||
@@ -174,13 +174,13 @@ impl SubTest for TestBinEmit {
|
||||
if !enc.is_legal() {
|
||||
return Err(format!("{} can't be encoded: {}",
|
||||
inst,
|
||||
func.dfg.display_inst(inst)));
|
||||
func.dfg.display_inst(inst, isa)));
|
||||
}
|
||||
let have = sink.text.trim();
|
||||
if have != want {
|
||||
return Err(format!("Bad machine code for {}: {}\nWant: {}\nGot: {}",
|
||||
inst,
|
||||
func.dfg.display_inst(inst),
|
||||
func.dfg.display_inst(inst, isa),
|
||||
want,
|
||||
have));
|
||||
}
|
||||
|
||||
@@ -42,7 +42,7 @@ pub fn pretty_verifier_error(func: &ir::Function,
|
||||
let mut msg = err.to_string();
|
||||
match err.location {
|
||||
AnyEntity::Inst(inst) => {
|
||||
write!(msg, "\n{}: {}\n\n", inst, func.dfg.display_inst(inst)).unwrap()
|
||||
write!(msg, "\n{}: {}\n\n", inst, func.dfg.display_inst(inst, isa)).unwrap()
|
||||
}
|
||||
_ => msg.push('\n'),
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user