[zeek/spicy] cb2e75: Catch up on docs.

0 views
Skip to first unread message

Robin Sommer

unread,
Feb 19, 2026, 8:10:15 AMFeb 19
to spicy-...@zeek.org
Branch: refs/heads/topic/robin/remove-unused-fields
Home: https://github.com/zeek/spicy
Commit: cb2e7502370a81ca425c305314edf49f6228b4ed
https://github.com/zeek/spicy/commit/cb2e7502370a81ca425c305314edf49f6228b4ed
Author: Robin Sommer <ro...@corelight.com>
Date: 2026-02-19 (Thu, 19 Feb 2026)

Changed paths:
M doc/examples/_usage-spicy-driver.output
M doc/examples/_usage-spicyc.output
M doc/programming/examples/_constant-field.spicy.output_2
R doc/programming/examples/_debug-hooks.spicy.output
M doc/programming/examples/_mylibrary.spicy.output
M doc/programming/examples/_parse-backtrack.spicy.output
M doc/programming/examples/_parse-bitfield.spicy.output
M doc/programming/examples/_parse-requires-property.spicy.output_2
M doc/programming/examples/_parse-requires-with-error.spicy.output
M doc/programming/examples/_parse-requires.spicy.output_2
R doc/programming/examples/_parse-void-size.spicy.output

Log Message:
-----------
Catch up on docs.

We had some changes that weren't reflected in the auto-generated docs
yet.


Commit: 365042f44e1aaf0c71547decea416effabeb2f89
https://github.com/zeek/spicy/commit/365042f44e1aaf0c71547decea416effabeb2f89
Author: Robin Sommer <ro...@corelight.com>
Date: 2026-02-19 (Thu, 19 Feb 2026)

Changed paths:
M doc/toolchain.rst
M hilti/toolchain/include/compiler/detail/optimizer/pass.h
M hilti/toolchain/src/compiler/optimizer/pass.cc

Log Message:
-----------
Add environment variable `HILTI_DISABLE_OPTIMIZER_PASSES`.

We used to have an environment variable to specify which optimizer
passes to run. This brings it back in inverse: a colon-separated list
of passes to disable. Leaving out individual passes seems more useful
than having to list all passes that one wants to run.

Not documenting the names of passes as this is primarily for
development purposes.


Commit: ce74b5ac6cfe6e59de97224fa34cd0f0d1cd1ed0
https://github.com/zeek/spicy/commit/ce74b5ac6cfe6e59de97224fa34cd0f0d1cd1ed0
Author: Robin Sommer <ro...@corelight.com>
Date: 2026-02-19 (Thu, 19 Feb 2026)

Changed paths:
M doc/toolchain.rst
M hilti/toolchain/include/compiler/context.h
M hilti/toolchain/src/compiler/driver.cc
M spicy/toolchain/bin/spicy-driver.cc
M spicy/toolchain/bin/spicy-dump/main.cc

Log Message:
-----------
Add new options `--[no-]strict-public-api` to toolchain commands.

If active, this disallows any optimizations that affect the external
C++ API of the generated code. By default, this is on when generating
debug code and off when generating release code.


Commit: ad4038ea456931e35331de40f8a4bad2ea5636fd
https://github.com/zeek/spicy/commit/ad4038ea456931e35331de40f8a4bad2ea5636fd
Author: Robin Sommer <ro...@corelight.com>
Date: 2026-02-19 (Thu, 19 Feb 2026)

Changed paths:
M hilti/runtime/include/type-info.h
M hilti/runtime/include/types/bitfield.h
M hilti/toolchain/include/ast/declarations/field.h
M hilti/toolchain/include/compiler/detail/cxx/elements.h
M hilti/toolchain/src/compiler/codegen/ctors.cc
M hilti/toolchain/src/compiler/codegen/types.cc
M hilti/toolchain/src/compiler/cxx/elements.cc
M hilti/toolchain/src/compiler/validator.cc
M spicy/toolchain/bin/spicy-dump/printer-json.cc
M spicy/toolchain/bin/spicy-dump/printer-text.cc
M spicy/toolchain/src/compiler/codegen/unit-builder.cc
A tests/Baseline/hilti.optimization.no-emit/output
A tests/Baseline/hilti.optimization.no-emit/output.c++
M tests/Baseline/spicy.optimization.unused-functions/noopt.hlt
M tests/Baseline/spicy.optimization.unused-functions/opt.hlt
M tests/Baseline/spicy.optimization.unused-types/log
M tests/Baseline/spicy.optimization.unused-types/noopt.hlt
M tests/Baseline/spicy.optimization.unused-types/opt.hlt
M tests/Baseline/spicy.types.bitfield.anonymous-field-with-switch/output
M tests/Baseline/spicy.types.bitfield.anonymous-field/output
M tests/Baseline/spicy.types.unit.self-recursive/output
M tests/Baseline/spicy.types.unit.switch-blocks-with-laheads/output
M tests/Baseline/spicy.types.unit.switch-if-expr/output
M tests/Baseline/spicy.types.unit.switch-if-lahead/output
M tests/Baseline/spicy.types.unit.switch-nested-lahead/output
M tests/Baseline/spicy.types.unit.synchronize-after/output
M tests/Baseline/spicy.types.unit.synchronize-at/output
M tests/Baseline/spicy.types.unit.synchronize-confirm-elsewhere/output
M tests/Baseline/spicy.types.unit.synchronize-parse-error-during-trial-mode/output
A tests/hilti/optimization/no-emit.hlt

Log Message:
-----------
Extend `&no-emit` attribute with string argument support.

The existing (purely internal) `&no-emit` attribute now requires a
string argument to distinguish between 'private' fields (never visible
to user) and 'optimized' fields (removed by optimizer, but still
included in type information and type rendering; in the latter case,
they will be printed as `(optimized out)`.

`optimized` isn't in actual use yet. The corresponding optimizer pass
adding it will come in a subsequent change. However, we do already
include a test that adds `&no-emit` manually to exercise the code
generation and rendering. We already adapt `spicy-dump` as well, but
can't test it yet.

This comes with two slightly backwards-incompatible changes:

- Before, we used to include private struct fields into the type
information, even though we weren't using them anywhere (our tools
using type information were just skipping over them already). For
simplicity, we now directly skip them when emitting type
information. That means that host application can assume that any
fields included into the type information but marked as
not-emitted, are fields that would normally be visible to the user
but have been optimized out.

- spicy-dump output now includes struct fields that don't have a value
set. In text output, they are rendered as `(unset)`, in JSON output
with `null` values. The reason is that, because we want to have
optimized fields rendered as "(optimized out)" in text output, it
would seem surprising to have any non-optimized fields not appear at
all. Similarly for JSON, where we render optimized fields as `null`
(although one could debate whether they should be included in JSON
at all).


Commit: 5815f4334bddecf31af3526923793caa11ca08c1
https://github.com/zeek/spicy/commit/5815f4334bddecf31af3526923793caa11ca08c1
Author: Robin Sommer <ro...@corelight.com>
Date: 2026-02-19 (Thu, 19 Feb 2026)

Changed paths:
M spicy/toolchain/include/ast/attribute.h
M spicy/toolchain/include/ast/types/unit-items/variable.h
M spicy/toolchain/src/compiler/codegen/parser-builder.cc
M spicy/toolchain/src/compiler/codegen/unit-builder.cc
M spicy/toolchain/src/compiler/parser/scanner.ll
M spicy/toolchain/src/compiler/validator.cc

Log Message:
-----------
Add `&always-emit` attribute to Spicy.

This attribute already existed at the HILTI level to express that
struct fields are not to be skipped from the emitted code. We allow
the same in Spicy now for unit fields, and carry the attribute through
to the corresponding Spicy struct.


Commit: bd8270b64ef26df1dfa220813aa3aef40a320998
https://github.com/zeek/spicy/commit/bd8270b64ef26df1dfa220813aa3aef40a320998
Author: Robin Sommer <ro...@corelight.com>
Date: 2026-02-19 (Thu, 19 Feb 2026)

Changed paths:
M hilti/toolchain/include/ast/builder/builder.h
M hilti/toolchain/include/ast/builder/node-factory.h
M hilti/toolchain/include/ast/declaration.h
M hilti/toolchain/include/ast/declarations/all.h
A hilti/toolchain/include/ast/declarations/export.h
M hilti/toolchain/include/ast/forward.h
M hilti/toolchain/include/ast/node-tag.h
M hilti/toolchain/include/ast/visitor-dispatcher.h
M hilti/toolchain/src/ast/node.cc
M hilti/toolchain/src/ast/operator-registry.cc
M hilti/toolchain/src/ast/scope-lookup.cc
M hilti/toolchain/src/compiler/codegen/codegen.cc
M hilti/toolchain/src/compiler/optimizer/passes/dead-code-static.cc
M hilti/toolchain/src/compiler/optimizer/passes/propagate-function-returns.cc
M hilti/toolchain/src/compiler/optimizer/passes/remove-unused-params.cc
M hilti/toolchain/src/compiler/parser/parser.yy
M hilti/toolchain/src/compiler/parser/scanner.ll
M hilti/toolchain/src/compiler/printer.cc
M hilti/toolchain/src/compiler/resolver.cc
M hilti/toolchain/src/compiler/validator.cc
M spicy/toolchain/src/compiler/codegen/codegen.cc
M spicy/toolchain/src/compiler/parser/parser.yy
M spicy/toolchain/src/compiler/resolver.cc
M spicy/toolchain/src/compiler/validator.cc
A tests/Baseline/hilti.types.struct.export-fail/output
A tests/Baseline/hilti.types.struct.export/output
A tests/Baseline/spicy.types.unit.export/output
A tests/hilti/types/struct/export-fail.hlt
A tests/hilti/types/struct/export.hlt
A tests/spicy/types/unit/export.spicy

Log Message:
-----------
Add new linkage `export`.

This applies to structs and units, and generally works like `public`, but in addition declares that the
HILTI optimizer/codegen may not change the fields of the type. It's
like `--strict-public-api` but on a per type basis.

To export a type, it first needs to declared normally, and can then
be exported. In Spicy:

``
type Foo = unit { ... }

export Foo;
``

(`export type Foo` doesn't work for parsing reasons; plus we want to
be able to export already existing types.)


Commit: af556ac2b98812279b2e912ec7a9ebb410092db9
https://github.com/zeek/spicy/commit/af556ac2b98812279b2e912ec7a9ebb410092db9
Author: Robin Sommer <ro...@corelight.com>
Date: 2026-02-19 (Thu, 19 Feb 2026)

Changed paths:
M hilti/toolchain/src/compiler/printer.cc
M spicy/toolchain/src/compiler/printer.cc

Log Message:
-----------
Add null checks to AST printers.

For convenience, to avoid caller-side checks.


Commit: 3010741b526a963e6d2fd79bb04ab3e7ef07a213
https://github.com/zeek/spicy/commit/3010741b526a963e6d2fd79bb04ab3e7ef07a213
Author: Robin Sommer <ro...@corelight.com>
Date: 2026-02-19 (Thu, 19 Feb 2026)

Changed paths:
M hilti/lib/hilti.hlt
M hilti/runtime/include/types/struct.h
M tests/Baseline/hilti.ast.basic-module/debug.log
M tests/Baseline/hilti.ast.coercion/output
M tests/Baseline/hilti.ast.imported-id/output
M tests/Baseline/hilti.ast.types/output
M tests/Baseline/hilti.cfg.assert/output
M tests/Baseline/hilti.cfg.assign/output
M tests/Baseline/hilti.cfg.dead-write-shadowed/output
M tests/Baseline/hilti.cfg.empty/output
M tests/Baseline/hilti.cfg.for/output
M tests/Baseline/hilti.cfg.if/output
M tests/Baseline/hilti.cfg.local-struct-value/output
M tests/Baseline/hilti.cfg.no-dataflow/output
M tests/Baseline/hilti.cfg.return/output
M tests/Baseline/hilti.cfg.simple-statements/output
M tests/Baseline/hilti.cfg.struct_member_access/output
M tests/Baseline/hilti.cfg.switch/output
M tests/Baseline/hilti.cfg.try/output
M tests/Baseline/hilti.cfg.unreachable-return/output
M tests/Baseline/hilti.cfg.while/output
M tests/Baseline/hilti.expressions.ctor-replacement/output
M tests/Baseline/hilti.optimization.unused-init/output
M tests/Baseline/hilti.types.struct.canonical-ids/output
M tests/Baseline/spicy.types.function.cxxname-normalization/output
M tests/Baseline/spicy.types.unit.canonical-ids-with-import/output
M tests/Baseline/spicy.types.unit.canonical-ids/output

Log Message:
-----------
Expose a couple of helper runtime functions to throw exceptions.

This adds `hilti::throw_unset_optional()` and
`hilti::throw_attribute_not_set()` that throw the corresponding
exceptions. Having functions will allow us to use throw from inside
expressions, which C++' `throw` cannot do. The C++ implementation of
the former already existed but wasn't accessible to HILTI code yet.


Commit: 6238351a6bbc28ee2d03f719da76633f1f3f2afb
https://github.com/zeek/spicy/commit/6238351a6bbc28ee2d03f719da76633f1f3f2afb
Author: Robin Sommer <ro...@corelight.com>
Date: 2026-02-19 (Thu, 19 Feb 2026)

Changed paths:
M hilti/toolchain/include/ast/attribute.h
M hilti/toolchain/include/ast/ctors/struct.h
M hilti/toolchain/include/ast/ctors/tuple.h
M hilti/toolchain/include/ast/expressions/assign.h
M hilti/toolchain/include/ast/expressions/resolved-operator.h
M hilti/toolchain/include/ast/node.h
M hilti/toolchain/include/ast/types/operand-list.h
M hilti/toolchain/src/compiler/cfg.cc

Log Message:
-----------
Add a couple of AST node editing methods.

Most of the these allow detaching an existing child expression from a
node, to then re-use it elsewhere without requiring a deep copy.


Commit: a2f9dbc38f55ce5e851a898a09239a31f3cedbb3
https://github.com/zeek/spicy/commit/a2f9dbc38f55ce5e851a898a09239a31f3cedbb3
Author: Robin Sommer <ro...@corelight.com>
Date: 2026-02-19 (Thu, 19 Feb 2026)

Changed paths:
M hilti/toolchain/include/ast/builder/builder.h
M hilti/toolchain/include/ast/builder/node-factory.h
M hilti/toolchain/include/ast/expressions/grouping.h
M hilti/toolchain/include/ast/node.h
M hilti/toolchain/src/compiler/codegen/expressions.cc
M hilti/toolchain/src/compiler/constant-folder.cc
M hilti/toolchain/src/compiler/optimizer/passes/peephole.cc
M hilti/toolchain/src/compiler/parser/parser.yy
M hilti/toolchain/src/compiler/printer.cc
M hilti/toolchain/src/compiler/resolver.cc
M hilti/toolchain/src/compiler/validator.cc
M tests/Baseline/hilti.expressions.grouping-with-local/output
M tests/hilti/expressions/grouping-with-local.hlt

Log Message:
-----------
Extend groupings to support multiple expressions.

The HILTI AST so far did not have a way to express a sequence of
expressions (think: `,` operator in C). This adds support for that by
extending grouping expressions to contain more than one expression.
They will be evaluated in sequence, with all having access to the
local tmp if defined; and the grouping will return the value of the
final expression as its value. Nor surprisingly, these are codegened
to C++ through the `,` operator.


Commit: 6c8dd93769977a45fc77ac4d484fe79c2849729a
https://github.com/zeek/spicy/commit/6c8dd93769977a45fc77ac4d484fe79c2849729a
Author: Robin Sommer <ro...@corelight.com>
Date: 2026-02-19 (Thu, 19 Feb 2026)

Changed paths:
M hilti/toolchain/include/compiler/detail/cfg.h
M hilti/toolchain/src/ast/ast-context.cc
M hilti/toolchain/src/compiler/cfg.cc

Log Message:
-----------
Fix CFG logic for adding function parameters.

I was getting assertion errors and noticed the logic wasn't making use
of the AST information that the resolver computes for types linked to
methods. So this switches that over.

It's a slightly larger change because we need to get the CFG access to
the AST context, which is a bit of hassle to get it in place. On the
plus side, having the context available seems generally useful for the
CFG class, so that seems ok.


