script_opt: Use Func::GetName()

This commit is contained in:
Arne Welzel 2024-09-27 12:52:32 +02:00
parent 89127722ea
commit 71e9c8d436
16 changed files with 49 additions and 48 deletions

View file

@ -110,7 +110,7 @@ bool should_analyze(const ScriptFuncPtr& f, const StmtPtr& body) {
if ( ofiles.empty() && ofuncs.empty() )
return true;
auto fun = f->Name();
const auto& fun = f->GetName();
for ( auto& o : ofuncs )
if ( std::regex_match(fun, o) )
@ -165,7 +165,7 @@ static void optimize_func(ScriptFuncPtr f, std::shared_ptr<ProfileFunc> pf, std:
const char* reason;
if ( ! is_ZAM_compilable(pf.get(), &reason) ) {
if ( analysis_options.report_uncompilable )
printf("Skipping compilation of %s due to %s\n", f->Name(), reason);
printf("Skipping compilation of %s due to %s\n", f->GetName().c_str(), reason);
return;
}
@ -184,10 +184,10 @@ static void optimize_func(ScriptFuncPtr f, std::shared_ptr<ProfileFunc> pf, std:
if ( ! new_body->IsReduced(rc.get()) ) {
if ( non_reduced_perp )
reporter->InternalError("Reduction inconsistency for %s: %s\n", f->Name(),
reporter->InternalError("Reduction inconsistency for %s: %s\n", f->GetName().c_str(),
obj_desc(non_reduced_perp).c_str());
else
reporter->InternalError("Reduction inconsistency for %s\n", f->Name());
reporter->InternalError("Reduction inconsistency for %s\n", f->GetName().c_str());
}
checking_reduction = false;
@ -365,11 +365,11 @@ static void report_CPP() {
std::unordered_set<unsigned long long> already_reported;
for ( auto& f : funcs ) {
auto name = f.Func()->Name();
const auto& name = f.Func()->GetName();
auto hash = f.Profile()->HashVal();
bool have = compiled_scripts.count(hash) > 0;
printf("script function %s (hash %llu): %s\n", name, hash, have ? "yes" : "no");
printf("script function %s (hash %llu): %s\n", name.c_str(), hash, have ? "yes" : "no");
if ( have )
already_reported.insert(hash);
@ -409,7 +409,7 @@ static void use_CPP() {
// we're using code compiled for standalone.
if ( f.Body()->Tag() != STMT_CPP ) {
auto func = f.Func();
if ( added_bodies[func->Name()].count(hash) > 0 )
if ( added_bodies[func->GetName()].count(hash) > 0 )
// We've already added the
// replacement. Delete orig.
func->ReplaceBody(f.Body(), nullptr);