Vern Paxson
179b4b22ba
efficient initialization of vectors-of-vectors-of-vectors
2024-08-10 09:33:52 -07:00
Vern Paxson
df7b346337
first cut of switching over compound initializations to flat arrays
2024-08-09 18:19:02 -07:00
Vern Paxson
d1a5f0f0ff
remove unused method
2024-08-09 16:33:13 -07:00
Vern Paxson
daab1d7478
anticipatory documentation updates
2024-08-09 16:18:22 -07:00
Vern Paxson
78b50dbeb7
make types consistent
2024-08-09 16:06:53 -07:00
Vern Paxson
dcc917a1bf
remove use of template in initializer
2024-08-09 16:05:36 -07:00
Tim Wojtulewicz
e2b03681d1
Remove EventRegistry::Used and EventRegistry::SetUsed
2024-08-07 11:58:21 -07:00
Vern Paxson
37c1f6641c
script optimization support for "add" and "delete" being expressions
2024-05-29 12:40:06 -07:00
Vern Paxson
7c8c83efc4
factor script optimization Expr AST nodes out of main AST header
2024-04-25 09:15:13 -07:00
Vern Paxson
4e253aae0a
optimize generation of "-O gen-C++" code for table/vector size operations
2024-04-25 09:15:12 -07:00
Vern Paxson
74d36eb759
script optimization support for clearing tables/vectors using "delete"
2024-03-08 19:09:46 +01:00
Vern Paxson
54877e9dec
fixed bug where appending an empty vector to a vector-of-vector's had no effect
2024-03-08 19:09:43 +01:00
Vern Paxson
9e32443504
minor updates and fixes for script optimization maintenance
2024-02-04 07:57:45 -08:00
Vern Paxson
f7b739a47d
fixes for initializations of "-O gen-C++" script compilations
2024-01-15 15:03:56 +01:00
Tim Wojtulewicz
df65b668b7
CPP-gen: Don't emit extra braces if only one element
2024-01-08 13:26:57 -07:00
Vern Paxson
e2646f9752
fix for -O C++ lambda functions reporting errors/warnings
2023-12-12 09:45:19 +01:00
Vern Paxson
f573036099
script optimization fixes for pattern tables
2023-12-12 09:45:19 +01:00
Vern Paxson
709d410fcd
regularized (some) types of pointers used in script optimization
2023-12-12 09:45:19 +01:00
Vern Paxson
a824bb1e4b
some very minor tidying of script optimization code/documentation
2023-12-12 09:45:19 +01:00
Dominik Charousset
a69928d977
Integrate review feedback
2023-12-04 15:23:56 +01:00
Dominik Charousset
647fdf7737
Add facade types to avoid using raw Broker types
...
By avoiding to use `broker::data` directly, we gain a degree of freedom
that allows us to swap out `broker::data` for something else (e.g.,
`broker::variant`) in the future. Furthermore, it also helps us to keep
Broker types "local" to the Broker manager and gives us a nicer
interface.
Also replaces uses of `broker::expected` with `std::optional`. While an
`expected `can carry additional information as to why a value is not
present, nothing in Zeek ever cared about that. Hence, using
`std::optional` removes an unnecessary dependency on a Broker detail
while also being more efficient (no extra heap allocation when no value
is present).
2023-12-04 15:23:28 +01:00
Arne Welzel
501b582bc7
TablePatternMatcher: Use const StringValPtr& instead of const StringVal*
2023-11-21 10:34:16 +01:00
Arne Welzel
c8bab6a0ec
IndexType: Add IsPatternIndex(), like IsSubNetIndex()
2023-11-21 10:34:16 +01:00
Vern Paxson
61fcca8482
script optimization support for using strings to index table[pattern] values
2023-11-21 10:34:16 +01:00
Vern Paxson
c49918ba8b
fixed some warnings about mixing signed & unsigned integers
2023-11-10 09:56:59 +01:00
Arne Welzel
ff34a4aa7f
EventHandler: Deprecate SetUsed() and Used() as well.
...
Seems the latter isn't used outside of the functions that were deprecated
in the previous commit and with UsageAnalyzer not making use of this
information unclear why we should keep it around.
Relates to #3187 .
2023-11-07 16:06:35 +01:00
Dominik Charousset
cebb85b1e8
Fix unsafe and inefficient uses of copy_string
...
Add a new overload to `copy_string` that takes the input characters plus
size. The new overload avoids inefficient scanning of the input for the
null terminator in cases where we know the size beforehand. Furthermore,
this overload *must* be used when dealing with input character sequences
that may have no null terminator, e.g., when the input is from a
`std::string_view` object.
2023-11-03 15:25:38 +01:00
Benjamin Bannier
f5a76c1aed
Reformat Zeek in Spicy style
...
This largely copies over Spicy's `.clang-format` configuration file. The
one place where we deviate is header include order since Zeek depends on
headers being included in a certain order.
2023-10-30 09:40:55 +01:00
Vern Paxson
417a99ed0d
minor updates to -O gen-C++ maintenance notes and scripts
2023-09-27 15:56:31 -07:00
Vern Paxson
434a7e059d
introduce internal "mask" expression node to avoid mixed-type overloading of "/"
2023-09-26 14:39:26 -07:00
Vern Paxson
80eed34985
-O gen-C++ fixes for compatibility with GH-3249 changes
...
minor -O gen-C++ BTest updates
2023-09-01 12:17:38 -07:00
Vern Paxson
e8f4e54475
change Trigger constructor to not potentially auto-delete itself
2023-08-28 10:17:26 -07:00
Vern Paxson
1473149579
updated notes regarding "-O gen-C++" maintenance
2023-08-24 11:47:01 -07:00
Vern Paxson
81a9745fb3
"-O gen-C++" support for "assert" statements
2023-08-24 11:46:59 -07:00
Vern Paxson
4928e074d4
addressed some nits re "-O gen-C++" script optimization
2023-08-16 17:04:39 -07:00
Vern Paxson
6af0014a7b
fixes for compiling lambdas to C++
2023-08-16 17:03:37 -07:00
Tim Wojtulewicz
067bbf82fb
Fix script_opt/cpp test scripts to work correctly on all platforms
2023-07-25 08:39:31 -07:00
Tim Wojtulewicz
c9f6b3463f
CPP code-gen: Use std::move for constructor arguments
2023-07-25 08:39:31 -07:00
Tim Wojtulewicz
73adf2bf01
CPP code-gen: Mark child classes final, remove final from function defs
2023-07-25 08:39:31 -07:00
Vern Paxson
10797bb955
-O gen-C++ fix for recent smart pointer changes
2023-07-13 15:05:16 -07:00
Vern Paxson
5480dc8869
fixes for compiling function calls that return non-error nil ValPtr's
2023-07-13 13:06:42 -07:00
Tim Wojtulewicz
64b78f6fb9
Use emplace_back over push_back where appropriate
2023-07-07 09:17:05 -07:00
Vern Paxson
ecc93606c4
feature completeness for ZAM
2023-06-30 09:36:14 +02:00
Vern Paxson
65a7e3de5f
-O gen-C++ tweaks to be compatible with ZAM changes
2023-06-30 09:36:14 +02:00
Vern Paxson
110ba7a0a1
AST profiling enhnacements in support of script optimization for lambdas/whens
2023-06-30 09:36:14 +02:00
Vern Paxson
46983cfb2f
refinements to LambdaExpr's to provide flexibility, support for ZVal captures
2023-06-30 09:36:14 +02:00
Vern Paxson
b6464814c9
the "Capture" struct is now a class
2023-06-30 09:36:14 +02:00
Vern Paxson
18be4ba91b
-O gen-C++ refinements for BiF failures, negative vector indices, boolean vector operations
2023-06-15 15:07:18 -07:00
Arne Welzel
7a043e5e8f
all: Fix typos identified by typos pre-commit hook
2023-06-13 17:57:32 +02:00
Vern Paxson
7d7a293c04
updates to C++ maintenance scripts to better handle uncompilable BTests
2023-05-05 12:01:31 -07:00