Commit: b278c034d01ce203a6ccb0e246b8141d8981caf7
https://github.com/zeek/spicy/commit/b278c034d01ce203a6ccb0e246b8141d8981caf7
Author: Robin Sommer <ro...@corelight.com>
Date: 2026-02-19 (Thu, 19 Feb 2026)

Changed paths:
M tests/hilti/cfg/dead-write-shadowed.hlt
M tests/hilti/cfg/unreachable-return.hlt
M tests/hilti/expressions/default-ctor.hlt
M tests/hilti/optimization/no-emit.hlt
M tests/hilti/rt/print.hlt
M tests/hilti/types/reference/weak-from-value-ref-struct.hlt
M tests/hilti/types/struct/ctor.hlt
M tests/hilti/types/struct/method-auto-param.hlt
M tests/hilti/types/struct/on-heap-cyclic.hlt
M tests/hilti/types/struct/on-heap.hlt
M tests/hilti/types/struct/params-init-ambiguity.hlt
M tests/hilti/types/struct/static-field.hlt
M tests/hilti/types/struct/string-conversion.hlt
M tests/hilti/types/tuple/ctor.hlt
M tests/hilti/use-cases/parse-bytes.hlt
M tests/spicy/cfg/unit-parameter.spicy
M tests/spicy/rt/base64-filter.spicy
M tests/spicy/rt/profiler.spicy
M tests/spicy/rt/zlib-filter.spicy
M tests/spicy/tools/spicy-driver-file.spicy
M tests/spicy/tools/spicy-driver-library-path.spicy
M tests/spicy/tools/spicy-driver-properties.spicy
M tests/spicy/tools/spicy-dump-bitfields.spicy
M tests/spicy/types/bitfield/anonymous-field.spicy
M tests/spicy/types/bitfield/ctor-look-ahead.spicy
M tests/spicy/types/bitfield/typedef.spicy
M tests/spicy/types/bytes/parse-chunked-until.spicy
M tests/spicy/types/bytes/parse-chunked.spicy
M tests/spicy/types/bytes/parse-ctor.spicy
M tests/spicy/types/bytes/parse-eod.spicy
M tests/spicy/types/bytes/parse-inc.spicy
M tests/spicy/types/bytes/parse-length-eod-chunked.spicy
M tests/spicy/types/bytes/parse-length-eod.spicy
M tests/spicy/types/bytes/parse-length.spicy
M tests/spicy/types/bytes/parse-until.spicy
M tests/spicy/types/enum/type.spicy
M tests/spicy/types/integer/parse-lahead.spicy
M tests/spicy/types/real/parse.spicy
M tests/spicy/types/regexp/parse-ctor.spicy
M tests/spicy/types/regexp/regression-incremental.spicy
M tests/spicy/types/sink/connect-mime.spicy
M tests/spicy/types/sink/connect.spicy
M tests/spicy/types/sink/write-open-end-regexp.spicy
M tests/spicy/types/sink/write.spicy
M tests/spicy/types/unit/backtrack-lah.spicy
M tests/spicy/types/unit/backtrack-on-error.spicy
M tests/spicy/types/unit/backtrack.spicy
M tests/spicy/types/unit/block.spicy
M tests/spicy/types/unit/conditional-parse-at.spicy
M tests/spicy/types/unit/context-inout.spicy
M tests/spicy/types/unit/external-global-vars.spicy
M tests/spicy/types/unit/external-hooks-unit-arg.spicy
M tests/spicy/types/unit/filter-chained.spicy
M tests/spicy/types/unit/filter-in-sub.spicy
M tests/spicy/types/unit/filter.spicy
M tests/spicy/types/unit/hooks-across-imports.spicy
M tests/spicy/types/unit/params-for-vars.spicy
M tests/spicy/types/unit/print-hook-nested.spicy
M tests/spicy/types/unit/size-side-effects.spicy
M tests/spicy/types/unit/struct-ctor-init.spicy
M tests/spicy/types/unit/switch-blocks-with-lists.spicy
M tests/spicy/types/unit/switch-blocks.spicy
M tests/spicy/types/unit/switch-if-expr.spicy
M tests/spicy/types/unit/switch-if-lahead.spicy
M tests/spicy/types/unit/switch-lahead-literal.spicy
M tests/spicy/types/unit/switch-lahead.spicy
M tests/spicy/types/unit/switch-nested-lahead.spicy
M tests/spicy/types/unit/switch-nested.spicy
M tests/spicy/types/unit/switch-parse-from.spicy
M tests/spicy/types/unit/switch.spicy
M tests/spicy/types/unit/void-eod.spicy
M tests/spicy/types/unit/void-requires.spicy
M tests/spicy/types/unit/void-until.spicy
M tests/spicy/types/unit/void.spicy
M tests/spicy/types/vector/parse-enum.spicy
M tests/spicy/types/vector/parse-lahead-across-other-parses.spicy
M tests/spicy/types/vector/parse-lahead-ctor.spicy
M tests/spicy/types/vector/parse-lahead-int-longest-match.spicy
M tests/spicy/types/vector/parse-lahead-int-regexp-longest-match.spicy
M tests/spicy/types/vector/parse-lahead-int-regexp.spicy
M tests/spicy/types/vector/parse-lahead-int-variable.spicy
M tests/spicy/types/vector/parse-lahead-int.spicy
M tests/spicy/types/vector/parse-lahead-mixed.spicy
M tests/spicy/types/vector/parse-lahead-nested.spicy
M tests/spicy/types/vector/parse-lahead-parse-from.spicy
M tests/spicy/types/vector/parse-lahead-regexp.spicy
M tests/spicy/types/vector/parse-length.spicy
M tests/spicy/types/vector/parse-size-stop.spicy
M tests/spicy/types/vector/parse-size.spicy
M tests/spicy/types/vector/parse-until-including.spicy
M tests/spicy/types/vector/parse-until.spicy
M tests/spicy/types/vector/parse-while.spicy

Log Message:
-----------
Switch tests to debug builds.

Most, but not all, of our tests are compiling HILTI/Spicy code with
`--debug`. This changes some of the remaining tests over, both for
consistency and to prepare for upcoming optimizations that would hide
the anticipated output in release builds. None of this changes any
baselines.

(This does not touch any tests for optimizations or CFGs in case
they explicitly want the release builds.)


Commit: 751b2e6a99920dd099a87d858c9beda1b7f685ab
https://github.com/zeek/spicy/commit/751b2e6a99920dd099a87d858c9beda1b7f685ab
Author: Robin Sommer <ro...@corelight.com>
Date: 2026-02-19 (Thu, 19 Feb 2026)

Changed paths:
M hilti/toolchain/src/compiler/resolver.cc

Log Message:
-----------
Improve tuple assignment.

We would in some cases introduce a temporary where we didn't need to.
Also adding a check to catch coercion errors, which could previously
end up not being reported.


Commit: bcddb0c797236c2a87d991f20566c1c360091fe0
https://github.com/zeek/spicy/commit/bcddb0c797236c2a87d991f20566c1c360091fe0
Author: Robin Sommer <ro...@corelight.com>
Date: 2026-02-19 (Thu, 19 Feb 2026)

Changed paths:
M hilti/toolchain/CMakeLists.txt
M hilti/toolchain/include/base/util.h
M hilti/toolchain/include/compiler/detail/optimizer/pass-id.h
A hilti/toolchain/src/compiler/optimizer/passes/remove-unused-fields.cc
M tests/Baseline/hilti.cfg.dead-write-shadowed/output
M tests/Baseline/hilti.cfg.local-struct-value/output
M tests/Baseline/hilti.cfg.unreachable-return/output
M tests/Baseline/hilti.optimization.dataflow-unreachable/output
M tests/Baseline/hilti.optimization.unimplemented_hook/log
M tests/Baseline/hilti.optimization.unreachable-code/log
M tests/Baseline/hilti.optimization.unused-init/output
A tests/Baseline/hilti.optimization.unused-struct-fields/output
M tests/Baseline/hilti.optimization.unused_function/log
M tests/Baseline/hilti.types.struct.on-heap/output
M tests/Baseline/spicy.optimization.default-parser-functions/log
M tests/Baseline/spicy.optimization.default-parser-functions/opt.hlt
M tests/Baseline/spicy.optimization.feature_requirements/log
M tests/Baseline/spicy.optimization.unused-functions/log
M tests/Baseline/spicy.optimization.unused-types/log
M tests/Baseline/spicy.optimization.unused-types/opt.hlt
A tests/hilti/optimization/unused-struct-fields.hlt

Log Message:
-----------
Add new optimizer pass removing unused struct fields.

Add optimizer pass that removes struct fields with no productive
accesses. The pass marks unused fields with `&no-emit="optimized"`,
allowing them to remain in the AST through codegen, which then emits
code to render them as `(optimized out)`. Fields with `&always-emit`,
or inside types with `&always-emit`, are never removed.

The new optimization is enabled only in `--no-strict-public-api` mode,
which means by default it's on release builds, but not in debug
builds. (That aligns pretty well with the fact that in debug mode,
Spicy generates accesses to *all* parsed fields through the debug
messages it emits, which means they wouldn't be optimized out
anyways.)


Commit: fc8eaed39cfab484a1131be9b1150563b2764e02
https://github.com/zeek/spicy/commit/fc8eaed39cfab484a1131be9b1150563b2764e02
Author: Robin Sommer <ro...@corelight.com>
Date: 2026-02-19 (Thu, 19 Feb 2026)

Changed paths:
M hilti/toolchain/src/compiler/optimizer/passes/peephole.cc
M spicy/toolchain/src/compiler/codegen/parser-builder.cc
M tests/Baseline/spicy.optimization.default-parser-functions/log
M tests/Baseline/spicy.optimization.default-parser-functions/noopt.hlt
M tests/Baseline/spicy.optimization.default-parser-functions/opt.hlt
M tests/Baseline/spicy.rt.debug-trace/.stderr
M tests/Baseline/spicy.types.unit.canonical-ids-with-import/output
M tests/spicy/optimization/error-push-pop.spicy
M tests/spicy/types/unit/attribute-access.spicy
M tests/spicy/types/unit/switch-convert-mixed.spicy

Log Message:
-----------
Parse fields into stack variables first.

So far, when parse a standard unit field, we'd immediately store the
retrieved value into the corresponding struct member. Now, if we parse
a non-mutable value, we instead store it into a local temporary first,
finish the field's processing, and only then move the value over from
the temporary to the struct field. The advantage is better
optimization potential: we have more opportunities to identify the
struct field as not (productively) used, and the C++ compiler can
likewise work on the stack temporary for most of the time. However, we
do this only for non-mutable values, because fields of mutable types
need to reflect incremental updates correctly at all times.


Commit: 5442d2e38cce8133b9f2c0830b2b02675eab10f4
https://github.com/zeek/spicy/commit/5442d2e38cce8133b9f2c0830b2b02675eab10f4
Author: Robin Sommer <ro...@corelight.com>
Date: 2026-02-19 (Thu, 19 Feb 2026)

Changed paths:
M hilti/toolchain/include/compiler/detail/cfg.h
M hilti/toolchain/src/compiler/cfg.cc
M hilti/toolchain/src/compiler/optimizer/passes/remove-unused-fields.cc

Log Message:
-----------
Provide two flow-based helpers through the CFG context.

The first provides flow information for a given expression, the second
determines if a given expression might contain side effects. Right
now, both are approximate, as we don't have expression-level dataflow
tracking yet. In the future, these should be able to become more
precise.


Commit: 326795560725b6514b27096fcb8cacd81f9cbb0e
https://github.com/zeek/spicy/commit/326795560725b6514b27096fcb8cacd81f9cbb0e
Author: Robin Sommer <ro...@corelight.com>
Date: 2026-02-19 (Thu, 19 Feb 2026)

Changed paths:
M hilti/toolchain/include/compiler/detail/cfg.h
M hilti/toolchain/src/compiler/cfg.cc
M hilti/toolchain/src/compiler/optimizer/passes/dead-code-static.cc
M hilti/toolchain/src/compiler/optimizer/passes/remove-unused-fields.cc
M hilti/toolchain/src/compiler/optimizer/passes/remove-unused-params.cc
M tests/Baseline/hilti.optimization.dataflow-unreachable/output
M tests/Baseline/hilti.optimization.unimplemented_hook/log
M tests/Baseline/hilti.optimization.unused-struct-fields/output
M tests/Baseline/spicy.optimization.default-parser-functions/log
M tests/Baseline/spicy.optimization.feature_requirements/log
M tests/Baseline/spicy.optimization.unused-functions/log
M tests/Baseline/spicy.optimization.unused-types/log

Log Message:
-----------
Use new helper for side effects elsewhere.


Commit: 6579be2855ef8eccd202023ff405f11f3066d1c5
https://github.com/zeek/spicy/commit/6579be2855ef8eccd202023ff405f11f3066d1c5
Author: Robin Sommer <ro...@corelight.com>
Date: 2026-02-19 (Thu, 19 Feb 2026)

Changed paths:
M hilti/toolchain/include/ast/ast-context.h
M hilti/toolchain/src/ast/ast-context.cc
M tests/Baseline/hilti.ast.basic-module/debug.log
M tests/Baseline/hilti.ast.imported-id/output
M tests/Baseline/hilti.ast.types/output
M tests/Baseline/spicy.types.unit.canonical-ids-with-import/output
M tests/Baseline/spicy.types.unit.canonical-ids/output

Log Message:
-----------
Compute AST dependencies always right after resolving.

Before, it was pretty inconsistent when exactly the information would
be available. In particular it wasn't available to post-compilation
hooks, which was unfortunate. With this change, we can now leverage
dependencies on the Zeek side.

Implementation note: We need to make the dependency computation a bit
more robust here now because it can potentially run on a not validated
(and hence invalid) AST. That can happen if the resolver flags any
errors. On the other hand, we can't easily run the validator just
before the dependency computation because that would change some
assumptions on when exactly validation runs, potentially leading to
different results.


Commit: 6ef33ef538de3c4cd4b0bda16ab91d4398326264
https://github.com/zeek/spicy/commit/6ef33ef538de3c4cd4b0bda16ab91d4398326264
Author: Robin Sommer <ro...@corelight.com>
Date: 2026-02-19 (Thu, 19 Feb 2026)

Changed paths:
M hilti/toolchain/include/compiler/context.h
M hilti/toolchain/src/compiler/driver.cc
M hilti/toolchain/src/compiler/optimizer/passes/remove-unused-fields.cc
M spicy/toolchain/bin/spicy-driver.cc
M spicy/toolchain/bin/spicy-dump/main.cc

Log Message:
-----------
fixup! Add new options `--[no-]strict-public-api` to toolchain commands.

This changes the internal optional from an optional boolean to an
enum.


Commit: e6cb2b0cdbac1eaa3ff7e475a4128358ed9eea25
https://github.com/zeek/spicy/commit/e6cb2b0cdbac1eaa3ff7e475a4128358ed9eea25
Author: Robin Sommer <ro...@corelight.com>
Date: 2026-02-19 (Thu, 19 Feb 2026)

Changed paths:
M hilti/runtime/include/types/bitfield.h
M hilti/toolchain/include/ast/builder/builder.h
M hilti/toolchain/include/ast/builder/node-factory.h
M hilti/toolchain/include/ast/ctors/tuple.h
M hilti/toolchain/include/ast/declaration.h
M hilti/toolchain/include/ast/expressions/grouping.h
M hilti/toolchain/include/ast/node.h
M hilti/toolchain/include/base/util.h
M hilti/toolchain/include/compiler/detail/cfg.h
M hilti/toolchain/src/compiler/cfg.cc
M hilti/toolchain/src/compiler/optimizer/pass.cc
M hilti/toolchain/src/compiler/optimizer/passes/remove-unused-fields.cc
M spicy/toolchain/bin/spicy-dump/printer-json.cc
M spicy/toolchain/src/compiler/codegen/unit-builder.cc

Log Message:
-----------
Address review feedback.


Commit: 0dfb43cb021d04b738a26763f3aea468abd745f2
https://github.com/zeek/spicy/commit/0dfb43cb021d04b738a26763f3aea468abd745f2
Author: Robin Sommer <ro...@corelight.com>
Date: 2026-02-19 (Thu, 19 Feb 2026)

