added &no_ZAM_opt/&no_CPP_opt attributes and --no-opt-files/--no-opt-funcs for controlling skipping script optimization

This commit is contained in:
Vern Paxson 2025-09-12 11:03:37 -06:00 committed by Tim Wojtulewicz
parent 2bde66c9d6
commit 441baaf2c1
16 changed files with 198 additions and 57 deletions

View file

@ -76,7 +76,7 @@ std::shared_ptr<CPP_InitInfo> CPPCompile::GenerateGlobalInit(IDPtr g) {
if ( ! standalone )
return make_shared<GlobalLookupInitInfo>(this, g, globals[gn]);
if ( obj_matches_opt_files(g) )
if ( obj_matches_opt_files(g) == AnalyzeDecision::SHOULD )
return make_shared<GlobalInitInfo>(this, g, globals[gn]);
// It's not a global that's created by the scripts we're compiling,
@ -86,7 +86,7 @@ std::shared_ptr<CPP_InitInfo> CPPCompile::GenerateGlobalInit(IDPtr g) {
bool needs_redef = false;
for ( const auto& i_e : g->GetOptInfo()->GetInitExprs() )
if ( obj_matches_opt_files(i_e) ) {
if ( obj_matches_opt_files(i_e) == AnalyzeDecision::SHOULD ) {
needs_redef = true;
break;
}