mirror of
https://github.com/zeek/zeek.git
synced 2025-10-03 15:18:20 +00:00
Merge branch 'master' into topic/vern/lambda-copy-semantics
This commit is contained in:
commit
614fade0a4
68 changed files with 21745 additions and 252 deletions
22
src/Func.h
22
src/Func.h
|
@ -10,6 +10,7 @@
|
|||
#include <type_traits>
|
||||
|
||||
#include "zeek/ZeekList.h"
|
||||
#include "zeek/Stmt.h"
|
||||
#include "zeek/Obj.h"
|
||||
#include "zeek/IntrusivePtr.h"
|
||||
#include "zeek/Type.h" /* for function_flavor */
|
||||
|
@ -43,6 +44,8 @@ using ScopePtr = IntrusivePtr<Scope>;
|
|||
using IDPtr = IntrusivePtr<ID>;
|
||||
using StmtPtr = IntrusivePtr<Stmt>;
|
||||
|
||||
class ScriptFunc;
|
||||
|
||||
} // namespace detail
|
||||
|
||||
class Func;
|
||||
|
@ -232,6 +235,22 @@ public:
|
|||
const std::vector<IDPtr>& new_inits,
|
||||
size_t new_frame_size, int priority) override;
|
||||
|
||||
StmtPtr CurrentBody() const { return current_body; }
|
||||
|
||||
/**
|
||||
* Returns the function's frame size.
|
||||
* @return The number of ValPtr slots in the function's frame.
|
||||
*/
|
||||
int FrameSize() const { return frame_size; }
|
||||
|
||||
/**
|
||||
* Changes the function's frame size to a new size - used for
|
||||
* script optimization/compilation.
|
||||
*
|
||||
* @param new_size The frame size the function should use.
|
||||
*/
|
||||
void SetFrameSize(int new_size) { frame_size = new_size; }
|
||||
|
||||
/** Sets this function's outer_id list. */
|
||||
void SetOuterIDs(IDPList ids)
|
||||
{ outer_ids = std::move(ids); }
|
||||
|
@ -283,6 +302,9 @@ private:
|
|||
Frame* captures_frame = nullptr;
|
||||
|
||||
OffsetMap* captures_offset_mapping = nullptr;
|
||||
|
||||
// The most recently added/updated body.
|
||||
StmtPtr current_body;
|
||||
};
|
||||
|
||||
using built_in_func = BifReturnVal (*)(Frame* frame, const Args* args);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue