-
Notifications
You must be signed in to change notification settings - Fork 37
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
supports_filter
optimization doesn't kick in
#1399
Comments
For testing purposes, here's patch that generally disables filter support: https://gist.github.com/rsmmr/38aa07d5adc50381513f4fbccf08f2ce |
We should probably also double check other optimizations if they work as intended. |
I checked the code generated from a version before we added optimizations (v1.1.0), and it looks like even then we would have emitted the |
The issue here seems to be that we unconditionally access This was not an issue for method method tuple<view<stream>, int<64>, iterator<stream>, optional<hilti::RecoverableFailure>> Test::Foo::__parse_Test_Foo_stage2(inout value_ref<stream> __data, copy view<stream> __cur, copy bool __trim, copy int<64> __lah, copy iterator<stream> __lahe, copy optional<hilti::RecoverableFailure> __error) {
# "/tmp/bla.spicy:3:19-5:2"
local tuple<view<stream>, int<64>, iterator<stream>, optional<hilti::RecoverableFailure>> __result;
# "/tmp/bla.spicy:7:12-10:2"
# Begin parsing production: Unit: Test_Bar -> x y
(*self).bar = default<Bar>();
(__cur, __lah, __lahe, __error) = (*(*self).bar).__parse_stage1(__data, __cur, __trim, __lah, __lahe, __error);
# End parsing production: Unit: Test_Bar -> x y
... Adding full support for removing filters would roughly look like this:
|
Fortunately this turned out to be easier to implement than I have anticipated since I didn't to implement requirements on The only piece breaking this previously was the unguarded access to the It also turned out we already had above reproducer in our existing baselines. With above patch we now remove filter support as well in that case (in addition to all other optional parser features we already removed previously). |
Also backported to |
No filters in use, but we still generate this code:
In fact, if I remember right, originally (i.e., before we switched to automatic optimization), we wouldn't be generating the
stage1
function at all if the unit didn't need to support filtering.The text was updated successfully, but these errors were encountered: