-
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
31
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.
+579
−210
Open
Changes from all commits
Commits
Show all changes
31 commits
Select commit
Hold shift + click to select a range
452b8c6
Make ZEND_AST_CONST_ENUM_INIT a 4-children node
arnaud-lb c2d5e59
Store enum case id in ZEND_AST_CONST_ENUM_INIT
arnaud-lb 30addd5
Store enum case id in instance
arnaud-lb 156c340
Expose enum case_id internally
arnaud-lb 5bd0b89
Generate C enum for internal enums
arnaud-lb ffd98fa
Port ext/random
arnaud-lb 79fdec2
Z_PARAM_ENUM()
arnaud-lb 1bcd8ff
ext/dom
arnaud-lb fd3c8bf
ext/pcntl
arnaud-lb ca6abed
ext/reflection
arnaud-lb 988c778
ext/uri
arnaud-lb 7361cd0
ext/standard
arnaud-lb bb9f446
ext/bcmath
arnaud-lb bd388af
Remove underscore
arnaud-lb f4cc6d6
Switch to int
arnaud-lb 366a8fc
Fix build
arnaud-lb d01df3c
Mark generated files
arnaud-lb 95a2fd3
Header guards
arnaud-lb f1d17ea
WS
arnaud-lb 4e1f5c6
Remove default case
arnaud-lb 4d590e5
Include _decl.h from the extension main header
arnaud-lb 64915dd
Switch over enum constants
arnaud-lb 40036ff
Check that decl files are up to date
arnaud-lb 664bb2c
Do not incorporate version into hash
arnaud-lb ec7858a
Fix wrong default
arnaud-lb e424425
Code style
arnaud-lb 2bb15f6
Refactor bcmatch to avoid the conversion from zend_enum_RoundingMode …
arnaud-lb da4bcc3
UPGRADING.INTERNALS
arnaud-lb 6c869d9
More specific regex
arnaud-lb 63ac898
Review
arnaud-lb b9e03ae
Make C enum generateion opt-in
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.