Commit graph

200 commits

Author SHA1 Message Date
Tim Wojtulewicz
e613e7c304 Fix clang-tidy modernize-use-override warnings in headers 2025-06-23 08:35:24 -07:00
Tim Wojtulewicz
fb55c8856e Fix clang-tidy modernize-use-default-member-init warnings in headers 2025-06-23 08:35:24 -07:00
Tim Wojtulewicz
f386deba94 Fix clang-tidy performance-enum-size warnings in headers 2025-06-23 08:35:24 -07:00
Tim Wojtulewicz
13b7713889 Fix clang-tidy bugprone-macro-parentheses warnings in headers 2025-06-23 08:35:24 -07:00
Vern Paxson
0fda589a19 ZAM optimization now removes hook calls to hooks without any bodies 2024-12-03 12:47:20 -07:00
Arne Welzel
ec1088c3ef Merge remote-tracking branch 'origin/topic/vern/zam-regularization'
* origin/topic/vern/zam-regularization: (33 commits)
  simpler and more robust identification of function parameters for AST profiling
  fixes to limit AST traversal in the face of recursive types
  address some script optimization compiler warnings under Linux
  fix for -O C++ construction of variable names that use multiple module namespaces
  fix for script optimization of "opaque" values that are run-time constants
  fix for script optimization of nested switch statements
  script optimization fix for complex "in" expressions in conditionals
  updates to typos allow-list reflecting ZAM regularization changes
  BTest updates for ZAM regularization changes
  convert new ZAM operations to use typed operands
  complete migration of ZAM to use only public ZVal methods
  "-O validate-ZAM" option to validate generated ZAM instructions
  internal option to suppress control-flow optimization
  exposing some functionality for greater flexibility in structuring run-time execution
  rework ZAM compilation of type switches to leverage value switches
  add tracking of control flow information
  factoring of ZAM operation specifications into separate files
  updates to ZAM operations / gen-zam regularization, other than the operations themselves
  type-checking fix for vector-of-string operations
  ZVal constructor for booleans
  ...
2024-08-16 12:10:33 +02:00
Vern Paxson
e93db75f78 fixes for script optimization of coerce-to-any expressions 2024-08-16 11:18:57 +02:00
Vern Paxson
5a3b519fb4 fix for script optimization of constants of type "opaque" 2024-08-13 14:33:00 -07:00
Vern Paxson
4b719ef45a script optimization for record operations sourced (in part) from other records 2024-06-24 09:38:37 +02:00
Vern Paxson
0e5bece385 "add" and "delete" are now expressions rather than statements 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
01fd30dda9 new internal AST node for expression idioms with corresponding ZAM built-ins 2024-04-25 09:15:13 -07:00
Vern Paxson
16b2946fef streamlining of expressions only used for script optimization 2024-04-25 09:15:13 -07:00
Vern Paxson
f557b40d14 reordering of expressions to match main usage vs. script-optimization extras 2024-04-25 09:15:13 -07:00
Vern Paxson
52f506b7ae support for conditional expressions transforming into interal has-elements expr 2024-04-25 09:15:12 -07:00
Vern Paxson
d15d4a6e08 unify functionality across EqExpr and RelExpr classes 2024-04-25 09:15:12 -07:00
Vern Paxson
5445e8c7ff optimization of scripting idioms - min/max, has-elements 2024-04-25 09:15:12 -07:00
Vern Paxson
e38053ee3c hooks for ZAM optimization of calls to particular functions 2024-04-25 09:15:12 -07: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
Arne Welzel
2f1893bc58 Allow delete statement for tables, sets and vectors
Relates to #3472. This allow "delete tbl" as an alternative for
clear_table(tbl). Also works for vectors.
2024-02-21 18:00:00 +01:00
Arne Welzel
caa1c7493f Obj: Implement with_location_of() as template 2024-02-06 11:03:06 +01:00
Vern Paxson
e5bb63c662 fixes & enhancements to location information associated w/ AST nodes & ZAM optimization 2024-02-06 11:03:02 +01:00
Vern Paxson
96f5de8df8 ZAM speedup for constructing empty vectors 2024-01-15 15:03:56 +01:00
Vern Paxson
699549eb45 support for indexing "table[pattern] of T" with strings to get multi-matches 2023-11-21 10:34:15 +01:00
Vern Paxson
b489cfc508 greater ZAM optimization of inlined function calls 2023-11-10 09:57:35 +01:00
Vern Paxson
e3b75ac391 some minor ZAM optimization improvements 2023-11-10 09:57:35 +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
cbc3d9c739 ZAM fix for inlining bug when a local is assigned to a function parameter 2023-09-27 14:03:45 -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
1ff490b41c more extensive ZAM inlining & compilation of lambdas 2023-07-17 16:31:30 -07:00
Vern Paxson
1d5bc841e0 ZAM optimization for ?$ operator applied to non-optional fields 2023-07-17 16:31:30 -07:00
Tim Wojtulewicz
90d0bc64fa Replace empty destructor bodies with =default definitions 2023-07-07 09:17:05 -07:00
Vern Paxson
cb15e0d4f1 Address PR review feedback on zam-feature-complete
* insert_or_assign usage
  * master -> primary
  * FunctionIngredientsPtr
  * FuncType::Capture deprecations
  * no new ScriptFunc constructor
