After upgrading our (ClickHouse's) libcxx from 15 to 16, the compiler
started to complain about usage of an incomplete type "RoseInstruction"
in this (header) function:
void RoseProgram::replace(Iter it, std::unique_ptr<RoseInstruction> ri) {
...
The reason is that libcxx 16 is the first version which implements C++23
constexpr std::unique_ptr (P2273R3, see (*)). RoseProgram::replace()
happens to be be const-evaluatable and the compiler tries to run
std::unique_ptr's ctor + dtor. This fails because at this point
RoseInstruction isn't defined yet.
There are two ways of fixing this:
1. Include rose_build_instruction.h (which contains RoseInstruction)
into rose_build_program.h. Disadvantage: The new include will
propagate transitively into all callers.
2. Move the function implementation into the source file which sees
RoseInstruction's definition already. Disadvantage: Template
instantiation is no longer automatic, instead there must be either a)
explicit template instantiation (e.g. in rose_build_program.cpp) or
b) all callers which instantiate the function must live in the same
source file and do the instantiations by themselves. Fortunately, the
latter is the case here, but potential future code outside
rose_build_program.cpp will require ugly explicit instantiation.
(*) https://en.cppreference.com/w/cpp/23
The scheme utilises the MATCH and NMATCH instructions to
scan for 16 characters at the same rate as vermicelli
scans for one.
Change-Id: Ie2cef904c56651e6108593c668e9b65bc001a886
Design compile time api hs_compile_lit() and hs_compile_lit_multi()
to handle pure literal pattern sets. Corresponding option --literal-on
is added for hyperscan testing suites. Extended parameters and part of
flags are not supported for this api.
We avoid merging different transient engines as it may force us to run heavier
engines and no stream state is consumed either way. However, there should be
no harm in just removing duplicate instances of a transient engine.