-
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
Explore automatically marking anon fields skip
if its value is not accessed
#1872
Comments
If the field is anonymous, one can't install a hook, no? Seems reasonable to to imply "cannot be accessed and imply skip" even if the unit is public, no? |
Of course 🤦, since one cannot refer to anon fields elsewhere, hooks on them have to be defined inline! |
I don't think this is the case. How would you add a hook implementation in custom C++? For that to run, it would need to be called from the generated hook stub, which won't know anything about the hook. Or am I missing something? |
The value from an anonymous field is not accessed via
$$
in attributes like e.g.,&convert
or&requires
, or hooks it should always be possible to automatically mark itskip
.While checking the attributes can be done locally, checking forWe can make use of the fact that one can only add hooks to anon fields inline.$$
in hooks would require global analysis looking at all files in the compilation. If the unit ispublic
we can never make this optimization since hooks might be implemented in C++ which we cannot inspect.The text was updated successfully, but these errors were encountered: