mirror of
https://github.com/zeek/zeek.git
synced 2025-10-06 16:48:19 +00:00
fixes for correctly tracking which functions have been fully inlined
This commit is contained in:
parent
91d70e6dd4
commit
3f64858335
3 changed files with 17 additions and 7 deletions
|
@ -31,10 +31,10 @@ public:
|
|||
// or an InlineExpr if it is; or nil if further inlining should stop.
|
||||
ExprPtr CheckForInlining(CallExprPtr c);
|
||||
|
||||
// True if the given function has been inlined.
|
||||
bool WasInlined(const Func* f)
|
||||
// True if every instance of the function was inlined.
|
||||
bool WasFullyInlined(const Func* f)
|
||||
{
|
||||
return inline_ables.count(f) > 0 && skipped_inlining.count(f) == 0;
|
||||
return did_inline.count(f) > 0 && skipped_inlining.count(f) == 0;
|
||||
}
|
||||
|
||||
protected:
|
||||
|
@ -52,6 +52,9 @@ protected:
|
|||
// Functions that we've determined to be suitable for inlining.
|
||||
std::unordered_set<const Func*> inline_ables;
|
||||
|
||||
// Functions that we inlined.
|
||||
std::unordered_set<const Func*> did_inline;
|
||||
|
||||
// Functions that we didn't fully inline, so require separate
|
||||
// compilation.
|
||||
std::unordered_set<const Func*> skipped_inlining;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue