more debugging information when dumping script optimization data structures

This commit is contained in:
Vern Paxson 2023-06-16 15:22:28 -07:00 committed by Arne Welzel
parent 4a5a7f975d
commit 528aa6766a
2 changed files with 13 additions and 0 deletions

View file

@ -2709,6 +2709,13 @@ void InlineExpr::ExprDescribe(ODesc* d) const
{
d->Add("inline(");
args->Describe(d);
d->Add(")(");
for ( auto& p : params )
{
if ( &p != &params[0] )
d->AddSP(",");
d->Add(p->Name());
}
d->Add("){");
body->Describe(d);
d->Add("}");

View file

@ -216,6 +216,9 @@ static void optimize_func(ScriptFunc* f, std::shared_ptr<ProfileFunc> pf, ScopeP
new_body = ud->RemoveUnused();
if ( analysis_options.dump_xform )
printf("Post removal of unused: %s\n", obj_desc(new_body.get()).c_str());
if ( new_body != body )
{
f->ReplaceBody(body, new_body);
@ -593,6 +596,9 @@ void analyze_scripts(bool no_unused_warnings)
// At this point we're done with C++ considerations, so instead
// are compiling to ZAM.
analyze_scripts_for_ZAM(pfs);
if ( reporter->Errors() > 0 )
reporter->FatalError("Optimized script execution aborted due to errors");
}
void profile_script_execution()