-
Notifications
You must be signed in to change notification settings - Fork 8k
Generate C enums from internal enums, introduce Z_PARAM_ENUM() #20917
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
Open
arnaud-lb
wants to merge
22
commits into
php:master
Choose a base branch
from
arnaud-lb:enum-c-enum
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+464
−153
Open
Changes from all commits
Commits
Show all changes
22 commits
Select commit
Hold shift + click to select a range
6a32aa9
Make ZEND_AST_CONST_ENUM_INIT a 4-children node
arnaud-lb ddbe6e8
Store enum case id in ZEND_AST_CONST_ENUM_INIT
arnaud-lb 7cb52e1
Store enum case id in instance
arnaud-lb 04f5516
Expose enum case_id internally
arnaud-lb 931ef2e
Generate C enum for internal enums
arnaud-lb 4ba42da
Port ext/random
arnaud-lb 1a8c2ab
Z_PARAM_ENUM()
arnaud-lb b9bf559
ext/dom
arnaud-lb 1fdeb57
ext/pcntl
arnaud-lb 37402d4
ext/reflection
arnaud-lb 5c37810
ext/uri
arnaud-lb 830fa82
ext/standard
arnaud-lb d52a4f0
ext/bcmath
arnaud-lb d02e229
Remove underscore
arnaud-lb 5ca5760
Switch to int
arnaud-lb a4b7313
Fix build
arnaud-lb 734389e
Mark generated files
arnaud-lb adfa289
Header guards
arnaud-lb 0af48e0
WS
arnaud-lb 8607f51
Remove default case
arnaud-lb 804e7fa
Include _decl.h from the extension main header
arnaud-lb 816e94c
Switch over enum constants
arnaud-lb File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
This assert is redundant with the one in
zend_enum_obj_from_obj(). I also don't see how it could help with codegen.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 though about this when adding this assert, but if we consider functions as opaque APIs, we don't know that
zend_enum_obj_from_obj()has redundant asserts.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.
That is fair, but in this case it is probably reasonable to expect
zend_enum_obj_from_obj()to do the verification (if necessary), since that's the purpose of the function, especially since a failed assert is always a programmer error.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.
No particularly strong feelings either way, though.