Changed paths:
M hilti/toolchain/src/compiler/optimizer/passes/remove-unused-fields.cc
M tests/Baseline/hilti.optimization.unused-struct-fields/output

Log Message:
-----------
Fix bug with side-effect-having expressions in field optimizer pass.


Commit: fd67f793fd7db8152ec75e593289b12a29ae561e
https://github.com/zeek/spicy/commit/fd67f793fd7db8152ec75e593289b12a29ae561e
Author: Robin Sommer <ro...@corelight.com>
Date: 2026-02-19 (Thu, 19 Feb 2026)

Changed paths:
M hilti/toolchain/src/ast/types/struct.cc
M spicy/toolchain/src/ast/types/unit.cc
M tests/Baseline/hilti.ast.basic-module/debug.log
M tests/Baseline/hilti.ast.coercion/output
M tests/Baseline/hilti.ast.imported-id/output
M tests/Baseline/hilti.ast.types/output
M tests/Baseline/hilti.expressions.ctor-replacement/output

Log Message:
-----------
Fix ill-defined declaration linkage.

At a couple places, we weren't passing a (well-defined) linkage to
expression declarations. The linkage doesn't really matter
functionally but shows up in debug output, so make it consistent.


Commit: 5ddc13ec39e74db0845b664d9f2f0e309678ff96
https://github.com/zeek/spicy/commit/5ddc13ec39e74db0845b664d9f2f0e309678ff96
Author: Robin Sommer <ro...@corelight.com>
Date: 2026-02-19 (Thu, 19 Feb 2026)

Changed paths:
M doc/examples/_usage-spicy-driver.output
M doc/examples/_usage-spicy-dump.output
M doc/examples/_usage-spicyc.output
M doc/host-applications.rst
M doc/programming/examples/_anonymous-field.spicy.output
M doc/programming/examples/_basic-unit-module-with-default.spicy.output
M doc/programming/examples/_basic-unit-module.spicy.output
A doc/programming/examples/_basic-unit-module.spicy.output_2
M doc/programming/examples/_basic-unit-parse-byte-order.spicy.output
M doc/programming/examples/_basic-unit-parse.spicy.output
M doc/programming/examples/_constant-field.spicy.output_1
M doc/programming/examples/_constant-field.spicy.output_2
M doc/programming/examples/_context-empty.spicy.output
M doc/programming/examples/_max-size.spicy.output
M doc/programming/examples/_parse-address.spicy.output
M doc/programming/examples/_parse-backtrack.spicy.output
M doc/programming/examples/_parse-bitfield-enum.spicy.output
M doc/programming/examples/_parse-bitfield.spicy.output
M doc/programming/examples/_parse-convert-unit.spicy.output
M doc/programming/examples/_parse-convert.spicy.output
M doc/programming/examples/_parse-filter.spicy.output
M doc/programming/examples/_parse-if.spicy.output
M doc/programming/examples/_parse-look-ahead.spicy.output
M doc/programming/examples/_parse-parse.spicy.output
M doc/programming/examples/_parse-random-access.spicy.output
M doc/programming/examples/_parse-requires-property.spicy.output_1
M doc/programming/examples/_parse-requires-property.spicy.output_2
M doc/programming/examples/_parse-requires-with-error.spicy.output
M doc/programming/examples/_parse-requires.spicy.output_1
M doc/programming/examples/_parse-requires.spicy.output_2
M doc/programming/examples/_parse-sink.spicy.output
M doc/programming/examples/_parse-switch-lhead-2.spicy.output
M doc/programming/examples/_parse-switch-lhead.spicy.output
M doc/programming/examples/_parse-switch-size.spicy.output
M doc/programming/examples/_parse-switch.spicy.output
M doc/programming/examples/_parse-synchronized.spicy.output
M doc/programming/examples/_parse-unit-params.spicy.output
M doc/programming/examples/_parse-vector-foreach.spicy.output
M doc/programming/examples/_parse-vector.spicy.output
M doc/programming/examples/_regexp.spicy.output
M doc/programming/examples/_size.spicy.output
M doc/programming/examples/_skip.spicy.output
M doc/programming/examples/_unit-params-string.spicy.output
M doc/programming/examples/_unit-params-vector.spicy.output
M doc/programming/examples/_unit-params.spicy.output
M doc/programming/examples/_unit-vars-init.spicy.output
M doc/programming/examples/_unit-vars-optional.spicy.output
M doc/programming/examples/_unit-vars.spicy.output
M doc/programming/language/index.rst
A doc/programming/language/optimization.rst
M doc/programming/language/statements.rst
M doc/programming/parsing.rst
M doc/tutorial/examples/_rrq.spicy.output_1
M doc/tutorial/examples/_rrq.spicy.output_2
M doc/tutorial/examples/_tftp-1.spicy.output
M doc/tutorial/examples/_tftp-2.spicy.output
M doc/tutorial/examples/_tftp-3.spicy.output_1
M doc/tutorial/examples/_tftp-4.spicy.output
M doc/tutorial/examples/_tftp-complete-1.spicy.output
M doc/tutorial/examples/_tftp-enum.spicy.output
M doc/tutorial/examples/_tftp-unified-request.spicy.output
M doc/tutorial/index.rst
M spicy/toolchain/bin/spicy-driver.cc
M spicy/toolchain/bin/spicy-dump/main.cc

Log Message:
-----------
Updating documentation for optimizer changes.


Compare: https://github.com/zeek/spicy/compare/e7cb3d57c962...5ddc13ec39e7

To unsubscribe from these emails, change your notification settings at https://github.com/zeek/spicy/settings/notifications

Robin Sommer

unread,
Feb 20, 2026, 3:44:45 AMFeb 20
to spicy-...@zeek.org
Branch: refs/heads/main
Home: https://github.com/zeek/spicy
Commit: cb2e7502370a81ca425c305314edf49f6228b4ed
https://github.com/zeek/spicy/commit/cb2e7502370a81ca425c305314edf49f6228b4ed
Author: Robin Sommer <ro...@corelight.com>
Date: 2026-02-19 (Thu, 19 Feb 2026)

Changed paths:
M doc/examples/_usage-spicy-driver.output
M doc/examples/_usage-spicyc.output
M doc/programming/examples/_constant-field.spicy.output_2
R doc/programming/examples/_debug-hooks.spicy.output
M doc/programming/examples/_mylibrary.spicy.output
M doc/programming/examples/_parse-backtrack.spicy.output
M doc/programming/examples/_parse-bitfield.spicy.output
M doc/programming/examples/_parse-requires-property.spicy.output_2
M doc/programming/examples/_parse-requires-with-error.spicy.output
M doc/programming/examples/_parse-requires.spicy.output_2
R doc/programming/examples/_parse-void-size.spicy.output

Log Message:
-----------
Catch up on docs.

We had some changes that weren't reflected in the auto-generated docs
yet.


Commit: 209d89473c744a9fe502e432f45bf92e9b0e4e52
https://github.com/zeek/spicy/commit/209d89473c744a9fe502e432f45bf92e9b0e4e52
Author: Robin Sommer <ro...@corelight.com>
Date: 2026-02-19 (Thu, 19 Feb 2026)

Changed paths:
M doc/toolchain.rst
M hilti/toolchain/include/compiler/detail/optimizer/pass.h
M hilti/toolchain/src/compiler/optimizer/pass.cc

Log Message:
-----------
Add environment variable `HILTI_DISABLE_OPTIMIZER_PASSES`.

We used to have an environment variable to specify which optimizer
passes to run. This brings it back in inverse: a colon-separated list
of passes to disable. Leaving out individual passes seems more useful
than having to list all passes that one wants to run.

Not documenting the names of passes as this is primarily for
development purposes.


Commit: c519dd5839c79523948e56653f0e8a70bfae1085
https://github.com/zeek/spicy/commit/c519dd5839c79523948e56653f0e8a70bfae1085
Author: Robin Sommer <ro...@corelight.com>
Date: 2026-02-19 (Thu, 19 Feb 2026)

Changed paths:
M doc/toolchain.rst
M hilti/toolchain/include/compiler/context.h
M hilti/toolchain/src/compiler/driver.cc
M spicy/toolchain/bin/spicy-driver.cc
M spicy/toolchain/bin/spicy-dump/main.cc

Log Message:
-----------
Add new options `--[no-]strict-public-api` to toolchain commands.

