-
Notifications
You must be signed in to change notification settings - Fork 584
Allow automatic long name macro generation #23434
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
base: blead
Are you sure you want to change the base?
Conversation
This makes it easier to edit, and conforms to our tab policy
This is in preparation for the next commit.
This reverts to the naming that prevailed until 5.41: #define foo bar The Perl_ prefixes were introduced in expectation that a scheme would be used to allow a bunch of functions to be converted to macros. This actually didn't work, so was reverted by GH Perl#23209. However those #define changes didn't need to be reverted, so weren't A revised scheme is now being introduced in the next commit, which needs the original #define forms. So this commit reverts back to those.
Prior to this commit, a macro that doesn't deal with thread context can have its long 'Perl_foo' name form be automatically generated. This was added in 5.41 by GH Perl#22691. I had thought it worked in all cases, but the threaded case had to be reverted by Perl#23209. The original scheme was too simplistic. This new commit reintroduces the thread context automatic handling, but isn't so naive this time. This commit will enable the emptying of much of mathoms.c, and the removal of quite a few similar functions scattered throughout the code. The next commit will convert the first such function, as a proof of concept.
This was an inline function; it would have originally been a macro if we didn't have to worry about thread context. The previous commit allows us to not have to consider that.
# An all uppercase macro name gets an uppercase prefix. | ||
return ($flags =~ /m/ && $flags =~ /p/ && $func !~ /[[:lower:]]/) | ||
? "PERL_$func" | ||
: "Perl_$func"; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this a white space only chunk? or a code change?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The first commit in this p.r. separates out all the white space changes from code changes.
@@ -720,4 +759,4 @@ sub update_headers { | |||
|
|||
update_headers() unless caller; | |||
|
|||
# ex: set ts=8 sts=4 sw=4 noet: | |||
# ex: set ts=8 sts=4 sw=4 et: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Umm ... ??? Why was this sent thru astyle or clangformat?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't understand this comment. It was not sent through those things. The commit message for the commit that changes it explains why it was done
Prior to this p.r., a macro that doesn't deal with thread context can have its long 'Perl_foo' name form be automatically generated. This was added in 5.41 by GH #22691. I had thought it worked in all cases, but the threaded case had to be reverted by #23209.
The original scheme was too simplistic. This new series of commits reintroduces the thread context automatic handling, but isn't so naive this time.
This will enable the emptying of much of mathoms.c, and the removal of quite a few similar functions scattered throughout the code.
The final commit converts the first such function, as a proof of concept.
This request should be merged before the final disposition of #23421, as this accomplishes much of what that one does without requiring new syntax