-
Notifications
You must be signed in to change notification settings - Fork 598
makedef.pl: Eliminate need for embed.fnc sync #23858
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
Conversation
d3aeae7
to
c668745
Compare
I see:
No existing APIs have O without p that I could see, and I don't think we want to encourage new ones. |
typo (extra |
Linuxs -> Linux? |
All fixed. I now forbid the O flag without p. This led to removing the special list in regen/embed.pl which merely duplicates the knowledge conveyed by the O flag entries. No need to duplicate this knowledge. |
Otherwise fine |
A misspelling and a run-on sentence
And add some comments in embed.fnc
The list consists of exactly the functions that have the O flag set in embed.fnc. No need to keep this data twice. The entries are trivially generatable from existing entries as we go along And those generated entries have the added advantage of not using the short name, so potentially less name space pollution
A future commit will refer to this further below; better to have a name than $_ for that.
This is so the string doesn't have to be repeated
The 'o' flag requires a Perl_prefix, so shouldn't skip it. Perhaps it was a typo, meant to be the 'O' flag. But that flag now also requires the p flags, so also a Perl_prefix.
This was in a #ifdef of being in sv.c, which it is, but since it is public, it needs to be moved out of this. This removes the need for a copy of its prototype to be in sv_inline.h
There is unfortunately some duplication required in makedef.pl copied from perl.h. This adds some more for two variables, required for the next commit, which will remove far more lines from makedef.pl than this adds
makedef.pl has to manually be kept in sync with various other pieces of code. It has to know the conditionals that various symbols are compiled under. This is extra work, and error prone. This commit eliminates that need for embed.fnc syncing. The relatively new HeaderParser already returns the information about what conditionals are in effect that we need in its object for each entry. This commit just takes advantage of that, and removes the many lines that were previously needed for this purpose. Running this under Linux with PLATFORM=test revealed about a dozen symbols that would have been needlessly exported, such as Perl_grok_bslash_x(), which is only defined in certain files, and not globally.
makedef.pl has to manually be kept in sync with various other pieces of code. This is extra work, and error prone. This commit eliminates that need for embed.fnc syncing.
The relatively new HeaderParser already returns the information we need in its object for each entry. This commit just takes advantage of that, and removes the many lines that were previously needed for this purpose.
Running this under Linux with PLATFORM=test revealed nearly 50 symbols that would have been needlessly exported, such as Perl_grok_bslash_x(), which is only defined in certain files, and not globally.