2023-06-30 09:59:10 +02:00
Vern Paxson
46983cfb2f refinements to LambdaExpr's to provide flexibility, support for ZVal captures 2023-06-30 09:36:14 +02:00
Tim Wojtulewicz
4229af6820 Remove deprecations tagged for v6.1 2023-06-14 10:07:22 -07:00
Vern Paxson
0c434ca4f8 changed function_ingredients struct to FunctionIngredients class with accessors 2023-04-02 11:34:16 -07:00
Arne Welzel
5ef62b2de8 Expr: Remove vector scalar operations
These seem to have been deprecated since 2018, so do it now.
Unfortunately the message didn't contain a version when it'll
be removed, but it's been long enough.
2023-03-20 21:35:48 +01:00
Tim Wojtulewicz
2739275b88 Merge remote-tracking branch 'jsoref/spelling-src'
* jsoref/spelling-src:
  Spelling src
2022-11-11 12:49:15 -07:00
Josh Soref
cd201aa24e Spelling src
These are non-functional changes.

* accounting
* activation
* actual
* added
* addresult
* aggregable
* aligned
* alternatively
* ambiguous
* analysis
* analyzer
* anticlimactic
* apparently
* application
* appropriate
* arithmetic
* assignment
* assigns
* associated
* authentication
* authoritative
* barrier
* boundary
* broccoli
* buffering
* caching
* called
* canonicalized
* capturing
* certificates
* ciphersuite
* columns
* communication
* comparison
* comparisons
* compilation
* component
* concatenating
* concatenation
* connection
* convenience
* correctly
* corresponding
* could
* counting
* data
* declared
* decryption
* defining
* dependent
* deprecated
* detached
* dictionary
* directional
* directly
* directory
* discarding
* disconnecting
* distinguishes
* documentation
* elsewhere
* emitted
* empty
* endianness
* endpoint
* enumerator
* essentially
* evaluated
* everything
* exactly
* execute
* explicit
* expressions
* facilitates
* fiddling
* filesystem
* flag
* flagged
* for
* fragments
* guarantee
* guaranteed
* happen
* happening
* hemisphere
* identifier
* identifies
* identify
* implementation
* implemented
* implementing
* including
* inconsistency
* indeterminate
* indices
* individual
* information
* initial
* initialization
* initialize
* initialized
* initializes
* instantiate
* instantiated
* instantiates
* interface
* internal
* interpreted
* interpreter
* into
* it
* iterators
* length
* likely
* log
* longer
* mainly
* mark
* maximum
* message
* minimum
* module
* must
* name
* namespace
* necessary
* nonexistent
* not
* notifications
* notifier
* number
* objects
* occurred
* operations
* original
* otherwise
* output
* overridden
* override
* overriding
* overwriting
* ownership
* parameters
* particular
* payload
* persistent
* potential
* precision
* preexisting
* preservation
* preserved
* primarily
* probably
* procedure
* proceed
* process
* processed
* processes
* processing
* propagate
* propagated
* prototype
* provides
* publishing
* purposes
* queue
* reached
* reason
* reassem
* reassemble
* reassembler
* recommend
* record
* reduction
* reference
* regularly
* representation
* request
* reserved
* retrieve
* returning
* separate
* should
* shouldn't
* significant
* signing
* simplified
* simultaneously
* single
* somebody
* sources
* specific
* specification
* specified
* specifies
* specify
* statement
* subdirectories
* succeeded
* successful
* successfully
* supplied
* synchronization
* tag
* temporarily
* terminating
* that
* the
* transmitted
* true
* truncated
* try
* understand
* unescaped
* unforwarding
* unknown
* unknowndata
* unspecified
* update
* usually
* which
* wildcard

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
2022-11-09 12:08:15 -05:00
Josh Soref
34966a93ef spelling: canonicalize
Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
2022-11-07 20:05:24 -05:00
AmazingPP
f2bfa61fc6 Add bitshift operators 2022-07-21 11:12:30 +08:00
Tim Wojtulewicz
4d4c6280e9 Miscellaneous deprecations and renaming 2022-07-12 12:01:23 -07:00
Vern Paxson
5a0a88526e removed deprecated capture-by-reference closures 2022-06-17 15:55:43 -07:00
Vern Paxson
a0fc8ca5e4 broader support for AST traversal, including Attr and Attributes objects 2022-05-26 17:38:34 -07:00
Tim Wojtulewicz
73273fc87b Merge remote-tracking branch 'origin/topic/vern/ZAM-inlining'
* origin/topic/vern/ZAM-inlining:
  speed up ZAM compilation by capping function size when inlining
2022-05-19 11:45:50 -07:00
Vern Paxson
7d00ce0082 speed up ZAM compilation by capping function size when inlining 2022-05-14 14:52:31 -07:00
Vern Paxson
702172079a tweaks per reviewing feedback 2022-05-13 16:16:21 -07:00
Vern Paxson
9ada7ac4e7 tracking of when statements/expressions occur in a "when" context 2022-05-12 13:45:45 -07:00
Vern Paxson
e786ba2fa9 type-checking for use of empty table constructors in expressions 2022-03-31 19:30:58 -07:00
Vern Paxson
4d051620e8 reworking of expressions to unify =/+=/-= with initialization 2022-03-23 15:36:35 -07:00