zeek / spicy

C++ parser generator for dissecting protocols & files.
https://docs.zeek.org/projects/spicy
Other
243 stars 37 forks source link

Trim inline code emitted more than once #1801

Closed bbannier closed 3 weeks ago

bbannier commented 1 month ago

Closes #1800.

bbannier commented 1 month ago

This works now. I tested this with a big internal Zeek analyzer, and due to more granular dependency tracking we end up generating type infos in more files than before which causes us to emit more code. I suspect type info constants could be expensive to compile so we should ideally trim this down. This is tricky since we might e.g., instantiate a value ref over a custom type in a certain module only, so it is not immediately clear where we should emit these (additionally we do not emit C++ unit for builtin modules).

bbannier commented 3 weeks ago

Now part of #1822.