diff --git a/src/script_opt/ProfileFunc.cc b/src/script_opt/ProfileFunc.cc index e821674d73..8173aa9792 100644 --- a/src/script_opt/ProfileFunc.cc +++ b/src/script_opt/ProfileFunc.cc @@ -388,7 +388,10 @@ TraversalCode ProfileFunc::PreExpr(const Expr* e) { auto sf = static_cast(func_vf); script_calls.insert(sf); } - else + + // Track the BiF, though not if we know we're not going to + // compile the call to it. + else if ( obj_matches_opt_files(e) != AnalyzeDecision::SHOULD_NOT ) BiF_globals.insert(func); } else { diff --git a/src/script_opt/ProfileFunc.h b/src/script_opt/ProfileFunc.h index 72b8452e96..5f84d489a8 100644 --- a/src/script_opt/ProfileFunc.h +++ b/src/script_opt/ProfileFunc.h @@ -256,7 +256,8 @@ protected: std::unordered_set script_calls; // Same for BiF's, though for them we record the corresponding global - // rather than the BuiltinFunc*. + // rather than the BuiltinFunc*. In addition, we only track BiFs germane + // to code we're compiling. IDSet BiF_globals; // Script functions appearing in "when" clauses.