From 8d7719471997bd8178fbd1f616e0131e9baddc94 Mon Sep 17 00:00:00 2001 From: Vern Paxson Date: Sun, 10 Jan 2021 13:36:28 -0800 Subject: [PATCH] make script function profiles immutable --- src/script_opt/ProfileFunc.h | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/src/script_opt/ProfileFunc.h b/src/script_opt/ProfileFunc.h index a11660b639..bb2110f864 100644 --- a/src/script_opt/ProfileFunc.h +++ b/src/script_opt/ProfileFunc.h @@ -18,13 +18,20 @@ public: ProfileFunc(bool _compute_hash = false) { compute_hash = _compute_hash; } - std::unordered_set& Globals() { return globals; } - std::unordered_set& Locals() { return locals; } - std::unordered_set& Inits() { return inits; } - std::unordered_set& ScriptCalls() { return script_calls; } - std::unordered_set& BiFCalls() { return BiF_calls; } - std::unordered_set& WhenCalls() { return when_calls; } - std::unordered_set& Events() { return events; } + const std::unordered_set& Globals() const + { return globals; } + const std::unordered_set& Locals() const + { return locals; } + const std::unordered_set& Inits() const + { return inits; } + const std::unordered_set& ScriptCalls() const + { return script_calls; } + const std::unordered_set& BiFCalls() const + { return BiF_calls; } + const std::unordered_set& WhenCalls() const + { return when_calls; } + const std::unordered_set& Events() const + { return events; } bool DoesIndirectCalls() { return does_indirect_calls; } std::size_t HashVal() { return hash_val; }