If active, this disallows any optimizations that affect the external
C++ API of the generated code. By default, this is on when generating
debug code and off when generating release code.


Commit: 335e1dbd3c11cd7f87d25c21a996dc42aeff5a0e
https://github.com/zeek/spicy/commit/335e1dbd3c11cd7f87d25c21a996dc42aeff5a0e
Commit: ab72f7f7ce5121ec34e2c2cc1535b18a6baaa964
https://github.com/zeek/spicy/commit/ab72f7f7ce5121ec34e2c2cc1535b18a6baaa964
Author: Robin Sommer <ro...@corelight.com>
Date: 2026-02-19 (Thu, 19 Feb 2026)

Changed paths:
M spicy/toolchain/include/ast/attribute.h
M spicy/toolchain/include/ast/types/unit-items/variable.h
M spicy/toolchain/src/compiler/codegen/parser-builder.cc
M spicy/toolchain/src/compiler/codegen/unit-builder.cc
M spicy/toolchain/src/compiler/parser/scanner.ll
M spicy/toolchain/src/compiler/validator.cc

Log Message:
-----------
Add `&always-emit` attribute to Spicy.

This attribute already existed at the HILTI level to express that
struct fields are not to be skipped from the emitted code. We allow
the same in Spicy now for unit fields, and carry the attribute through
to the corresponding Spicy struct.


Commit: 37b700c728facfd68f3157410e5efba44da762fd
https://github.com/zeek/spicy/commit/37b700c728facfd68f3157410e5efba44da762fd
Commit: 6c93fb43e32d7ea656976ded605ed2050b47dfe6
https://github.com/zeek/spicy/commit/6c93fb43e32d7ea656976ded605ed2050b47dfe6
Author: Robin Sommer <ro...@corelight.com>
Date: 2026-02-19 (Thu, 19 Feb 2026)

Changed paths:
M hilti/toolchain/src/compiler/printer.cc
M spicy/toolchain/src/compiler/printer.cc

Log Message:
-----------
Add null checks to AST printers.

For convenience, to avoid caller-side checks.


Commit: 533c7c810042da2031c87d0ae94a8ee482761399
https://github.com/zeek/spicy/commit/533c7c810042da2031c87d0ae94a8ee482761399
Commit: 77fe1b7472e1654b5243a8d369af99d3c7d043b6
https://github.com/zeek/spicy/commit/77fe1b7472e1654b5243a8d369af99d3c7d043b6
Author: Robin Sommer <ro...@corelight.com>
Date: 2026-02-19 (Thu, 19 Feb 2026)

Changed paths:
M hilti/toolchain/include/ast/attribute.h
M hilti/toolchain/include/ast/ctors/struct.h
M hilti/toolchain/include/ast/ctors/tuple.h
M hilti/toolchain/include/ast/expressions/assign.h
M hilti/toolchain/include/ast/expressions/resolved-operator.h
M hilti/toolchain/include/ast/node.h
M hilti/toolchain/include/ast/types/operand-list.h
M hilti/toolchain/src/compiler/cfg.cc

Log Message:
-----------
Add a couple of AST node editing methods.

Most of the these allow detaching an existing child expression from a
node, to then re-use it elsewhere without requiring a deep copy.


Commit: 2adda9c7d455278a462fc7a64743081b8c02ef1a
https://github.com/zeek/spicy/commit/2adda9c7d455278a462fc7a64743081b8c02ef1a
Commit: d2abe13c6e7f022969c906a772ac90faf303a0fe
https://github.com/zeek/spicy/commit/d2abe13c6e7f022969c906a772ac90faf303a0fe
Author: Robin Sommer <ro...@corelight.com>
Date: 2026-02-19 (Thu, 19 Feb 2026)

Changed paths:
M hilti/toolchain/include/compiler/detail/cfg.h
M hilti/toolchain/src/ast/ast-context.cc
M hilti/toolchain/src/compiler/cfg.cc

Log Message:
-----------
Fix CFG logic for adding function parameters.

I was getting assertion errors and noticed the logic wasn't making use
of the AST information that the resolver computes for types linked to
methods. So this switches that over.

It's a slightly larger change because we need to get the CFG access to
the AST context, which is a bit of hassle to get it in place. On the
plus side, having the context available seems generally useful for the
CFG class, so that seems ok.


Commit: d8a1e3ea7913b9a05d0488e6c5be447e30c2400c
https://github.com/zeek/spicy/commit/d8a1e3ea7913b9a05d0488e6c5be447e30c2400c
Commit: c02a51548f62d70dea1985202671d5cab2ea6485
https://github.com/zeek/spicy/commit/c02a51548f62d70dea1985202671d5cab2ea6485
Author: Robin Sommer <ro...@corelight.com>
Date: 2026-02-19 (Thu, 19 Feb 2026)

Changed paths:
M hilti/toolchain/src/compiler/resolver.cc

Log Message:
-----------
Improve tuple assignment.

We would in some cases introduce a temporary where we didn't need to.
Also adding a check to catch coercion errors, which could previously
end up not being reported.


Commit: 79d44f786c8570853284d376c2ac6da485680f9e
https://github.com/zeek/spicy/commit/79d44f786c8570853284d376c2ac6da485680f9e
Commit: c2521ef5907a6048a3e901a0a60aa2dea388dade
https://github.com/zeek/spicy/commit/c2521ef5907a6048a3e901a0a60aa2dea388dade
Commit: 640f41129e576ae10ea4f7d398d46364aba10abe
https://github.com/zeek/spicy/commit/640f41129e576ae10ea4f7d398d46364aba10abe
Author: Robin Sommer <ro...@corelight.com>
Date: 2026-02-19 (Thu, 19 Feb 2026)

Changed paths:
M hilti/toolchain/include/compiler/detail/cfg.h
M hilti/toolchain/src/compiler/cfg.cc
M hilti/toolchain/src/compiler/optimizer/passes/remove-unused-fields.cc

Log Message:
-----------
Provide two flow-based helpers through the CFG context.

The first provides flow information for a given expression, the second
determines if a given expression might contain side effects. Right
now, both are approximate, as we don't have expression-level dataflow
tracking yet. In the future, these should be able to become more
precise.


Commit: becf12a2166e1f35451de47e3923f9dbeb1c664d
https://github.com/zeek/spicy/commit/becf12a2166e1f35451de47e3923f9dbeb1c664d
Author: Robin Sommer <ro...@corelight.com>
Date: 2026-02-19 (Thu, 19 Feb 2026)

Changed paths:
M hilti/toolchain/include/compiler/detail/cfg.h
M hilti/toolchain/src/compiler/cfg.cc
M hilti/toolchain/src/compiler/optimizer/passes/dead-code-static.cc
M hilti/toolchain/src/compiler/optimizer/passes/remove-unused-fields.cc
M hilti/toolchain/src/compiler/optimizer/passes/remove-unused-params.cc
M tests/Baseline/hilti.optimization.dataflow-unreachable/output
M tests/Baseline/hilti.optimization.unimplemented_hook/log
M tests/Baseline/hilti.optimization.unused-struct-fields/output
M tests/Baseline/spicy.optimization.default-parser-functions/log
M tests/Baseline/spicy.optimization.feature_requirements/log
M tests/Baseline/spicy.optimization.unused-functions/log
M tests/Baseline/spicy.optimization.unused-types/log

Log Message:
-----------
Use new helper for side effects elsewhere.


Commit: 09d3f0998d77615cbe1e9bd09cfe91c00439f7b8
https://github.com/zeek/spicy/commit/09d3f0998d77615cbe1e9bd09cfe91c00439f7b8
Author: Robin Sommer <ro...@corelight.com>
Date: 2026-02-19 (Thu, 19 Feb 2026)

Changed paths:
M hilti/toolchain/include/ast/ast-context.h
M hilti/toolchain/src/ast/ast-context.cc
M tests/Baseline/hilti.ast.basic-module/debug.log
M tests/Baseline/hilti.ast.imported-id/output
M tests/Baseline/hilti.ast.types/output
M tests/Baseline/spicy.types.unit.canonical-ids-with-import/output
M tests/Baseline/spicy.types.unit.canonical-ids/output

Log Message:
-----------
Compute AST dependencies always right after resolving.

