-
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
Merged
Merged
Changes from all commits
Commits
Show all changes
31 commits
Select commit
Hold shift + click to select a range
49791d6
Make ZEND_AST_CONST_ENUM_INIT a 4-children node
arnaud-lb 4af8948
Store enum case id in ZEND_AST_CONST_ENUM_INIT
arnaud-lb 73fd3f1
Store enum case id in instance
arnaud-lb 81e585d
Expose enum case_id internally
arnaud-lb 24be83d
Generate C enum for internal enums
arnaud-lb 73611c6
Port ext/random
arnaud-lb c35423f
Z_PARAM_ENUM()
arnaud-lb ed7d319
ext/dom
arnaud-lb aace901
ext/pcntl
arnaud-lb 9426a7a
ext/reflection
arnaud-lb 8ab1441
ext/uri
arnaud-lb 891cca6
ext/standard
arnaud-lb 9aaf909
ext/bcmath
arnaud-lb 8f1db64
Remove underscore
arnaud-lb 68a7ecc
Switch to int
arnaud-lb 606555b
Fix build
arnaud-lb a3240be
Mark generated files
arnaud-lb 3f8e6c8
Header guards
arnaud-lb eb41ca4
WS
arnaud-lb b7e01d5
Remove default case
arnaud-lb 4a904d2
Include _decl.h from the extension main header
arnaud-lb 40e4f8a
Switch over enum constants
arnaud-lb 1772929
Check that decl files are up to date
arnaud-lb 2213e4a
Do not incorporate version into hash
arnaud-lb b9493af
Fix wrong default
arnaud-lb 17d763d
Code style
arnaud-lb b4d932b
Refactor bcmatch to avoid the conversion from zend_enum_RoundingMode …
arnaud-lb 840860d
UPGRADING.INTERNALS
arnaud-lb 286d44e
More specific regex
arnaud-lb 4c6cb49
Make C enum generateion opt-in
arnaud-lb bebdc23
UPGRADING.INTERNALS
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.