for -O gen-standalone-C++, make the presence of uncompilable functions fatal unless -O allow-cond is used

This commit is contained in:
Vern Paxson 2025-09-11 13:30:40 -06:00
parent c6cf1ee3ae
commit e5210160ea
2 changed files with 13 additions and 0 deletions

View file

@ -25,6 +25,13 @@ CPPCompile::CPPCompile(vector<FuncInfo>& _funcs, std::shared_ptr<ProfileFuncs> _
}
Compile(report_uncompilable);
if ( standalone && skipped_uncompilable_func && ! analysis_options.allow_cond ) {
reporter->Error(
"standalone C++ compilation incomplete due to having to skip some functions; use \"-O allow-cond\" to "
"override");
exit(1);
}
}
CPPCompile::~CPPCompile() { fclose(write_file); }
@ -208,6 +215,7 @@ bool CPPCompile::AnalyzeFuncBody(FuncInfo& fi, unordered_set<string>& filenames_
}
fi.SetSkip(true);
skipped_uncompilable_func = true;
}
}
@ -252,6 +260,8 @@ bool CPPCompile::AnalyzeFuncBody(FuncInfo& fi, unordered_set<string>& filenames_
}
not_fully_compilable.insert(f->GetName());
skipped_uncompilable_func = true;
return false;
}