Before, it was pretty inconsistent when exactly the information would
be available. In particular it wasn't available to post-compilation
hooks, which was unfortunate. With this change, we can now leverage
dependencies on the Zeek side.

Implementation note: We need to make the dependency computation a bit
more robust here now because it can potentially run on a not validated
(and hence invalid) AST. That can happen if the resolver flags any
errors. On the other hand, we can't easily run the validator just
before the dependency computation because that would change some
assumptions on when exactly validation runs, potentially leading to
different results.


Commit: c31bd8557e82f6fdf5ffcf792825a8fcc59f9998
https://github.com/zeek/spicy/commit/c31bd8557e82f6fdf5ffcf792825a8fcc59f9998
Author: Robin Sommer <ro...@corelight.com>
Date: 2026-02-19 (Thu, 19 Feb 2026)

Changed paths:
M hilti/toolchain/src/compiler/optimizer/passes/remove-unused-fields.cc
M tests/Baseline/hilti.optimization.unused-struct-fields/output

Log Message:
-----------
Fix bug with side-effect-having expressions in field optimizer pass.


Commit: 383bff1a4cb78d52d825410bf756063910332593
https://github.com/zeek/spicy/commit/383bff1a4cb78d52d825410bf756063910332593
Author: Robin Sommer <ro...@corelight.com>
Date: 2026-02-19 (Thu, 19 Feb 2026)

Changed paths:
M hilti/toolchain/src/ast/types/struct.cc
M spicy/toolchain/src/ast/types/unit.cc
M tests/Baseline/hilti.ast.basic-module/debug.log
M tests/Baseline/hilti.ast.coercion/output
M tests/Baseline/hilti.ast.imported-id/output
M tests/Baseline/hilti.ast.types/output
M tests/Baseline/hilti.expressions.ctor-replacement/output

Log Message:
-----------
Fix ill-defined declaration linkage.

At a couple places, we weren't passing a (well-defined) linkage to
expression declarations. The linkage doesn't really matter
functionally but shows up in debug output, so make it consistent.


Commit: 7ac08ab13ad7f25013c10fd843401e86508ee475
https://github.com/zeek/spicy/commit/7ac08ab13ad7f25013c10fd843401e86508ee475
Commit: 4a0055ef9d5989ff864f3a2372c7fa281910fd7a
https://github.com/zeek/spicy/commit/4a0055ef9d5989ff864f3a2372c7fa281910fd7a
Author: Robin Sommer <ro...@corelight.com>
Date: 2026-02-20 (Fri, 20 Feb 2026)

Changed paths:
M CHANGES
M VERSION
M doc/examples/_usage-spicy-driver.output
M doc/examples/_usage-spicy-dump.output
M doc/examples/_usage-spicyc.output
M doc/host-applications.rst
M doc/programming/examples/_anonymous-field.spicy.output
M doc/programming/examples/_basic-unit-module-with-default.spicy.output
M doc/programming/examples/_basic-unit-module.spicy.output
A doc/programming/examples/_basic-unit-module.spicy.output_2
M doc/programming/examples/_basic-unit-parse-byte-order.spicy.output
M doc/programming/examples/_basic-unit-parse.spicy.output
M doc/programming/examples/_constant-field.spicy.output_1
M doc/programming/examples/_constant-field.spicy.output_2
M doc/programming/examples/_context-empty.spicy.output
R doc/programming/examples/_debug-hooks.spicy.output
M doc/programming/examples/_max-size.spicy.output
M doc/programming/examples/_mylibrary.spicy.output
R doc/programming/examples/_parse-void-size.spicy.output
M doc/programming/examples/_regexp.spicy.output
M doc/programming/examples/_size.spicy.output
M doc/programming/examples/_skip.spicy.output
M doc/programming/examples/_unit-params-string.spicy.output
M doc/programming/examples/_unit-params-vector.spicy.output
M doc/programming/examples/_unit-params.spicy.output
M doc/programming/examples/_unit-vars-init.spicy.output
M doc/programming/examples/_unit-vars-optional.spicy.output
M doc/programming/examples/_unit-vars.spicy.output
M doc/programming/language/index.rst
A doc/programming/language/optimization.rst
M doc/programming/language/statements.rst
M doc/programming/parsing.rst
M doc/toolchain.rst
M doc/tutorial/examples/_rrq.spicy.output_1
M doc/tutorial/examples/_rrq.spicy.output_2
M doc/tutorial/examples/_tftp-1.spicy.output
M doc/tutorial/examples/_tftp-2.spicy.output
M doc/tutorial/examples/_tftp-3.spicy.output_1
M doc/tutorial/examples/_tftp-4.spicy.output
M doc/tutorial/examples/_tftp-complete-1.spicy.output
M doc/tutorial/examples/_tftp-enum.spicy.output
M doc/tutorial/examples/_tftp-unified-request.spicy.output
M doc/tutorial/index.rst
M hilti/lib/hilti.hlt
M hilti/runtime/include/type-info.h
M hilti/runtime/include/types/bitfield.h
M hilti/runtime/include/types/struct.h
M hilti/toolchain/CMakeLists.txt
M hilti/toolchain/include/ast/ast-context.h
M hilti/toolchain/include/ast/attribute.h
M hilti/toolchain/include/ast/builder/builder.h
M hilti/toolchain/include/ast/builder/node-factory.h
M hilti/toolchain/include/ast/ctors/struct.h
M hilti/toolchain/include/ast/ctors/tuple.h
M hilti/toolchain/include/ast/declaration.h
M hilti/toolchain/include/ast/declarations/all.h
A hilti/toolchain/include/ast/declarations/export.h
M hilti/toolchain/include/ast/declarations/field.h
M hilti/toolchain/include/ast/expressions/assign.h
M hilti/toolchain/include/ast/expressions/grouping.h
M hilti/toolchain/include/ast/expressions/resolved-operator.h
M hilti/toolchain/include/ast/forward.h
M hilti/toolchain/include/ast/node-tag.h
M hilti/toolchain/include/ast/node.h
M hilti/toolchain/include/ast/types/operand-list.h
M hilti/toolchain/include/ast/visitor-dispatcher.h
M hilti/toolchain/include/base/util.h
M hilti/toolchain/include/compiler/context.h
M hilti/toolchain/include/compiler/detail/cfg.h
M hilti/toolchain/include/compiler/detail/cxx/elements.h
M hilti/toolchain/include/compiler/detail/optimizer/pass-id.h
M hilti/toolchain/include/compiler/detail/optimizer/pass.h
M hilti/toolchain/src/ast/ast-context.cc
M hilti/toolchain/src/ast/node.cc
M hilti/toolchain/src/ast/operator-registry.cc
M hilti/toolchain/src/ast/scope-lookup.cc
M hilti/toolchain/src/ast/types/struct.cc
M hilti/toolchain/src/compiler/cfg.cc
M hilti/toolchain/src/compiler/codegen/codegen.cc
M hilti/toolchain/src/compiler/codegen/ctors.cc
M hilti/toolchain/src/compiler/codegen/expressions.cc
M hilti/toolchain/src/compiler/codegen/types.cc
M hilti/toolchain/src/compiler/constant-folder.cc
M hilti/toolchain/src/compiler/cxx/elements.cc
M hilti/toolchain/src/compiler/driver.cc
M hilti/toolchain/src/compiler/optimizer/pass.cc
M hilti/toolchain/src/compiler/optimizer/passes/dead-code-static.cc
M hilti/toolchain/src/compiler/optimizer/passes/peephole.cc
M hilti/toolchain/src/compiler/optimizer/passes/propagate-function-returns.cc
A hilti/toolchain/src/compiler/optimizer/passes/remove-unused-fields.cc
M hilti/toolchain/src/compiler/optimizer/passes/remove-unused-params.cc
M hilti/toolchain/src/compiler/parser/parser.yy
M hilti/toolchain/src/compiler/parser/scanner.ll
M hilti/toolchain/src/compiler/printer.cc
M hilti/toolchain/src/compiler/resolver.cc
M hilti/toolchain/src/compiler/validator.cc
M spicy/toolchain/bin/spicy-driver.cc
M spicy/toolchain/bin/spicy-dump/main.cc
M spicy/toolchain/bin/spicy-dump/printer-json.cc
M spicy/toolchain/bin/spicy-dump/printer-text.cc
M spicy/toolchain/include/ast/attribute.h
M spicy/toolchain/include/ast/types/unit-items/variable.h
M spicy/toolchain/src/ast/types/unit.cc
M spicy/toolchain/src/compiler/codegen/codegen.cc
M spicy/toolchain/src/compiler/codegen/parser-builder.cc
M spicy/toolchain/src/compiler/codegen/unit-builder.cc
M spicy/toolchain/src/compiler/parser/parser.yy
M spicy/toolchain/src/compiler/parser/scanner.ll
M spicy/toolchain/src/compiler/printer.cc
M spicy/toolchain/src/compiler/resolver.cc
M spicy/toolchain/src/compiler/validator.cc
M tests/Baseline/hilti.ast.basic-module/debug.log
M tests/Baseline/hilti.ast.coercion/output
M tests/Baseline/hilti.ast.imported-id/output
M tests/Baseline/hilti.ast.types/output
M tests/Baseline/hilti.cfg.assert/output
M tests/Baseline/hilti.cfg.assign/output
M tests/Baseline/hilti.cfg.dead-write-shadowed/output
M tests/Baseline/hilti.cfg.empty/output
M tests/Baseline/hilti.cfg.for/output
M tests/Baseline/hilti.cfg.if/output
M tests/Baseline/hilti.cfg.local-struct-value/output
M tests/Baseline/hilti.cfg.no-dataflow/output
M tests/Baseline/hilti.cfg.return/output
M tests/Baseline/hilti.cfg.simple-statements/output
M tests/Baseline/hilti.cfg.struct_member_access/output
M tests/Baseline/hilti.cfg.switch/output
M tests/Baseline/hilti.cfg.try/output
M tests/Baseline/hilti.cfg.unreachable-return/output
M tests/Baseline/hilti.cfg.while/output
M tests/Baseline/hilti.expressions.ctor-replacement/output
M tests/Baseline/hilti.expressions.grouping-with-local/output
M tests/Baseline/hilti.optimization.dataflow-unreachable/output
A tests/Baseline/hilti.optimization.no-emit/output
A tests/Baseline/hilti.optimization.no-emit/output.c++
M tests/Baseline/hilti.optimization.unimplemented_hook/log
M tests/Baseline/hilti.optimization.unreachable-code/log
M tests/Baseline/hilti.optimization.unused-init/output
A tests/Baseline/hilti.optimization.unused-struct-fields/output
M tests/Baseline/hilti.optimization.unused_function/log
M tests/Baseline/hilti.types.struct.canonical-ids/output
A tests/Baseline/hilti.types.struct.export-fail/output
A tests/Baseline/hilti.types.struct.export/output
M tests/Baseline/hilti.types.struct.on-heap/output
M tests/Baseline/spicy.optimization.default-parser-functions/log
M tests/Baseline/spicy.optimization.default-parser-functions/noopt.hlt
M tests/Baseline/spicy.optimization.default-parser-functions/opt.hlt
M tests/Baseline/spicy.optimization.feature_requirements/log
M tests/Baseline/spicy.optimization.unused-functions/log
M tests/Baseline/spicy.optimization.unused-functions/noopt.hlt
M tests/Baseline/spicy.optimization.unused-functions/opt.hlt
M tests/Baseline/spicy.optimization.unused-types/log
M tests/Baseline/spicy.optimization.unused-types/noopt.hlt
M tests/Baseline/spicy.optimization.unused-types/opt.hlt
M tests/Baseline/spicy.rt.debug-trace/.stderr
M tests/Baseline/spicy.types.bitfield.anonymous-field-with-switch/output
M tests/Baseline/spicy.types.bitfield.anonymous-field/output
M tests/Baseline/spicy.types.function.cxxname-normalization/output
M tests/Baseline/spicy.types.unit.canonical-ids-with-import/output
M tests/Baseline/spicy.types.unit.canonical-ids/output
A tests/Baseline/spicy.types.unit.export/output
M tests/Baseline/spicy.types.unit.self-recursive/output
M tests/Baseline/spicy.types.unit.switch-blocks-with-laheads/output
M tests/Baseline/spicy.types.unit.switch-if-expr/output
M tests/Baseline/spicy.types.unit.switch-if-lahead/output
M tests/Baseline/spicy.types.unit.switch-nested-lahead/output
M tests/Baseline/spicy.types.unit.synchronize-after/output
M tests/Baseline/spicy.types.unit.synchronize-at/output
M tests/Baseline/spicy.types.unit.synchronize-confirm-elsewhere/output
M tests/Baseline/spicy.types.unit.synchronize-parse-error-during-trial-mode/output
M tests/hilti/cfg/dead-write-shadowed.hlt
M tests/hilti/cfg/unreachable-return.hlt
M tests/hilti/expressions/default-ctor.hlt
M tests/hilti/expressions/grouping-with-local.hlt
A tests/hilti/optimization/no-emit.hlt
A tests/hilti/optimization/unused-struct-fields.hlt
M tests/hilti/rt/print.hlt
M tests/hilti/types/reference/weak-from-value-ref-struct.hlt
M tests/hilti/types/struct/ctor.hlt
A tests/hilti/types/struct/export-fail.hlt
A tests/hilti/types/struct/export.hlt
M tests/hilti/types/struct/method-auto-param.hlt
M tests/hilti/types/struct/on-heap-cyclic.hlt
M tests/hilti/types/struct/on-heap.hlt
M tests/hilti/types/struct/params-init-ambiguity.hlt
M tests/hilti/types/struct/static-field.hlt
M tests/hilti/types/struct/string-conversion.hlt
M tests/hilti/types/tuple/ctor.hlt
M tests/hilti/use-cases/parse-bytes.hlt
M tests/spicy/cfg/unit-parameter.spicy
M tests/spicy/optimization/error-push-pop.spicy
M tests/spicy/types/unit/attribute-access.spicy
M tests/spicy/types/unit/backtrack-lah.spicy
M tests/spicy/types/unit/backtrack-on-error.spicy
M tests/spicy/types/unit/backtrack.spicy
M tests/spicy/types/unit/block.spicy
M tests/spicy/types/unit/conditional-parse-at.spicy
M tests/spicy/types/unit/context-inout.spicy
A tests/spicy/types/unit/export.spicy
M tests/spicy/types/unit/external-global-vars.spicy
M tests/spicy/types/unit/external-hooks-unit-arg.spicy
M tests/spicy/types/unit/filter-chained.spicy
M tests/spicy/types/unit/filter-in-sub.spicy
M tests/spicy/types/unit/filter.spicy
M tests/spicy/types/unit/hooks-across-imports.spicy
M tests/spicy/types/unit/params-for-vars.spicy
M tests/spicy/types/unit/print-hook-nested.spicy
M tests/spicy/types/unit/size-side-effects.spicy
M tests/spicy/types/unit/struct-ctor-init.spicy
M tests/spicy/types/unit/switch-blocks-with-lists.spicy
M tests/spicy/types/unit/switch-blocks.spicy
M tests/spicy/types/unit/switch-convert-mixed.spicy
Merge remote-tracking branch 'origin/topic/robin/remove-unused-fields'

* origin/topic/robin/remove-unused-fields: (21 commits)
Updating documentation for optimizer changes.
Fix ill-defined declaration linkage.
Fix bug with side-effect-having expressions in field optimizer pass.
Compute AST dependencies always right after resolving.
Use new helper for side effects elsewhere.
Provide two flow-based helpers through the CFG context.
Parse fields into stack variables first.
Add new optimizer pass removing unused struct fields.
Improve tuple assignment.
Switch tests to debug builds.
Fix CFG logic for adding function parameters.
Extend groupings to support multiple expressions.
Add a couple of AST node editing methods.
Expose a couple of helper runtime functions to throw exceptions.
Add null checks to AST printers.
Add new linkage `export`.
Add `&always-emit` attribute to Spicy.
Extend `&no-emit` attribute with string argument support.
Add new options `--[no-]strict-public-api` to toolchain commands.
Add environment variable `HILTI_DISABLE_OPTIMIZER_PASSES`.
...


Compare: https://github.com/zeek/spicy/compare/3142d1933eb0...4a0055ef9d59
Reply all
Reply to author
Forward
0 new messages