Branch: refs/heads/topic/robin/remove-unused-fields
Home:
https://github.com/zeek/spicy
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
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: 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
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: 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
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: 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
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: 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
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: 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
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: c2521ef5907a6048a3e901a0a60aa2dea388dade
https://github.com/zeek/spicy/commit/c2521ef5907a6048a3e901a0a60aa2dea388dade
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: 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
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/5ddc13ec39e7...7ac08ab13ad7
To unsubscribe from these emails, change your notification settings at
https://github.com/zeek/spicy/settings/notifications