Skip to content
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

Revamp kinds for bounds expressions #50

Closed
dtarditi opened this issue Sep 13, 2016 · 1 comment
Closed

Revamp kinds for bounds expressions #50

dtarditi opened this issue Sep 13, 2016 · 1 comment
Milestone

Comments

@dtarditi
Copy link
Contributor

It would be good to have one kind field on bounds expressions instead of specialized kinds per type of bounds expressions. This would make it easier to write code that traverses bounds expressions. Currently, we have to test the type of a bounds expression and then look at the kind field.

dtarditi added a commit to dtarditi/checkedc-clang that referenced this issue Sep 14, 2016
Instead of having separate kind enumerations for different bounds expression
classes, have just one kind enumeration for all bounds expression classes.
This makes it easier to write predicates that check for a specific kind of
bounds expression, without having to do a dynamic type test and cast to the
specific bounds expression type.  This addresses Github issue microsoft#50.

The downside of the unified kind enumeration is that a developer can use a
kind that is invalid for a specific bounds expression class.  Add code to
validate the kind information.

Add predicates for testing for specific kinds of bounds expressions and
clean up code for type checking bounds expressions by using the predicates.

This also adds a kind for the `: ptr` interop bounds annotation to the
kind enumeration for bounds expressions.

Testing:
- Passes existing clang and Checked C tests.
dtarditi added a commit that referenced this issue Sep 15, 2016
Instead of having separate kind enumerations for different bounds expression
classes, have just one kind enumeration for all bounds expression classes.
This makes it easier to write predicates that check for a specific kind of
bounds expression, without having to do a dynamic type test and cast to the
specific bounds expression type.  This addresses Github issue #50.

The downside of the unified kind enumeration is that a developer can use a
kind that is invalid for a specific bounds expression class.  Add code to
validate the kind information.

Add predicates for testing for specific kinds of bounds expressions and
clean up code for type checking bounds expressions by using the predicates.

This also adds a kind for the `: ptr` interop bounds annotation to the
kind enumeration for bounds expressions.

Testing:
- Passes existing clang and Checked C tests.
@dtarditi
Copy link
Contributor Author

This work is complete.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant