allow profiling without updating of hash values

This commit is contained in:
Vern Paxson 2024-08-05 09:17:13 +01:00 committed by Arne Welzel
parent 3962810e4b
commit d2c6208421
3 changed files with 30 additions and 19 deletions

View file

@ -347,13 +347,15 @@ using is_compilable_pred = bool (*)(const ProfileFunc*, const char** reason);
// Collectively profile an entire collection of functions.
class ProfileFuncs {
public:
// Updates entries in "funcs" to include profiles. If pred is
// non-nil, then it is called for each profile to see whether it's
// compilable, and, if not, the FuncInfo is marked as ShouldSkip().
// "full_record_hashes" controls whether the hashes for extended
// records covers their final, full form, or should only their
// original fields.
ProfileFuncs(std::vector<FuncInfo>& funcs, is_compilable_pred pred, bool full_record_hashes);
// Updates entries in "funcs" to include profiles. If pred is non-nil,
// then it is called for each profile to see whether it's compilable,
// and, if not, the FuncInfo is marked as ShouldSkip().
// "compute_func_hashes" governs whether we compute hashes for the
// FuncInfo entries, or keep their existing ones. "full_record_hashes"
// controls whether the hashes for extended records covers their final,
// full form, or should only their original fields.
ProfileFuncs(std::vector<FuncInfo>& funcs, is_compilable_pred pred, bool compute_func_hashes,
bool full_record_hashes);
// The following accessors provide a global profile across all of
// the (non-skipped) functions in "funcs". See the comments for
@ -604,6 +606,9 @@ protected:
// These can arise for example due to lambdas or record attributes.
std::vector<const Expr*> pending_exprs;
// Whether to compute new hashes for the FuncInfo entries.
bool compute_func_hashes;
// Whether the hashes for extended records should cover their final,
// full form, or only their original fields.
bool full_record_hashes;