Honour @:keep meta
Reflaxe does not honour the @:keep meta which says
If used on a class, the class along with all fields is unaffected by DCE. If used on a field, that field is unaffected by DCE.
https://haxe.org/manual/cr-dce.html
Other targets will always generate a class that has @:keep meta regardless of if it is used or not.
Yeahhh, reflaxe/C++ has its own custom DCE system (kind of like the JS target), but I completely forgot to account for @:keep. Good find!! ^^
Hah, that explains why the DCE is so good, on the Lua target compiling function main() {} with --dce=full outputs about 700 lines of Lua.
Also FYI there's a @:dce meta you can apply to types as well which
Forces dead code elimination even when
--dce fullis not specified.
@:keep should be fixed if you update Reflaxe, but leaving this open since also need to resolve @:dce 👌
Aha now it make sense In my go target, I had too keep smartDCE off otherwise I was losing some importent classes, next time I will try to fine a common denominator.