Pass the target isa when printing a function as a string.

This allows encodings and register names to be printed correctly.
This commit is contained in:
Dan Gohman
2018-09-28 23:19:15 -07:00
parent 20eea311a3
commit 06bbd3e393
6 changed files with 6 additions and 6 deletions

View File

@@ -41,7 +41,7 @@ impl SubTest for TestDCE {
.dce(context.flags_or_isa()) .dce(context.flags_or_isa())
.map_err(|e| pretty_error(&comp_ctx.func, context.isa, Into::into(e)))?; .map_err(|e| pretty_error(&comp_ctx.func, context.isa, Into::into(e)))?;
let text = comp_ctx.func.to_string(); let text = comp_ctx.func.display(context.isa).to_string();
run_filecheck(&text, context) run_filecheck(&text, context)
} }
} }

View File

@@ -41,7 +41,7 @@ impl SubTest for TestLICM {
.licm(context.flags_or_isa()) .licm(context.flags_or_isa())
.map_err(|e| pretty_error(&comp_ctx.func, context.isa, Into::into(e)))?; .map_err(|e| pretty_error(&comp_ctx.func, context.isa, Into::into(e)))?;
let text = comp_ctx.func.to_string(); let text = comp_ctx.func.display(context.isa).to_string();
run_filecheck(&text, context) run_filecheck(&text, context)
} }
} }

View File

@@ -38,7 +38,7 @@ impl SubTest for TestPostopt {
.postopt(isa) .postopt(isa)
.map_err(|e| pretty_error(&comp_ctx.func, context.isa, Into::into(e)))?; .map_err(|e| pretty_error(&comp_ctx.func, context.isa, Into::into(e)))?;
let text = comp_ctx.func.to_string(); let text = comp_ctx.func.display(isa).to_string();
run_filecheck(&text, context) run_filecheck(&text, context)
} }
} }

View File

@@ -38,7 +38,7 @@ impl SubTest for TestPreopt {
.preopt(isa) .preopt(isa)
.map_err(|e| pretty_error(&comp_ctx.func, context.isa, Into::into(e)))?; .map_err(|e| pretty_error(&comp_ctx.func, context.isa, Into::into(e)))?;
let text = &comp_ctx.func.to_string(); let text = &comp_ctx.func.display(isa).to_string();
run_filecheck(&text, context) run_filecheck(&text, context)
} }
} }

View File

@@ -40,7 +40,7 @@ impl SubTest for TestShrink {
.shrink_instructions(isa) .shrink_instructions(isa)
.map_err(|e| pretty_error(&comp_ctx.func, context.isa, Into::into(e)))?; .map_err(|e| pretty_error(&comp_ctx.func, context.isa, Into::into(e)))?;
let text = comp_ctx.func.to_string(); let text = comp_ctx.func.display(isa).to_string();
run_filecheck(&text, context) run_filecheck(&text, context)
} }
} }

View File

@@ -40,7 +40,7 @@ impl SubTest for TestSimpleGVN {
.simple_gvn(context.flags_or_isa()) .simple_gvn(context.flags_or_isa())
.map_err(|e| pretty_error(&comp_ctx.func, context.isa, Into::into(e)))?; .map_err(|e| pretty_error(&comp_ctx.func, context.isa, Into::into(e)))?;
let text = comp_ctx.func.to_string(); let text = comp_ctx.func.display(context.isa).to_string();
run_filecheck(&text, context) run_filecheck(&text, context)
} }
} }